Releases: databrickslabs/ucx
Releases · databrickslabs/ucx
v0.46.0
- Added
lazy_loader
to known list (#2991). With this commit, thelazy_loader
module has been added to the known list in the configuration file, addressing a portion of issue #193, which may have been caused by the discovery or loading of this module. Thelazy_loader
is a package or module that, once added to the known list, will be recognized and loaded by the system. This change does not affect any existing functionality or introduce new methods. The commit solely updates the known.json file to includelazy_loader
with an empty list, indicating that it is ready for use. This modification will enable the correct loading and recognition of thelazy_loader
module in the system. - Added
librosa
to known list (#2992). In this update, we have added several open-source libraries to the known list in the configuration file, includinglibrosa
,llvmlite
,msgpack
,pooch
,soundfile
, andsoxr
. These libraries are commonly used in data engineering, machine learning, and scientific computing tasks.librosa
is a Python library for audio and music analysis, whilellvmlite
is a lightweight Python interface to the LLVM compiler infrastructure.msgpack
is a binary serialization format like JSON,pooch
is a package for managing external data files,soundfile
is a library for reading and writing audio files, andsoxr
is a library for high-quality audio resampling. Each library has an empty list next to it for specifying additional configuration related to the library. This update partially resolves issue #1931 by addinglibrosa
to the known list, ensuring that these libraries will be properly recognized and utilized by the codebase. - Added
linkify-it-py
to known list (#2993). In this release, we have added support for two new open-source packages,linkify-it-py
anduc-micro-py
, to enhance the software's functionality and compatibility. The addition oflinkify-it-py
and its constituent modules, as well as the incorporation ofuc-micro-py
with its modules and classes, aims to expand the software's capabilities. These changes are related to the resolution of issue #1931, and they will enable the software to work seamlessly with these packages, thereby providing a better user experience. - Added
lz4
to known list (#2994). In this release, we have added support for the LZ4 lossless data compression algorithm, which is known for its focus on compression and decompression speed. The implementation includes four variants: lz4, lz4.block, lz4.frame, and lz4.version, each providing different levels of compression and decompression speed and flexibility. This addition expands the range of supported compression algorithms, providing more options for users to choose from and partially addressing issue #1931 related to supporting additional compression algorithms. This improvement will be beneficial to software engineers working with data compression in their projects. - Fixed
SystemError: AST constructor recursion depth mismatch
failing the entire job (#3000). This PR introduces more deterministic, Go-style, error handling for parsing Python code, addressing issues that caused the entire job to fail due to aSystemError: AST constructor recursion depth mismatch
(#3000) and bug #2976. It includes removing theAstroidSyntaxError
import, adding an import forSqlglotError
, and updating theSqlParseError
exception toSqlglotError
in thelint
method of theSqlLinter
class. Additionally, abstract classesTablePyCollector
andDfsaPyCollector
and their respective methods for collecting tables and direct file system accesses have been removed. ThePythonSequentialLinter
class, previously handling multiple responsibilities, has also been removed, enhancing code modularity, understandability, maintainability, and testability. The changes affect thebase.py
,python_ast.py
, andpython_sequential_linter.py
modules. - Skip applying permissions for workspace system groups to Unity Catalog resources (#2997). This commit introduces changes to the ACL-related code in the
databricks labs ucx create-catalog-schemas
command and themigrate-table-*
workflow, skipping the application of permissions for workspace system groups in the Unity Catalog. These system groups, which include 'admins', do not exist at the account level. To ensure the correctness of these modifications, unit and integration tests have been added, including a test that checks the proper handling of user privileges in system groups during catalog schema creation. TheAccessControlResponse
object has been updated for theadmins
andusers
groups, granting them specific permissions for a workspace and warehouse object, respectively, enhancing the system's functionality in multi-user environments with system groups.
Contributors: @pritishpai, @asnare, @JCZuurmond, @nfx
v0.45.0
- Added DBFS Root resolution when HMS Federation is enabled (#2947). This commit introduces a DBFS resolver for use with HMS (Hive Metastore) federation, enabling accurate resolution of DBFS root locations when HMS federation is enabled. A new
_resolve_dbfs_root()
class method is added to theMountsCrawler
class, and a boolean argumentenable_hms_federation
is included in theMountsCrawler
constructor, providing better handling of federation functionality. The commit also adds a test function,test_resolve_dbfs_root_in_hms_federation
, to validate the resolution of DBFS roots with HMS federation. The test covers special cases, such as the/user/hive/metastore
path, and utilizesLocationTrie
for more accurate location guessing. These changes aim to improve the overall DBFS root resolution when using HMS federation. - Added
jax-jumpy
to known list (#2959). In this release, we have added thejax-jumpy
package to the list of known packages in our system.jax-jumpy
is a Python-based numerical computation library, which includes modules such asjumpy
,jumpy._base_fns
,jumpy.core
,jumpy.lax
,jumpy.numpy
,jumpy.numpy._factory_fns
,jumpy.numpy._transform_data
,jumpy.numpy._types
,jumpy.numpy.linalg
,jumpy.ops
, andjumpy.random
. These modules are now recognized by our system, which partially resolves issue #1931, which may have been caused by the integration of thejax-jumpy
package. Engineers can now utilize the capabilities of this library in their numerical computations. - Added
joblibspark
to known list (#2960). In this release, we have added support for thejoblibspark
library in our system by updating theknown.json
file, which keeps track of various libraries and their associated components. This change is a part of the resolution for issue #1931 and includes new elements such asdoc
,doc.conf
,joblibspark
,joblibspark.backend
, andjoblibspark.utils
. These additions enable the system to recognize and manage the new components related tojoblibspark
, allowing for improved compatibility and functionality. - Added
jsonpatch
to known list (#2969). In this release, we have addedjsonpatch
to the list of known libraries in theknown.json
file. Jsonpatch is a library used for applying JSON patches, which allow for partial updates to a JSON document. By including jsonpatch in the known list, developers can now easily utilize its functionality for JSON patching, and any necessary dependencies will be handled automatically. This change partially addresses issue #1931, which may have been caused by the use or integration of jsonpatch. We encourage developers to take advantage of this new addition to enhance their code and efficiently make partial updates to JSON documents. - Added
langchain-community
to known list (#2970). A new entry forlangchain-community
has been added to the configuration file for known language chain components in this release. This entry includes several sub-components such as 'langchain_community.agents', 'langchain_community.callbacks', 'langchain_community.chat_loaders', 'langchain_community.chat_message_histories', 'langchain_community.chat_models', 'langchain_community.cross_encoders', 'langchain_community.docstore', 'langchain_community.document_compressors', 'langchain_community.document_loaders', 'langchain_community.document_transformers', 'langchain_community.embeddings', 'langchain_community.example_selectors', 'langchain_community.graph_vectorstores', 'langchain_community.graphs', 'langchain_community.indexes', 'langchain_community.llms', 'langchain_community.memory', 'langchain_community.output_parsers', 'langchain_community.query_constructors', 'langchain_community.retrievers', 'langchain_community.storage', 'langchain_community.tools', 'langchain_community.utilities', and 'langchain_community.utils'. Currently, these sub-components are empty and have no additional configuration or code. This change partially resolves issue #1931, but the specifics of the issue and how these components will be used are still unclear. - Added
langcodes
to known list (#2971). A newlangcodes
library has been added to the project, addressing part of issue #1931. This library includes several modules that provide functionalities related to language codes and their manipulation, includinglangcodes
,langcodes.build_data
,langcodes.data_dicts
,langcodes.language_distance
,langcodes.language_lists
,langcodes.registry_parser
,langcodes.tag_parser
, andlangcodes.util
. Additionally, the memory-efficient trie (prefix tree) data structure library,marisa-trie
, has been included in the known list. It is important to note that no existing functionality has been altered in this commit. - Addressing Ownership Conflict when creating catalog/schemas (#2956). This release introduces new functionality to handle ownership conflicts during catalog/schema creation in our open-source library. The
_apply_from_legacy_table_acls
method has been enhanced with two loops to address non-own grants and own grants separately. This ensures proper handling of ownership conflicts by generating and executing UC grant SQL for each grant type, with appropriate exceptions. Additionally, a new helper function,this_type_and_key()
, has been added to improve code readability. The release also introduces new methods, GrantsCrawler and Rule, in the hive_metastore package of the labs.ucx module, responsible for populating views and mapping source and destination objects. The test_catalog_schema.py file has been updated to include tests for creating catalogs and schemas with legacy ACLs, utilizing the new Rule method and GrantsCrawler. Issue #2932 has been addressed with these changes, which include adding new methods and updating existing tests for hive_metastore. - Clarify
skip
andunskip
commands work on views (#2962). In this release, theskip
andunskip
commands in the databricks labs UCX tool have been updated to clarify their functionality on views and to make it more explicit with the addition of the--view
flag. These commands allow users to skip or unskip certain schemas, tables, or views during the table migration process. This is useful for temporarily disabling migration of a particular schema, table, or view. Unit tests have been added to ensure the correct behavior of these commands when working with views. Two new methods have been added to test the behavior of theunskip
command when a schema or table is specified, and two additional methods test the behavior of theunskip
command when a view or no schema is specified. Finally, two methods test that an error message is logged when both the--table
and--view
flags are specified. - Fixed issue with migrating MANAGED hive_metastore table to UC (#2928). This commit addresses an issue with migrating Hive Metastore (HMS) MANAGED tables to Unity Catalog (UC) as EXTERNAL, where deleting a MANAGED table can result in data loss. To prevent this, a new option
CONVERT_TO_EXTERNAL
has been added to themigrate_tables
method for migrating managed tables to UC as external, ensuring that the HMS managed table is converted to an external table in HMS and UC, and protecting against data loss when deleting a managed table that has been migrated to UC as external. Additionally, new caching properties have been added for better performance, and existing methods have been modified to handle the migration of managed tables to UC as external. Tests, including unit and integration tests, have been added to ensure the proper functioning of these changes. It is important to note that changing MANAGED tables to EXTERNAL can have potential consequences on regulatory data cleanup, and the impact of this change should be carefully validated for existing workloads. - Let
create-catalogs-schemas
reuseMigrateGrants
so that it applies group renaming (#2955). Thecreate-catalogs-schemas
command in thedatabricks labs ucx
package has been enhanced to reuse theMigrateGrants
function, enabling group renaming and eliminating redundant code. Themigrate-tables
workflow remains functionally the same. Changes include modifying theCatalogSchema
class to accept amigrate_grants
argument, introducing newCatalog
andSchema
dataclasses, and updating various methods in thehive_metastore
module. Unit and integration tests have been added and manually verified to ensure proper functionality. TheMigrateGrants
class has been updated to accept twoSecurableObject
arguments and sort matched grants. Thefrom_src_dst
function inmapping.py
now includes a newas_uc_table
method and updates toas_uc_table_key
. Addressing issues #2934, #2932, and #2955, the changes also include a newkey
property for thetables.py
file, and updates to thetest_create_catalogs_schemas
andtest_migrate_tables
test functions. - Updated sqlglot requirement from <25.25,>=25.5.0 to >=25.5.0,<25.26 ([#2968](...
v0.44.0
- Added
imbalanced-learn
to known list (#2943). A new open-source library, "imbalanced-learn," has been added to the project's known list of libraries, providing various functionalities for handling imbalanced datasets. The addition includes modules such as "imblearn", "imblearn._config", "imblearn._min_dependencies", "imblearn._version", "imblearn.base", and many others, enabling features such as over-sampling, under-sampling, combining sampling techniques, and creating ensembles. This change partially resolves issue #1931, which may have been related to the handling of imbalanced datasets, thereby enhancing the project's ability to manage such datasets. - Added
importlib_resources
to known list (#2944). In this update, we've added theimportlib_resources
package to the known list in theknown.json
file. This package offers a consistent and straightforward interface for accessing resources such as data files and directories in Python packages. It includes several modules, includingimportlib_resources
,importlib_resources._adapters
,importlib_resources._common
,importlib_resources._functional
,importlib_resources._itertools
,importlib_resources.abc
,importlib_resources.compat
,importlib_resources.compat.py38
,importlib_resources.compat.py39
,importlib_resources.future
,importlib_resources.future.adapters
,importlib_resources.readers
, andimportlib_resources.simple
. These modules provide various functionalities for handling resources within a Python package. By adding this package to the known list, we enable its usage and integration with the project's codebase. This change partially addresses issue #1931, improving the management and accessibility of resources within our Python packages. - Dependency update: ensure we install with at least version 0.9.1 of
databricks-labs-blueprint
(#2950). In the updatedpyproject.toml
file, the version constraint for thedatabricks-labs-blueprint
dependency has been revised to range between 0.9.1 and 0.10, specifically targeting 0.9.1 or higher. This modification ensures the incorporation of a fixed upstream issue (databrickslabs/blueprint#157), which was integrated in the 0.9.1 release. This adjustment was triggered by a preceding change (#2920) that standardized notebook paths, thereby addressing issue #2882, which was dependent on this upstream correction. By embracing this upgrade, users can engage the most recent dependency version, thereby ensuring the remediation of the aforementioned issue. - Fixed an issue with source table deleted after migration (#2927). In this release, we have addressed an issue where a source table was marked as migrated even after it was deleted following migration. An exception handling mechanism has been added to the
is_migrated
method to returnTrue
and log a warning message if the source table does not exist, indicating that it has been migrated. A new test function,test_migration_index_deleted_source
, has also been included to verify the migration index behavior when the source table no longer exists. This function creates a source and destination table, sets the destination table'supgraded_from
property to the source table, drops the source table, and checks if the migration index contains the source table and if an error message was recorded, indicating that the source table no longer exists. Theget_seen_tables
method remains unchanged in this diff. - Improve robustness of
sqlglot
failure handling (#2952). This PR introduces changes to improve the robustness of error handling in thesqlglot
library, specifically targeting issues with inadequate parsing quality. Thecollect_table_infos
method has been updated and renamed tocollect_used_tables
to accurately gather information about tables used in a SQL expression. Thelint_expression
andcollect_tables
methods have also been updated to use the newcollect_used_tables
method for better accuracy. Additionally, methods such asfind_all
,walk_expressions
, and the test suite for the SQL parser have been enhanced to handle potential failures and unsupported SQL syntax more gracefully, by returning empty lists or logging warning messages instead of raising errors. These changes aim to improve the reliability and robustness of thesqlglot
library, enabling it to handle unexpected input more effectively. - Log warnings when mounts are discovered on incorrect cluster type (#2929). The
migrate-tables
command in the ucx project's CLI now includes a verification step to ensure the successful completion of a prerequisite assessment workflow before execution. If this workflow has not been completed, a warning message is logged and the command is not executed. A new exception handling mechanism has been implemented for thedbutils.fs.mounts()
method, which logs a warning and skips mount point discovery if an exception is raised. A new unit test has been added to verify that a warning is logged when attempting to discover mounts on an incompatible cluster type. The diff also includes a new methodVerifyProgressTracking
for verifying progress tracking and updates to existing test methods to include verification of successful runs and error handling before assessment. These changes improve the handling of edge cases in the mount point discovery process, add warnings for mounts on incorrect cluster types, and increase test coverage with progress tracking verification. create-uber-principal
fixes and improvements (#2941). This change introduces fixes and improvements to thecreate-uber-principal
functionality within thedatabricks-sdk-py
project, specifically targeting the Azure access module. The main enhancements include addressing an issue with the Databricks warehouses API by adding theset_workspace_warehouse_config_wrapper
function, modifying the command to request the uber principal name only when necessary, improving storage account crawl logic, and introducing new methods to manage workspace-level configurations. Error handling mechanisms have been fortified through added and modified try-except blocks. Additionally, several unit and integration tests have been implemented and verified to ensure the functionality is correct and running smoothly. These changes improve the overall robustness and versatility of thecreate-uber-principal
command, directly addressing issues #2764, #2771, and progressing on #2949.
Contributors: @pritishpai, @FastLee, @asnare, @JCZuurmond, @nfx
v0.43.0
- Added
imageio
to known list (#2942). In this release, we have addedimageio
to our library's known list, which includes all its modules, sub-modules, testing, and typing packages. This change addresses issue #1931, which may have been caused by a dependency or compatibility issue. Theimageio
library offers I/O functionality for scientific imaging data, and its addition is expected to expand the library's supported formats and functionality. As a result, software engineers can leverage the enhanced capabilities to handle scientific imaging data more effectively. - Added
ipyflow-core
to known list (#2945). In this release, the project has expanded its capabilities by adding two open-source libraries to a known list contained in a JSON file. The first library,ipyflow-core
, brings a range of modules for the data model, experimental features, frontend, kernel, patches, shell, slicing, tracing, types, and utils. The second library,pyccolo
, offers fast and adaptable code transformation using abstract syntax trees, with functionalities including code rewriting, import hooks, syntax augmentation, and tracing, along with various utility functions. By incorporating these libraries into the project, we aim to enhance its overall efficiency and versatility, providing software engineers with access to a broader set of tools and capabilities. - Added
isodate
to known list (#2946). In this release, we have added theisodate
package to our library's known package list, which resolves part of issue #1931. Theisodate
package provides several modules for parsing and manipulating ISO 8601 dated strings, includingisodate
,isodate.duration
,isodate.isodates
,isodate.isodatetime
,isodate.isoduration
,isodate.isoerror
,isodate.isostrf
,isodate.isotime
,isodate.isotzinfo
, andisodate.tzinfo
. This addition enhances our compatibility and integration with theisodate
package in the larger system, enabling users to utilize the full functionality of theisodate
package in their applications. - Experimental command for enabling HMS federation (#2939). In this release, we have introduced an experimental feature for enabling HMS (Hive Metastore) federation through a new
enable-hms-federation
command in the labs.yml file. This command, when enabled, will create a federated HMS catalog synced with the workspace HMS in a hierarchical manner, facilitating migration and integration of HMS models. Additionally, we have added an optionalenable_hms_federation
constructor argument to theLocations
class in the locations.py file. Setting this flag to True enables a fallback mode for AWS resources to use HMS for data access. TheHiveMetastoreFederationEnabler
class is introduced with anenable()
method to modify the workspace configuration and enable HMS federation. These changes aim to provide a more streamlined experience for users working with complex modeling systems, and careful testing and feedback are encouraged on this experimental feature. - Experimental support for HMS federation (#2283). In this release, we introduce experimental support for Hive Metastore (HMS) federation in our open-source library. A new
HiveMetastoreFederation
class has been implemented, enabling the registration of an internal HMS as a federated catalog. This class utilizes theWorkspaceClient
object from thedatabricks.sdk
library to create necessary connections and handles permissions for successful federation. Additionally, a new filetest_federation.py
has been added, containing unit tests to demonstrate the functionality of HMS federation, including the creation of federated catalogs and handling of existing connections. As this is an experimental feature, users should expect potential issues and are encouraged to provide feedback to help improve its functionality. - Fixed
InvalidParameterValue
failure for scanning jobs running on interactive clusters that got deleted (#2935). In this release, we have addressed an issue where anInvalidParameterValue
error was not being handled properly during scanning jobs run on interactive clusters that were deleted. This error has now been added to the exceptions handled in the_register_existing_cluster_id
and_register_cluster_info
methods. These methods retrieve information about an existing cluster or its ID, and if the cluster is not found or an invalid parameter value is provided, they now yield aDependencyProblem
object with an appropriate error message. ThisDependencyProblem
object is used to indicate that there is a problem with the dependencies required for the job, preventing it from running successfully. By handling this error, the code ensures that the job can fail gracefully and provide a clear and informative error message to the user, avoiding any potential confusion or unexpected behavior. - Improve logging when skipping legacy grant in
create-catalogs-schemas
(#2933). In this update, thecreate-catalogs-schemas
process has been improved with enhanced logging for skipped legacy grants. This change is a follow-up to previous issue #2917 and progresses issue #2932. The_apply_from_legacy_table_acls
and_update_principal_acl
methods now include more descriptive logging when a legacy grant is skipped, providing information about the type of grant being skipped and clarifying that it is not supported in the Unity Catalog. Additionally, a new methodget_interactive_cluster_grants
has been added to theprincipal_acl
object, returning a list of grants specific to the interactive cluster. Thehive_acl
object is now autospec'd after theprincipal_acl.get_interactive_cluster_grants
call. Thetest_catalog_schema_acl
function has been updated to reflect these changes. New grants have been added to thehive_grants
list, including grants foruser1
withUSE
action type onhive_metastore
catalog and grants foruser2
withUSAGE
action type onschema3
database. A new grant foruser4
withDENY
action type onschema3
database has also been added, but it is skipped in the logging due to it not being supported in UC. Skipped legacy grants forDENY
action type oncatalog2
catalog and 'catalog2.schema2' database are also included in the commit. These updates improve the clarity and usefulness of the logs, making it easier for users to understand what is happening during the migration of grants to UC and ensuring that unsupported grants are not inadvertently included in the UC. - Notebook linting: ensure path-type is preserved during linting (#2923). In this release, we have enhanced the type safety of the
NotebookResolver
class in theloaders.py
module by introducing a new type variablePathT
. This change includes an update to the_adjust_path
method, which ensures the preservation of the original file suffix when adding the ".py" suffix for Python notebooks. This addresses a potential issue where aWorkspacePath
instance could be incorrectly converted to a genericPath
instance, causing downstream errors. Although this change may potentially resolve issue #2888, the reproduction steps for that issue were not provided in the commit message. It is important to note that while this change has been manually tested, it does not include any new unit tests, integration tests, or staging environment verification.
Contributors: @nfx, @pritishpai, @ericvergnaud, @asnare, @JCZuurmond
v0.42.0
- Added
google-cloud-storage
to known list (#2827). In this release, we have added thegoogle-cloud-storage
library, along with its various modules and sub-modules, to our project's known list in a JSON file. Additionally, we have included thegoogle-crc32c
andgoogle-resumable-media
libraries. These libraries provide functionalities such as content addressable storage, checksum calculation, and resumable media upload and download. This change is a partial resolution to issue #1931, which is likely related to the integration or usage of these libraries in the project. Software engineers should take note of these additions and how they may impact the project's functionality. - Added
google-crc32c
to known list (#2828). With this commit, we have added thegoogle-crc32c
library to our system's known list, addressing part of issue #1931. This addition enhances the overall functionality of the system by providing efficient and high-speed CRC32C computation when utilized. Thegoogle-crc32c
library is known for its performance and reliability, and by incorporating it into our system, we aim to improve the efficiency and robustness of the CRC32C computation process. This enhancement is part of our ongoing efforts to optimize the system and ensure a more efficient experience for our end-users. With this change, users can expect faster and more reliable CRC32C computations in their applications. - Added
holidays
to known list (#2906). In this release, we have expanded the known list in our open-source library to include a newholidays
category, aimed at supporting tracking of holidays for different countries, religions, and financial institutions. This category includes several subcategories, such as calendars, countries, deprecation, financial holidays, groups, helpers, holiday base, mixins, observed holiday base, registry, and utils. Each subcategory contains an empty list, allowing for future data storage related to holidays. This change partially resolves issue #1931, and represents a significant step towards supporting a more comprehensive range of holiday tracking needs in our library. Software engineers may utilize this new feature to build applications that require tracking and management of various holidays and related data. - Added
htmlmin
to known list (#2907). In this update, we have added thehtmlmin
library to theknown.json
configuration file's list of known libraries. This addition enables the use and management ofhtmlmin
and its components, includinghtmlmin.command
,htmlmin.decorator
,htmlmin.escape
,htmlmin.main
,htmlmin.middleware
,htmlmin.parser
,htmlmin.python3html
, andhtmlmin.python3html.parser
. This change partially addresses issue #1931, which may have been caused by the integration or usage ofhtmlmin
. Software engineers can now utilizehtmlmin
and its features in their projects, thanks to this enhancement. - Document preparing external locations when creating catalogs (#2915). Databricks Labs' UCX tool has been updated to incorporate the preparation of external locations when creating catalogs during the upgrade to Unity Catalog (UC). This enhancement involves the addition of new documentation outlining how to physically separate data in storage within UC, adhering to Databricks' best practices. The
create-catalogs-schemas
command has been updated to create UC catalogs and schemas based on a mapping file, allowing users to reuse previously created external locations or establish new ones outside of UCX. For data separation, users can leverage external locations when using subpaths, providing flexibility in data management during the upgrade process. - Fixed
KeyError
fromassess_workflows
task (#2919). In this release, we have made significant improvements to error handling in our open-source library. We have fixed a KeyError in theassess_workflows
task and modified the_safe_infer_internal
and_unsafe_infer_internal
methods to handle bothInferenceError
andKeyError
during inference. When an error occurs, we now log the error message with the node and yield aUninferable
object. Additionally, we have updated thedo_infer_values
method of the_LocalInferredValue
class to yield an iterator of iterables ofNodeNG
objects. We have added multiple unit tests for inferring values in Python code, including cases for handling externally defined values and their absence. These changes ensure that our library can handle errors more gracefully and provide more informative feedback during inference, making it more robust and easier to use in software engineering projects. - Fixed
OSError: [Errno 95]
bug inassess_workflows
task by skipping GIT-sourced workflows from static code analysis (#2924). In this release, we have resolved theOSError: [Errno 95]
bug in theassess_workflows
task that occurred while performing static code analysis on GIT-sourced workflows. A new attributeSource
has been introduced in thejobs
module of thedatabricks.sdk.service
package to identify the source of a notebook task. If the notebook task source is GIT, a newDependencyProblem
is raised, indicating that notebooks in GIT should be analyzed using thedatabricks labs ucx lint-local-code
CLI command. The_register_notebook
method has been updated to check if the notebook task source is GIT and return an appropriateDependencyProblem
message. This change enhances the reliability of theassess_workflows
task by avoiding the aforementioned bug and provides a more informative message when notebooks are sourced from GIT. This change is part of our ongoing effort to improve the project's quality and reliability and benefits software engineers who adopt the project. - Fixed absolute path normalisation in source code analysis (#2920). In this release, we have addressed an issue with the Workspace API not supporting relative subpaths such as "/a/b/../c", which has been resolved by resolving workspace paths before calling the API. This fix is backward compatible and ensures the correct behavior of the source code analysis. Additionally, we have added integration tests and co-authored this commit with Eric Vergnaud and Serge Smertin. Furthermore, we have added a new test case that supports relative grand-parent paths in the dependency graph construction, utilizing a new
NotebookLoader
class. This loader is responsible for loading the notebook content and metadata given a path, and this new test case exercises the path resolution logic when a notebook depends on another notebook located two levels up in the directory hierarchy. These changes improve the robustness and reliability of the source code analysis in the presence of relative paths. - Fixed downloading wheel libraries from DBFS on mounted Azure Storage fail with access denied (#2918). In this release, we have introduced enhancements to the library's handling of registering and downloading wheel libraries from DBFS on mounted Azure Storage, addressing an issue that resulted in access denied errors. The changes include improved error handling with the addition of a
try-except
block to handle potentialBadRequest
exceptions and the inclusion of three new methods to register different types of libraries. The_register_requirements_txt
method reads requirements files and registers each library specified in the file, logging a warning message for any references to other requirements or constraints files. The_register_whl
method creates a temporary copy of the given wheel file in the local file system and registers it, while the_register_egg
method checks the runtime version and yields aDependencyProblem
if the version is greater than (14, 0). These changes simplify the code and enhance error handling while addressing the reported issues related to registering libraries. The changes are implemented in thejobs.py
file located in thedatabricks/labs/ucx/source_code
directory, which also includes the import of theBadRequest
exception class fromdatabricks.sdk.errors
. - Fixed issue with migrating MANAGED hive_metastore table to UC (#2892). In this release, we have implemented changes to address the issue of migrating HMS (Hive Metastore) managed tables to UC (Unity Catalog) as EXTERNAL. Historically, deleting a managed table also removed the underlying data, leading to potential data loss and making the UC table unusable. The new approach provides options to mitigate these issues, including migrating as EXTERNAL or cloning the data to maintain integrity. These changes aim to prevent accidental data deletion, ensure data recoverability, and avoid inconsistencies when new data is added to either HMS or UC. We have introduced new class attributes, methods, and parameters in relevant modules such as
WorkspaceConfig
,Table
,migrate_tables
, andinstall.py
. These modifications support the new migration strategies and allow for more flexibility in managing how tables are migrated and how data is handled. The upgrade process can be triggered using themigrate-tables
UCX command or by running the table migration workflows deployed to the workspace. Thorough testing and documentation have been performed to minimize risks of data inconsis...
v0.41.0
- Added UCX history schema and table for storing UCX's artifact (#2744). In this release, we have introduced a new dataclass
Historical
to store UCX artifacts for migration progress tracking, including attributes such as workspace identifier, job run identifier, object type, object identifier, data, failures, owner, and UCX version. TheProgressTrackingInstallation
class has been updated to include a new method for deploying a table for historical records using theHistorical
dataclass. Additionally, we have modified thedatabricks labs ucx create-ucx-catalog
command, and updated the integration test filetest_install.py
to include a parametrized test function for checking if theworkflow_runs
andhistorical
tables are created by the UCX installation. We have also renamed the functiontest_progress_tracking_installation_run_creates_workflow_runs_table
totest_progress_tracking_installation_run_creates_tables
to reflect the addition of the new table. These changes add necessary functionality for tracking UCX migration progress and provide associated tests to ensure correctness, thereby improving UCX's progress tracking functionality and resolving issue #2572. - Added
hjson
to known list (#2899). In this release, we are excited to announce the addition of support for the Hjson library, addressing partial resolution for issue #1931 related to configuration. This change integrates the following Hjson modules: hjson, hjson.compat, hjson.decoder, hjson.encoder, hjson.encoderH, hjson.ordered_dict, hjson.scanner, and hjson.tool. Hjson is a powerful library that enhances JSON functionality by providing comments and multi-line strings. By incorporating Hjson into our library's known list, users can now leverage its advanced features in a more streamlined and cohesive manner, resulting in a more versatile and efficient development experience. - Bump databrickslabs/sandbox from acceptance/v0.3.0 to 0.3.1 (#2894). In this version bump from acceptance/v0.3.0 to 0.3.1 of the databrickslabs/sandbox library, several enhancements and bug fixes have been implemented. These changes include updates to the README file with instructions on how to use the library with the databricks labs sandbox command, fixes for the
unsupported protocol scheme
error, and the addition of more git-related libraries. Additionally, dependency updates for golang.org/x/crypto from version 0.16.0 to 0.17.0 have been made in the /go-libs and /runtime-packages directories. This version also introduces new commits that allow larger logs from acceptance tests and implement experimental OIDC refresh token rotation. The tests using this library have been updated to utilize the new version to ensure compatibility and functionality. - Fixed
AttributeError:
UsedTablehas no attribute 'table'
by adding more type checks (#2895). In this release, we have made significant improvements to the library's type safety and robustness in handlingUsedTable
objects. We fixed an AttributeError related to theUsedTable
class not having atable
attribute by adding more type checks in thecollect_tables
method of theTablePyCollector
andCollectTablesVisit
classes. We also introducedAstroidSyntaxError
exception handling and logging. Additionally, we renamed thetable_infos
variable toused_tables
and changed its type to 'list[JobProblem]' in thecollect_tables_from_tree
and '_SparkSqlAnalyzer.collect_tables' functions. We added conditional statements to check for the presence of required attributes before yielding a new 'TableInfoNode'. A new unit test file, 'test_context.py', has been added to exercise thetables_collector
method, which extracts table references from a given code snippet, improving the linter's table reference extraction capabilities. - Fixed
TokenError
in assessment workflow (#2896). In this update, we've implemented a bug fix to improve the robustness of the assessment workflow in our open-source library. Previously, the code only caught parse errors during the execution of the workflow, but parse errors were not the only cause of failures. This commit changes the exception being caught fromParseError
to the more generalSqlglotError
, which is the common ancestor of bothParseError
andTokenError
. By catching the more generalSqlglotError
, the code is now able to handle both parse errors and tokenization errors, providing a more robust solution. Thewalk_expressions
method has been updated to catchSqlglotError
instead ofParseError
. This change allows the assessment workflow to handle a wider range of issues that may arise during the execution of SQL code, making it more versatile and reliable. TheSqlglotError
class has been imported from thesqlglot.errors
module. This update enhances the assessment workflow's ability to handle more complex SQL queries, ensuring smoother execution. - Fixed
assessment
workflow failure for jobs running tasks on existing interactive clusters (#2889). In this release, we have implemented changes to address a failure in theassessment
workflow when jobs are run on existing interactive clusters (issue #2886). The fix includes modifying thejobs.py
file by adding a try-except block when loading libraries for an existing cluster, utilizing a new exception typeResourceDoesNotExist
to handle cases where the cluster does not exist. Furthermore, the_register_cluster_info
function has been enhanced to manage situations where the existing cluster is not found, raising aDependencyProblem
with the message 'cluster-not-found'. This ensures the workflow can continue running jobs on other clusters or with other configurations. Overall, these enhancements improve the system's robustness by gracefully handling edge cases and preventing workflow failure due to non-existent clusters. - Ignore UCX inventory database in HMS while scanning tables (#2897). In this release, changes have been implemented in the 'tables.py' file of the 'databricks/labs/ucx/hive_metastore' directory to address the issue of mistakenly scanning the UCX inventory database during table scanning. The
_all_databases
method has been updated to exclude the UCX inventory database by checking if the database name matches the schema name and skipping it if so. This change affects the_crawl
and_get_table_names
methods, which no longer process the UCX inventory schema when scanning for tables. A TODO comment has been added to the_get_table_names
method, suggesting potential removal of the UCX inventory schema check in future releases. This change ensures accurate and efficient table scanning, avoiding thehallucination
of mistaking the UCX inventory schema as a database to be scanned. - Tech debt: fix situations where
next()
isn't being used properly (#2885). In this commit, technical debt related to the proper usage of Python's built-innext()
function has been addressed in several areas of the codebase. Previously, there was an assumption thatNone
would be returned if there is no next value, which is incorrect. This commit updates and fixes the implementation to correctly handle cases wherenext()
is used. Specifically, theget_dbutils_notebook_run_path_arg
,of_language
class method in theCellLanguage
class, and certain methods in thetest_table_migrate.py
file have been updated to correctly handle situations where there is no next value. Thehas_path()
method has been removed, and theprepend_path()
method has been updated to insert the given path at the beginning of the list of system paths. Additionally, a test case for checking table in mount mapping with table owner has been included. These changes improve the robustness and reliability of the code by ensuring that it handles edge cases related to thenext()
function and paths correctly. - [chore] apply
make fmt
(#2883). In this release, themake_random
parameter has been removed from thesave_locations
method in theconftest.py
file for the integration tests. This method is used to save a list ofExternalLocation
objects to theexternal_locations
table in the inventory database, and it no longer requires themake_random
parameter. In the updated implementation, thesave_locations
method creates a singleExternalLocation
object with a specific string and priority based on the workspace environment (Azure or AWS), and then uses the SQL backend to save the list ofExternalLocation
objects to the database. This change simplifies thesave_locations
method and makes it more reusable throughout the test suite.
Dependency updates:
- Bump databrickslabs/sandbox from acceptance/v0.3.0 to 0.3.1 (#2894).
Contributors: @nfx, @asnare, @dependabot[bot], @JCZuurmond, @pritishpai
v0.40.0
- Added
google-cloud-core
to known list (#2826). In this release, we have incorporated thegoogle-cloud-core
library into our project's configuration file, specifying several modules from this library. This change is part of the resolution of issue #1931, which pertains to working with Google Cloud services. Thegoogle-cloud-core
library offers core functionalities for Google Cloud client libraries, including helper functions, HTTP-related functionalities, testing utilities, client classes, environment variable handling, exceptions, obsolete features, operation tracking, and version management. By adding these new modules to the known list in the configuration file, we can now utilize them in our project as needed, thereby enhancing our ability to work with Google Cloud services. - Added
gviz-api
to known list (#2831). In this release, we have added thegviz-api
library to our known library list, specifically specifying thegviz_api
package within it. This addition enables the proper handling and recognition of components from thegviz-api
library in the system, thereby addressing a portion of issue #1931. While the specifics of thegviz-api
library's implementation and usage are not described in the commit message, it is expected to provide functionality related to data visualization. This enhancement will enable us to expand our system's capabilities and provide more comprehensive solutions for our users. - Added export CLI functionality for assessment results (#2553). A new
export
command-line interface (CLI) function has been added to the open-source library to export assessment results. This feature includes the addition of a newAssessmentExporter
class in theexport.py
module, which is responsible for exporting assessment results to CSV files inside a ZIP archive. Users can specify the destination path and type of report for the exported results. A notebook utility is also included to run the export from the workspace environment, with default location, unit tests, and integration tests for the notebook utility. Theacl_migrator
method has been optimized for better performance. This new functionality provides more flexibility in exporting assessment results and improves the overall assessment functionality of the library. - Added functional test related to bug #2850 (#2880). A new functional test has been added to address a bug fix related to issue #2850, which involves reading data from a CSV file located in a volume using Spark's readStream function. The test specifies various options including file format, schema location, header, and compression. The CSV file is loaded from '/Volumes/playground/test/demo_data/' and the schema location is set to '/Volumes/playground/test/schemas/'. Additionally, a unit test has been added and is referenced in the commit. This functional test will help ensure that the bug fix for issue #2850 is working as expected.
- Added handling for
PermissionDenied
when retrievingWorkspaceClient
s from account (#2877). In this release, theworkspace_clients
method of theAccount
class inworkspaces.py
has been updated to handlePermissionDenied
exceptions when retrievingWorkspaceClient
s. This change introduces a try-except block around the command retrieving the workspace client, which catches thePermissionDenied
exception and logs a warning message if access to a workspace is denied. If no exception is raised, the workspace client is added to the list of clients as before. The commit also includes a new unit test to verify this functionality. This update addresses issue #2874 and enhances the robustness of thedatabricks labs ucx sync-workspace-info
command by ensuring it gracefully handles permission errors during workspace retrieval. - Added testing with Python 3.13 (#2878). The project has been updated to include testing with Python 3.13, in addition to the previously supported versions of Python 3.10, 3.11, and 3.12. This update is reflected in the
.github/workflows/push.yml
file, which now includes '3.13' in thepyVersion
matrix for the jobs. This addition expands the range of Python versions that the project can be tested and run on, providing increased flexibility and compatibility for users, as well as ensuring continued support for the latest versions of the Python programming language. - Added used tables in assessment dashboard (#2836). In this update, we introduce a new widget to the assessment dashboard for displaying used tables, enhancing visibility into how tables are utilized within the Databricks environment. This change includes the addition of the
UsedTable
class in thedatabricks.labs.ucx.source_code.base
module, which tracks table usage details in the inventory database. Two new methods,collect_dfsas_from_query
andcollect_used_tables_from_query
, have been implemented to collect data source access and used tables information from a query, with lineage information added to the table details. Additionally, a test function,test_dashboard_with_prepopulated_data
, has been introduced to prepopulate data for use in the dashboard, ensuring proper functionality of the new feature. - Avoid resource conflicts in integration tests by using a random dir name (#2865). In this release, we have implemented changes to address resource conflicts in integration tests by introducing random directory names. The
save_locations
method inconftest.py
has been updated to generate random directory names using thetempfile.mkdtemp
function, based on the value of the newmake_random
parameter. Additionally, in thetest_migrate.py
file located in thetests/integration/hive_metastore
directory, the hard-coded directory name has been replaced with a random one generated by themake_random
function, which is used when creating external tables and specifying the external delta location. Lastly, thetest_move_tables_table_properties_mismatch_preserves_original
function intest_table_move.py
has been updated to include a randomly generated directory name in the table's external delta and storage location, ensuring that tests can run concurrently without conflicting with each other. These changes resolve the issue described in #2797 and improve the reliability of integration tests. - Exclude dfsas from used tables (#2841). In this release, we've made significant improvements to the accuracy of table identification and handling in our system. We've excluded certain direct filesystem access patterns from being treated as tables in the current implementation, correcting a previous error. The
collect_tables
method has been updated to exclude table names matching defined direct filesystem access patterns. Additionally, we've added a new methodTableInfoNode
to wrap used tables and the nodes that use them. We've also introduced changes to handle direct filesystem access patterns more accurately, ensuring that the DataFrame API'sspark.table()
function is identified correctly, while thespark.read.parquet()
function, representing direct filesystem access, is now ignored. These changes are supported by new unit tests to ensure correctness and reliability, enhancing the overall functionality and behavior of the system. - Fixed known matches false postives for libraries starting with the same name as a library in the known.json (#2860). This commit addresses an issue of false positives in known matches for libraries that have the same name as a library in the known.json file. The
module_compatibility
function in theknown.py
file was updated to look for exact matches or parent module matches, rather than just matches at the beginning of the name. This more nuanced approach ensures that libraries with similar names are not incorrectly flagged as having compatibility issues. Additionally, theknown.json
file is now sorted when constructing module problems, indicating that the order of the entries in this file may have been relevant to the issue being resolved. To ensure the accuracy of the changes, new unit tests were added. The test suite was expanded to include tests for known and unknown compatibility, and a new load test was added for the known.json file. These changes improve the reliability of the known matches feature, which is critical for ensuring the correct identification of compatibility issues. - Make delta format case sensitive (#2861). In this commit, the delta format is made case sensitive to enhance the robustness and reliability of the code. The
TableInMount
class has been updated with a__post_init__
method to convert theformat
attribute to uppercase, ensuring case sensitivity. Additionally, theTable
class in thetables.py
file has been modified to include a__post_init__
method that converts thetable_format
attribute to uppercase during object creation, making format comparisons case insensitive. New properties,is_delta
andis_hive
, have been added to theTable
class to check if the table format is delta or hive, respectively. Thes...
v0.39.0
- Added
Farama-Notifications
to known list (#2822). A new configuration has been implemented in this release to integrate Farama-Notifications into the existing system, partially addressing issue #193 - Added
aiohttp-cors
library to known list (#2775). In this release, we have added theaiohttp-cors
library to our project, providing asynchronous Cross-Origin Resource Sharing (CORS) handling for theaiohttp
library. This addition enhances the robustness and flexibility of CORS management in our relevant projects. The library includes several new modules such as "aiohttp_cors", "aiohttp_cors.abc", "aiohttp_cors.cors_config", "aiohttp_cors.mixin", "aiohttp_cors.preflight_handler", "aiohttp_cors.resource_options", and "aiohttp_cors.urldispatcher_router_adapter", which offer functionalities for configuring and handling CORS inaiohttp
applications. This change partially resolves issue #1931 and further strengthens our application's security and cross-origin resource sharing capabilities. - Added
category-encoders
library to known list (#2781). In this release, we've added thecategory-encoders
library to our supported libraries, which provides a variety of methods for encoding categorical variables as numerical data, including one-hot encoding and target encoding. This addition resolves part of issue #1931, which concerned the support of this library. The library has been integrated into our system by adding a new entry forcategory-encoders
in the known.json file, which contains several modules and classes corresponding to various encoding methods provided by the library. This enhancement enables software engineers to leverage the capabilities ofcategory-encoders
library to encode categorical variables more efficiently and effectively. - Added
cmdstanpy
to known list (#2786). In this release, we have addedcmdstanpy
andstanio
libraries to our codebase.cmdstanpy
is a Python library for interfacing with the Stan probabilistic programming language and has been added to the whitelist. This addition enables the use ofcmdstanpy
's functionalities, including loading, inspecting, and manipulating Stan model objects, as well as running MCMC simulations. Additionally, we have included thestanio
library, which provides functionality for reading and writing Stan data and model files. These additions enhance the codebase's capabilities for working with probabilistic models, offering expanded options for loading, manipulating, and simulating models written in Stan. - Added
confection
library to known list (#2787). In this release, theconfection
library, a lightweight, pure Python library for parsing and formatting cookies with two modules for working with cookie headers and utility functions, has been added to the known list of libraries and is now usable within the project. Additionally, several modules from thesrsly
library, a collection of serialization utilities for Python including support for JSON, MessagePack, cloudpickle, and Ruamel YAML, have been added to the known list of libraries, increasing the project's flexibility and functionality in handling serialized data. This partially resolves issue #1931. - Added
configparser
library to known list (#2796). In this release, we have added support for theconfigparser
library, addressing issue #1931.Configparser
is a standard Python library used for parsing configuration files. This change not only whitelists the library but also includes the "backports.configparser" and "backports.configparser.compat" modules, providing backward compatibility for older versions of Python. By recognizing and supporting theconfigparser
library, users can now utilize it in their code with confidence, knowing that it is a known and supported library. This update also ensures that the backports for older Python versions are recognized, enabling users to leverage the library seamlessly, regardless of the Python version they are using. - Added
diskcache
library to known list (#2790). A new update has been made to include thediskcache
library in our open-source library's known list, as detailed in the release notes. This addition brings in multiple modules, includingdiskcache
,diskcache.cli
,diskcache.core
,diskcache.djangocache
,diskcache.persistent
, anddiskcache.recipes
. Thediskcache
library is a high-performance caching system, useful for a variety of purposes such as caching database queries, API responses, or any large data that needs frequent access. By adding thediskcache
library to the known list, developers can now leverage its capabilities in their projects, partially addressing issue #1931. - Added
dm-tree
library to known list (#2789). In this release, we have added thedm-tree
library to our project's known list, enabling its integration and use within our software. Thedm-tree
library is a C++ API that provides functionalities for creating and manipulating tree data structures, with support for sequences and tree benchmarking. This addition expands our range of available data structures, addressing the lack of support for tree data structures and partially resolving issue #1931, which may have been related to the integration of thedm-tree
library. By incorporating this library, we aim to enhance our project's performance and versatility, providing software engineers with more options for handling tree data structures. - Added
evaluate
to known list (#2821). In this release, we have added theevaluate
package and its dependent libraries to our open-source library. Theevaluate
package is a tool for evaluating and analyzing machine learning models, providing a consistent interface to various evaluation tasks. Its dependent libraries includecolorful
,cmdstanpy
,comm
,eradicate
,multiprocess
, andxxhash
. Thecolorful
library is used for colorizing terminal output, whilecmdstanpy
provides Python infrastructure for Stan, a platform for statistical modeling and high-performance statistical computation. Thecomm
library is used for creating and managing IPython comms, anderadicate
is used for removing unwanted columns from pandas DataFrame. Themultiprocess
library is used for spawning processes, andxxhash
is used for the XXHash algorithms, which are used for fast hash computation. This addition partly resolves issue #1931, providing enhanced functionality for evaluating machine learning models. - Added
future
to known list (#2823). In this commit, we have added thefuture
module, a compatibility layer for Python 2 and Python 3, to the project's known list in the configuration file. This module provides a wide range of backward-compatible tools and fixers to smooth over the differences between the two major versions of Python. It includes numerous sub-modules such as "future.backports", "future.builtins", "future.moves", and "future.standard_library", among others, which offer backward-compatible features for various parts of the Python standard library. The commit also includes related modules like "libfuturize", "libpasteurize", andpast
and their respective sub-modules, which provide tools for automatically converting Python 2 code to Python 3 syntax. These additions enhance the project's compatibility with both Python 2 and Python 3, providing developers with an easier way to write cross-compatible code. By adding thefuture
module and related tools, the project can take full advantage of the features and capabilities provided, simplifying the process of writing code that works on both versions of the language. - Added
google-api-core
to known list (#2824). In this commit, we have added thegoogle-api-core
andproto-plus
packages to our codebase. Thegoogle-api-core
package brings in a collection of modules for low-level support of Google Cloud services, such as client options, gRPC helpers, and retry mechanisms. This addition enables access to a wide range of functionalities for interacting with Google Cloud services. Theproto-plus
package includes protobuf-related modules, simplifying the handling and manipulation of protobuf messages. This package includes datetime helpers, enums, fields, marshaling utilities, message definitions, and more. These changes enhance the project's versatility, providing users with a more feature-rich environment for interacting with external services, such as those provided by Google Cloud. Users will benefit from the added functionality and convenience provided by these packages. - Added
google-auth-oauthlib
and dependent libraries to known list (#2825). In this release, we have added thegoogle-auth-oauthlib
andrequests-oauthlib
libraries and their dependencies to our repository to enhance OAuth2 authentication flow support. Thegoogle-auth-oauthlib
library is utilized for Google's OAuth2 client authentication and authorization flows, whilerequests-oauthlib
provi...
v0.38.0
- Added Py4j implementation of tables crawler to retrieve a list of HMS tables in the assessment workflow (#2579). In this release, we have added a Py4j implementation of a tables crawler to retrieve a list of Hive Metastore tables in the assessment workflow. A new
FasterTableScanCrawler
class has been introduced, which can be used in the Assessment Job based on a feature flag to replace the old Scala code, allowing for better logging during table scans. The existingassessment.crawl_tables
workflow now utilizes the new py4j crawler instead of the scala one. Integration tests have been added to ensure the functionality works correctly. The commit also includes a new method for listing table names in the specified database and improvements to error handling and logging mechanisms. The new Py4j tables crawler enhances the functionality of the assessment workflow by improving error handling, resulting in better logging and faster table scanning during the assessment process. This change is part of addressing issue #2190 and was co-authored by Serge Smertin. - Added
create-ucx-catalog
cli command (#2694). A new CLI command,create-ucx-catalog
, has been added to create a catalog for migration tracking that can be used across multiple workspaces. The command creates a UCX catalog for tracking migration status and artifacts, and is created by runningdatabricks labs ucx create-ucx-catalog
and specifying the storage location for the catalog. Relevant user documentation, unit tests, and integration tests have been added for this command. Theassign-metastore
command has also been updated to allow for the selection of a metastore when multiple metastores are available in the workspace region. This change improves the migration tracking feature and enhances the user experience. - Added experimental
migration-progress-experimental
workflow (#2658). This commit introduces an experimental workflow,migration-progress-experimental
, which refreshes the inventory for various resources such as clusters, grants, jobs, pipelines, policies, tables, TableMigrationStatus, and UDFs. The workflow can be triggered using thedatabricks labs ucx migration-progress
CLI command and uses a new implementation of a Scala-based crawler,TablesCrawler
, which will eventually replace the current implementation. The new workflow is a duplicate of most of theassessment
pipeline's functionality but with some differences, such as the use ofTablesCrawler
. Relevant user documentation has been added, along with unit tests, integration tests, and a screenshot of a successful staging environment run. The new workflow is expected to run on a schedule in the future. This change resolves #2574 and progresses #2074. - Added handling for
InternalError
inListing.__iter__
(#2697). This release introduces improved error handling in theListing.__iter__
method of theGeneric
class, located in theworkspace_access/generic.py
file. Previously, onlyNotFound
exceptions were handled, but now bothInternalError
andNotFound
exceptions are caught and logged appropriately. This change enhances the robustness of the method, which is responsible for listing objects of a specific type and returning them asGenericPermissionsInfo
objects. To ensure the correct functionality, we have added new unit tests and manual testing. The logging of theInternalError
exception is properly handled in theGenericPermissionsSupport
class when listing serving endpoints. This behavior is verified by the newly added test functiontest_internal_error_in_serving_endpoints_raises_warning
and the updatedtest_serving_endpoints_not_enabled_raises_warning
. - Added handling for
PermissionDenied
when listing accessible workspaces (#2733). A newcan_administer
method has been added to theWorkspaces
class in theworkspaces.py
file, which allows for more fine-grained control over which users can administer workspaces. This method checks if the user has access to a given workspace and is a member of the workspace'sadmins
group, indicating that the user has administrative privileges for that workspace. If the user does not have access to the workspace or is not a member of theadmins
group, the method returnsFalse
. Additionally, error handling in theget_accessible_workspaces
method has been improved by adding aPermissionDenied
exception to the list of exceptions that are caught and logged. New unit tests have been added for theAccountWorkspaces
class of thedatabricks.labs.blueprint.account
module to ensure that the new method is functioning as intended, specifically checking if a user is a workspace administrator based on whether they belong to theadmins
group. The linked issue #2732 is resolved by this change. All changes have been manually and unit tested. - Added static code analysis results to assessment dashboard (#2696). This commit introduces two new tasks,
assess_dashboards
andassess_workflows
, to the existing assessment dashboard for identifying migration problems in dashboards and workflows. These tasks analyze embedded queries and notebooks for migration issues and collect direct filesystem access patterns requiring attention. Upon completion, the results are stored in the inventory database and displayed on the Migration dashboard. Additionally, two new widgets, job/query problem widgets and directfs access widgets, have been added to enhance the dashboard's functionality by providing additional information related to code compatibility and access control. Integration tests using mock data have been added and manually tested to ensure the proper functionality of these new features. This update improves the overall assessment and compatibility checking capabilities of the dashboard, making it easier for users to identify and address issues related to Unity Catalog compatibility in their workflows and dashboards. - Added unskip CLI command to undo a skip on schema or a table (#2727). This pull request introduces a new CLI command, "unskip", which allows users to reverse a previously applied
skip
on a schema or table. Theunskip
command accepts a required--schema
parameter and an optional--table
parameter. A new function, also named "unskip", has been added, which takes the same parameters as theskip
command. The function checks for the required--schema
parameter and creates a new WorkspaceContext object to call the appropriate method on the table_mapping object. Two new methods,unskip_schema
and "unskip_table_or_view", have been added to the HiveMapping class. These methods remove the skip mark from a schema or table, respectively, and handle exceptions such as NotFound and BadRequest. The get_tables_to_migrate method has been updated to consider the unskipped tables or schemas. Currently, the feature is tested manually and has not been added to the user documentation. - Added unskip CLI command to undo a skip on schema or a table (#2734). A new
unskip
CLI command has been added to the project, which allows users to remove theskip
mark set by the existingskip
command on a specified schema or table. This command takes an optional--table
flag, and if not provided, it will unskip the entire schema. The new functionality is accompanied by a unit test and relevant user documentation, and addresses issue #1938. The implementation includes the addition of theunskip_table_or_view
method, which generates the appropriateALTER TABLE/VIEW
statement to remove the skip marker, and updates to theunskip_schema
method to include the schema name in theALTER SCHEMA
statement. Additionally, exception handling has been updated to includeNotFound
andBadRequest
exceptions. This feature simplifies the process of undoing a skip on a schema, table, or view in the Hive metastore, which previously required manual editing of the Hive metastore properties. - Assess source code as part of the assessment (#2678). This commit introduces enhancements to the assessment workflow, including the addition of two new tasks for evaluating source code from SQL queries in dashboards and from notebooks/files in jobs and tasks. The existing
databricks labs install ucx
command has been modified to incorporate linting during the assessment. TheQueryLinter
class has been updated to accept an additional argument for linting source code. These changes have been thoroughly tested through integration tests to ensure proper functionality. Co-authored by Eric Vergnaud. - Bump astroid version, pylint version and drop our f-string workaround (#2746). In this update, we have bumped the versions of astroid and pylint to 3.3.1 and removed workarounds related to f-string inference limitations in previous versions of astroid (< 3.3). These workarounds were necessary for handling issues such as uninferrable sys.path values and the lack of f-string inference in loops. We have also updated corresponding tests to reflect these changes and improve the overall code quality and maintainability of the project. These changes are part of a larger effort to update dependencies and simplify the codebase by leveraging the latest features of up...
v0.37.0
- Added ability to run create-missing-principals command as collection (#2675). This release introduces the capability to run the
create-missing-principals
command as a collection in the UCX (Unified Cloud Experience) tool with the new optional flagrun-as-collection
. This allows for more control and flexibility when managing cloud resources, particularly in handling multiple workspaces. The existingcreate-missing-principals
command has been modified to accept a newrun_as_collection
parameter, enabling the command to run on multiple workspaces when set to True. The function has been updated to handle a list ofWorkspaceContext
objects, allowing it to iterate over each object and execute necessary actions for each workspace. Additionally, a newAccountClient
parameter has been added to facilitate the retrieval of all workspaces associated with a specific account. New test functions have been added totest_cli.py
to test this new functionality on AWS and Azure cloud providers. Theacc_client
argument has been added to the test functions to enable running the tests with an authenticated AWS or Azure client, and theMockPrompts
object is used to simulate user responses to the prompts displayed during the execution of the command. - Added storage for direct filesystem references in code (#2526). The open-source library has been updated with a new table
directfs_in_paths
to store Direct File System Access (DFSA) records, extending support for managing and collecting DFSAs as part of addressing issue #2350 and #2526. The changes include a new classDirectFsAccessCrawlers
and methods for handling DFSAs, as well as linting, testing, and a manually verified schema upgrade. Additionally, a new SQL query deprecates the use of direct filesystem references. The commit is co-authored by Eric Vergnaud, Serge Smertin, and Andrew Snare. - Added task for linting queries (#2630). This commit introduces a new
QueryLinter
class for linting SQL queries in the workspace, similar to the existingWorkflowLinter
for jobs. TheQueryLinter
checks for any issues in dashboard queries and reports them in a newquery_problems
table. The commit also includes the addition of unit tests, integration tests, and manual testing of the schema upgrade. TheQueryLinter
method has been updated to include aTableMigrationIndex
object, which is currently set to an empty list and will be updated in a future commit. This change improves the quality of the codebase by ensuring that all SQL queries are properly linted and any issues are reported, allowing for better maintenance and development of the system. The commit is co-authored by multiple developers, including Eric Vergnaud, Serge Smertin, Andrew Snare, and Cor. Additionally, a new linting rule, "direct-filesystem-access", has been introduced to deprecate the use of direct filesystem references in favor of more abstracted file access methods in the project's codebase. - Adopt
databricks-labs-pytester
PyPI package (#2663). In this release, we have made updates to thepyproject.toml
file, removing thepytest
package version 8.1.0 and updating it to 8.3.3. We have also added thedatabricks-labs-pytester
package with a minimum version of 0.2.1. This update also includes the adoption of thedatabricks-labs-pytester
PyPI package, which moves fixture usage frommixins.fixtures
into its own top-level library. This affects various test files, includingtest_jobs.py
, by replacing theget_purge_suffix
fixture withwatchdog_purge_suffix
to standardize the approach to creating and managing temporary directories and files used in tests. Additionally, new fixtures have been introduced in a separate PR for testing thedatabricks.labs.ucx
package, includingdebug_env_name
,product_info
,inventory_schema
,make_lakeview_dashboard
,make_dashboard
,make_dbfs_data_copy
,make_mounted_location
,make_storage_dir
,sql_exec
, andmigrated_group
. These fixtures simplify the testing process by providing preconfigured resources that can be used in the tests. Theredash.py
file has been removed from thedatabricks/labs/ucx/mixins
directory as the Redash API is being deprecated and replaced with a new library. - Assessment: crawl UDFs as a task in parallel to tables instead of implicitly during grants (#2642). This release introduces changes to the assessment workflow, specifically in how User Defined Functions (UDFs) are crawled/scanned. Previously, UDFs were crawled/scanned implicitly by the GrantsCrawler, which requested a snapshot from the UDFSCrawler that hadn't executed yet. With this update, UDFs are now crawled/scanned as their own task, running in parallel with tables before grants crawling begins. This modification addresses issue #2574, which requires grants and UDFs to be refreshable but only once within a given workflow run. A new method, crawl_udfs, has been introduced to iterate over all UDFs in the Hive Metastore of the current workspace and persist their metadata in a table named $inventory_database.udfs. This inventory is utilized when scanning securable objects for issues with grants that cannot be migrated to Unit Catalog. The crawl_grants task now depends on crawl_udfs, crawl_tables, and setup_tacl, ensuring that UDFs are crawled/scanned before grants are.
- Collect direct filesystem access from queries (#2599). This commit introduces support for extracting Direct File System Access (DirectFsAccess) records from workspace queries, adding a new table
directfs_in_queries
and a new viewdirectfs
that unionsdirectfs_in_paths
with the new table. The DirectFsAccessCrawlers class has been refactored into two separate classes:DirectFsAccessCrawler.for_paths
andDirectFsAccessCrawler.for_queries
, and a newQueryLinter
class has been introduced to check queries for DirectFsAccess records. Unit tests and manual tests have been conducted to ensure the correct functioning of the schema upgrade. The commit is co-authored by Eric Vergnaud, Serge Smertin, and Andrew Snare. - Fixed failing integration test:
test_reflect_account_groups_on_workspace_skips_groups_that_already_exists_in_the_workspace
(#2624). In this release, we have made updates to the group migration workflow, addressing an issue (#2623) where the integration testtest_reflect_account_groups_on_workspace_skips_groups_that_already_exists_in_the_workspace
failed due to unhandled scenarios where a workspace group already existed with the same name as an account group to be reflected. The changes include the addition of a new method,_workspace_groups_in_workspace()
, which checks for the existence of workspace groups. We have also modified thegroup-migration
workflow and integrated testtest_reflect_account_groups_on_workspace_skips_account_groups_when_a_workspace_group_has_same_name
. To enhance consistency and robustness, theGroupManager
class has been updated with two new methods:test_reflect_account_groups_on_workspace_warns_skipping_when_a_workspace_group_has_same_name
andtest_reflect_account_groups_on_workspace_logs_skipping_groups_when_already_reflected_on_workspace
. These new methods check if a group is skipped when a workspace group with the same name exists and log a warning message, as well as log skipping groups that are already reflected on the workspace. These improvements ensure that the system behaves as expected during the group migration process, handling cases where workspace groups and account groups share the same name. - Fixed failing solution accelerator verification tests (#2648). This release includes a fix for an issue in the LocalCodeLinter class that was unable to normalize Python code at the notebook cell level. The solution involved modifying the LocalCodeLinter constructor to include a notebook loader, as well as adding a conditional block to the lint_path method to determine the correct loader to use based on whether the path is a notebook or not. These changes allow the linter to handle Python code more effectively within Jupyter notebook cells. The tests for this change were manually verified using
make solacc
on the files that failed in CI. This commit has been co-authored by Eric Vergnaud. The functionality of the linter remains unchanged, and there is no impact on the overall software functionality. The target audience for this description includes software engineers who adopt this open-source library. - Fixed handling of potentially corrupt
state.json
of UCX workflows (#2673). This commit introduces a fix for potential corruption ofstate.json
files in UCX workflows, addressing issue #2673 and resolving #2667. It updates the import statement ininstall.py
, introduces a newwith_extra
function, and centralizes the deletion of jobs, improving code maintainability. Two new methods are added to check if a job is managed by UCX. Additionally, the commit removes deprecation warnings for direct filesystem references in pytester fixtures and adjusts the known.json file to accurately reflect the project's state. A newTask
method is added for defining UCX workflow tasks, and several test cases are updated to ensure the correct handli...