From c0bbc337e6a02ec25d5a642e1cad5d89833bf16c Mon Sep 17 00:00:00 2001 From: Aryamanz29 Date: Mon, 24 Feb 2025 23:34:26 +0530 Subject: [PATCH 01/10] APP-5633: Updated deps to the latest version (main + dev) - Migrated to ruff (linter + formatter). - Removed black, flake8, autoflake8 and isort. --- .pre-commit-config.yaml | 41 +---- pyatlan/client/atlan.py | 211 ++++++----------------- tox.ini => pytest.ini | 14 +- qa-checks | 12 +- requirements-dev.txt | 29 ++-- requirements.txt | 14 +- ruff.toml | 27 +++ tests/integration/custom_package_test.py | 5 +- 8 files changed, 121 insertions(+), 232 deletions(-) rename tox.ini => pytest.ini (83%) create mode 100644 ruff.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cdbe1eec7..abbf6c575 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,42 +1,17 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - id: debug-statements - - repo: https://github.com/PyCQA/autoflake - rev: v2.3.1 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.9.7 hooks: - - id: autoflake - args: [--ignore-init-module-imports, --remove-all-unused-imports, --remove-unused-variables, --in-place] - language_version: python3 - - - repo: https://github.com/pycqa/flake8 - rev: 7.0.0 - hooks: - - id: flake8 - additional_dependencies: ["flake8-bandit", "flake8-bugbear"] - - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - args: ["--profile", "black", "--filter-files"] - - - repo: https://github.com/psf/black - rev: 24.4.2 - hooks: - - id: black - language_version: python3 - - - repo: local - hooks: - - id: tests - name: run tests - entry: pytest - language: system - types: [python] - stages: [push] + - id: ruff + name: ruff-sort-imports + args: [--select, I, --fix] + - id: ruff + - id: ruff-format diff --git a/pyatlan/client/atlan.py b/pyatlan/client/atlan.py index 0c5618e49..405e394e6 100644 --- a/pyatlan/client/atlan.py +++ b/pyatlan/client/atlan.py @@ -395,9 +395,7 @@ def _call_api_internal( if not line: continue if not line.startswith("data: "): - raise ErrorCode.UNABLE_TO_DESERIALIZE.exception_with_parameters( - line - ) + raise ErrorCode.UNABLE_TO_DESERIALIZE.exception_with_parameters(line) events.append(json.loads(line.split("data: ")[1])) if text_response: response_ = response.text @@ -422,14 +420,8 @@ def _call_api_internal( else: with contextlib.suppress(ValueError, json.decoder.JSONDecodeError): error_info = json.loads(response.text) - error_code = ( - error_info.get("errorCode", 0) - or error_info.get("code", 0) - or error_info.get("status") - ) - error_message = error_info.get( - "errorMessage", "" - ) or error_info.get("message", "") + error_code = error_info.get("errorCode", 0) or error_info.get("code", 0) or error_info.get("status") + error_message = error_info.get("errorMessage", "") or error_info.get("message", "") error_cause = error_info.get("errorCause", []) causes = error_info.get("causes", []) backend_error_id = error_info.get("errorId") @@ -442,17 +434,14 @@ def _call_api_internal( for cause in causes ] # Join the error cause details into a single string, separated by newlines - error_cause_details_str = ( - "\n".join(error_cause_details) if error_cause_details else "" - ) + error_cause_details_str = "\n".join(error_cause_details) if error_cause_details else "" # Retry with impersonation (if _user_id is present) # on authentication failure (token may have expired) if ( self._user_id and not self._has_retried_for_401 - and response.status_code - == ErrorCode.AUTHENTICATION_PASSTHROUGH.http_error_code + and response.status_code == ErrorCode.AUTHENTICATION_PASSTHROUGH.http_error_code ): try: return self._handle_401_token_refresh( @@ -471,9 +460,7 @@ def _call_api_internal( ) if error_code and error_message: - error = ERROR_CODE_FOR_HTTP_STATUS.get( - response.status_code, ErrorCode.ERROR_PASSTHROUGH - ) + error = ERROR_CODE_FOR_HTTP_STATUS.get(response.status_code, ErrorCode.ERROR_PASSTHROUGH) # Raise exception with error details and causes raise error.exception_with_parameters( error_code, @@ -526,9 +513,7 @@ def _upload_file(self, api, file=None, filename=None): post_data = generator.get_post_data() api.produces = f"multipart/form-data; boundary={generator.boundary}" path = self._create_path(api) - params = self._create_params( - api, query_params=None, request_obj=None, exclude_unset=True - ) + params = self._create_params(api, query_params=None, request_obj=None, exclude_unset=True) if LOGGER.isEnabledFor(logging.DEBUG): self._api_logger(api, path) return self._call_api_internal(api, path, params, binary_data=post_data) @@ -563,9 +548,7 @@ def _presigned_url_file_download(self, api: API, file_path: str): params["headers"].pop("authorization", None) return self._call_api_internal(api, path, params, download_file_path=file_path) - def _create_params( - self, api: API, query_params, request_obj, exclude_unset: bool = True - ): + def _create_params(self, api: API, query_params, request_obj, exclude_unset: bool = True): params = copy.deepcopy(self._request_params) params["headers"]["Accept"] = api.consumes params["headers"]["content-type"] = api.produces @@ -573,9 +556,7 @@ def _create_params( params["params"] = query_params if request_obj is not None: if isinstance(request_obj, AtlanObject): - params["data"] = request_obj.json( - by_alias=True, exclude_unset=exclude_unset - ) + params["data"] = request_obj.json(by_alias=True, exclude_unset=exclude_unset) elif api.consumes == APPLICATION_ENCODED_FORM: params["data"] = request_obj else: @@ -640,15 +621,12 @@ def get_roles( DeprecationWarning, stacklevel=2, ) - return self.role.get( - limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset - ) + return self.role.get(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) def get_all_roles(self) -> RoleResponse: """Deprecated - use self.role.get_all() instead.""" warn( - "This method is deprecated, please use 'self.role.get_all' instead, which offers identical " - "functionality.", + "This method is deprecated, please use 'self.role.get_all' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) @@ -705,9 +683,7 @@ def get_groups( DeprecationWarning, stacklevel=2, ) - return self.group.get( - limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset - ) + return self.group.get(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) def get_all_groups( self, @@ -783,8 +759,7 @@ def get_groups_for_user( ) -> GroupResponse: """Deprecated - use user.get_groups() instead.""" warn( - "This method is deprecated, please use 'user.get_groups' instead, which offers identical " - "functionality.", + "This method is deprecated, please use 'user.get_groups' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) @@ -797,8 +772,7 @@ def add_user_to_groups( ) -> None: """Deprecated - use user.add_to_groups() instead.""" warn( - "This method is deprecated, please use 'user.add_to_groups' instead, which offers identical " - "functionality.", + "This method is deprecated, please use 'user.add_to_groups' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) @@ -811,8 +785,7 @@ def change_user_role( ) -> None: """Deprecated - use user.change_role() instead.""" warn( - "This method is deprecated, please use 'user.change_role' instead, which offers identical " - "functionality.", + "This method is deprecated, please use 'user.change_role' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) @@ -823,8 +796,7 @@ def get_current_user( ) -> UserMinimalResponse: """Deprecated - use user.get_current() instead.""" warn( - "This method is deprecated, please use 'user.get_current' instead, which offers identical " - "functionality.", + "This method is deprecated, please use 'user.get_current' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) @@ -844,9 +816,7 @@ def get_users( DeprecationWarning, stacklevel=2, ) - return self.user.get( - limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset - ) + return self.user.get(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) def get_all_users( self, @@ -867,8 +837,7 @@ def get_users_by_email( ) -> Optional[List[AtlanUser]]: """Deprecated - use user.get_by_email() instead.""" warn( - "This method is deprecated, please use 'user.get_by_email' instead, which offers identical " - "functionality.", + "This method is deprecated, please use 'user.get_by_email' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) @@ -932,8 +901,7 @@ def get_asset_by_guid( ) -> A: """Deprecated - use asset.get_by_guid() instead.""" warn( - "This method is deprecated, please use 'asset.get_by_guid' instead, which offers identical " - "functionality.", + "This method is deprecated, please use 'asset.get_by_guid' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) @@ -1005,9 +973,7 @@ def upsert_merging_cm( DeprecationWarning, stacklevel=2, ) - return self.asset.save_merging_cm( - entity=entity, replace_atlan_tags=replace_atlan_tags - ) + return self.asset.save_merging_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) def save_merging_cm( self, entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False @@ -1019,13 +985,9 @@ def save_merging_cm( DeprecationWarning, stacklevel=2, ) - return self.asset.save_merging_cm( - entity=entity, replace_atlan_tags=replace_atlan_tags - ) + return self.asset.save_merging_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) - def update_merging_cm( - self, entity: Asset, replace_atlan_tags: bool = False - ) -> AssetMutationResponse: + def update_merging_cm(self, entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse: """Deprecated - use asset.update_merging_cm() instead.""" warn( "This method is deprecated, please use 'asset.update_merging_cm' instead, which offers identical " @@ -1033,9 +995,7 @@ def update_merging_cm( DeprecationWarning, stacklevel=2, ) - return self.asset.update_merging_cm( - entity=entity, replace_atlan_tags=replace_atlan_tags - ) + return self.asset.update_merging_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) def upsert_replacing_cm( self, entity: Union[Asset, List[Asset]], replace_atlan_tagss: bool = False @@ -1047,9 +1007,7 @@ def upsert_replacing_cm( DeprecationWarning, stacklevel=2, ) - return self.asset.save_replacing_cm( - entity=entity, replace_atlan_tags=replace_atlan_tagss - ) + return self.asset.save_replacing_cm(entity=entity, replace_atlan_tags=replace_atlan_tagss) def save_replacing_cm( self, entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False @@ -1061,13 +1019,9 @@ def save_replacing_cm( DeprecationWarning, stacklevel=2, ) - return self.asset.save_replacing_cm( - entity=entity, replace_atlan_tags=replace_atlan_tags - ) + return self.asset.save_replacing_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) - def update_replacing_cm( - self, entity: Asset, replace_atlan_tags: bool = False - ) -> AssetMutationResponse: + def update_replacing_cm(self, entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse: """Deprecated - use asset.update_replacing_cm() instead.""" warn( "This method is deprecated, please use 'asset.update_replacing_cm' instead, which offers identical " @@ -1075,13 +1029,9 @@ def update_replacing_cm( DeprecationWarning, stacklevel=2, ) - return self.asset.update_replacing_cm( - entity=entity, replace_atlan_tags=replace_atlan_tags - ) + return self.asset.update_replacing_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) - def purge_entity_by_guid( - self, guid: Union[str, List[str]] - ) -> AssetMutationResponse: + def purge_entity_by_guid(self, guid: Union[str, List[str]]) -> AssetMutationResponse: """Deprecated - use asset.purge_by_guid() instead.""" warn( "This method is deprecated, please use 'asset.purge_by_guid' instead, which offers identical " @@ -1091,9 +1041,7 @@ def purge_entity_by_guid( ) return self.asset.purge_by_guid(guid=guid) - def delete_entity_by_guid( - self, guid: Union[str, List[str]] - ) -> AssetMutationResponse: + def delete_entity_by_guid(self, guid: Union[str, List[str]]) -> AssetMutationResponse: """Deprecated - use asset.delete_by_guid() instead.""" warn( "This method is deprecated, please use 'asset.delete_by_guid' instead, which offers identical " @@ -1106,8 +1054,7 @@ def delete_entity_by_guid( def restore(self, asset_type: Type[A], qualified_name: str) -> bool: """Deprecated - use asset.restore() instead.""" warn( - "This method is deprecated, please use 'asset.restore' instead, which offers identical " - "functionality.", + "This method is deprecated, please use 'asset.restore' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) @@ -1131,9 +1078,7 @@ def get_all_typedefs(self) -> TypeDefResponse: ) return self.typedef.get_all() - def get_typedefs( - self, type_category: Union[AtlanTypeCategory, List[AtlanTypeCategory]] - ) -> TypeDefResponse: + def get_typedefs(self, type_category: Union[AtlanTypeCategory, List[AtlanTypeCategory]]) -> TypeDefResponse: """Deprecated - use typedef.get() instead.""" warn( "This method is deprecated, please use 'typedef.get' instead, which offers identical functionality.", @@ -1198,9 +1143,7 @@ def add_atlan_tags( ) @validate_arguments - def remove_atlan_tag( - self, asset_type: Type[A], qualified_name: str, atlan_tag_name: str - ) -> None: + def remove_atlan_tag(self, asset_type: Type[A], qualified_name: str, atlan_tag_name: str) -> None: """Deprecated - use asset.remove_atlan_tag() instead.""" warn( "This method is deprecated, please use 'asset.remove_atlan_tag' instead, which offers identical " @@ -1239,9 +1182,7 @@ def update_certificate( ) @validate_arguments - def remove_certificate( - self, asset_type: Type[A], qualified_name: str, name: str - ) -> Optional[A]: + def remove_certificate(self, asset_type: Type[A], qualified_name: str, name: str) -> Optional[A]: """Deprecated - use asset.remove_certificate() instead.""" warn( "This method is deprecated, please use 'asset.remove_certificate' instead, which offers identical " @@ -1249,9 +1190,7 @@ def remove_certificate( DeprecationWarning, stacklevel=2, ) - return self.asset.remove_certificate( - asset_type=asset_type, qualified_name=qualified_name, name=name - ) + return self.asset.remove_certificate(asset_type=asset_type, qualified_name=qualified_name, name=name) @validate_arguments def update_announcement( @@ -1276,9 +1215,7 @@ def update_announcement( ) @validate_arguments - def remove_announcement( - self, asset_type: Type[A], qualified_name: str, name: str - ) -> Optional[A]: + def remove_announcement(self, asset_type: Type[A], qualified_name: str, name: str) -> Optional[A]: """Deprecated - use asset.remove_announcement() instead.""" warn( "This method is deprecated, please use 'asset.remove_announcement' instead, which offers identical " @@ -1286,13 +1223,9 @@ def remove_announcement( DeprecationWarning, stacklevel=2, ) - return self.asset.remove_announcement( - asset_type=asset_type, qualified_name=qualified_name, name=name - ) + return self.asset.remove_announcement(asset_type=asset_type, qualified_name=qualified_name, name=name) - def update_custom_metadata_attributes( - self, guid: str, custom_metadata: CustomMetadataDict - ): + def update_custom_metadata_attributes(self, guid: str, custom_metadata: CustomMetadataDict): """Deprecated - use asset.update_custom_metadata_attributes() instead.""" warn( "This method is deprecated, please use 'asset.update_custom_metadata_attributes' instead, which offers " @@ -1300,9 +1233,7 @@ def update_custom_metadata_attributes( DeprecationWarning, stacklevel=2, ) - self.asset.update_custom_metadata_attributes( - guid=guid, custom_metadata=custom_metadata - ) + self.asset.update_custom_metadata_attributes(guid=guid, custom_metadata=custom_metadata) def replace_custom_metadata(self, guid: str, custom_metadata: CustomMetadataDict): """Deprecated - use asset.replace_custom_metadata() instead.""" @@ -1338,9 +1269,7 @@ def append_terms( DeprecationWarning, stacklevel=2, ) - return self.asset.append_terms( - asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name - ) + return self.asset.append_terms(asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name) @validate_arguments def replace_terms( @@ -1357,9 +1286,7 @@ def replace_terms( DeprecationWarning, stacklevel=2, ) - return self.asset.replace_terms( - asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name - ) + return self.asset.replace_terms(asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name) @validate_arguments def remove_terms( @@ -1375,9 +1302,7 @@ def remove_terms( DeprecationWarning, stacklevel=2, ) - return self.asset.remove_terms( - asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name - ) + return self.asset.remove_terms(asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name) @validate_arguments def find_connections_by_name( @@ -1393,13 +1318,9 @@ def find_connections_by_name( DeprecationWarning, stacklevel=2, ) - return self.asset.find_connections_by_name( - name=name, connector_type=connector_type, attributes=attributes - ) + return self.asset.find_connections_by_name(name=name, connector_type=connector_type, attributes=attributes) - def get_lineage_list( - self, lineage_request: LineageListRequest - ) -> LineageListResults: + def get_lineage_list(self, lineage_request: LineageListRequest) -> LineageListResults: """Deprecated - use asset.get_lineage_list() instead.""" warn( "This method is deprecated, please use 'asset.get_lineage_list' instead, which offers identical " @@ -1409,31 +1330,23 @@ def get_lineage_list( ) return self.asset.get_lineage_list(lineage_request=lineage_request) - def add_api_token_as_admin( - self, asset_guid: str, impersonation_token: str - ) -> Optional[AssetMutationResponse]: + def add_api_token_as_admin(self, asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]: """Deprecated - use user.add_as_admin() instead.""" warn( "This method is deprecated, please use 'user.add_as_admin' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) - return self.user.add_as_admin( - asset_guid=asset_guid, impersonation_token=impersonation_token - ) + return self.user.add_as_admin(asset_guid=asset_guid, impersonation_token=impersonation_token) - def add_api_token_as_viewer( - self, asset_guid: str, impersonation_token: str - ) -> Optional[AssetMutationResponse]: + def add_api_token_as_viewer(self, asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]: """Deprecated - use user.add_as_viewer() instead.""" warn( "This method is deprecated, please use 'user.add_as_viewer' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) - return self.user.add_as_viewer( - asset_guid=asset_guid, impersonation_token=impersonation_token - ) + return self.user.add_as_viewer(asset_guid=asset_guid, impersonation_token=impersonation_token) def get_api_tokens( self, @@ -1449,9 +1362,7 @@ def get_api_tokens( DeprecationWarning, stacklevel=2, ) - return self.token.get( - limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset - ) + return self.token.get(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) def get_api_token_by_name(self, display_name: str) -> Optional[ApiToken]: """Deprecated - use token.get_by_name() instead.""" @@ -1520,9 +1431,7 @@ def purge_api_token(self, guid: str) -> None: ) self.token.purge(guid=guid) - def get_keycloak_events( - self, keycloak_request: KeycloakEventRequest - ) -> KeycloakEventResponse: + def get_keycloak_events(self, keycloak_request: KeycloakEventRequest) -> KeycloakEventResponse: """Deprecated - use admin.get_keycloak_events() instead.""" warn( "This method is deprecated, please use 'admin.get_keycloak_events' instead, which offers identical " @@ -1620,9 +1529,7 @@ def find_category_by_name( DeprecationWarning, stacklevel=2, ) - return self.asset.find_category_by_name( - name=name, glossary_name=glossary_name, attributes=attributes - ) + return self.asset.find_category_by_name(name=name, glossary_name=glossary_name, attributes=attributes) @validate_arguments def find_term_fast_by_name( @@ -1658,22 +1565,18 @@ def find_term_by_name( DeprecationWarning, stacklevel=2, ) - return self.asset.find_term_by_name( - name=name, glossary_name=glossary_name, attributes=attributes - ) + return self.asset.find_term_by_name(name=name, glossary_name=glossary_name, attributes=attributes) @contextlib.contextmanager - def max_retries( - self, max_retries: Retry = CONNECTION_RETRY - ) -> Generator[None, None, None]: + def max_retries(self, max_retries: Retry = CONNECTION_RETRY) -> Generator[None, None, None]: """Creates a context manger that can used to temporarily change parameters used for retrying connnections. The original Retry information will be restored when the context is exited.""" if self.base_url == "INTERNAL": adapter = self._session.adapters[HTTP_PREFIX] else: adapter = self._session.adapters[HTTPS_PREFIX] - current_max = adapter.max_retries - adapter.max_retries = max_retries + current_max = adapter.max_retries # type: ignore[attr-defined] + adapter.max_retries = max_retries # type: ignore[attr-defined] LOGGER.debug( "max_retries set to total: %s force_list: %s", max_retries.total, @@ -1687,11 +1590,11 @@ def max_retries( LOGGER.exception("Exception in max retries") raise ErrorCode.RETRY_OVERRUN.exception_with_parameters() from err finally: - adapter.max_retries = current_max + adapter.max_retries = current_max # type: ignore[attr-defined] LOGGER.debug( "max_retries restored to total: %s force_list: %s", - adapter.max_retries.total, - adapter.max_retries.status_forcelist, + adapter.max_retries.total, # type: ignore[attr-defined] + adapter.max_retries.status_forcelist, # type: ignore[attr-defined] ) diff --git a/tox.ini b/pytest.ini similarity index 83% rename from tox.ini rename to pytest.ini index a646def52..6a484e7a4 100644 --- a/tox.ini +++ b/pytest.ini @@ -1,5 +1,5 @@ ########################################################################## -# Copyright 2022 Atlan Pte, Ltd +# Copyright 2024 Atlan Pte, Ltd # Copyright [2015-2021] The Apache Software Foundation # # Licensed to the Apache Software Foundation (ASF) under one @@ -19,18 +19,6 @@ # limitations under the License. ########################################################################## -[flake8] -max-line-length = 120 -per-file-ignores = - tests/*:S101 - pyatlan/model/assets.py:S307 -exclude = - env - venv - __pycache__ - pyatlan/model/assets/__init__.py - pyatlan/model/structs/__init__.py - [pytest] ; Here `name_of_plugin` is refers to the pytest-timer ; https://github.com/skudriashev/pytest-timer/blob/a1995d6bb7a6d3f02edbec90622d928a50db95e1/setup.py#L26C50-L26C62 diff --git a/qa-checks b/qa-checks index 588b92642..01465b29b 100755 --- a/qa-checks +++ b/qa-checks @@ -16,13 +16,13 @@ perform_check() { } # Formatter -black-check() { - perform_check "black" "black --check --quiet ." "black ." +ruff-formatter-check() { + perform_check "ruff" "ruff format --check ." "ruff format ." } # Linter -flake8-check() { - perform_check "flake8" "flake8" "flake8 ." +ruff-linter-check() { + perform_check "ruff" " ruff check ." " ruff check ." } # Static type checker @@ -30,7 +30,7 @@ mypy-check() { perform_check "mypy" "mypy pyatlan tests" "mypy pyatlan tests" } -black-check -flake8-check +ruff-formatter-check +ruff-linter-check mypy-check exit $FAILURE diff --git a/requirements-dev.txt b/requirements-dev.txt index 9792f8f5c..c0b933707 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,16 +1,15 @@ -flake8~=7.0.0 -mypy~=1.9.0 -black~=24.4.0 -types-requests==2.31.0.2 -pytest~=8.1.1 -pytest-order~=1.2.0 -pytest-timer[termcolor]==1.0.0 -pytest-sugar==1.0.0 -retry==0.9.2 -pre-commit~=3.5.0 +mypy~=1.15.0 +ruff~=0.9.7 +types-requests~=2.32.0.20241016 +pytest~=8.3.4 +pytest-order~=1.3.0 +pytest-timer[termcolor]~=1.0.0 +pytest-sugar~=1.0.0 +retry~=0.9.2 +pre-commit~=4.1.0 deepdiff~=7.0.1 -pytest-cov~=5.0.0 -twine~=5.0.0 -types-retry==0.9.9.3 -networkx>=3.1 -networkx-stubs==0.0.1 +pytest-cov~=6.0.0 +twine~=6.1.0 +types-retry~=0.9.9.20241221 +networkx~=3.4.2 +networkx-stubs~=0.0.1 diff --git a/requirements.txt b/requirements.txt index 87faa2e25..ffd66fef2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ -requests>=2.24 -pydantic>=2.0.0,<3.0.0 -jinja2==3.1.5 -tenacity==8.2.3 +requests~=2.32.3 +pydantic~=2.10.6 +jinja2~=3.1.5 +tenacity~=9.0.0 urllib3>=1.26.0,<3 lazy_loader~=0.4 -nanoid==2.0.0 -pytz==2024.2 -python-dateutil==2.9.0.post0 +nanoid~=2.0.0 +pytz~=2025.1 +python-dateutil~=2.9.0.post0 PyYAML~=6.0.2 diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 000000000..83185f829 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,27 @@ +########################################################################## +# Copyright 2024 Atlan Pte, Ltd +# Copyright [2015-2021] The Apache Software Foundation +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +########################################################################## +line-length = 120 +exclude = ["env", "venv", "__pycache__", "pyatlan/model/assets/__init__.py", "pyatlan/model/structs/__init__.py"] + +# Ignore `E402` (import violations) in all `__init__.py` files, and in selected subdirectories. +[lint.per-file-ignores] +"tests/*" = ["S101"] +"pyatlan/model/assets.py" = ["S307"] diff --git a/tests/integration/custom_package_test.py b/tests/integration/custom_package_test.py index 70eef44d0..87593bb92 100644 --- a/tests/integration/custom_package_test.py +++ b/tests/integration/custom_package_test.py @@ -22,7 +22,6 @@ def mock_pkg_env(): "X_ATLAN_AGENT_ID": "agent_id_value", "X_ATLAN_AGENT_PACKAGE_NAME": "package_name_value", "X_ATLAN_AGENT_WORKFLOW_ID": "workflow_id_value", - "X_ATLAN_AGENT_WORKFLOW_ID": "workflow_id_value", "CLIENT_ID": "client_id_value", "CLIENT_SECRET": "client_secret_value", }, @@ -87,9 +86,7 @@ def test_generate_config(custom_package: CustomPackage, tmpdir): config_name = "owner_propagator_cfg.py" assert dir / config_name - spec = importlib.util.spec_from_file_location( - "owner_propagator_cfg", dir / config_name - ) + spec = importlib.util.spec_from_file_location("owner_propagator_cfg", dir / config_name) assert spec is not None module = importlib.util.module_from_spec(spec) assert module is not None From 89a1d72181b1427d2459a4dfbe469a6a993d3742 Mon Sep 17 00:00:00 2001 From: Aryamanz29 Date: Mon, 24 Feb 2025 23:45:01 +0530 Subject: [PATCH 02/10] [ruff-migration] Migrated to ruff (linter + formatter + sort imports) --- check_tag.py | 8 +- pyatlan/cache/abstract_asset_cache.py | 8 +- pyatlan/cache/connection_cache.py | 17 +- pyatlan/cache/custom_metadata_cache.py | 44 +- pyatlan/cache/group_cache.py | 4 +- pyatlan/cache/role_cache.py | 4 +- pyatlan/cache/source_tag_cache.py | 12 +- pyatlan/cache/user_cache.py | 16 +- pyatlan/client/admin.py | 16 +- pyatlan/client/asset.py | 390 ++--- pyatlan/client/audit.py | 30 +- pyatlan/client/common.py | 4 +- pyatlan/client/constants.py | 167 +- pyatlan/client/contract.py | 8 +- pyatlan/client/credential.py | 20 +- pyatlan/client/file.py | 24 +- pyatlan/client/group.py | 20 +- pyatlan/client/impersonate.py | 24 +- pyatlan/client/open_lineage.py | 31 +- pyatlan/client/query.py | 4 +- pyatlan/client/role.py | 8 +- pyatlan/client/search_log.py | 68 +- pyatlan/client/sso.py | 36 +- pyatlan/client/task.py | 13 +- pyatlan/client/token.py | 16 +- pyatlan/client/typedef.py | 36 +- pyatlan/client/user.py | 49 +- pyatlan/client/workflow.py | 98 +- pyatlan/errors.py | 3 +- pyatlan/events/atlan_event_handler.py | 17 +- pyatlan/events/atlan_lambda_handler.py | 8 +- pyatlan/generator/class_generator.py | 157 +- pyatlan/model/aggregation.py | 16 +- pyatlan/model/api_tokens.py | 51 +- pyatlan/model/assets/a_d_l_s.py | 28 +- pyatlan/model/assets/a_d_l_s_account.py | 145 +- pyatlan/model/assets/a_d_l_s_container.py | 97 +- pyatlan/model/assets/a_d_l_s_object.py | 222 +-- pyatlan/model/assets/a_p_i.py | 42 +- pyatlan/model/assets/a_p_i_field.py | 95 +- pyatlan/model/assets/a_p_i_object.py | 20 +- pyatlan/model/assets/a_p_i_path.py | 75 +- pyatlan/model/assets/a_p_i_query.py | 69 +- pyatlan/model/assets/a_p_i_spec.py | 73 +- pyatlan/model/assets/a_w_s.py | 16 +- pyatlan/model/assets/anaplan.py | 62 +- pyatlan/model/assets/anaplan_app.py | 24 +- pyatlan/model/assets/anaplan_dimension.py | 28 +- pyatlan/model/assets/anaplan_line_item.py | 34 +- pyatlan/model/assets/anaplan_list.py | 24 +- pyatlan/model/assets/anaplan_model.py | 32 +- pyatlan/model/assets/anaplan_module.py | 20 +- pyatlan/model/assets/anaplan_page.py | 32 +- .../model/assets/anaplan_system_dimension.py | 12 +- pyatlan/model/assets/anaplan_view.py | 62 +- pyatlan/model/assets/anaplan_workspace.py | 56 +- pyatlan/model/assets/auth_service.py | 34 +- pyatlan/model/assets/azure.py | 22 +- pyatlan/model/assets/azure_event_hub.py | 28 +- pyatlan/model/assets/azure_service_bus.py | 54 +- .../assets/azure_service_bus_namespace.py | 14 +- .../model/assets/azure_service_bus_schema.py | 14 +- .../model/assets/azure_service_bus_topic.py | 28 +- pyatlan/model/assets/badge.py | 27 +- pyatlan/model/assets/bigquery_tag.py | 152 +- pyatlan/model/assets/business_policy.py | 174 +- .../model/assets/business_policy_exception.py | 86 +- .../model/assets/business_policy_incident.py | 54 +- pyatlan/model/assets/business_policy_log.py | 54 +- pyatlan/model/assets/cognite3_d_model.py | 4 +- pyatlan/model/assets/cognite_asset.py | 20 +- pyatlan/model/assets/cognite_event.py | 4 +- pyatlan/model/assets/cognite_file.py | 4 +- pyatlan/model/assets/cognite_sequence.py | 4 +- pyatlan/model/assets/cognite_time_series.py | 4 +- pyatlan/model/assets/cognos.py | 32 +- pyatlan/model/assets/cognos_dashboard.py | 4 +- pyatlan/model/assets/cognos_datasource.py | 18 +- pyatlan/model/assets/cognos_exploration.py | 4 +- pyatlan/model/assets/cognos_file.py | 4 +- pyatlan/model/assets/cognos_folder.py | 68 +- pyatlan/model/assets/cognos_module.py | 4 +- pyatlan/model/assets/cognos_package.py | 4 +- pyatlan/model/assets/cognos_report.py | 4 +- pyatlan/model/assets/collection.py | 4 +- pyatlan/model/assets/connection.py | 187 +-- pyatlan/model/assets/core/a_d_f.py | 12 +- pyatlan/model/assets/core/access_control.py | 56 +- pyatlan/model/assets/core/adf_activity.py | 214 +-- pyatlan/model/assets/core/adf_dataflow.py | 28 +- pyatlan/model/assets/core/adf_dataset.py | 112 +- .../model/assets/core/adf_linkedservice.py | 224 +-- pyatlan/model/assets/core/adf_pipeline.py | 44 +- pyatlan/model/assets/core/airflow.py | 56 +- pyatlan/model/assets/core/airflow_dag.py | 22 +- pyatlan/model/assets/core/airflow_task.py | 96 +- pyatlan/model/assets/core/anomalo_check.py | 138 +- pyatlan/model/assets/core/application.py | 44 +- .../model/assets/core/application_field.py | 52 +- pyatlan/model/assets/core/asset.py | 1467 ++++------------- pyatlan/model/assets/core/atlas_glossary.py | 57 +- .../assets/core/atlas_glossary_category.py | 72 +- .../model/assets/core/atlas_glossary_term.py | 108 +- pyatlan/model/assets/core/auth_policy.py | 95 +- pyatlan/model/assets/core/b_i_process.py | 8 +- pyatlan/model/assets/core/calculation_view.py | 48 +- pyatlan/model/assets/core/catalog.py | 98 +- pyatlan/model/assets/core/column.py | 416 ++--- pyatlan/model/assets/core/column_process.py | 13 +- .../assets/core/cosmos_mongo_d_b_account.py | 276 +--- .../core/cosmos_mongo_d_b_collection.py | 490 ++---- .../assets/core/cosmos_mongo_d_b_database.py | 206 +-- pyatlan/model/assets/core/data_contract.py | 108 +- pyatlan/model/assets/core/data_domain.py | 34 +- pyatlan/model/assets/core/data_mesh.py | 16 +- pyatlan/model/assets/core/data_product.py | 206 +-- pyatlan/model/assets/core/database.py | 33 +- .../core/databricks_unity_catalog_tag.py | 114 +- pyatlan/model/assets/core/dbt.py | 76 +- pyatlan/model/assets/core/dbt_metric.py | 144 +- pyatlan/model/assets/core/dbt_model.py | 120 +- pyatlan/model/assets/core/dbt_model_column.py | 50 +- pyatlan/model/assets/core/dbt_source.py | 16 +- pyatlan/model/assets/core/dbt_test.py | 52 +- .../assets/core/dynamo_d_b_secondary_index.py | 270 +-- pyatlan/model/assets/core/file.py | 25 +- pyatlan/model/assets/core/fivetran.py | 44 +- .../model/assets/core/fivetran_connector.py | 586 ++----- pyatlan/model/assets/core/folder.py | 22 +- pyatlan/model/assets/core/function.py | 40 +- pyatlan/model/assets/core/link.py | 23 +- pyatlan/model/assets/core/m_c_incident.py | 44 +- pyatlan/model/assets/core/m_c_monitor.py | 176 +- .../model/assets/core/materialised_view.py | 50 +- pyatlan/model/assets/core/matillion.py | 4 +- .../model/assets/core/matillion_component.py | 108 +- pyatlan/model/assets/core/matillion_group.py | 12 +- pyatlan/model/assets/core/matillion_job.py | 64 +- .../model/assets/core/matillion_project.py | 40 +- pyatlan/model/assets/core/metric.py | 38 +- pyatlan/model/assets/core/model.py | 82 +- pyatlan/model/assets/core/model_attribute.py | 170 +- .../core/model_attribute_association.py | 98 +- pyatlan/model/assets/core/model_data_model.py | 8 +- pyatlan/model/assets/core/model_entity.py | 202 +-- .../assets/core/model_entity_association.py | 216 +-- pyatlan/model/assets/core/model_version.py | 26 +- .../model/assets/core/mongo_d_b_collection.py | 400 +---- .../model/assets/core/mongo_d_b_database.py | 122 +- pyatlan/model/assets/core/monte_carlo.py | 14 +- pyatlan/model/assets/core/namespace.py | 8 +- pyatlan/model/assets/core/no_s_q_l.py | 10 +- pyatlan/model/assets/core/persona.py | 18 +- pyatlan/model/assets/core/power_b_i.py | 42 +- pyatlan/model/assets/core/power_b_i_column.py | 66 +- .../model/assets/core/power_b_i_dashboard.py | 14 +- .../model/assets/core/power_b_i_dataflow.py | 126 +- .../core/power_b_i_dataflow_entity_column.py | 72 +- .../model/assets/core/power_b_i_dataset.py | 30 +- .../model/assets/core/power_b_i_datasource.py | 16 +- .../model/assets/core/power_b_i_measure.py | 46 +- pyatlan/model/assets/core/power_b_i_page.py | 18 +- pyatlan/model/assets/core/power_b_i_report.py | 30 +- pyatlan/model/assets/core/power_b_i_table.py | 82 +- pyatlan/model/assets/core/power_b_i_tile.py | 28 +- .../model/assets/core/power_b_i_workspace.py | 24 +- pyatlan/model/assets/core/procedure.py | 17 +- pyatlan/model/assets/core/process.py | 41 +- pyatlan/model/assets/core/query.py | 100 +- pyatlan/model/assets/core/readme.py | 39 +- pyatlan/model/assets/core/referenceable.py | 69 +- pyatlan/model/assets/core/resource.py | 8 +- pyatlan/model/assets/core/s_q_l.py | 102 +- pyatlan/model/assets/core/schema.py | 81 +- pyatlan/model/assets/core/schema_registry.py | 24 +- .../assets/core/schema_registry_subject.py | 102 +- pyatlan/model/assets/core/snowflake_pipe.py | 50 +- pyatlan/model/assets/core/snowflake_stream.py | 54 +- pyatlan/model/assets/core/snowflake_tag.py | 118 +- pyatlan/model/assets/core/soda_check.py | 48 +- pyatlan/model/assets/core/spark.py | 40 +- pyatlan/model/assets/core/spark_job.py | 8 +- pyatlan/model/assets/core/stakeholder.py | 42 +- .../model/assets/core/stakeholder_title.py | 22 +- pyatlan/model/assets/core/table.py | 150 +- pyatlan/model/assets/core/table_partition.py | 97 +- pyatlan/model/assets/core/tag.py | 12 +- pyatlan/model/assets/core/view.py | 46 +- pyatlan/model/assets/cube.py | 8 +- pyatlan/model/assets/cube_dimension.py | 8 +- pyatlan/model/assets/cube_field.py | 64 +- pyatlan/model/assets/cube_hierarchy.py | 12 +- pyatlan/model/assets/custom_entity.py | 76 +- pyatlan/model/assets/data_studio.py | 118 +- pyatlan/model/assets/data_studio_asset.py | 83 +- pyatlan/model/assets/dataverse.py | 16 +- pyatlan/model/assets/dataverse_attribute.py | 94 +- pyatlan/model/assets/dataverse_entity.py | 32 +- pyatlan/model/assets/dbt_column_process.py | 126 +- pyatlan/model/assets/dbt_process.py | 120 +- pyatlan/model/assets/dbt_tag.py | 88 +- pyatlan/model/assets/domo_card.py | 26 +- pyatlan/model/assets/domo_dashboard.py | 42 +- pyatlan/model/assets/domo_dataset.py | 46 +- pyatlan/model/assets/domo_dataset_column.py | 20 +- pyatlan/model/assets/dynamo_d_b.py | 54 +- .../dynamo_d_b_global_secondary_index.py | 4 +- .../dynamo_d_b_local_secondary_index.py | 4 +- pyatlan/model/assets/dynamo_dbtable.py | 310 +--- pyatlan/model/assets/g_c_s.py | 142 +- pyatlan/model/assets/g_c_s_bucket.py | 105 +- pyatlan/model/assets/g_c_s_object.py | 141 +- pyatlan/model/assets/google.py | 20 +- pyatlan/model/assets/incident.py | 8 +- pyatlan/model/assets/kafka_consumer_group.py | 60 +- pyatlan/model/assets/kafka_topic.py | 158 +- pyatlan/model/assets/looker_dashboard.py | 56 +- pyatlan/model/assets/looker_explore.py | 24 +- pyatlan/model/assets/looker_field.py | 126 +- pyatlan/model/assets/looker_folder.py | 34 +- pyatlan/model/assets/looker_look.py | 66 +- pyatlan/model/assets/looker_model.py | 16 +- pyatlan/model/assets/looker_project.py | 48 +- pyatlan/model/assets/looker_query.py | 36 +- pyatlan/model/assets/looker_tile.py | 16 +- pyatlan/model/assets/looker_view.py | 24 +- pyatlan/model/assets/metabase.py | 24 +- pyatlan/model/assets/metabase_collection.py | 38 +- pyatlan/model/assets/metabase_dashboard.py | 16 +- pyatlan/model/assets/metabase_question.py | 22 +- pyatlan/model/assets/micro_strategy.py | 150 +- .../model/assets/micro_strategy_attribute.py | 62 +- pyatlan/model/assets/micro_strategy_cube.py | 62 +- .../model/assets/micro_strategy_document.py | 16 +- .../model/assets/micro_strategy_dossier.py | 50 +- pyatlan/model/assets/micro_strategy_fact.py | 46 +- pyatlan/model/assets/micro_strategy_metric.py | 216 +-- .../model/assets/micro_strategy_project.py | 98 +- pyatlan/model/assets/micro_strategy_report.py | 48 +- .../assets/micro_strategy_visualization.py | 84 +- pyatlan/model/assets/mode.py | 34 +- pyatlan/model/assets/mode_chart.py | 8 +- pyatlan/model/assets/mode_collection.py | 20 +- pyatlan/model/assets/mode_query.py | 18 +- pyatlan/model/assets/mode_report.py | 50 +- pyatlan/model/assets/mode_workspace.py | 12 +- .../model/assets/multi_dimensional_dataset.py | 36 +- pyatlan/model/assets/preset.py | 44 +- pyatlan/model/assets/preset_chart.py | 51 +- pyatlan/model/assets/preset_dashboard.py | 137 +- pyatlan/model/assets/preset_dataset.py | 59 +- pyatlan/model/assets/preset_workspace.py | 139 +- pyatlan/model/assets/purpose.py | 46 +- pyatlan/model/assets/qlik.py | 18 +- pyatlan/model/assets/qlik_app.py | 44 +- pyatlan/model/assets/qlik_chart.py | 24 +- pyatlan/model/assets/qlik_dataset.py | 18 +- pyatlan/model/assets/qlik_sheet.py | 16 +- pyatlan/model/assets/qlik_space.py | 12 +- pyatlan/model/assets/quick_sight.py | 12 +- pyatlan/model/assets/quick_sight_analysis.py | 96 +- .../assets/quick_sight_analysis_visual.py | 26 +- pyatlan/model/assets/quick_sight_dashboard.py | 76 +- .../assets/quick_sight_dashboard_visual.py | 42 +- pyatlan/model/assets/quick_sight_dataset.py | 72 +- .../model/assets/quick_sight_dataset_field.py | 44 +- pyatlan/model/assets/quick_sight_folder.py | 62 +- pyatlan/model/assets/redash.py | 4 +- pyatlan/model/assets/redash_dashboard.py | 14 +- pyatlan/model/assets/redash_query.py | 90 +- pyatlan/model/assets/redash_visualization.py | 16 +- pyatlan/model/assets/s3.py | 20 +- pyatlan/model/assets/s3_bucket.py | 35 +- pyatlan/model/assets/s3_object.py | 71 +- pyatlan/model/assets/salesforce.py | 10 +- pyatlan/model/assets/salesforce_dashboard.py | 8 +- pyatlan/model/assets/salesforce_field.py | 42 +- pyatlan/model/assets/salesforce_object.py | 12 +- .../model/assets/salesforce_organization.py | 12 +- pyatlan/model/assets/salesforce_report.py | 12 +- pyatlan/model/assets/sigma.py | 42 +- pyatlan/model/assets/sigma_data_element.py | 50 +- .../model/assets/sigma_data_element_field.py | 40 +- pyatlan/model/assets/sigma_dataset.py | 22 +- pyatlan/model/assets/sigma_dataset_column.py | 14 +- pyatlan/model/assets/sigma_page.py | 22 +- pyatlan/model/assets/sigma_workbook.py | 8 +- pyatlan/model/assets/sisense_dashboard.py | 54 +- pyatlan/model/assets/sisense_datamodel.py | 124 +- .../model/assets/sisense_datamodel_table.py | 144 +- pyatlan/model/assets/sisense_folder.py | 64 +- pyatlan/model/assets/sisense_widget.py | 86 +- pyatlan/model/assets/superset.py | 26 +- pyatlan/model/assets/superset_chart.py | 57 +- pyatlan/model/assets/superset_dashboard.py | 141 +- pyatlan/model/assets/superset_dataset.py | 63 +- .../model/assets/tableau_calculated_field.py | 68 +- pyatlan/model/assets/tableau_dashboard.py | 50 +- pyatlan/model/assets/tableau_datasource.py | 90 +- .../model/assets/tableau_datasource_field.py | 186 +-- pyatlan/model/assets/tableau_flow.py | 50 +- pyatlan/model/assets/tableau_metric.py | 38 +- pyatlan/model/assets/tableau_project.py | 58 +- pyatlan/model/assets/tableau_site.py | 4 +- pyatlan/model/assets/tableau_workbook.py | 58 +- pyatlan/model/assets/tableau_worksheet.py | 66 +- pyatlan/model/assets/tag_attachment.py | 6 +- pyatlan/model/assets/task.py | 60 +- pyatlan/model/assets/thoughtspot.py | 36 +- pyatlan/model/assets/thoughtspot_column.py | 96 +- pyatlan/model/assets/thoughtspot_dashlet.py | 40 +- pyatlan/model/assets/thoughtspot_liveboard.py | 8 +- pyatlan/model/assets/thoughtspot_table.py | 8 +- pyatlan/model/assets/thoughtspot_view.py | 8 +- pyatlan/model/assets/thoughtspot_worksheet.py | 8 +- pyatlan/model/assets/workflow.py | 44 +- pyatlan/model/assets/workflow_run.py | 90 +- pyatlan/model/atlan_image.py | 40 +- pyatlan/model/audit.py | 49 +- pyatlan/model/contract.py | 80 +- pyatlan/model/core.py | 53 +- pyatlan/model/credential.py | 12 +- pyatlan/model/custom_metadata.py | 17 +- pyatlan/model/data_mesh.py | 16 +- pyatlan/model/enums.py | 40 +- pyatlan/model/events.py | 28 +- pyatlan/model/fields/atlan_fields.py | 146 +- pyatlan/model/fluent_search.py | 59 +- pyatlan/model/group.py | 60 +- pyatlan/model/keycloak_events.py | 64 +- pyatlan/model/lineage.py | 129 +- pyatlan/model/lineage_ref.py | 8 +- pyatlan/model/open_lineage/base.py | 4 +- .../open_lineage/column_lineage_dataset.py | 16 +- pyatlan/model/open_lineage/dataset.py | 4 +- pyatlan/model/open_lineage/event.py | 8 +- pyatlan/model/open_lineage/facet.py | 13 +- pyatlan/model/open_lineage/input_dataset.py | 4 +- pyatlan/model/open_lineage/job.py | 12 +- pyatlan/model/open_lineage/output_dataset.py | 14 +- pyatlan/model/open_lineage/run.py | 4 +- pyatlan/model/open_lineage/utils.py | 4 +- .../packages/api_token_connection_admin.py | 10 +- pyatlan/model/packages/asset_export_basic.py | 18 +- pyatlan/model/packages/asset_import.py | 38 +- pyatlan/model/packages/base/miner.py | 4 +- pyatlan/model/packages/base/package.py | 14 +- pyatlan/model/packages/big_query_crawler.py | 18 +- .../model/packages/confluent_kafka_crawler.py | 12 +- pyatlan/model/packages/connection_delete.py | 4 +- pyatlan/model/packages/databricks_crawler.py | 46 +- pyatlan/model/packages/databricks_miner.py | 28 +- pyatlan/model/packages/dbt_crawler.py | 30 +- pyatlan/model/packages/dynamo_d_b_crawler.py | 16 +- pyatlan/model/packages/glue_crawler.py | 24 +- pyatlan/model/packages/lineage_builder.py | 6 +- .../model/packages/lineage_generator_nt.py | 2 +- pyatlan/model/packages/mongodb_crawler.py | 18 +- pyatlan/model/packages/oracle_crawler.py | 36 +- pyatlan/model/packages/postgres_crawler.py | 16 +- pyatlan/model/packages/powerbi_crawler.py | 26 +- .../packages/relational_assets_builder.py | 26 +- .../model/packages/s_q_l_server_crawler.py | 24 +- pyatlan/model/packages/sigma_crawler.py | 14 +- pyatlan/model/packages/snowflake_crawler.py | 42 +- pyatlan/model/packages/snowflake_miner.py | 28 +- pyatlan/model/packages/sql_server_crawler.py | 28 +- pyatlan/model/packages/tableau_crawler.py | 18 +- pyatlan/model/query.py | 135 +- pyatlan/model/response.py | 28 +- pyatlan/model/role.py | 16 +- pyatlan/model/search.py | 51 +- pyatlan/model/search_log.py | 108 +- pyatlan/model/sso.py | 8 +- pyatlan/model/structs.py | 36 +- pyatlan/model/suggestions.py | 73 +- pyatlan/model/task.py | 52 +- pyatlan/model/typedef.py | 232 +-- pyatlan/model/user.py | 120 +- pyatlan/model/utils.py | 4 +- pyatlan/model/workflow.py | 8 +- pyatlan/multipart_data_generator.py | 11 +- pyatlan/pkg/create_package_files.py | 4 +- pyatlan/pkg/models.py | 10 +- pyatlan/pkg/ui.py | 4 +- pyatlan/pkg/utils.py | 37 +- pyatlan/pkg/widgets.py | 16 +- .../custom_metadata/deploy_branded_cm.py | 5 +- .../custom_metadata/update_cm_on_assets.py | 24 +- pyatlan/samples/events/lambda_enforcer.py | 16 +- pyatlan/samples/events/lambda_scorer.py | 26 +- pyatlan/samples/search/and_star_assets.py | 18 +- .../samples/search/and_traverse_lineage.py | 9 +- pyatlan/test_utils/__init__.py | 62 +- pyatlan/utils.py | 70 +- qa-checks | 8 +- setup.py | 4 +- tests/integration/adls_asset_test.py | 55 +- tests/integration/admin_test.py | 6 +- tests/integration/airflow_asset_test.py | 36 +- tests/integration/anaplan_asset_test.py | 181 +- tests/integration/api_asset_test.py | 320 +--- tests/integration/app_asset_test.py | 44 +- .../integration/azure_event_hub_asset_test.py | 16 +- tests/integration/connection_test.py | 28 +- tests/integration/custom_asset_test.py | 28 +- tests/integration/custom_metadata_test.py | 80 +- tests/integration/data_mesh_test.py | 95 +- tests/integration/data_studio_asset_test.py | 36 +- tests/integration/dataverse_asset_test.py | 39 +- tests/integration/file_test.py | 8 +- tests/integration/gcs_asset_test.py | 32 +- tests/integration/glossary_test.py | 156 +- tests/integration/insights_test.py | 46 +- tests/integration/kafka_asset_test.py | 28 +- tests/integration/lineage_test.py | 64 +- tests/integration/persona_test.py | 12 +- tests/integration/preset_asset_test.py | 45 +- tests/integration/purpose_test.py | 25 +- tests/integration/quick_sight_asset_test.py | 69 +- tests/integration/requests_test.py | 6 +- tests/integration/s3_asset_test.py | 28 +- tests/integration/suggestions_test.py | 52 +- tests/integration/superset_asset_test.py | 34 +- tests/integration/test_asset_batch.py | 63 +- tests/integration/test_client.py | 284 +--- tests/integration/test_file_client.py | 16 +- tests/integration/test_index_search.py | 93 +- tests/integration/test_open_lineage.py | 30 +- tests/integration/test_sql_assets.py | 199 +-- tests/integration/test_sso_client.py | 25 +- tests/integration/test_task_client.py | 12 +- tests/integration/test_workflow_client.py | 96 +- tests/unit/model/a_d_l_s_account_test.py | 16 +- tests/unit/model/a_d_l_s_container_test.py | 12 +- tests/unit/model/a_d_l_s_object_test.py | 16 +- tests/unit/model/a_p_i_field_test.py | 30 +- tests/unit/model/a_p_i_object_test.py | 20 +- tests/unit/model/a_p_i_path_test.py | 8 +- tests/unit/model/a_p_i_query_test.py | 12 +- tests/unit/model/a_p_i_spec_test.py | 16 +- tests/unit/model/airflow_dag_test.py | 16 +- tests/unit/model/airflow_task_test.py | 20 +- tests/unit/model/anaplan_app_test.py | 12 +- tests/unit/model/anaplan_dimension_test.py | 8 +- tests/unit/model/anaplan_line_item_test.py | 8 +- tests/unit/model/anaplan_list_test.py | 8 +- tests/unit/model/anaplan_model_test.py | 12 +- tests/unit/model/anaplan_module_test.py | 8 +- tests/unit/model/anaplan_page_test.py | 8 +- .../model/anaplan_system_dimension_test.py | 12 +- tests/unit/model/anaplan_view_test.py | 8 +- tests/unit/model/anaplan_workspace_test.py | 12 +- tests/unit/model/application_field_test.py | 12 +- tests/unit/model/application_test.py | 8 +- .../model/azure_event_consumer_group_test.py | 12 +- tests/unit/model/azure_event_hub_test.py | 16 +- tests/unit/model/badge_test.py | 8 +- tests/unit/model/column_process_test.py | 4 +- tests/unit/model/column_test.py | 8 +- tests/unit/model/connection_test.py | 8 +- tests/unit/model/constants.py | 111 +- tests/unit/model/custom_entity_test.py | 20 +- tests/unit/model/data_contract_test.py | 4 +- tests/unit/model/data_domain_test.py | 8 +- tests/unit/model/data_product_test.py | 32 +- tests/unit/model/data_studio_asset_test.py | 12 +- tests/unit/model/database_test.py | 12 +- tests/unit/model/dataverse_attribute_test.py | 16 +- tests/unit/model/dataverse_entity_test.py | 16 +- tests/unit/model/fields/atlan_fields_test.py | 8 +- tests/unit/model/file_test.py | 16 +- tests/unit/model/gcs_bucket_test.py | 12 +- tests/unit/model/gcs_object_test.py | 16 +- tests/unit/model/glossary_category_test.py | 4 +- tests/unit/model/glossary_term_test.py | 17 +- tests/unit/model/glossary_test.py | 4 +- tests/unit/model/kafka_consumer_group_test.py | 12 +- tests/unit/model/kafka_topic_test.py | 16 +- tests/unit/model/materialised_view_test.py | 16 +- .../model/open_lineage/open_lineage_test.py | 28 +- tests/unit/model/preset_chart_test.py | 16 +- tests/unit/model/preset_dashboard_test.py | 18 +- tests/unit/model/preset_dataset_test.py | 16 +- tests/unit/model/preset_workspace_test.py | 12 +- tests/unit/model/procedure_test.py | 8 +- tests/unit/model/process_test.py | 20 +- tests/unit/model/quick_sight_analysis_test.py | 4 +- .../model/quick_sight_analysis_visual_test.py | 4 +- .../unit/model/quick_sight_dashboard_test.py | 4 +- .../quick_sight_dashboard_visual_test.py | 4 +- .../model/quick_sight_dataset_field_test.py | 4 +- tests/unit/model/quick_sight_dataset_test.py | 8 +- tests/unit/model/quick_sight_folder_test.py | 4 +- tests/unit/model/readme_test.py | 12 +- tests/unit/model/s3_bucket_test.py | 12 +- tests/unit/model/s3object_test.py | 8 +- tests/unit/model/schema_test.py | 16 +- tests/unit/model/superset_chart_test.py | 14 +- tests/unit/model/superset_dashboard_test.py | 17 +- tests/unit/model/superset_dataset_test.py | 14 +- tests/unit/model/table_partition_test.py | 4 +- tests/unit/model/table_test.py | 12 +- tests/unit/model/view_test.py | 12 +- tests/unit/pkg/test_models.py | 8 +- tests/unit/pkg/test_widgets.py | 32 +- tests/unit/test_atlan_tag_name.py | 13 +- tests/unit/test_audit_search.py | 26 +- tests/unit/test_client.py | 272 +-- tests/unit/test_connection_cache.py | 32 +- tests/unit/test_core.py | 16 +- tests/unit/test_credential_client.py | 61 +- tests/unit/test_custom_metadata.py | 28 +- tests/unit/test_deprecated.py | 28 +- tests/unit/test_file_client.py | 20 +- tests/unit/test_glossary_term.py | 16 +- tests/unit/test_lineage.py | 135 +- tests/unit/test_model.py | 36 +- tests/unit/test_packages.py | 169 +- tests/unit/test_query_client.py | 8 +- tests/unit/test_search_log_search.py | 18 +- tests/unit/test_search_model.py | 59 +- tests/unit/test_source_cache.py | 32 +- tests/unit/test_sso_client.py | 20 +- tests/unit/test_structs.py | 4 +- tests/unit/test_task_client.py | 11 +- tests/unit/test_typedef_model.py | 30 +- tests/unit/test_utils.py | 8 +- tests/unit/test_workflow_client.py | 87 +- 529 files changed, 6665 insertions(+), 21445 deletions(-) diff --git a/check_tag.py b/check_tag.py index e19d4d75a..cc0a18389 100644 --- a/check_tag.py +++ b/check_tag.py @@ -25,9 +25,7 @@ def read(file_name): """Read a text file and return the content as a string.""" - with io.open( - os.path.join(os.path.dirname(__file__), file_name), encoding="utf-8" - ) as f: + with io.open(os.path.join(os.path.dirname(__file__), file_name), encoding="utf-8") as f: return f.read() @@ -38,9 +36,7 @@ def main(env_var="GITHUB_REF") -> int: if tag == version: return 0 else: - print( - f"✖ {env_var} env var {git_ref!r} does not match package version: {tag!r} != {version!r}" - ) + print(f"✖ {env_var} env var {git_ref!r} does not match package version: {tag!r} != {version!r}") return 1 diff --git a/pyatlan/cache/abstract_asset_cache.py b/pyatlan/cache/abstract_asset_cache.py index e6059b826..8789f43da 100644 --- a/pyatlan/cache/abstract_asset_cache.py +++ b/pyatlan/cache/abstract_asset_cache.py @@ -129,9 +129,7 @@ def _get_by_qualified_name(self, qualified_name: str, allow_refresh: bool = True if not guid: raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( qualified_name, - AtlanConnectorType._get_connector_type_from_qualified_name( - qualified_name - ).value, + AtlanConnectorType._get_connector_type_from_qualified_name(qualified_name).value, ) return self._get_by_guid(guid=guid, allow_refresh=False) @@ -153,9 +151,7 @@ def _get_by_name(self, name: AbstractAssetName, allow_refresh: bool = True): self.lookup_by_name(name) guid = self.name_to_guid.get(str(name)) if not guid: - raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters( - name._TYPE_NAME, name - ) + raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters(name._TYPE_NAME, name) return self._get_by_guid(guid=guid, allow_refresh=False) diff --git a/pyatlan/cache/connection_cache.py b/pyatlan/cache/connection_cache.py index 4784fa2ec..164a8358d 100644 --- a/pyatlan/cache/connection_cache.py +++ b/pyatlan/cache/connection_cache.py @@ -69,9 +69,7 @@ def get_by_guid(cls, guid: str, allow_refresh: bool = True) -> Connection: return cls.get_cache()._get_by_guid(guid=guid, allow_refresh=allow_refresh) @classmethod - def get_by_qualified_name( - cls, qualified_name: str, allow_refresh: bool = True - ) -> Connection: + def get_by_qualified_name(cls, qualified_name: str, allow_refresh: bool = True) -> Connection: """ Retrieve a connection from the cache by its unique Atlan-internal name. @@ -84,14 +82,10 @@ def get_by_qualified_name( :raises NotFoundError: if the connection cannot be found (does not exist) in Atlan :raises InvalidRequestError: if no qualified_name was provided for the connection to retrieve """ - return cls.get_cache()._get_by_qualified_name( - qualified_name=qualified_name, allow_refresh=allow_refresh - ) + return cls.get_cache()._get_by_qualified_name(qualified_name=qualified_name, allow_refresh=allow_refresh) @classmethod - def get_by_name( - cls, name: ConnectionName, allow_refresh: bool = True - ) -> Connection: + def get_by_name(cls, name: ConnectionName, allow_refresh: bool = True) -> Connection: """ Retrieve an connection from the cache by its uniquely identifiable name. @@ -148,10 +142,7 @@ def lookup_by_name(self, name: ConnectionName) -> None: return if len(results) > 1: LOGGER.warning( - ( - "Found multiple connections of the same type " - "with the same name, caching only the first: %s" - ), + ("Found multiple connections of the same type with the same name, caching only the first: %s"), name, ) self.cache(results[0]) diff --git a/pyatlan/cache/custom_metadata_cache.py b/pyatlan/cache/custom_metadata_cache.py index b4665c600..a8085f568 100644 --- a/pyatlan/cache/custom_metadata_cache.py +++ b/pyatlan/cache/custom_metadata_cache.py @@ -27,9 +27,7 @@ def get_cache(cls) -> "CustomMetadataCache": client = AtlanClient.get_default_client() cache_key = client.cache_key if cache_key not in cls.caches: - cls.caches[cache_key] = CustomMetadataCache( - typedef_client=client.typedef - ) + cls.caches[cache_key] = CustomMetadataCache(typedef_client=client.typedef) cache = cls.caches[cache_key] return cache @@ -82,9 +80,7 @@ def get_all_custom_attributes( :returns: a dict from custom metadata set name to all details about its attributes :raises NotFoundError: if the custom metadata cannot be found """ - return cls.get_cache()._get_all_custom_attributes( - include_deleted=include_deleted, force_refresh=force_refresh - ) + return cls.get_cache()._get_all_custom_attributes(include_deleted=include_deleted, force_refresh=force_refresh) @classmethod def get_attr_id_for_name(cls, set_name: str, attr_name: str) -> str: @@ -97,9 +93,7 @@ def get_attr_id_for_name(cls, set_name: str, attr_name: str) -> str: :returns: Atlan-internal ID string for the attribute :raises NotFoundError: if the custom metadata attribute cannot be found """ - return cls.get_cache()._get_attr_id_for_name( - set_name=set_name, attr_name=attr_name - ) + return cls.get_cache()._get_attr_id_for_name(set_name=set_name, attr_name=attr_name) @classmethod def get_attr_name_for_id(cls, set_id: str, attr_id: str) -> str: @@ -134,9 +128,7 @@ def get_attributes_for_search_results(cls, set_name: str) -> Optional[List[str]] return cls.get_cache()._get_attributes_for_search_results(set_name=set_name) @classmethod - def get_attribute_for_search_results( - cls, set_name: str, attr_name: str - ) -> Optional[str]: + def get_attribute_for_search_results(cls, set_name: str, attr_name: str) -> Optional[str]: """ Retrieve a single custom attribute name to include on search results. @@ -145,9 +137,7 @@ def get_attribute_for_search_results( :param attr_name: human-readable name of the attribute :returns: the attribute name, strictly useful for inclusion in search results """ - return cls.get_cache()._get_attribute_for_search_results( - set_name=set_name, attr_name=attr_name - ) + return cls.get_cache()._get_attribute_for_search_results(set_name=set_name, attr_name=attr_name) @classmethod def get_custom_metadata_def(cls, name: str) -> CustomMetadataDef: @@ -298,9 +288,7 @@ def _get_all_custom_attributes( to_include = [] if attribute_defs: to_include.extend( - attr - for attr in attribute_defs - if not attr.options or not attr.options.is_archived + attr for attr in attribute_defs if not attr.options or not attr.options.is_archived ) m[type_name] = to_include return m @@ -326,9 +314,7 @@ def _get_attr_id_for_name(self, set_name: str, attr_name: str) -> str: if attr_id := sub_map.get(attr_name): # If found, return straight away return attr_id - raise ErrorCode.CM_ATTR_NOT_FOUND_BY_NAME.exception_with_parameters( - attr_name, set_name - ) + raise ErrorCode.CM_ATTR_NOT_FOUND_BY_NAME.exception_with_parameters(attr_name, set_name) raise ErrorCode.CM_ATTR_NOT_FOUND_BY_ID.exception_with_parameters(set_id) def _get_attr_name_for_id(self, set_id: str, attr_id: str) -> str: @@ -348,9 +334,7 @@ def _get_attr_name_for_id(self, set_id: str, attr_id: str) -> str: if sub_map := self.map_attr_id_to_name.get(set_id): if attr_name := sub_map.get(attr_id): return attr_name - raise ErrorCode.CM_ATTR_NOT_FOUND_BY_ID.exception_with_parameters( - attr_id, set_id - ) + raise ErrorCode.CM_ATTR_NOT_FOUND_BY_ID.exception_with_parameters(attr_id, set_id) def _is_attr_archived(self, attr_id: str) -> bool: """ @@ -367,9 +351,7 @@ def _get_attributes_for_search_results_(self, set_id: str) -> Optional[List[str] return [f"{set_id}.{idstr}" for idstr in attr_ids] return None - def _get_attribute_for_search_results_( - self, set_id: str, attr_name: str - ) -> Optional[str]: + def _get_attribute_for_search_results_(self, set_id: str, attr_name: str) -> Optional[str]: if sub_map := self.map_attr_name_to_id.get(set_id): return sub_map.get(attr_name, None) return None @@ -388,9 +370,7 @@ def _get_attributes_for_search_results(self, set_name: str) -> Optional[List[str return self._get_attributes_for_search_results_(set_id) return None - def _get_attribute_for_search_results( - self, set_name: str, attr_name: str - ) -> Optional[str]: + def _get_attribute_for_search_results(self, set_name: str, attr_name: str) -> Optional[str]: """ Retrieve a single custom attribute name to include on search results. @@ -436,6 +416,4 @@ def _get_attribute_def(self, attr_id: str) -> AttributeDef: self._refresh_cache() if attr_def := self.attr_cache_by_id.get(attr_id): return attr_def - raise ErrorCode.CM_ATTR_NOT_FOUND_BY_ID.exception_with_parameters( - attr_id, "(unknown)" - ) + raise ErrorCode.CM_ATTR_NOT_FOUND_BY_ID.exception_with_parameters(attr_id, "(unknown)") diff --git a/pyatlan/cache/group_cache.py b/pyatlan/cache/group_cache.py index 48c9e8e94..6dde2c4aa 100644 --- a/pyatlan/cache/group_cache.py +++ b/pyatlan/cache/group_cache.py @@ -131,6 +131,4 @@ def _validate_aliases(self, aliases: Iterable[str]): """ for group_alias in aliases: if not self.get_id_for_name(group_alias): - raise ValueError( - f"Provided group name {group_alias} was not found in Atlan." - ) + raise ValueError(f"Provided group name {group_alias} was not found in Atlan.") diff --git a/pyatlan/cache/role_cache.py b/pyatlan/cache/role_cache.py index 896d00a1b..c72d0e466 100644 --- a/pyatlan/cache/role_cache.py +++ b/pyatlan/cache/role_cache.py @@ -65,9 +65,7 @@ def __init__(self, role_client: RoleClient): def _refresh_cache(self) -> None: with self.lock: - response = self.role_client.get( - limit=100, post_filter='{"name":{"$ilike":"$%"}}' - ) + response = self.role_client.get(limit=100, post_filter='{"name":{"$ilike":"$%"}}') if response is not None: self.cache_by_id = {} self.map_id_to_name = {} diff --git a/pyatlan/cache/source_tag_cache.py b/pyatlan/cache/source_tag_cache.py index 98d58a432..8ec6e8f26 100644 --- a/pyatlan/cache/source_tag_cache.py +++ b/pyatlan/cache/source_tag_cache.py @@ -66,9 +66,7 @@ def get_by_guid(cls, guid: str, allow_refresh: bool = True) -> Tag: return cls.get_cache()._get_by_guid(guid=guid, allow_refresh=allow_refresh) @classmethod - def get_by_qualified_name( - cls, qualified_name: str, allow_refresh: bool = True - ) -> Tag: + def get_by_qualified_name(cls, qualified_name: str, allow_refresh: bool = True) -> Tag: """ Retrieve a source tag from the cache by its unique Atlan-internal name. @@ -81,9 +79,7 @@ def get_by_qualified_name( :raises NotFoundError: if the source tag cannot be found (does not exist) in Atlan :raises InvalidRequestError: if no qualified_name was provided for the source tag to retrieve """ - return cls.get_cache()._get_by_qualified_name( - qualified_name=qualified_name, allow_refresh=allow_refresh - ) + return cls.get_cache()._get_by_qualified_name(qualified_name=qualified_name, allow_refresh=allow_refresh) @classmethod def get_by_name(cls, name: SourceTagName, allow_refresh: bool = True) -> Tag: @@ -168,9 +164,7 @@ def get_name(self, asset: Asset): try: source_tag_name = str(SourceTagName(asset)) except AtlanError as e: - LOGGER.error( - "Unable to construct a source tag name for: %s", asset.qualified_name - ) + LOGGER.error("Unable to construct a source tag name for: %s", asset.qualified_name) LOGGER.debug("Details: %s", e) return source_tag_name diff --git a/pyatlan/cache/user_cache.py b/pyatlan/cache/user_cache.py index 0f95c3a4a..5a870f6ac 100644 --- a/pyatlan/cache/user_cache.py +++ b/pyatlan/cache/user_cache.py @@ -26,9 +26,7 @@ def get_cache(cls) -> "UserCache": client = AtlanClient.get_default_client() cache_key = client.cache_key if cache_key not in cls.caches: - cls.caches[cache_key] = UserCache( - user_client=client.user, token_client=client.token - ) + cls.caches[cache_key] = UserCache(user_client=client.user, token_client=client.token) return cls.caches[cache_key] @classmethod @@ -110,9 +108,7 @@ def _get_id_for_name(self, name: str) -> Optional[str]: self.map_name_to_id[name] = token.guid return token.guid else: - raise ErrorCode.API_TOKEN_NOT_FOUND_BY_NAME.exception_with_parameters( - name - ) + raise ErrorCode.API_TOKEN_NOT_FOUND_BY_NAME.exception_with_parameters(name) self._refresh_cache() return self.map_name_to_id.get(name) @@ -152,9 +148,5 @@ def _validate_names(self, names: Iterable[str]): :param names: a collection of usernames to be checked """ for username in names: - if not self.get_id_for_name(username) and not self.token_client.get_by_id( - username - ): - raise ValueError( - f"Provided username {username} was not found in Atlan." - ) + if not self.get_id_for_name(username) and not self.token_client.get_by_id(username): + raise ValueError(f"Provided username {username} was not found in Atlan.") diff --git a/pyatlan/client/admin.py b/pyatlan/client/admin.py index fccf0ee84..79107e66d 100644 --- a/pyatlan/client/admin.py +++ b/pyatlan/client/admin.py @@ -26,15 +26,11 @@ class AdminClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @validate_arguments - def get_keycloak_events( - self, keycloak_request: KeycloakEventRequest - ) -> KeycloakEventResponse: + def get_keycloak_events(self, keycloak_request: KeycloakEventRequest) -> KeycloakEventResponse: """ Retrieve all events, based on the supplied filters. @@ -50,9 +46,7 @@ def get_keycloak_events( try: events = parse_obj_as(List[KeycloakEvent], raw_json) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err else: events = [] return KeycloakEventResponse( @@ -78,9 +72,7 @@ def get_admin_events(self, admin_request: AdminEventRequest) -> AdminEventRespon try: events = parse_obj_as(List[AdminEvent], raw_json) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err else: events = [] return AdminEventResponse( diff --git a/pyatlan/client/asset.py b/pyatlan/client/asset.py index 6ff01dada..ece5b0a75 100644 --- a/pyatlan/client/asset.py +++ b/pyatlan/client/asset.py @@ -142,9 +142,7 @@ class AssetClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @staticmethod @@ -156,13 +154,8 @@ def _prepare_sorts_for_bulk_search(sorts: List[SortItem]): def _get_bulk_search_log_message(self, bulk): return ( - ( - "Bulk search option is enabled. " - if bulk - else "Result size (%s) exceeds threshold (%s). " - ) - + "Ignoring requests for offset-based paging and using timestamp-based paging instead." - ) + "Bulk search option is enabled. " if bulk else "Result size (%s) exceeds threshold (%s). " + ) + "Ignoring requests for offset-based paging and using timestamp-based paging instead." # TODO: Try adding @validate_arguments to this method once # the issue below is fixed or when we switch to pydantic v2 @@ -201,22 +194,17 @@ def search(self, criteria: IndexSearchRequest, bulk=False) -> IndexSearchResults if "entities" in raw_json: try: for entity in raw_json["entities"]: - unflatten_custom_metadata_for_entity( - entity=entity, attributes=criteria.attributes - ) + unflatten_custom_metadata_for_entity(entity=entity, attributes=criteria.attributes) assets = parse_obj_as(List[Asset], raw_json["entities"]) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err else: assets = [] aggregations = self._get_aggregations(raw_json) count = raw_json.get("approximateCount", 0) - if ( - count > IndexSearchResults._MASS_EXTRACT_THRESHOLD - and not IndexSearchResults.presorted_by_timestamp(criteria.dsl.sort) + if count > IndexSearchResults._MASS_EXTRACT_THRESHOLD and not IndexSearchResults.presorted_by_timestamp( + criteria.dsl.sort ): # If there is any user-specified sorting present in the search request if criteria.dsl.sort and len(criteria.dsl.sort) > 1: @@ -254,9 +242,7 @@ def _get_aggregations(self, raw_json) -> Optional[Aggregations]: # TODO: Try adding @validate_arguments to this method once # the issue below is fixed or when we switch to pydantic v2 # https://github.com/pydantic/pydantic/issues/2901 - def get_lineage_list( - self, lineage_request: LineageListRequest - ) -> LineageListResults: + def get_lineage_list(self, lineage_request: LineageListRequest) -> LineageListResults: """ Retrieve lineage using the higher-performance "list" API. @@ -267,21 +253,15 @@ def get_lineage_list( """ if lineage_request.direction == LineageDirection.BOTH: raise ErrorCode.INVALID_LINEAGE_DIRECTION.exception_with_parameters() - raw_json = self._client._call_api( - GET_LINEAGE_LIST, None, request_obj=lineage_request, exclude_unset=True - ) + raw_json = self._client._call_api(GET_LINEAGE_LIST, None, request_obj=lineage_request, exclude_unset=True) if "entities" in raw_json: try: for entity in raw_json["entities"]: - unflatten_custom_metadata_for_entity( - entity=entity, attributes=lineage_request.attributes - ) + unflatten_custom_metadata_for_entity(entity=entity, attributes=lineage_request.attributes) assets = parse_obj_as(List[Asset], raw_json["entities"]) has_more = parse_obj_as(bool, raw_json["hasMore"]) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err else: assets = [] has_more = False @@ -310,11 +290,7 @@ def find_personas_by_name( """ if attributes is None: attributes = [] - query = ( - Term.with_state("ACTIVE") - + Term.with_type_name("PERSONA") - + Term.with_name(name) - ) + query = Term.with_state("ACTIVE") + Term.with_type_name("PERSONA") + Term.with_name(name) return self._search_for_asset_with_name( query=query, name=name, @@ -339,11 +315,7 @@ def find_purposes_by_name( """ if attributes is None: attributes = [] - query = ( - Term.with_state("ACTIVE") - + Term.with_type_name("PURPOSE") - + Term.with_name(name) - ) + query = Term.with_state("ACTIVE") + Term.with_type_name("PURPOSE") + Term.with_name(name) return self._search_for_asset_with_name( query=query, name=name, @@ -386,13 +358,9 @@ def get_by_qualified_name( attributes = attributes or [] related_attributes = related_attributes or [] - if (attributes and len(attributes)) or ( - related_attributes and len(related_attributes) - ): + if (attributes and len(attributes)) or (related_attributes and len(related_attributes)): client = AtlanClient.get_default_client() - search = ( - FluentSearch().select().where(Asset.QUALIFIED_NAME.eq(qualified_name)) - ) + search = FluentSearch().select().where(Asset.QUALIFIED_NAME.eq(qualified_name)) for attribute in attributes: search = search.include_on_results(attribute) for relation_attribute in related_attributes: @@ -407,23 +375,17 @@ def get_by_qualified_name( asset_type.__name__, qualified_name ) else: - raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( - qualified_name, asset_type.__name__ - ) + raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters(qualified_name, asset_type.__name__) raw_json = self._client._call_api( GET_ENTITY_BY_UNIQUE_ATTRIBUTE.format_path_with_params(asset_type.__name__), query_params, ) if raw_json["entity"]["typeName"] != asset_type.__name__: - raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters( - asset_type.__name__, qualified_name - ) + raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters(asset_type.__name__, qualified_name) asset = self._handle_relationships(raw_json) if not isinstance(asset, asset_type): - raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters( - asset_type.__name__, qualified_name - ) + raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters(asset_type.__name__, qualified_name) return asset @validate_arguments(config=dict(arbitrary_types_allowed=True)) @@ -459,9 +421,7 @@ def get_by_guid( attributes = attributes or [] related_attributes = related_attributes or [] - if (attributes and len(attributes)) or ( - related_attributes and len(related_attributes) - ): + if (attributes and len(attributes)) or (related_attributes and len(related_attributes)): client = AtlanClient.get_default_client() search = FluentSearch().select().where(Asset.GUID.eq(guid)) for attribute in attributes: @@ -474,9 +434,7 @@ def get_by_guid( if isinstance(first_result, asset_type): return first_result else: - raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( - guid, asset_type.__name__ - ) + raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, asset_type.__name__) else: raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid) @@ -486,19 +444,12 @@ def get_by_guid( ) asset = self._handle_relationships(raw_json) if not isinstance(asset, asset_type): - raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( - guid, asset_type.__name__ - ) + raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, asset_type.__name__) return asset def _handle_relationships(self, raw_json): - if ( - "relationshipAttributes" in raw_json["entity"] - and raw_json["entity"]["relationshipAttributes"] - ): - raw_json["entity"]["attributes"].update( - raw_json["entity"]["relationshipAttributes"] - ) + if "relationshipAttributes" in raw_json["entity"] and raw_json["entity"]["relationshipAttributes"]: + raw_json["entity"]["attributes"].update(raw_json["entity"]["relationshipAttributes"]) raw_json["entity"]["relationshipAttributes"] = {} asset = AssetResponse[A](**raw_json).entity asset.is_incomplete = False @@ -506,7 +457,9 @@ def _handle_relationships(self, raw_json): @validate_arguments def retrieve_minimal( - self, guid: str, asset_type: Type[A] = Asset # type: ignore[assignment] + self, + guid: str, + asset_type: Type[A] = Asset, # type: ignore[assignment] ) -> A: """ Retrieves an asset by its GUID, without any of its relationships. @@ -599,14 +552,11 @@ def upsert_merging_cm( ) -> AssetMutationResponse: """Deprecated - use save_merging_cm() instead.""" warn( - "This method is deprecated, please use 'save_merging_cm' instead, which offers identical " - "functionality.", + "This method is deprecated, please use 'save_merging_cm' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) - return self.save_merging_cm( - entity=entity, replace_atlan_tags=replace_atlan_tags - ) + return self.save_merging_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) @validate_arguments def save_merging_cm( @@ -629,9 +579,7 @@ def save_merging_cm( ) @validate_arguments - def update_merging_cm( - self, entity: Asset, replace_atlan_tags: bool = False - ) -> AssetMutationResponse: + def update_merging_cm(self, entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse: """ If no asset exists, fails with a NotFoundError. Will merge any provided custom metadata with any custom metadata that already exists on the asset. @@ -648,9 +596,7 @@ def update_merging_cm( min_ext_info=True, ignore_relationships=True, ) # Allow this to throw the NotFoundError if the entity does not exist - return self.save_merging_cm( - entity=entity, replace_atlan_tags=replace_atlan_tags - ) + return self.save_merging_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) @validate_arguments def upsert_replacing_cm( @@ -658,14 +604,11 @@ def upsert_replacing_cm( ) -> AssetMutationResponse: """Deprecated - use save_replacing_cm() instead.""" warn( - "This method is deprecated, please use 'save_replacing_cm' instead, which offers identical " - "functionality.", + "This method is deprecated, please use 'save_replacing_cm' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) - return self.save_replacing_cm( - entity=entity, replace_atlan_tags=replace_atlan_tagss - ) + return self.save_replacing_cm(entity=entity, replace_atlan_tags=replace_atlan_tagss) @validate_arguments def save_replacing_cm( @@ -701,9 +644,7 @@ def save_replacing_cm( return AssetMutationResponse(**raw_json) @validate_arguments - def update_replacing_cm( - self, entity: Asset, replace_atlan_tags: bool = False - ) -> AssetMutationResponse: + def update_replacing_cm(self, entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse: """ If no asset exists, fails with a NotFoundError. Will overwrite all custom metadata on any existing asset with only the custom metadata provided @@ -722,9 +663,7 @@ def update_replacing_cm( min_ext_info=True, ignore_relationships=True, ) # Allow this to throw the NotFoundError if the entity does not exist - return self.save_replacing_cm( - entity=entity, replace_atlan_tags=replace_atlan_tags - ) + return self.save_replacing_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) @validate_arguments def purge_by_guid(self, guid: Union[str, List[str]]) -> AssetMutationResponse: @@ -742,9 +681,7 @@ def purge_by_guid(self, guid: Union[str, List[str]]) -> AssetMutationResponse: else: guids.append(guid) query_params = {"deleteType": AtlanDeleteType.PURGE.value, "guid": guids} - raw_json = self._client._call_api( - DELETE_ENTITIES_BY_GUIDS, query_params=query_params - ) + raw_json = self._client._call_api(DELETE_ENTITIES_BY_GUIDS, query_params=query_params) return AssetMutationResponse(**raw_json) @validate_arguments @@ -767,13 +704,9 @@ def delete_by_guid(self, guid: Union[str, List[str]]) -> AssetMutationResponse: for guid in guids: asset = self.retrieve_minimal(guid=guid, asset_type=Asset) if not asset.can_be_archived(): - raise ErrorCode.ASSET_CAN_NOT_BE_ARCHIVED.exception_with_parameters( - guid, asset.type_name - ) + raise ErrorCode.ASSET_CAN_NOT_BE_ARCHIVED.exception_with_parameters(guid, asset.type_name) query_params = {"deleteType": AtlanDeleteType.SOFT.value, "guid": guids} - raw_json = self._client._call_api( - DELETE_ENTITIES_BY_GUIDS, query_params=query_params - ) + raw_json = self._client._call_api(DELETE_ENTITIES_BY_GUIDS, query_params=query_params) response = AssetMutationResponse(**raw_json) for asset in response.assets_deleted(asset_type=Asset): self._wait_till_deleted(asset) @@ -949,9 +882,7 @@ def update_atlan_tags( ) @validate_arguments - def remove_atlan_tag( - self, asset_type: Type[A], qualified_name: str, atlan_tag_name: str - ) -> None: + def remove_atlan_tag(self, asset_type: Type[A], qualified_name: str, atlan_tag_name: str) -> None: """ Removes a single Atlan tag from the provided asset. Note: if the provided Atlan tag does not exist on the asset, an error will be raised. @@ -966,9 +897,7 @@ def remove_atlan_tag( classification_id = AtlanTagCache.get_id_for_name(atlan_tag_name) if not classification_id: - raise ErrorCode.ATLAN_TAG_NOT_FOUND_BY_NAME.exception_with_parameters( - atlan_tag_name - ) + raise ErrorCode.ATLAN_TAG_NOT_FOUND_BY_NAME.exception_with_parameters(atlan_tag_name) query_params = {"attr:qualifiedName": qualified_name} self._client._call_api( DELETE_ENTITY_BY_ATTRIBUTE.format_path_with_params( @@ -977,14 +906,10 @@ def remove_atlan_tag( query_params, ) - def _update_asset_by_attribute( - self, asset: A, asset_type: Type[A], qualified_name: str - ): + def _update_asset_by_attribute(self, asset: A, asset_type: Type[A], qualified_name: str): query_params = {"attr:qualifiedName": qualified_name} raw_json = self._client._call_api( - PARTIAL_UPDATE_ENTITY_BY_ATTRIBUTE.format_path_with_params( - asset_type.__name__ - ), + PARTIAL_UPDATE_ENTITY_BY_ATTRIBUTE.format_path_with_params(asset_type.__name__), query_params, AssetRequest[Asset](entity=asset), ) @@ -1234,9 +1159,7 @@ def remove_announcement( return self._update_asset_by_attribute(asset, asset_type, qualified_name) @validate_arguments(config=dict(arbitrary_types_allowed=True)) - def update_custom_metadata_attributes( - self, guid: str, custom_metadata: CustomMetadataDict - ): + def update_custom_metadata_attributes(self, guid: str, custom_metadata: CustomMetadataDict): """ Update only the provided custom metadata attributes on the asset. This will leave all other custom metadata attributes, even within the same named custom metadata, unchanged. @@ -1245,9 +1168,7 @@ def update_custom_metadata_attributes( :param custom_metadata: custom metadata to update, as human-readable names mapped to values :raises AtlanError: on any API communication issue """ - custom_metadata_request = CustomMetadataRequest.create( - custom_metadata_dict=custom_metadata - ) + custom_metadata_request = CustomMetadataRequest.create(custom_metadata_dict=custom_metadata) self._client._call_api( ADD_BUSINESS_ATTRIBUTE_BY_ID.format_path( { @@ -1271,9 +1192,7 @@ def replace_custom_metadata(self, guid: str, custom_metadata: CustomMetadataDict """ # clear unset attributes so that they are removed custom_metadata.clear_unset() - custom_metadata_request = CustomMetadataRequest.create( - custom_metadata_dict=custom_metadata - ) + custom_metadata_request = CustomMetadataRequest.create(custom_metadata_dict=custom_metadata) self._client._call_api( ADD_BUSINESS_ATTRIBUTE_BY_ID.format_path( { @@ -1297,9 +1216,7 @@ def remove_custom_metadata(self, guid: str, cm_name: str): custom_metadata = CustomMetadataDict(name=cm_name) # invoke clear_all so all attributes are set to None and consequently removed custom_metadata.clear_all() - custom_metadata_request = CustomMetadataRequest.create( - custom_metadata_dict=custom_metadata - ) + custom_metadata_request = CustomMetadataRequest.create(custom_metadata_dict=custom_metadata) self._client._call_api( ADD_BUSINESS_ATTRIBUTE_BY_ID.format_path( { @@ -1338,19 +1255,9 @@ def append_terms( if guid: if qualified_name: raise ErrorCode.QN_OR_GUID_NOT_BOTH.exception_with_parameters() - results = ( - FluentSearch() - .select() - .where(asset_type.GUID.eq(guid)) - .execute(client=client) - ) + results = FluentSearch().select().where(asset_type.GUID.eq(guid)).execute(client=client) elif qualified_name: - results = ( - FluentSearch() - .select() - .where(asset_type.QUALIFIED_NAME.eq(qualified_name)) - .execute(client=client) - ) + results = FluentSearch().select().where(asset_type.QUALIFIED_NAME.eq(qualified_name)).execute(client=client) else: raise ErrorCode.QN_OR_GUID.exception_with_parameters() @@ -1362,14 +1269,10 @@ def append_terms( asset_type.__name__, qualified_name ) else: - raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( - guid, asset_type.__name__ - ) + raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, asset_type.__name__) else: if guid is None: - raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( - qualified_name, asset_type.__name__ - ) + raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters(qualified_name, asset_type.__name__) else: raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid) qualified_name = first_result.qualified_name @@ -1377,9 +1280,7 @@ def append_terms( updated_asset = asset_type.updater(qualified_name=qualified_name, name=name) for i, term in enumerate(terms): if hasattr(term, "guid") and term.guid: - terms[i] = AtlasGlossaryTerm.ref_by_guid( - guid=term.guid, semantic=SaveSemantic.APPEND - ) + terms[i] = AtlasGlossaryTerm.ref_by_guid(guid=term.guid, semantic=SaveSemantic.APPEND) elif hasattr(term, "qualified_name") and term.qualified_name: terms[i] = AtlasGlossaryTerm.ref_by_qualified_name( qualified_name=term.qualified_name, semantic=SaveSemantic.APPEND @@ -1415,19 +1316,9 @@ def replace_terms( if guid: if qualified_name: raise ErrorCode.QN_OR_GUID_NOT_BOTH.exception_with_parameters() - results = ( - FluentSearch() - .select() - .where(asset_type.GUID.eq(guid)) - .execute(client=client) - ) + results = FluentSearch().select().where(asset_type.GUID.eq(guid)).execute(client=client) elif qualified_name: - results = ( - FluentSearch() - .select() - .where(asset_type.QUALIFIED_NAME.eq(qualified_name)) - .execute(client=client) - ) + results = FluentSearch().select().where(asset_type.QUALIFIED_NAME.eq(qualified_name)).execute(client=client) else: raise ErrorCode.QN_OR_GUID.exception_with_parameters() @@ -1439,14 +1330,10 @@ def replace_terms( asset_type.__name__, qualified_name ) else: - raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( - guid, asset_type.__name__ - ) + raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, asset_type.__name__) else: if guid is None: - raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( - qualified_name, asset_type.__name__ - ) + raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters(qualified_name, asset_type.__name__) else: raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid) qualified_name = first_result.qualified_name @@ -1454,9 +1341,7 @@ def replace_terms( updated_asset = asset_type.updater(qualified_name=qualified_name, name=name) for i, term in enumerate(terms): if hasattr(term, "guid") and term.guid: - terms[i] = AtlasGlossaryTerm.ref_by_guid( - guid=term.guid, semantic=SaveSemantic.REPLACE - ) + terms[i] = AtlasGlossaryTerm.ref_by_guid(guid=term.guid, semantic=SaveSemantic.REPLACE) elif hasattr(term, "qualified_name") and term.qualified_name: terms[i] = AtlasGlossaryTerm.ref_by_qualified_name( qualified_name=term.qualified_name, semantic=SaveSemantic.REPLACE @@ -1494,19 +1379,9 @@ def remove_terms( if guid: if qualified_name: raise ErrorCode.QN_OR_GUID_NOT_BOTH.exception_with_parameters() - results = ( - FluentSearch() - .select() - .where(asset_type.GUID.eq(guid)) - .execute(client=client) - ) + results = FluentSearch().select().where(asset_type.GUID.eq(guid)).execute(client=client) elif qualified_name: - results = ( - FluentSearch() - .select() - .where(asset_type.QUALIFIED_NAME.eq(qualified_name)) - .execute(client=client) - ) + results = FluentSearch().select().where(asset_type.QUALIFIED_NAME.eq(qualified_name)).execute(client=client) else: raise ErrorCode.QN_OR_GUID.exception_with_parameters() @@ -1518,14 +1393,10 @@ def remove_terms( asset_type.__name__, qualified_name ) else: - raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( - guid, asset_type.__name__ - ) + raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, asset_type.__name__) else: if guid is None: - raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( - qualified_name, asset_type.__name__ - ) + raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters(qualified_name, asset_type.__name__) else: raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid) qualified_name = first_result.qualified_name @@ -1533,9 +1404,7 @@ def remove_terms( updated_asset = asset_type.updater(qualified_name=qualified_name, name=name) for i, term in enumerate(terms): if hasattr(term, "guid") and term.guid: - terms[i] = AtlasGlossaryTerm.ref_by_guid( - guid=term.guid, semantic=SaveSemantic.REMOVE - ) + terms[i] = AtlasGlossaryTerm.ref_by_guid(guid=term.guid, semantic=SaveSemantic.REMOVE) elif hasattr(term, "qualified_name") and term.qualified_name: terms[i] = AtlasGlossaryTerm.ref_by_qualified_name( qualified_name=term.qualified_name, semantic=SaveSemantic.REMOVE @@ -1620,9 +1489,7 @@ def find_category_fast_by_name( """ if attributes is None: attributes = [] - query = with_active_category( - name=name, glossary_qualified_name=glossary_qualified_name - ) + query = with_active_category(name=name, glossary_qualified_name=glossary_qualified_name) return self._search_for_asset_with_name( query=query, name=name, @@ -1667,9 +1534,7 @@ def _search_for_asset_with_name( allow_multiple: bool = False, ) -> List[A]: dsl = DSL(query=query) - search_request = IndexSearchRequest( - dsl=dsl, attributes=attributes, relation_attributes=["name"] - ) + search_request = IndexSearchRequest(dsl=dsl, attributes=attributes, relation_attributes=["name"]) results = self.search(search_request) if ( results @@ -1677,11 +1542,7 @@ def _search_for_asset_with_name( and ( # Check for paginated results first; # if not paginated, iterate over the results - assets := [ - asset - for asset in (results.current_page() or results) - if isinstance(asset, asset_type) - ] + assets := [asset for asset in (results.current_page() or results) if isinstance(asset, asset_type)] ) ): if not allow_multiple and len(assets) > 1: @@ -1691,9 +1552,7 @@ def _search_for_asset_with_name( name, ) return assets - raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters( - asset_type.__name__, name - ) + raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters(asset_type.__name__, name) @validate_arguments def find_term_fast_by_name( @@ -1715,9 +1574,7 @@ def find_term_fast_by_name( """ if attributes is None: attributes = [] - query = with_active_term( - name=name, glossary_qualified_name=glossary_qualified_name - ) + query = with_active_term(name=name, glossary_qualified_name=glossary_qualified_name) return self._search_for_asset_with_name( query=query, name=name, asset_type=AtlasGlossaryTerm, attributes=attributes )[0] @@ -1764,9 +1621,7 @@ def find_domain_by_name( """ attributes = attributes or [] query = Term.with_name(name) + Term.with_type_name("DataDomain") - return self._search_for_asset_with_name( - query=query, name=name, asset_type=DataDomain, attributes=attributes - )[0] + return self._search_for_asset_with_name(query=query, name=name, asset_type=DataDomain, attributes=attributes)[0] @validate_arguments def find_product_by_name( @@ -1784,9 +1639,9 @@ def find_product_by_name( """ attributes = attributes or [] query = Term.with_name(name) + Term.with_type_name("DataProduct") - return self._search_for_asset_with_name( - query=query, name=name, asset_type=DataProduct, attributes=attributes - )[0] + return self._search_for_asset_with_name(query=query, name=name, asset_type=DataProduct, attributes=attributes)[ + 0 + ] # TODO: Try adding @validate_arguments to this method once # the issue below is fixed or when we switch to pydantic v2 @@ -1833,18 +1688,14 @@ def get_hierarchy( search = search.include_on_relations(field) request = search.to_request() response = self.search(request) - for category in filter( - lambda a: isinstance(a, AtlasGlossaryCategory), response - ): + for category in filter(lambda a: isinstance(a, AtlasGlossaryCategory), response): guid = category.guid category_dict[guid] = category if category.parent_category is None: top_categories.add(guid) if not top_categories: - raise ErrorCode.NO_CATEGORIES.exception_with_parameters( - glossary.guid, glossary.qualified_name - ) + raise ErrorCode.NO_CATEGORIES.exception_with_parameters(glossary.guid, glossary.qualified_name) return CategoryHierarchy(top_level=top_categories, stub_dict=category_dict) @@ -1920,15 +1771,11 @@ def _get_next_page_json(self, is_bulk_search: bool = False): return raw_json except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err def _process_entities(self, entities): for entity in entities: - unflatten_custom_metadata_for_entity( - entity=entity, attributes=self._criteria.attributes - ) + unflatten_custom_metadata_for_entity(entity=entity, attributes=self._criteria.attributes) self._assets = parse_obj_as(List[Asset], entities) def _update_first_last_record_creation_times(self): @@ -1947,9 +1794,7 @@ def _update_first_last_record_creation_times(self): def _filter_processed_assets(self): self._assets = [ - asset - for asset in self._assets - if asset is not None and asset.guid not in self._processed_guids + asset for asset in self._assets if asset is not None and asset.guid not in self._processed_guids ] def __iter__(self) -> Generator[Asset, None, None]: @@ -2012,9 +1857,7 @@ def _prepare_query_for_timestamp_paging(self, query: Query): rewritten_filters.append(filter_) if self._first_record_creation_time != self._last_record_creation_time: - rewritten_filters.append( - self.get_paging_timestamp_query(self._last_record_creation_time) - ) + rewritten_filters.append(self.get_paging_timestamp_query(self._last_record_creation_time)) if isinstance(query, Bool): rewritten_query = Bool( filter=rewritten_filters, @@ -2054,9 +1897,7 @@ def next_page(self, start=None, size=None) -> bool: :returns: True if there is a next page of results, otherwise False """ self._start = start or self._start + self._size - is_bulk_search = ( - self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD - ) + is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD if size: self._size = size if is_bulk_search: @@ -2065,9 +1906,7 @@ def next_page(self, start=None, size=None) -> bool: # in a previous page of results. # If it has,then exclude it from the current results; # otherwise, we may encounter duplicate asset records. - self._processed_guids.update( - asset.guid for asset in self._assets if asset is not None - ) + self._processed_guids.update(asset.guid for asset in self._assets if asset is not None) return self._get_next_page() if self._assets else False def _get_next_page(self): @@ -2079,9 +1918,7 @@ def _get_next_page(self): query = self._criteria.dsl.query self._criteria.dsl.size = self._size self._criteria.dsl.from_ = self._start - is_bulk_search = ( - self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD - ) + is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD if is_bulk_search: self._prepare_query_for_timestamp_paging(query) @@ -2132,9 +1969,7 @@ def sort_by_timestamp_first(sorts: List[SortItem]) -> List[SortItem]: return creation_asc_sort rewritten_sorts = [ - sort - for sort in sorts - if (not sort.field) or (sort.field != Asset.CREATE_TIME.internal_field_name) + sort for sort in sorts if (not sort.field) or (sort.field != Asset.CREATE_TIME.internal_field_name) ] return creation_asc_sort + rewritten_sorts @@ -2268,9 +2103,7 @@ def __init__( self._client: AtlanClient = client self._max_size: int = max_size self._replace_atlan_tags: bool = replace_atlan_tags - self._custom_metadata_handling: CustomMetadataHandling = ( - custom_metadata_handling - ) + self._custom_metadata_handling: CustomMetadataHandling = custom_metadata_handling self._capture_failures: bool = capture_failures self._update_only: bool = update_only self._track: bool = track @@ -2394,24 +2227,15 @@ def flush(self) -> Optional[AssetMutationResponse]: fuzzy_match: bool = False if self._table_view_agnostic: types_in_batch = {asset.type_name for asset in self._batch} - fuzzy_match = any( - type_name in types_in_batch - for type_name in self._TABLE_LEVEL_ASSETS - ) - if ( - self._update_only - or self._creation_handling != AssetCreationHandling.FULL - or fuzzy_match - ): + fuzzy_match = any(type_name in types_in_batch for type_name in self._TABLE_LEVEL_ASSETS) + if self._update_only or self._creation_handling != AssetCreationHandling.FULL or fuzzy_match: found: Dict[str, str] = {} qualified_names = [asset.qualified_name or "" for asset in self._batch] if self._case_insensitive: search = FluentSearch().select(include_archived=True).min_somes(1) for qn in qualified_names: search = search.where_some( - Asset.QUALIFIED_NAME.eq( - value=qn or "", case_insensitive=self._case_insensitive - ) + Asset.QUALIFIED_NAME.eq(value=qn or "", case_insensitive=self._case_insensitive) ) else: search = ( @@ -2447,10 +2271,7 @@ def flush(self) -> Optional[AssetMutationResponse]: actual_qn=found.get(str(asset_id), ""), revised=revised, ) - elif ( - self._table_view_agnostic - and asset.type_name in self._TABLE_LEVEL_ASSETS - ): + elif self._table_view_agnostic and asset.type_name in self._TABLE_LEVEL_ASSETS: # If found as a different (but acceptable) type, update that instead as_table = AssetIdentity( type_name=Table.__name__, @@ -2517,13 +2338,8 @@ def flush(self) -> Optional[AssetMutationResponse]: if revised: try: if self._custom_metadata_handling == CustomMetadataHandling.IGNORE: - response = self._client.asset.save( - revised, replace_atlan_tags=self._replace_atlan_tags - ) - elif ( - self._custom_metadata_handling - == CustomMetadataHandling.OVERWRITE - ): + response = self._client.asset.save(revised, replace_atlan_tags=self._replace_atlan_tags) + elif self._custom_metadata_handling == CustomMetadataHandling.OVERWRITE: response = self._client.asset.save_replacing_cm( revised, replace_atlan_tags=self._replace_atlan_tags ) @@ -2539,9 +2355,7 @@ def flush(self) -> Optional[AssetMutationResponse]: ) except AtlanError as er: if self._capture_failures: - self._failures.append( - FailedBatch(failed_assets=self._batch, failure_reason=er) - ) + self._failures.append(FailedBatch(failed_assets=self._batch, failure_reason=er)) else: raise er self._batch = [] @@ -2570,27 +2384,17 @@ def _track_response(self, response: AssetMutationResponse, sent: list[Asset]): created_guids, updated_guids = set(), set() if response.mutated_entities: if response.mutated_entities.CREATE: - created_guids = { - asset.guid for asset in response.mutated_entities.CREATE - } + created_guids = {asset.guid for asset in response.mutated_entities.CREATE} if response.mutated_entities.UPDATE: - updated_guids = { - asset.guid for asset in response.mutated_entities.UPDATE - } + updated_guids = {asset.guid for asset in response.mutated_entities.UPDATE} for one in sent: guid = one.guid - if guid and ( - not response.guid_assignments - or guid not in response.guid_assignments - ): + if guid and (not response.guid_assignments or guid not in response.guid_assignments): # Ensure any assets that were sent with GUIDs # that were used as-is are added to the resolved GUIDs map self._resolved_guids[guid] = guid mapped_guid = self._resolved_guids.get(guid, guid) - if ( - mapped_guid not in created_guids - and mapped_guid not in updated_guids - ): + if mapped_guid not in created_guids and mapped_guid not in updated_guids: # Ensure any assets that do not show as either created or updated are still tracked # as possibly restored (and inject the mapped GUID in case it had a placeholder) one.guid = mapped_guid @@ -2644,9 +2448,7 @@ class AssetIdentity(AtlanObject): type_name: str qualified_name: str - def __init__( - self, type_name: str, qualified_name: str, case_insensitive: bool = False - ): + def __init__(self, type_name: str, qualified_name: str, case_insensitive: bool = False): """ Initializes an AssetIdentity. @@ -2694,9 +2496,7 @@ def _dfs(dfs_list: List[AtlasGlossaryCategory], to_add: List[AtlasGlossaryCatego class CategoryHierarchy: - def __init__( - self, top_level: Set[str], stub_dict: Dict[str, AtlasGlossaryCategory] - ): + def __init__(self, top_level: Set[str], stub_dict: Dict[str, AtlasGlossaryCategory]): self._top_level = top_level self._root_categories: list = [] self._categories: Dict[str, AtlasGlossaryCategory] = {} @@ -2710,9 +2510,7 @@ def _build_category_dict(self, stub_dict: Dict[str, AtlasGlossaryCategory]): parent_guid = parent.guid full_parent = self._categories.get(parent_guid, stub_dict[parent_guid]) children: List[AtlasGlossaryCategory] = ( - [] - if full_parent.children_categories is None - else full_parent.children_categories.copy() + [] if full_parent.children_categories is None else full_parent.children_categories.copy() ) if category not in children: children.append(category) diff --git a/pyatlan/client/audit.py b/pyatlan/client/audit.py index a90715d36..99443e31b 100644 --- a/pyatlan/client/audit.py +++ b/pyatlan/client/audit.py @@ -23,9 +23,7 @@ class AuditClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @staticmethod @@ -41,13 +39,8 @@ def _prepare_sorts_for_audit_bulk_search(sorts: List[SortItem]) -> List[SortItem def _get_audit_bulk_search_log_message(self, bulk): return ( - ( - "Audit bulk search option is enabled. " - if bulk - else "Result size (%s) exceeds threshold (%s). " - ) - + "Ignoring requests for offset-based paging and using timestamp-based paging instead." - ) + "Audit bulk search option is enabled. " if bulk else "Result size (%s) exceeds threshold (%s). " + ) + "Ignoring requests for offset-based paging and using timestamp-based paging instead." @validate_arguments def search(self, criteria: AuditSearchRequest, bulk=False) -> AuditSearchResults: @@ -74,9 +67,7 @@ def search(self, criteria: AuditSearchRequest, bulk=False) -> AuditSearchResults if bulk: if criteria.dsl.sort and len(criteria.dsl.sort) > 1: raise ErrorCode.UNABLE_TO_RUN_AUDIT_BULK_WITH_SORTS.exception_with_parameters() - criteria.dsl.sort = self._prepare_sorts_for_audit_bulk_search( - criteria.dsl.sort - ) + criteria.dsl.sort = self._prepare_sorts_for_audit_bulk_search(criteria.dsl.sort) LOGGER.debug(self._get_audit_bulk_search_log_message(bulk)) raw_json = self._client._call_api( @@ -87,26 +78,21 @@ def search(self, criteria: AuditSearchRequest, bulk=False) -> AuditSearchResults try: entity_audits = parse_obj_as(List[EntityAudit], raw_json[ENTITY_AUDITS]) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err else: entity_audits = [] count = raw_json["totalCount"] if "totalCount" in raw_json else 0 - if ( - count > AuditSearchResults._MASS_EXTRACT_THRESHOLD - and not AuditSearchResults.presorted_by_timestamp(criteria.dsl.sort) + if count > AuditSearchResults._MASS_EXTRACT_THRESHOLD and not AuditSearchResults.presorted_by_timestamp( + criteria.dsl.sort ): # If there is any user-specified sorting present in the search request if criteria.dsl.sort and len(criteria.dsl.sort) > 1: raise ErrorCode.UNABLE_TO_RUN_AUDIT_BULK_WITH_SORTS.exception_with_parameters() # Re-fetch the first page results with updated timestamp sorting # for bulk search if count > _MASS_EXTRACT_THRESHOLD (10,000 assets) - criteria.dsl.sort = self._prepare_sorts_for_audit_bulk_search( - criteria.dsl.sort - ) + criteria.dsl.sort = self._prepare_sorts_for_audit_bulk_search(criteria.dsl.sort) LOGGER.debug( self._get_audit_bulk_search_log_message(bulk), count, diff --git a/pyatlan/client/common.py b/pyatlan/client/common.py index d717182cc..85b3dbe65 100644 --- a/pyatlan/client/common.py +++ b/pyatlan/client/common.py @@ -28,9 +28,7 @@ def _call_api( ): pass - def max_retries( - self, max_retries: Retry = CONNECTION_RETRY - ) -> Generator[None, None, None]: + def max_retries(self, max_retries: Retry = CONNECTION_RETRY) -> Generator[None, None, None]: pass def _s3_presigned_url_file_upload(self, api, upload_file: Any): diff --git a/pyatlan/client/constants.py b/pyatlan/client/constants.py index 45ecaaf26..35995feeb 100644 --- a/pyatlan/client/constants.py +++ b/pyatlan/client/constants.py @@ -26,15 +26,9 @@ GET_ROLES = API(ROLE_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) # Group APIs -GET_GROUPS = API( - GROUP_API_V2, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) -CREATE_GROUP = API( - GROUP_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) -UPDATE_GROUP = API( - GROUP_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) +GET_GROUPS = API(GROUP_API_V2, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +CREATE_GROUP = API(GROUP_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +UPDATE_GROUP = API(GROUP_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) DELETE_GROUP = API( GROUP_API + "/{group_guid}/delete", HTTPMethod.POST, @@ -82,14 +76,10 @@ HTTPStatus.OK, endpoint=EndPoint.HERACLES, ) -GET_CURRENT_USER = API( - f"{USER_API}/current", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) +GET_CURRENT_USER = API(f"{USER_API}/current", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) # SQL parsing APIs -PARSE_QUERY = API( - f"{QUERY_API}/parse", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HEKA -) +PARSE_QUERY = API(f"{QUERY_API}/parse", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HEKA) # For running SQL queries EVENT_STREAM = "text/event-stream" @@ -103,28 +93,16 @@ ) # File upload APIs -UPLOAD_IMAGE = API( - IMAGE_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) +UPLOAD_IMAGE = API(IMAGE_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) # Keycloak event APIs -KEYCLOAK_EVENTS = API( - f"{LOGS_API}/login", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) -ADMIN_EVENTS = API( - f"{LOGS_API}/main", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) +KEYCLOAK_EVENTS = API(f"{LOGS_API}/login", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +ADMIN_EVENTS = API(f"{LOGS_API}/main", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) # API token APIs -GET_API_TOKENS = API( - TOKENS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) -UPSERT_API_TOKEN = API( - TOKENS_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) -DELETE_API_TOKEN = API( - TOKENS_API, HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) +GET_API_TOKENS = API(TOKENS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +UPSERT_API_TOKEN = API(TOKENS_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +DELETE_API_TOKEN = API(TOKENS_API, HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.HERACLES) GET_TOKEN = API( "/auth/realms/default/protocol/openid-connect/token", @@ -156,29 +134,19 @@ BULK_SET_CLASSIFICATIONS = "bulk/setClassifications" BULK_HEADERS = "bulk/headers" -BULK_UPDATE = API( - ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +BULK_UPDATE = API(ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) # Lineage APIs -GET_LINEAGE = API( - "lineage/getlineage", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) -GET_LINEAGE_LIST = API( - "lineage/list", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +GET_LINEAGE = API("lineage/getlineage", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +GET_LINEAGE_LIST = API("lineage/list", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) # Entity APIs -GET_ENTITY_BY_GUID = API( - f"{ENTITY_API}guid", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +GET_ENTITY_BY_GUID = API(f"{ENTITY_API}guid", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) GET_ENTITY_BY_UNIQUE_ATTRIBUTE = API( f"{ENTITY_API}uniqueAttribute/type", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS, ) -GET_ENTITIES_BY_GUIDS = API( - ENTITY_BULK_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +GET_ENTITIES_BY_GUIDS = API(ENTITY_BULK_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) GET_ENTITIES_BY_UNIQUE_ATTRIBUTE = API( f"{ENTITY_BULK_API}uniqueAttribute/type", HTTPMethod.GET, @@ -198,13 +166,9 @@ endpoint=EndPoint.ATLAS, ) -GET_AUDIT_EVENTS = API( - ENTITY_API + "{guid}/audit", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +GET_AUDIT_EVENTS = API(ENTITY_API + "{guid}/audit", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) CREATE_ENTITY = API(ENTITY_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) -CREATE_ENTITIES = API( - ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +CREATE_ENTITIES = API(ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) UPDATE_ENTITY = API(ENTITY_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) UPDATE_ENTITY_BY_ATTRIBUTE = API( f"{ENTITY_API}uniqueAttribute/type/", @@ -212,9 +176,7 @@ HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS, ) -UPDATE_ENTITIES = API( - ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +UPDATE_ENTITIES = API(ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) PARTIAL_UPDATE_ENTITY_BY_ATTRIBUTE = API( f"{ENTITY_API}uniqueAttribute/type/", HTTPMethod.PUT, @@ -227,21 +189,15 @@ HTTPStatus.OK, endpoint=EndPoint.ATLAS, ) -DELETE_ENTITY_BY_GUID = API( - f"{ENTITY_API}guid", HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +DELETE_ENTITY_BY_GUID = API(f"{ENTITY_API}guid", HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.ATLAS) DELETE_ENTITY_BY_ATTRIBUTE = API( f"{ENTITY_API}uniqueAttribute/type/", HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS, ) -DELETE_ENTITIES_BY_GUIDS = API( - ENTITY_BULK_API, HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) -PURGE_ENTITIES_BY_GUIDS = API( - ENTITY_PURGE_API, HTTPMethod.PUT, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +DELETE_ENTITIES_BY_GUIDS = API(ENTITY_BULK_API, HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +PURGE_ENTITIES_BY_GUIDS = API(ENTITY_PURGE_API, HTTPMethod.PUT, HTTPStatus.OK, endpoint=EndPoint.ATLAS) # Classification APIs GET_CLASSIFICATIONS = API( @@ -299,15 +255,12 @@ endpoint=EndPoint.ATLAS, ) DELETE_CLASSIFICATION_BY_TYPE_AND_ATTRIBUTE = API( - ENTITY_API + "uniqueAttribute/type/{type_name}/classification/{" - "classification_name}", + ENTITY_API + "uniqueAttribute/type/{type_name}/classification/{classification_name}", HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS, ) -GET_BULK_HEADERS = API( - ENTITY_API + BULK_HEADERS, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +GET_BULK_HEADERS = API(ENTITY_API + BULK_HEADERS, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) # Business Attributes APIs ADD_BUSINESS_ATTRIBUTE = API( @@ -359,9 +312,7 @@ # Glossary APIS GLOSSARY_URI = "glossary" -GET_ALL_GLOSSARIES = API( - GLOSSARY_URI, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +GET_ALL_GLOSSARIES = API(GLOSSARY_URI, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) # Labels APIs ADD_LABELS = API( @@ -427,28 +378,18 @@ endpoint=EndPoint.HERACLES, ) -WORKFLOW_INDEX_SEARCH = API( - WORKFLOW_INDEX_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) -WORKFLOW_INDEX_RUN_SEARCH = API( - WORKFLOW_INDEX_RUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) +WORKFLOW_INDEX_SEARCH = API(WORKFLOW_INDEX_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +WORKFLOW_INDEX_RUN_SEARCH = API(WORKFLOW_INDEX_RUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) # triggers a workflow using the current user's credentials WORKFLOW_RERUN_API = "workflows/submit" -WORKFLOW_RERUN = API( - WORKFLOW_RERUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) +WORKFLOW_RERUN = API(WORKFLOW_RERUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) # triggers a workflow using the workflow owner's credentials WORKFLOW_OWNER_RERUN_API = "workflows/triggerAsOwner" -WORKFLOW_OWNER_RERUN = API( - WORKFLOW_OWNER_RERUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) +WORKFLOW_OWNER_RERUN = API(WORKFLOW_OWNER_RERUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) WORKFLOW_RUN_API = "workflows?submit=true" -WORKFLOW_RUN = API( - WORKFLOW_RUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) +WORKFLOW_RUN = API(WORKFLOW_RUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) WORKFLOW_API = "workflows" WORKFLOW_UPDATE = API( WORKFLOW_API + "/{workflow_name}", @@ -503,9 +444,7 @@ HTTPStatus.OK, endpoint=EndPoint.HERACLES, ) -GET_ALL_CREDENTIALS = API( - CREDENTIALS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) +GET_ALL_CREDENTIALS = API(CREDENTIALS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) UPDATE_CREDENTIAL_BY_GUID = API( CREDENTIALS_API + "/{credential_guid}", HTTPMethod.POST, @@ -527,9 +466,7 @@ AUDIT_API = "entity/auditSearch" AUDIT_SEARCH = API(AUDIT_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) SEARCH_LOG_API = "search/searchlog" -SEARCH_LOG = API( - SEARCH_LOG_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) +SEARCH_LOG = API(SEARCH_LOG_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) TASK_API = "task/search" TASK_SEARCH = API(TASK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) @@ -540,30 +477,14 @@ GET_BY_NAME_TEMPLATE = TYPES_API + "{path_type}/name/{name}" GET_BY_GUID_TEMPLATE = TYPES_API + "{path_type}/guid/{guid}" -GET_TYPE_DEF_BY_NAME = API( - TYPEDEF_BY_NAME, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) -GET_TYPE_DEF_BY_GUID = API( - TYPEDEF_BY_GUID, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) -GET_ALL_TYPE_DEFS = API( - TYPEDEFS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) -GET_ALL_TYPE_DEF_HEADERS = API( - f"{TYPEDEFS_API}headers", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) -UPDATE_TYPE_DEFS = API( - TYPEDEFS_API, HTTPMethod.PUT, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) -CREATE_TYPE_DEFS = API( - TYPEDEFS_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS -) -DELETE_TYPE_DEFS = API( - TYPEDEFS_API, HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS -) -DELETE_TYPE_DEF_BY_NAME = API( - TYPEDEF_BY_NAME, HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS -) +GET_TYPE_DEF_BY_NAME = API(TYPEDEF_BY_NAME, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +GET_TYPE_DEF_BY_GUID = API(TYPEDEF_BY_GUID, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +GET_ALL_TYPE_DEFS = API(TYPEDEFS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +GET_ALL_TYPE_DEF_HEADERS = API(f"{TYPEDEFS_API}headers", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +UPDATE_TYPE_DEFS = API(TYPEDEFS_API, HTTPMethod.PUT, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +CREATE_TYPE_DEFS = API(TYPEDEFS_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +DELETE_TYPE_DEFS = API(TYPEDEFS_API, HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS) +DELETE_TYPE_DEF_BY_NAME = API(TYPEDEF_BY_NAME, HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS) SSO_API = "idp/" SSO_GROUP_MAPPER = SSO_API + "{sso_alias}/mappers" @@ -574,12 +495,8 @@ HTTPStatus.OK, endpoint=EndPoint.HERACLES, ) -GET_ALL_SSO_GROUP_MAPPING = API( - SSO_GROUP_MAPPER, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) -CREATE_SSO_GROUP_MAPPING = API( - SSO_GROUP_MAPPER, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES -) +GET_ALL_SSO_GROUP_MAPPING = API(SSO_GROUP_MAPPER, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +CREATE_SSO_GROUP_MAPPING = API(SSO_GROUP_MAPPER, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) UPDATE_SSO_GROUP_MAPPING = API( SSO_GROUP_MAPPER + "/{group_map_id}", HTTPMethod.POST, diff --git a/pyatlan/client/contract.py b/pyatlan/client/contract.py index 978f88fc4..54a1b352d 100644 --- a/pyatlan/client/contract.py +++ b/pyatlan/client/contract.py @@ -16,9 +16,7 @@ class ContractClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @validate_arguments @@ -37,8 +35,6 @@ def generate_initial_spec( """ response = self._client._call_api( CONTRACT_INIT_API, - request_obj=InitRequest( - asset_type=asset.type_name, asset_qualified_name=asset.qualified_name - ), + request_obj=InitRequest(asset_type=asset.type_name, asset_qualified_name=asset.qualified_name), ) return response.get("contract") diff --git a/pyatlan/client/credential.py b/pyatlan/client/credential.py index eea81ed7d..fcc2ba993 100644 --- a/pyatlan/client/credential.py +++ b/pyatlan/client/credential.py @@ -31,9 +31,7 @@ class CredentialClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @validate_arguments @@ -70,9 +68,7 @@ def get(self, guid: str) -> CredentialResponse: :returns: A CredentialResponse instance. :raises: AtlanError on any error during API invocation. """ - raw_json = self._client._call_api( - GET_CREDENTIAL_BY_GUID.format_path({"credential_guid": guid}) - ) + raw_json = self._client._call_api(GET_CREDENTIAL_BY_GUID.format_path({"credential_guid": guid})) if not isinstance(raw_json, dict): return raw_json return CredentialResponse(**raw_json) @@ -101,9 +97,7 @@ def get_all( if offset is not None: params["offset"] = offset - raw_json = self._client._call_api( - GET_ALL_CREDENTIALS.format_path_with_params(), query_params=params - ) + raw_json = self._client._call_api(GET_ALL_CREDENTIALS.format_path_with_params(), query_params=params) if not isinstance(raw_json, dict) or "records" not in raw_json: raise ErrorCode.JSON_ERROR.exception_with_parameters( @@ -123,9 +117,7 @@ def purge_by_guid(self, guid: str) -> CredentialResponse: :returns: details of the hard-deleted asset(s) :raises AtlanError: on any API communication issue """ - raw_json = self._client._call_api( - DELETE_CREDENTIALS_BY_GUID.format_path({"credential_guid": guid}) - ) + raw_json = self._client._call_api(DELETE_CREDENTIALS_BY_GUID.format_path({"credential_guid": guid})) return raw_json @@ -160,9 +152,7 @@ def test_and_update(self, credential: Credential) -> CredentialResponse: """ test_response = self.test(credential=credential) if not test_response.is_successful: - raise ErrorCode.INVALID_CREDENTIALS.exception_with_parameters( - test_response.message - ) + raise ErrorCode.INVALID_CREDENTIALS.exception_with_parameters(test_response.message) if not credential.id: raise ErrorCode.MISSING_TOKEN_ID.exception_with_parameters() raw_json = self._client._call_api( diff --git a/pyatlan/client/file.py b/pyatlan/client/file.py index 35465cc9d..57ef3f320 100644 --- a/pyatlan/client/file.py +++ b/pyatlan/client/file.py @@ -19,9 +19,7 @@ class FileClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @validate_arguments @@ -51,29 +49,21 @@ def upload_file(self, presigned_url: str, file_path: str) -> None: try: upload_file = open(file_path, "rb") except FileNotFoundError as err: - raise ErrorCode.INVALID_UPLOAD_FILE_PATH.exception_with_parameters( - str(err.strerror), file_path - ) + raise ErrorCode.INVALID_UPLOAD_FILE_PATH.exception_with_parameters(str(err.strerror), file_path) if CloudStorageIdentifier.S3 in presigned_url: return self._client._s3_presigned_url_file_upload( upload_file=upload_file, - api=PRESIGNED_URL_UPLOAD_S3.format_path( - {"presigned_url_put": presigned_url} - ), + api=PRESIGNED_URL_UPLOAD_S3.format_path({"presigned_url_put": presigned_url}), ) elif CloudStorageIdentifier.AZURE_BLOB in presigned_url: return self._client._azure_blob_presigned_url_file_upload( upload_file=upload_file, - api=PRESIGNED_URL_UPLOAD_AZURE_BLOB.format_path( - {"presigned_url_put": presigned_url} - ), + api=PRESIGNED_URL_UPLOAD_AZURE_BLOB.format_path({"presigned_url_put": presigned_url}), ) elif CloudStorageIdentifier.GCS in presigned_url: return self._client._gcs_presigned_url_file_upload( upload_file=upload_file, - api=PRESIGNED_URL_UPLOAD_GCS.format_path( - {"presigned_url_put": presigned_url} - ), + api=PRESIGNED_URL_UPLOAD_GCS.format_path({"presigned_url_put": presigned_url}), ) else: raise ErrorCode.UNSUPPORTED_PRESIGNED_URL.exception_with_parameters() @@ -95,7 +85,5 @@ def download_file( """ return self._client._presigned_url_file_download( file_path=file_path, - api=PRESIGNED_URL_DOWNLOAD.format_path( - {"presigned_url_get": presigned_url} - ), + api=PRESIGNED_URL_DOWNLOAD.format_path({"presigned_url_get": presigned_url}), ) diff --git a/pyatlan/client/group.py b/pyatlan/client/group.py index 5fafcb2a8..cc53d44b5 100644 --- a/pyatlan/client/group.py +++ b/pyatlan/client/group.py @@ -33,9 +33,7 @@ class GroupClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @validate_arguments @@ -55,9 +53,7 @@ def create( payload = CreateGroupRequest(group=group) if user_ids: payload.users = user_ids - raw_json = self._client._call_api( - CREATE_GROUP, request_obj=payload, exclude_unset=True - ) + raw_json = self._client._call_api(CREATE_GROUP, request_obj=payload, exclude_unset=True) return CreateGroupResponse(**raw_json) @validate_arguments @@ -121,9 +117,7 @@ def get( columns=columns, ) endpoint = GET_GROUPS.format_path_with_params() - raw_json = self._client._call_api( - api=endpoint, query_params=request.query_params - ) + raw_json = self._client._call_api(api=endpoint, query_params=request.query_params) return GroupResponse( client=self._client, endpoint=GET_GROUPS, @@ -183,9 +177,7 @@ def get_by_name( return None @validate_arguments - def get_members( - self, guid: str, request: Optional[UserRequest] = None - ) -> UserResponse: + def get_members(self, guid: str, request: Optional[UserRequest] = None) -> UserResponse: """ Retrieves a UserResponse object which contains a list of the members (users) of a group. @@ -196,9 +188,7 @@ def get_members( """ if not request: request = UserRequest() - endpoint = GET_GROUP_MEMBERS.format_path( - {"group_guid": guid} - ).format_path_with_params() + endpoint = GET_GROUP_MEMBERS.format_path({"group_guid": guid}).format_path_with_params() raw_json = self._client._call_api( api=endpoint, query_params=request.query_params, diff --git a/pyatlan/client/impersonate.py b/pyatlan/client/impersonate.py index e935ec9b7..525023163 100644 --- a/pyatlan/client/impersonate.py +++ b/pyatlan/client/impersonate.py @@ -26,9 +26,7 @@ class ImpersonationClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client def user(self, user_id: str) -> str: @@ -106,14 +104,10 @@ def get_client_secret(self, client_guid: str) -> Optional[str]: - InvalidRequestError: If the provided GUID is invalid or retrieval fails. """ try: - raw_json = self._client._call_api( - GET_CLIENT_SECRET.format_path({"client_guid": client_guid}) - ) + raw_json = self._client._call_api(GET_CLIENT_SECRET.format_path({"client_guid": client_guid})) return raw_json and raw_json.get("value") except AtlanError as e: - raise ErrorCode.UNABLE_TO_RETRIEVE_CLIENT_SECRET.exception_with_parameters( - client_guid - ) from e + raise ErrorCode.UNABLE_TO_RETRIEVE_CLIENT_SECRET.exception_with_parameters(client_guid) from e def get_user_id(self, username: str) -> Optional[str]: """ @@ -131,14 +125,6 @@ def get_user_id(self, username: str) -> Optional[str]: GET_KEYCLOAK_USER.format_path_with_params(), query_params={"username": username or " "}, ) - return ( - raw_json - and isinstance(raw_json, list) - and len(raw_json) >= 1 - and raw_json[0].get("id") - or None - ) + return raw_json and isinstance(raw_json, list) and len(raw_json) >= 1 and raw_json[0].get("id") or None except AtlanError as e: - raise ErrorCode.UNABLE_TO_RETRIEVE_USER_GUID.exception_with_parameters( - username - ) from e + raise ErrorCode.UNABLE_TO_RETRIEVE_USER_GUID.exception_with_parameters(username) from e diff --git a/pyatlan/client/open_lineage.py b/pyatlan/client/open_lineage.py index 4919965f1..0705a2dea 100644 --- a/pyatlan/client/open_lineage.py +++ b/pyatlan/client/open_lineage.py @@ -21,9 +21,7 @@ class OpenLineageClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @validate_arguments @@ -51,13 +49,9 @@ def create_connection( create_credential = Credential() create_credential.auth_type = "atlan_api_key" - create_credential.name = ( - f"default-{connector_type.value}-{int(utils.get_epoch_timestamp())}-0" - ) + create_credential.name = f"default-{connector_type.value}-{int(utils.get_epoch_timestamp())}-0" create_credential.connector = str(connector_type.value) - create_credential.connector_config_name = ( - f"atlan-connectors-{connector_type.value}" - ) + create_credential.connector_config_name = f"atlan-connectors-{connector_type.value}" create_credential.connector_type = "event" create_credential.extras = { "events.enable-partial-assets": True, @@ -78,9 +72,7 @@ def create_connection( return client.asset.save(connection) @validate_arguments - def send( - self, request: OpenLineageEvent, connector_type: AtlanConnectorType - ) -> None: + def send(self, request: OpenLineageEvent, connector_type: AtlanConnectorType) -> None: """ Sends the OpenLineage event to Atlan to be consumed. @@ -92,19 +84,12 @@ def send( try: self._client._call_api( request_obj=request, - api=OPEN_LINEAGE_SEND_EVENT_API.format_path( - {"connector_type": connector_type.value} - ), + api=OPEN_LINEAGE_SEND_EVENT_API.format_path({"connector_type": connector_type.value}), text_response=True, ) except AtlanError as e: - if ( - e.error_code.http_error_code == HTTPStatus.UNAUTHORIZED - and e.error_code.error_message.startswith( - "Unauthorized: url path not configured to receive data, urlPath:" - ) + if e.error_code.http_error_code == HTTPStatus.UNAUTHORIZED and e.error_code.error_message.startswith( + "Unauthorized: url path not configured to receive data, urlPath:" ): - raise ErrorCode.OPENLINEAGE_NOT_CONFIGURED.exception_with_parameters( - connector_type.value - ) from e + raise ErrorCode.OPENLINEAGE_NOT_CONFIGURED.exception_with_parameters(connector_type.value) from e raise e diff --git a/pyatlan/client/query.py b/pyatlan/client/query.py index ed984516f..ac20514cd 100644 --- a/pyatlan/client/query.py +++ b/pyatlan/client/query.py @@ -13,9 +13,7 @@ class QueryClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @validate_arguments diff --git a/pyatlan/client/role.py b/pyatlan/client/role.py index e6c8dcd0c..007a8306b 100644 --- a/pyatlan/client/role.py +++ b/pyatlan/client/role.py @@ -18,9 +18,7 @@ class RoleClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @validate_arguments @@ -52,9 +50,7 @@ def get( query_params["filter"] = post_filter if sort: query_params["sort"] = sort - raw_json = self._client._call_api( - GET_ROLES.format_path_with_params(), query_params - ) + raw_json = self._client._call_api(GET_ROLES.format_path_with_params(), query_params) return RoleResponse(**raw_json) def get_all(self) -> RoleResponse: diff --git a/pyatlan/client/search_log.py b/pyatlan/client/search_log.py index 41e039ea6..40b4e3547 100644 --- a/pyatlan/client/search_log.py +++ b/pyatlan/client/search_log.py @@ -30,9 +30,7 @@ class SearchLogClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client def _map_bucket_to_user_view(self, bucket) -> Union[UserViews, None]: @@ -88,18 +86,11 @@ def _prepare_sorts_for_sl_bulk_search( def _get_bulk_search_log_message(self, bulk): return ( - ( - "Search log bulk search option is enabled. " - if bulk - else "Result size (%s) exceeds threshold (%s). " - ) - + "Ignoring requests for offset-based paging and using timestamp-based paging instead." - ) + "Search log bulk search option is enabled. " if bulk else "Result size (%s) exceeds threshold (%s). " + ) + "Ignoring requests for offset-based paging and using timestamp-based paging instead." @validate_arguments - def search( - self, criteria: SearchLogRequest, bulk=False - ) -> Union[SearchLogViewResults, SearchLogResults]: + def search(self, criteria: SearchLogRequest, bulk=False) -> Union[SearchLogViewResults, SearchLogResults]: """ Search for search logs using the provided criteria. `Note:` if the number of results exceeds the predefined threshold @@ -123,9 +114,7 @@ def search( if bulk: if criteria.dsl.sort and len(criteria.dsl.sort) > 2: raise ErrorCode.UNABLE_TO_RUN_SEARCH_LOG_BULK_WITH_SORTS.exception_with_parameters() - criteria.dsl.sort = self._prepare_sorts_for_sl_bulk_search( - criteria.dsl.sort - ) + criteria.dsl.sort = self._prepare_sorts_for_sl_bulk_search(criteria.dsl.sort) LOGGER.debug(self._get_bulk_search_log_message(bulk)) user_views = [] asset_views = [] @@ -133,46 +122,28 @@ def search( raw_json = self._call_search_api(criteria) count = raw_json.get("approximateCount", 0) - if "aggregations" in raw_json and UNIQUE_USERS in raw_json.get( - "aggregations", {} - ): + if "aggregations" in raw_json and UNIQUE_USERS in raw_json.get("aggregations", {}): try: - user_views_bucket = raw_json["aggregations"][UNIQUE_USERS].get( - "buckets", [] - ) + user_views_bucket = raw_json["aggregations"][UNIQUE_USERS].get("buckets", []) user_views = parse_obj_as( List[UserViews], - [ - self._map_bucket_to_user_view(user_view) - for user_view in user_views_bucket - ], + [self._map_bucket_to_user_view(user_view) for user_view in user_views_bucket], ) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err return SearchLogViewResults( count=count, user_views=user_views, ) - if "aggregations" in raw_json and UNIQUE_ASSETS in raw_json.get( - "aggregations", {} - ): + if "aggregations" in raw_json and UNIQUE_ASSETS in raw_json.get("aggregations", {}): try: - asset_views_bucket = raw_json["aggregations"][UNIQUE_ASSETS].get( - "buckets", [] - ) + asset_views_bucket = raw_json["aggregations"][UNIQUE_ASSETS].get("buckets", []) asset_views = parse_obj_as( List[AssetViews], - [ - self._map_bucket_to_asset_view(asset_view) - for asset_view in asset_views_bucket - ], + [self._map_bucket_to_asset_view(asset_view) for asset_view in asset_views_bucket], ) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err return SearchLogViewResults( count=count, asset_views=asset_views, @@ -182,18 +153,13 @@ def search( try: log_entries = parse_obj_as(List[SearchLogEntry], raw_json["logs"]) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err - if ( - count > SearchLogResults._MASS_EXTRACT_THRESHOLD - and not SearchLogResults.presorted_by_timestamp(criteria.dsl.sort) + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + if count > SearchLogResults._MASS_EXTRACT_THRESHOLD and not SearchLogResults.presorted_by_timestamp( + criteria.dsl.sort ): if criteria.dsl.sort and len(criteria.dsl.sort) > 2: raise ErrorCode.UNABLE_TO_RUN_SEARCH_LOG_BULK_WITH_SORTS.exception_with_parameters() - criteria.dsl.sort = self._prepare_sorts_for_sl_bulk_search( - criteria.dsl.sort - ) + criteria.dsl.sort = self._prepare_sorts_for_sl_bulk_search(criteria.dsl.sort) LOGGER.debug( self._get_bulk_search_log_message(bulk), count, diff --git a/pyatlan/client/sso.py b/pyatlan/client/sso.py index 880489bf8..6c0bb2e92 100644 --- a/pyatlan/client/sso.py +++ b/pyatlan/client/sso.py @@ -27,9 +27,7 @@ class SSOClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @staticmethod @@ -43,13 +41,9 @@ def _parse_sso_mapper(raw_json): return parse_obj_as(List[SSOMapper], raw_json) return parse_obj_as(SSOMapper, raw_json) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err - def _check_existing_group_mappings( - self, sso_alias: str, atlan_group: AtlanGroup - ) -> None: + def _check_existing_group_mappings(self, sso_alias: str, atlan_group: AtlanGroup) -> None: """ Check if an SSO group mapping already exists within Atlan. This is necessary to avoid duplicate group mappings with @@ -66,9 +60,7 @@ def _check_existing_group_mappings( ) @validate_arguments - def create_group_mapping( - self, sso_alias: str, atlan_group: AtlanGroup, sso_group_name: str - ) -> SSOMapper: + def create_group_mapping(self, sso_alias: str, atlan_group: AtlanGroup, sso_group_name: str) -> SSOMapper: """ Creates a new Atlan SSO group mapping. @@ -133,9 +125,7 @@ def update_group_mapping( identity_provider_mapper=self.IDP_GROUP_MAPPER, ) # type: ignore[call-arg] raw_json = self._client._call_api( - UPDATE_SSO_GROUP_MAPPING.format_path( - {"sso_alias": sso_alias, "group_map_id": group_map_id} - ), + UPDATE_SSO_GROUP_MAPPING.format_path({"sso_alias": sso_alias, "group_map_id": group_map_id}), request_obj=group_mapper, ) return self._parse_sso_mapper(raw_json) @@ -149,14 +139,10 @@ def get_all_group_mappings(self, sso_alias: str) -> List[SSOMapper]: :raises AtlanError: on any error during API invocation. :returns: list of existing SSO group mapping instances. """ - raw_json = self._client._call_api( - GET_ALL_SSO_GROUP_MAPPING.format_path({"sso_alias": sso_alias}) - ) + raw_json = self._client._call_api(GET_ALL_SSO_GROUP_MAPPING.format_path({"sso_alias": sso_alias})) # Since `raw_json` includes both user and group mappings group_mappings = [ - mapping - for mapping in raw_json - if mapping["identityProviderMapper"] == SSOClient.IDP_GROUP_MAPPER + mapping for mapping in raw_json if mapping["identityProviderMapper"] == SSOClient.IDP_GROUP_MAPPER ] return self._parse_sso_mapper(group_mappings) @@ -171,9 +157,7 @@ def get_group_mapping(self, sso_alias: str, group_map_id: str) -> SSOMapper: :returns: existing SSO group mapping instance. """ raw_json = self._client._call_api( - GET_SSO_GROUP_MAPPING.format_path( - {"sso_alias": sso_alias, "group_map_id": group_map_id} - ) + GET_SSO_GROUP_MAPPING.format_path({"sso_alias": sso_alias, "group_map_id": group_map_id}) ) return self._parse_sso_mapper(raw_json) @@ -188,8 +172,6 @@ def delete_group_mapping(self, sso_alias: str, group_map_id: str) -> None: :returns: an empty response (`None`). """ raw_json = self._client._call_api( - DELETE_SSO_GROUP_MAPPING.format_path( - {"sso_alias": sso_alias, "group_map_id": group_map_id} - ) + DELETE_SSO_GROUP_MAPPING.format_path({"sso_alias": sso_alias, "group_map_id": group_map_id}) ) return raw_json diff --git a/pyatlan/client/task.py b/pyatlan/client/task.py index ab0f5ba6d..6d70631f1 100644 --- a/pyatlan/client/task.py +++ b/pyatlan/client/task.py @@ -19,9 +19,7 @@ class TaskClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @staticmethod @@ -31,9 +29,7 @@ def _parse_atlan_tasks(raw_json: Dict): try: atlan_tasks = parse_obj_as(List[AtlanTask], raw_json.get("tasks")) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err return atlan_tasks @staticmethod @@ -44,10 +40,7 @@ def _handle_sorting(sort: List[SortItem]): if not missing_sort: # If there is some sort, see whether time is already included for option in sort: - if ( - option.field - and option.field == AtlanTask.START_TIME.numeric_field_name - ): + if option.field and option.field == AtlanTask.START_TIME.numeric_field_name: missing_time_sort = False break diff --git a/pyatlan/client/token.py b/pyatlan/client/token.py index 5c206f079..2c3f251fd 100644 --- a/pyatlan/client/token.py +++ b/pyatlan/client/token.py @@ -21,9 +21,7 @@ class TokenClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @validate_arguments @@ -56,9 +54,7 @@ def get( query_params["filter"] = post_filter if sort is not None: query_params["sort"] = sort - raw_json = self._client._call_api( - GET_API_TOKENS.format_path_with_params(), query_params - ) + raw_json = self._client._call_api(GET_API_TOKENS.format_path_with_params(), query_params) return ApiTokenResponse(**raw_json) @validate_arguments @@ -105,9 +101,7 @@ def get_by_guid(self, guid: str) -> Optional[ApiToken]: :param guid: unique identifier by which to retrieve the API token :returns: the API token whose clientId matches the provided string, or None if there is none """ - if response := self.get( - offset=0, limit=5, post_filter='{"id":"' + guid + '"}', sort="createdAt" - ): + if response := self.get(offset=0, limit=5, post_filter='{"id":"' + guid + '"}', sort="createdAt"): if response.records and len(response.records) >= 1: return response.records[0] return None @@ -165,9 +159,7 @@ def update( description=description, persona_qualified_names=personas or set(), ) - raw_json = self._client._call_api( - UPSERT_API_TOKEN.format_path_with_params(guid), request_obj=request - ) + raw_json = self._client._call_api(UPSERT_API_TOKEN.format_path_with_params(guid), request_obj=request) return ApiToken(**raw_json) @validate_arguments diff --git a/pyatlan/client/typedef.py b/pyatlan/client/typedef.py index 9697b87f0..0e5e36a61 100644 --- a/pyatlan/client/typedef.py +++ b/pyatlan/client/typedef.py @@ -58,9 +58,7 @@ def _build_typedef_request(typedef: TypeDef) -> TypeDefResponse: custom_metadata_defs=[], ) # type: ignore[call-arg] else: - raise ErrorCode.UNABLE_TO_UPDATE_TYPEDEF_CATEGORY.exception_with_parameters( - typedef.category.value - ) + raise ErrorCode.UNABLE_TO_UPDATE_TYPEDEF_CATEGORY.exception_with_parameters(typedef.category.value) return payload @@ -115,9 +113,7 @@ class TypeDefClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client def get_all(self) -> TypeDefResponse: @@ -131,9 +127,7 @@ def get_all(self) -> TypeDefResponse: return TypeDefResponse(**raw_json) @validate_arguments - def get( - self, type_category: Union[AtlanTypeCategory, List[AtlanTypeCategory]] - ) -> TypeDefResponse: + def get(self, type_category: Union[AtlanTypeCategory, List[AtlanTypeCategory]]) -> TypeDefResponse: """ Retrieves a TypeDefResponse object that contain a list of the specified category type definitions in Atlan. @@ -164,15 +158,11 @@ def get_by_name(self, name: str) -> TypeDef: category or when unable to produce a valid response :raises AtlanError: on any API communication issue """ - raw_json = self._client._call_api( - GET_TYPE_DEF_BY_NAME.format_path_with_params(name) - ) + raw_json = self._client._call_api(GET_TYPE_DEF_BY_NAME.format_path_with_params(name)) try: return TypeDefFactory.create(raw_json) except (ValidationError, AttributeError) as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err @validate_arguments def create(self, typedef: TypeDef) -> TypeDefResponse: @@ -189,9 +179,7 @@ def create(self, typedef: TypeDef) -> TypeDefResponse: :raises AtlanError: on any API communication issue """ payload = _build_typedef_request(typedef) - raw_json = self._client._call_api( - CREATE_TYPE_DEFS, request_obj=payload, exclude_unset=True - ) + raw_json = self._client._call_api(CREATE_TYPE_DEFS, request_obj=payload, exclude_unset=True) _refresh_caches(typedef) return TypeDefResponse(**raw_json) @@ -210,9 +198,7 @@ def update(self, typedef: TypeDef) -> TypeDefResponse: :raises AtlanError: on any API communication issue """ payload = _build_typedef_request(typedef) - raw_json = self._client._call_api( - UPDATE_TYPE_DEFS, request_obj=payload, exclude_unset=True - ) + raw_json = self._client._call_api(UPDATE_TYPE_DEFS, request_obj=payload, exclude_unset=True) _refresh_caches(typedef) return TypeDefResponse(**raw_json) @@ -240,13 +226,9 @@ def purge(self, name: str, typedef_type: type) -> None: internal_name = str(AtlanTagCache.get_id_for_name(name)) else: - raise ErrorCode.UNABLE_TO_PURGE_TYPEDEF_OF_TYPE.exception_with_parameters( - typedef_type - ) + raise ErrorCode.UNABLE_TO_PURGE_TYPEDEF_OF_TYPE.exception_with_parameters(typedef_type) if internal_name: - self._client._call_api( - DELETE_TYPE_DEF_BY_NAME.format_path_with_params(internal_name) - ) + self._client._call_api(DELETE_TYPE_DEF_BY_NAME.format_path_with_params(internal_name)) else: raise ErrorCode.TYPEDEF_NOT_FOUND_BY_NAME.exception_with_parameters(name) diff --git a/pyatlan/client/user.py b/pyatlan/client/user.py index b56d9510b..f3b7d5e4e 100644 --- a/pyatlan/client/user.py +++ b/pyatlan/client/user.py @@ -40,15 +40,11 @@ class UserClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @validate_arguments - def create( - self, users: List[AtlanUser], return_info: bool = False - ) -> Optional[List[AtlanUser]]: + def create(self, users: List[AtlanUser], return_info: bool = False) -> Optional[List[AtlanUser]]: """ Create one or more new users. @@ -177,9 +173,7 @@ def get( ], ) endpoint = GET_USERS.format_path_with_params() - raw_json = self._client._call_api( - api=endpoint, query_params=request.query_params - ) + raw_json = self._client._call_api(api=endpoint, query_params=request.query_params) return UserResponse( client=self._client, endpoint=endpoint, @@ -275,9 +269,7 @@ def get_by_username(self, username: str) -> Optional[AtlanUser]: return None @validate_arguments - def get_by_usernames( - self, usernames: List[str], limit: int = 5, offset: int = 0 - ) -> Optional[List[AtlanUser]]: + def get_by_usernames(self, usernames: List[str], limit: int = 5, offset: int = 0) -> Optional[List[AtlanUser]]: """ Retrieves users based on their usernames. @@ -287,9 +279,7 @@ def get_by_usernames( :returns: the users with the specified usernames """ username_filter = '{"username":{"$in":' + dumps(usernames or [""]) + "}}" - if response := self.get( - offset=offset, limit=limit, post_filter=username_filter - ): + if response := self.get(offset=offset, limit=limit, post_filter=username_filter): return response.records return None @@ -314,9 +304,7 @@ def add_to_groups( ) @validate_arguments - def get_groups( - self, guid: str, request: Optional[GroupRequest] = None - ) -> GroupResponse: + def get_groups(self, guid: str, request: Optional[GroupRequest] = None) -> GroupResponse: """ Retrieve the groups this user belongs to. @@ -327,9 +315,7 @@ def get_groups( """ if not request: request = GroupRequest() - endpoint = GET_USER_GROUPS.format_path( - {"user_guid": guid} - ).format_path_with_params() + endpoint = GET_USER_GROUPS.format_path({"user_guid": guid}).format_path_with_params() raw_json = self._client._call_api( api=endpoint, query_params=request.query_params, @@ -346,9 +332,7 @@ def get_groups( ) @validate_arguments - def add_as_admin( - self, asset_guid: str, impersonation_token: str - ) -> Optional[AssetMutationResponse]: + def add_as_admin(self, asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]: """ Add the API token configured for the default client as an admin to the asset with the provided GUID. This is primarily useful for connections, to allow the API token to manage policies for the connection, and @@ -369,9 +353,7 @@ def add_as_admin( ) @validate_arguments - def add_as_viewer( - self, asset_guid: str, impersonation_token: str - ) -> Optional[AssetMutationResponse]: + def add_as_viewer(self, asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]: """ Add the API token configured for the default client as a viewer to the asset with the provided GUID. This is primarily useful for query collections, to allow the API token to view or run queries within the @@ -409,23 +391,16 @@ def _add_as( from pyatlan.model.fluent_search import FluentSearch if keyword_field not in [Asset.ADMIN_USERS, Asset.VIEWER_USERS]: - raise ValueError( - f"keyword_field should be {Asset.VIEWER_USERS} or {Asset.ADMIN_USERS}" - ) + raise ValueError(f"keyword_field should be {Asset.VIEWER_USERS} or {Asset.ADMIN_USERS}") token_user = self.get_current().username or "" with client_connection(api_key=impersonation_token) as tmp: request = ( - FluentSearch() - .where(Asset.GUID.eq(asset_guid)) - .include_on_results(keyword_field) - .page_size(1) + FluentSearch().where(Asset.GUID.eq(asset_guid)).include_on_results(keyword_field).page_size(1) ).to_request() results = tmp.asset.search(request) if not results.current_page(): - raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters( - asset_guid - ) + raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(asset_guid) asset = results.current_page()[0] if keyword_field == Asset.VIEWER_USERS: existing_viewers = asset.viewer_users or set() diff --git a/pyatlan/client/workflow.py b/pyatlan/client/workflow.py index f629b76d5..df904ddb6 100644 --- a/pyatlan/client/workflow.py +++ b/pyatlan/client/workflow.py @@ -54,9 +54,7 @@ class WorkflowClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "client", "ApiCaller" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") self._client = client @staticmethod @@ -68,14 +66,10 @@ def _parse_response(raw_json, response_type): return parse_obj_as(List[response_type], raw_json) return parse_obj_as(response_type, raw_json) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err @validate_arguments - def find_by_type( - self, prefix: WorkflowPackage, max_results: int = 10 - ) -> List[WorkflowSearchResult]: + def find_by_type(self, prefix: WorkflowPackage, max_results: int = 10) -> List[WorkflowSearchResult]: """ Find workflows based on their type (prefix). Note: Only workflows that have been run will be found. @@ -244,9 +238,7 @@ def _handle_workflow_types(self, workflow): if results := self.find_by_type(workflow): detail = results[0].source else: - raise ErrorCode.NO_PRIOR_RUN_AVAILABLE.exception_with_parameters( - workflow.value - ) + raise ErrorCode.NO_PRIOR_RUN_AVAILABLE.exception_with_parameters(workflow.value) elif isinstance(workflow, WorkflowSearchResult): detail = workflow.source else: @@ -254,25 +246,17 @@ def _handle_workflow_types(self, workflow): return detail @overload - def rerun( - self, workflow: WorkflowPackage, idempotent: bool = False - ) -> WorkflowRunResponse: ... + def rerun(self, workflow: WorkflowPackage, idempotent: bool = False) -> WorkflowRunResponse: ... @overload - def rerun( - self, workflow: WorkflowSearchResultDetail, idempotent: bool = False - ) -> WorkflowRunResponse: ... + def rerun(self, workflow: WorkflowSearchResultDetail, idempotent: bool = False) -> WorkflowRunResponse: ... @overload - def rerun( - self, workflow: WorkflowSearchResult, idempotent: bool = False - ) -> WorkflowRunResponse: ... + def rerun(self, workflow: WorkflowSearchResult, idempotent: bool = False) -> WorkflowRunResponse: ... def rerun( self, - workflow: Union[ - WorkflowPackage, WorkflowSearchResultDetail, WorkflowSearchResult - ], + workflow: Union[WorkflowPackage, WorkflowSearchResultDetail, WorkflowSearchResult], idempotent: bool = False, ) -> WorkflowRunResponse: """ @@ -298,11 +282,7 @@ def rerun( # since it takes some time to start or stop sleep(10) if ( - ( - current_run_details := self._find_current_run( - workflow_name=detail.metadata.name - ) - ) + (current_run_details := self._find_current_run(workflow_name=detail.metadata.name)) and current_run_details.source and current_run_details.source.metadata and current_run_details.source.spec @@ -314,9 +294,7 @@ def rerun( status=current_run_details.source.status, ) if detail and detail.metadata: - request = ReRunRequest( - namespace=detail.metadata.namespace, resource_name=detail.metadata.name - ) + request = ReRunRequest(namespace=detail.metadata.namespace, resource_name=detail.metadata.name) raw_json = self._client._call_api( WORKFLOW_RERUN, request_obj=request, @@ -324,14 +302,10 @@ def rerun( return WorkflowRunResponse(**raw_json) @overload - def run( - self, workflow: Workflow, workflow_schedule: Optional[WorkflowSchedule] = None - ) -> WorkflowResponse: ... + def run(self, workflow: Workflow, workflow_schedule: Optional[WorkflowSchedule] = None) -> WorkflowResponse: ... @overload - def run( - self, workflow: str, workflow_schedule: Optional[WorkflowSchedule] = None - ) -> WorkflowResponse: ... + def run(self, workflow: str, workflow_schedule: Optional[WorkflowSchedule] = None) -> WorkflowResponse: ... def run( self, @@ -382,9 +356,7 @@ def update(self, workflow: Workflow) -> WorkflowResponse: :raises AtlanError: on any API communication issue. """ raw_json = self._client._call_api( - WORKFLOW_UPDATE.format_path( - {"workflow_name": workflow.metadata and workflow.metadata.name} - ), + WORKFLOW_UPDATE.format_path({"workflow_name": workflow.metadata and workflow.metadata.name}), request_obj=workflow, ) return WorkflowResponse(**raw_json) @@ -510,19 +482,13 @@ def delete( ) @overload - def add_schedule( - self, workflow: WorkflowResponse, workflow_schedule: WorkflowSchedule - ) -> WorkflowResponse: ... + def add_schedule(self, workflow: WorkflowResponse, workflow_schedule: WorkflowSchedule) -> WorkflowResponse: ... @overload - def add_schedule( - self, workflow: WorkflowPackage, workflow_schedule: WorkflowSchedule - ) -> WorkflowResponse: ... + def add_schedule(self, workflow: WorkflowPackage, workflow_schedule: WorkflowSchedule) -> WorkflowResponse: ... @overload - def add_schedule( - self, workflow: WorkflowSearchResult, workflow_schedule: WorkflowSchedule - ) -> WorkflowResponse: ... + def add_schedule(self, workflow: WorkflowSearchResult, workflow_schedule: WorkflowSchedule) -> WorkflowResponse: ... @overload def add_schedule( @@ -564,10 +530,7 @@ def add_schedule( self._add_schedule(workflow_to_update, workflow_schedule) raw_json = self._client._call_api( WORKFLOW_UPDATE.format_path( - { - "workflow_name": workflow_to_update.metadata - and workflow_to_update.metadata.name - } + {"workflow_name": workflow_to_update.metadata and workflow_to_update.metadata.name} ), request_obj=workflow_to_update, ) @@ -583,9 +546,7 @@ def remove_schedule(self, workflow: WorkflowPackage) -> WorkflowResponse: ... def remove_schedule(self, workflow: WorkflowSearchResult) -> WorkflowResponse: ... @overload - def remove_schedule( - self, workflow: WorkflowSearchResultDetail - ) -> WorkflowResponse: ... + def remove_schedule(self, workflow: WorkflowSearchResultDetail) -> WorkflowResponse: ... def remove_schedule( self, @@ -615,15 +576,10 @@ def remove_schedule( ) workflow_to_update = self._handle_workflow_types(workflow) if workflow_to_update.metadata and workflow_to_update.metadata.annotations: - workflow_to_update.metadata.annotations.pop( - self._WORKFLOW_RUN_SCHEDULE, None - ) + workflow_to_update.metadata.annotations.pop(self._WORKFLOW_RUN_SCHEDULE, None) raw_json = self._client._call_api( WORKFLOW_UPDATE.format_path( - { - "workflow_name": workflow_to_update.metadata - and workflow_to_update.metadata.name - } + {"workflow_name": workflow_to_update.metadata and workflow_to_update.metadata.name} ), request_obj=workflow_to_update, ) @@ -656,9 +612,7 @@ def get_scheduled_run(self, workflow_name: str) -> WorkflowScheduleResponse: return self._parse_response(raw_json, WorkflowScheduleResponse) @validate_arguments - def find_schedule_query( - self, saved_query_id: str, max_results: int = 10 - ) -> List[WorkflowSearchResult]: + def find_schedule_query(self, saved_query_id: str, max_results: int = 10) -> List[WorkflowSearchResult]: """ Find scheduled query workflows by their saved query identifier. @@ -671,9 +625,7 @@ def find_schedule_query( filter=[ NestedQuery( path="metadata", - query=Prefix( - field="metadata.name.keyword", value=f"asq-{saved_query_id}" - ), + query=Prefix(field="metadata.name.keyword", value=f"asq-{saved_query_id}"), ), NestedQuery( path="metadata", @@ -728,10 +680,6 @@ def find_schedule_query_between( "startDate": request.start_date, "endDate": request.end_date, } - SEARCH_API = ( - SCHEDULE_QUERY_WORKFLOWS_MISSED - if missed - else SCHEDULE_QUERY_WORKFLOWS_SEARCH - ) + SEARCH_API = SCHEDULE_QUERY_WORKFLOWS_MISSED if missed else SCHEDULE_QUERY_WORKFLOWS_SEARCH raw_json = self._client._call_api(SEARCH_API, query_params=query_params) return self._parse_response(raw_json, WorkflowRunResponse) diff --git a/pyatlan/errors.py b/pyatlan/errors.py index 77307b46a..83f1b15b1 100644 --- a/pyatlan/errors.py +++ b/pyatlan/errors.py @@ -7,8 +7,7 @@ E = TypeVar("E", bound="AtlanError") RAISE_GITHUB_ISSUE = ( - "Please raise an issue on the Python SDK GitHub " - "repository providing context in which this error occurred." + "Please raise an issue on the Python SDK GitHub repository providing context in which this error occurred." ) diff --git a/pyatlan/events/atlan_event_handler.py b/pyatlan/events/atlan_event_handler.py index 8435d1cd7..e37b7b935 100644 --- a/pyatlan/events/atlan_event_handler.py +++ b/pyatlan/events/atlan_event_handler.py @@ -68,15 +68,7 @@ def get_current_view_of_asset( exclude_atlan_tags=not include_atlan_tags, ) response = client.asset.search(criteria=request) - return ( - result - if ( - result := ( - response.current_page()[0] if len(response.current_page()) > 0 else None - ) - ) - else None - ) + return result if (result := (response.current_page()[0] if len(response.current_page()) > 0 else None)) else None def has_description(asset: Asset) -> bool: @@ -109,9 +101,7 @@ def has_lineage(asset: Asset) -> bool: """ # If possible, look directly on inputs and outputs rather than the __hasLineage flag if isinstance(asset, Catalog): - return (asset.input_to_processes is not None) or ( - asset.output_from_processes is not None - ) + return (asset.input_to_processes is not None) or (asset.output_from_processes is not None) else: return bool(asset.has_lineage) @@ -192,8 +182,7 @@ def upsert_changes(self, changed_assets: List[Asset]): :param changed_assets: the in-memory-modified assets to send to Atlan """ warn( - "This method is deprecated, please use 'save_changes' instead, which offers identical " - "functionality.", + "This method is deprecated, please use 'save_changes' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) diff --git a/pyatlan/events/atlan_lambda_handler.py b/pyatlan/events/atlan_lambda_handler.py index 85eb8eb50..1b910c3cc 100644 --- a/pyatlan/events/atlan_lambda_handler.py +++ b/pyatlan/events/atlan_lambda_handler.py @@ -32,15 +32,11 @@ def process_event(handler: AtlanEventHandler, event, context): print("Matches a validation request - doing nothing and succeeding.") return {"statusCode": 200} if not valid_signature(SIGNING_SECRET, event.get("headers")): - raise IOError( - "Invalid signing secret received - will not process this request." - ) + raise IOError("Invalid signing secret received - will not process this request.") atlan_event = json.loads(body) atlan_event = AtlanEvent(**atlan_event) if handler.validate_prerequisites(atlan_event): - if isinstance(atlan_event.payload, AtlanEventPayload) and isinstance( - atlan_event.payload.asset, Asset - ): + if isinstance(atlan_event.payload, AtlanEventPayload) and isinstance(atlan_event.payload.asset, Asset): current = handler.get_current_state(atlan_event.payload.asset) if current is not None: updated = handler.calculate_changes(current) diff --git a/pyatlan/generator/class_generator.py b/pyatlan/generator/class_generator.py index 5180731c3..8f5a5fd54 100644 --- a/pyatlan/generator/class_generator.py +++ b/pyatlan/generator/class_generator.py @@ -5,6 +5,7 @@ pyatlan.model.enums. This script depends upon the presence of a JSON file containing typedefs downloaded from an Atlan instance. The script create_typedefs_file.py can be used to produce this file. """ + import datetime import enum import json @@ -96,8 +97,7 @@ def get_type(type_: str): def get_type_defs() -> TypeDefResponse: if ( not TYPE_DEF_FILE.exists() - or datetime.date.fromtimestamp(os.path.getmtime(TYPE_DEF_FILE)) - < datetime.date.today() + or datetime.date.fromtimestamp(os.path.getmtime(TYPE_DEF_FILE)) < datetime.date.today() ): raise ClassGenerationError( "File containing typedefs does not exist or is not current." @@ -171,9 +171,7 @@ def external_asset_dependencies(self): @property def external_module_dependencies(self): - return { - asset_info.module_info for asset_info in self.external_asset_dependencies - } + return {asset_info.module_info for asset_info in self.external_asset_dependencies} @property def imports(self): @@ -262,11 +260,7 @@ def import_super_class(self): super_type = AssetInfo.asset_info_by_name[self.entity_def.super_types[0]] if self.name not in self._CORE_ASSETS and super_type.name in self._CORE_ASSETS: return f"from .core.{super_type.module_name} import {super_type.name}" - elif ( - not self.is_core_asset - and super_type.is_core_asset - and self.name not in self._CORE_ASSETS - ): + elif not self.is_core_asset and super_type.is_core_asset and self.name not in self._CORE_ASSETS: return f"from .core.{super_type.module_name} import {super_type.name}" else: return f"from .{super_type.module_name} import {super_type.name}" @@ -286,22 +280,14 @@ def imports_for_referenced_assets(self): return imports def update_attribute_defs(self): - def get_ancestor_relationship_defs( - ancestor_name: str, ancestor_relationship_defs - ): + def get_ancestor_relationship_defs(ancestor_name: str, ancestor_relationship_defs): ancestor_entity_def = self.entity_defs_by_name[ancestor_name] if not ancestor_entity_def.super_types or not ancestor_name: return ancestor_relationship_defs - for relationship_def in ( - ancestor_entity_def.relationship_attribute_defs or [] - ): + for relationship_def in ancestor_entity_def.relationship_attribute_defs or []: ancestor_relationship_defs.add(relationship_def["name"]) return get_ancestor_relationship_defs( - ( - ancestor_entity_def.super_types[0] - if ancestor_entity_def.super_types - else "" - ), + (ancestor_entity_def.super_types[0] if ancestor_entity_def.super_types else ""), ancestor_relationship_defs, ) @@ -310,9 +296,7 @@ def get_ancestor_relationship_defs( entity_def.attribute_defs = self.merge_attributes(entity_def) names = {attribute_def["name"] for attribute_def in entity_def.attribute_defs} super_type_relationship_defs = ( - get_ancestor_relationship_defs(entity_def.super_types[0], set()) - if entity_def.super_types - else set() + get_ancestor_relationship_defs(entity_def.super_types[0], set()) if entity_def.super_types else set() ) entity_def.relationship_attribute_defs = list( { @@ -335,13 +319,9 @@ def update_required_asset_names(self) -> None: attributes_to_remove.add(attribute["name"]) elif type_name in AssetInfo.asset_info_by_name: self.required_asset_infos.add(AssetInfo.asset_info_by_name[type_name]) - self.entity_def.attribute_defs = [ - a for a in attribute_defs if a["name"] not in attributes_to_remove - ] + self.entity_def.attribute_defs = [a for a in attribute_defs if a["name"] not in attributes_to_remove] self.entity_def.relationship_attribute_defs = [ - a - for a in relationship_attribute_defs - if a["name"] not in attributes_to_remove + a for a in relationship_attribute_defs if a["name"] not in attributes_to_remove ] def merge_attributes(self, entity_def): @@ -354,9 +334,7 @@ def merge_them(s, a): for s_type in entity.super_types: merge_them(s_type, a) - attributes = { - attribute["name"]: attribute for attribute in entity_def.attribute_defs - } + attributes = {attribute["name"]: attribute for attribute in entity_def.attribute_defs} for super_type in entity_def.super_types: merge_them(super_type, attributes) @@ -373,9 +351,7 @@ def update_circular_dependencies(self): @classmethod def set_entity_defs(cls, entity_defs: List[EntityDef]): - cls.entity_defs_by_name = { - entity_def.name: entity_def for entity_def in entity_defs - } + cls.entity_defs_by_name = {entity_def.name: entity_def for entity_def in entity_defs} entity_defs = sorted(entity_defs, key=lambda e: ",".join(e.super_types or [])) for entity_def in entity_defs: name = entity_def.name @@ -385,8 +361,7 @@ def set_entity_defs(cls, entity_defs: List[EntityDef]): attribute["typeName"] = "array" if (not entity_def.super_types and name != REFERENCEABLE) or any( - super_type in cls.super_type_names_to_ignore - for super_type in (entity_def.super_types or []) + super_type in cls.super_type_names_to_ignore for super_type in (entity_def.super_types or []) ): cls.super_type_names_to_ignore.add(name) continue @@ -406,9 +381,7 @@ def update_all_circular_dependencies(cls): @classmethod def create_modules(cls): order = 0 - for parent_name, successors in nx.bfs_successors( - cls.hierarchy_graph, REFERENCEABLE - ): + for parent_name, successors in nx.bfs_successors(cls.hierarchy_graph, REFERENCEABLE): for asset_name in [parent_name] + successors: asset_info = cls.asset_info_by_name[asset_name] asset_info.order = order @@ -433,9 +406,7 @@ def create_modules(cls): asset_info.is_core_asset = True cls._CORE_ASSETS.add(asset_info.name) continue - super_asset = cls.asset_info_by_name[ - related_asset.super_class - ] + super_asset = cls.asset_info_by_name[related_asset.super_class] super_asset.is_core_asset = True cls._CORE_ASSETS.add(related_asset.super_class) @@ -614,30 +585,22 @@ def get_indexes_for_attribute() -> Dict[IndexType, str]: search_map = get_indexes_for_attribute() indices = search_map.keys() if indices == {IndexType.KEYWORD}: - return SearchType( - name="KeywordField", args=f'"{search_map.get(IndexType.KEYWORD)}"' - ) + return SearchType(name="KeywordField", args=f'"{search_map.get(IndexType.KEYWORD)}"') elif indices == {IndexType.TEXT}: return SearchType(name="TextField", args=f'"{search_map.get(IndexType.TEXT)}"') elif indices == {IndexType.NUMERIC}: - return SearchType( - name="NumericField", args=f'"{search_map.get(IndexType.NUMERIC)}"' - ) + return SearchType(name="NumericField", args=f'"{search_map.get(IndexType.NUMERIC)}"') elif indices == {IndexType.BOOLEAN}: - return SearchType( - name="BooleanField", args=f'"{search_map.get(IndexType.BOOLEAN)}"' - ) + return SearchType(name="BooleanField", args=f'"{search_map.get(IndexType.BOOLEAN)}"') elif indices == {IndexType.NUMERIC, IndexType.RANK_FEATURE}: return SearchType( name="NumericRankField", - args=f'"{search_map.get(IndexType.NUMERIC)}", ' - f'"{search_map.get(IndexType.RANK_FEATURE)}"', + args=f'"{search_map.get(IndexType.NUMERIC)}", "{search_map.get(IndexType.RANK_FEATURE)}"', ) elif indices == {IndexType.KEYWORD, IndexType.TEXT}: return SearchType( name="KeywordTextField", - args=f'"{search_map.get(IndexType.KEYWORD)}", ' - f'"{search_map.get(IndexType.TEXT)}"', + args=f'"{search_map.get(IndexType.KEYWORD)}", "{search_map.get(IndexType.TEXT)}"', ) elif indices == {IndexType.KEYWORD, IndexType.TEXT, IndexType.STEMMED}: return SearchType( @@ -651,9 +614,7 @@ def get_indexes_for_attribute() -> Dict[IndexType, str]: class Generator: def __init__(self) -> None: - self.environment = Environment( - loader=PackageLoader("pyatlan.generator", "templates") - ) + self.environment = Environment(loader=PackageLoader("pyatlan.generator", "templates")) self.environment.filters["to_snake_case"] = to_snake_case self.environment.filters["get_type"] = get_type self.environment.filters["get_search_type"] = get_search_type @@ -670,28 +631,20 @@ def merge_them(s, a): for s_type in entity.super_types: merge_them(s_type, a) - attributes = { - attribute["name"]: attribute for attribute in entity_def.attribute_defs - } + attributes = {attribute["name"]: attribute for attribute in entity_def.attribute_defs} for super_type in entity_def.super_types: merge_them(super_type, attributes) return list(attributes.values()) - def get_ancestor_relationship_defs( - self, ancestor_name: str, ancestor_relationship_defs - ): + def get_ancestor_relationship_defs(self, ancestor_name: str, ancestor_relationship_defs): ancestor_entity_def = AssetInfo.entity_defs_by_name[ancestor_name] if not ancestor_entity_def.super_types or not ancestor_name: return ancestor_relationship_defs for relationship_def in ancestor_entity_def.relationship_attribute_defs or []: ancestor_relationship_defs.add(relationship_def["name"]) return self.get_ancestor_relationship_defs( - ( - ancestor_entity_def.super_types[0] - if ancestor_entity_def.super_types - else "" - ), + (ancestor_entity_def.super_types[0] if ancestor_entity_def.super_types else ""), ancestor_relationship_defs, ) @@ -733,11 +686,7 @@ def render_init(self, assets: List[AssetInfo]): script.write(content) def render_core_init(self, assets: List[AssetInfo]): - asset_names = [ - asset.name - for asset in assets - if asset.is_core_asset or asset.name in asset._CORE_ASSETS - ] + asset_names = [asset.name for asset in assets if asset.is_core_asset or asset.name in asset._CORE_ASSETS] asset_imports = [ f"from .{asset.module_name} import {asset.name}" for asset in assets @@ -745,9 +694,7 @@ def render_core_init(self, assets: List[AssetInfo]): ] template = self.environment.get_template("core/init.jinja2") - content = template.render( - {"asset_imports": asset_imports, "asset_names": asset_names} - ) + content = template.render({"asset_imports": asset_imports, "asset_names": asset_names}) init_path = CORE_ASSETS_DIR / "__init__.py" with init_path.open("w") as script: @@ -785,20 +732,14 @@ def render_enums(self, enum_defs: List["EnumDefInfo"]): new_enums.replace(existing_enums) def render_docs_struct_snippets(self, struct_defs): - template = self.environment.get_template( - "documentation/struct_attributes.jinja2" - ) + template = self.environment.get_template("documentation/struct_attributes.jinja2") for struct_def in struct_defs: content = template.render({"struct_def": struct_def}) - with (DOCS_DIR / f"{struct_def.name.lower()}-properties.md").open( - "w" - ) as doc: + with (DOCS_DIR / f"{struct_def.name.lower()}-properties.md").open("w") as doc: doc.write(content) def render_docs_entity_properties(self, entity_defs): - template = self.environment.get_template( - "documentation/entity_attributes.jinja2" - ) + template = self.environment.get_template("documentation/entity_attributes.jinja2") for entity_def in entity_defs: attr_def_alpha = sorted(entity_def.attribute_defs, key=lambda x: x["name"]) content = template.render( @@ -807,40 +748,27 @@ def render_docs_entity_properties(self, entity_defs): "attribute_defs": attr_def_alpha, } ) - with (DOCS_DIR / f"{entity_def.name.lower()}-properties.md").open( - "w" - ) as doc: + with (DOCS_DIR / f"{entity_def.name.lower()}-properties.md").open("w") as doc: doc.write(content) def render_docs_entity_relationships(self, entity_defs): - template = self.environment.get_template( - "documentation/entity_relationships.jinja2" - ) + template = self.environment.get_template("documentation/entity_relationships.jinja2") for entity_def in entity_defs: - attr_def_alpha = sorted( - entity_def.relationship_attribute_defs, key=lambda x: x["name"] - ) + attr_def_alpha = sorted(entity_def.relationship_attribute_defs, key=lambda x: x["name"]) content = template.render( { "entity_def_name": entity_def.name, "attribute_defs": attr_def_alpha, } ) - with (DOCS_DIR / f"{entity_def.name.lower()}-relationships.md").open( - "w" - ) as doc: + with (DOCS_DIR / f"{entity_def.name.lower()}-relationships.md").open("w") as doc: doc.write(content) def render_sphinx_docs(self, entity_defs): - template = self.environment.get_template( - "documentation/sphinx_asset_index.jinja2" - ) + template = self.environment.get_template("documentation/sphinx_asset_index.jinja2") to_include = [] for entity_def in entity_defs: - if ( - not entity_def.name.startswith("__") - and not entity_def.name == "AtlasServer" - ): + if not entity_def.name.startswith("__") and not entity_def.name == "AtlasServer": to_include.append(entity_def) sorted_defs = sorted(to_include, key=(lambda x: x.name)) content = template.render( @@ -859,9 +787,7 @@ def render_sphinx_docs(self, entity_defs): "title_underline": "=" * len(entity_def.name), } ) - with (SPHINX_DIR / "asset" / f"{entity_def.name.lower()}.rst").open( - "w" - ) as doc: + with (SPHINX_DIR / "asset" / f"{entity_def.name.lower()}.rst").open("w") as doc: doc.write(content) @@ -876,8 +802,7 @@ class EnumDefInfo: def __init__(self, enum_def: EnumDef): self.name = get_type(enum_def.name) self.element_defs: List[KeyValue] = [ - self.get_key_value(e) - for e in sorted(enum_def.element_defs, key=lambda e: e.ordinal or 0) + self.get_key_value(e) for e in sorted(enum_def.element_defs, key=lambda e: e.ordinal or 0) ] def get_key_value(self, element_def: EnumDef.ElementDef): @@ -911,13 +836,9 @@ def filter_attributes_of_custom_entity_type(): filtered_relationship_attribute_defs = [ relationship_attribute_def for relationship_attribute_def in entity_def.relationship_attribute_defs - if not type_defs.is_custom_entity_def_name( - relationship_attribute_def["typeName"] - ) + if not type_defs.is_custom_entity_def_name(relationship_attribute_def["typeName"]) ] - entity_def.relationship_attribute_defs = ( - filtered_relationship_attribute_defs - ) + entity_def.relationship_attribute_defs = filtered_relationship_attribute_defs if __name__ == "__main__": diff --git a/pyatlan/model/aggregation.py b/pyatlan/model/aggregation.py index e36e850c2..eda71f3cf 100644 --- a/pyatlan/model/aggregation.py +++ b/pyatlan/model/aggregation.py @@ -31,6 +31,7 @@ class Details(AtlanObject): class Hits(AtlanObject): "Details of the hits requested." + total: Optional[AggregationHitsResult.Stats] = Field(default=None) max_score: Optional[float] = Field(default=None) hits: List[AggregationHitsResult.Details] = Field(default_factory=list) @@ -85,16 +86,9 @@ def get_source_value(self, field: AtlanField) -> Optional[str]: validate_type(name="field", _type=AtlanField, value=field) - if ( - self.nested_results - and SearchableField.EMBEDDED_SOURCE_VALUE in self.nested_results - ): + if self.nested_results and SearchableField.EMBEDDED_SOURCE_VALUE in self.nested_results: result = self.nested_results[SearchableField.EMBEDDED_SOURCE_VALUE] - if ( - isinstance(result, AggregationHitsResult) - and result.hits - and result.hits.hits - ): + if isinstance(result, AggregationHitsResult) and result.hits and result.hits.hits: details = result.hits.hits[0] if details and details.source: if isinstance(field, CustomMetadataField): @@ -134,9 +128,7 @@ def __getitem__(self, item): def get( self, key: str, default=None - ) -> Optional[ - Union[AggregationMetricResult, AggregationBucketResult, AggregationHitsResult] - ]: + ) -> Optional[Union[AggregationMetricResult, AggregationBucketResult, AggregationHitsResult]]: return self.__root__.get(key, default) diff --git a/pyatlan/model/api_tokens.py b/pyatlan/model/api_tokens.py index 60449aaed..08fed94bf 100644 --- a/pyatlan/model/api_tokens.py +++ b/pyatlan/model/api_tokens.py @@ -18,12 +18,8 @@ class Config: description="Unique identifier (GUID) of the linked persona.", alias="id", ) - persona: Optional[str] = Field( - default=None, description="Unique name of the linked persona." - ) - persona_qualified_name: Optional[str] = Field( - default=None, description="Unique qualified_name of the persona" - ) + persona: Optional[str] = Field(default=None, description="Unique name of the linked persona.") + persona_qualified_name: Optional[str] = Field(default=None, description="Unique qualified_name of the persona") class ApiToken(AtlanObject): @@ -43,12 +39,8 @@ class ApiTokenAttributes(AtlanObject): created_at: Optional[int] = Field( description="Epoch time, in milliseconds, at which the API token was created." ) - created_by: Optional[str] = Field( - default=None, description="User who created the API token." - ) - description: Optional[str] = Field( - default=None, description="Explanation of the API token." - ) + created_by: Optional[str] = Field(default=None, description="User who created the API token.") + description: Optional[str] = Field(default=None, description="Explanation of the API token.") display_name: Optional[str] = Field( default=None, description="Human-readable name provided when creating the token.", @@ -71,23 +63,15 @@ class ApiTokenAttributes(AtlanObject): @root_validator(pre=True) def check_embedded_objects(cls, values): - if "workspacePermissions" in values and isinstance( - values["workspacePermissions"], str - ): - values["workspacePermissions"] = json.loads( - values["workspacePermissions"] - ) + if "workspacePermissions" in values and isinstance(values["workspacePermissions"], str): + values["workspacePermissions"] = json.loads(values["workspacePermissions"]) if "personas" in values and isinstance(values["personas"], str): values["personas"] = json.loads(values["personas"]) - if "personaQualifiedName" in values and isinstance( - values["personaQualifiedName"], str - ): + if "personaQualifiedName" in values and isinstance(values["personaQualifiedName"], str): persona_qns = json.loads(values["personaQualifiedName"]) values["personaQualifiedName"] = set() for persona_qn in persona_qns: - values["personaQualifiedName"].add( - ApiTokenPersona(persona_qualified_name=persona_qn) - ) + values["personaQualifiedName"].add(ApiTokenPersona(persona_qualified_name=persona_qn)) return values guid: Optional[str] = Field( @@ -111,19 +95,12 @@ def check_embedded_objects(cls, values): @property def username(self): - return ( - SERVICE_ACCOUNT_ + self.client_id - if self.client_id - else self.attributes.client_id - ) + return SERVICE_ACCOUNT_ + self.client_id if self.client_id else self.attributes.client_id @root_validator(pre=True) def copy_values(cls, values): if "attributes" in values: - if ( - "displayName" in values["attributes"] - and values["attributes"]["displayName"] - ): + if "displayName" in values["attributes"] and values["attributes"]["displayName"]: values["displayName"] = values["attributes"]["displayName"] if "clientId" in values["attributes"] and values["attributes"]["clientId"]: values["clientId"] = values["attributes"]["clientId"] @@ -159,18 +136,14 @@ def set_max_validity(cls, values): if values["validity_seconds"] < 0: values["validity_seconds"] = cls._MAX_VALIDITY else: - values["validity_seconds"] = min( - values["validity_seconds"], cls._MAX_VALIDITY - ) + values["validity_seconds"] = min(values["validity_seconds"], cls._MAX_VALIDITY) if "personas" in values and not values["personas"]: values["personas"] = set() return values class ApiTokenResponse(AtlanObject): - total_record: Optional[int] = Field( - default=None, description="Total number of API tokens." - ) + total_record: Optional[int] = Field(default=None, description="Total number of API tokens.") filter_record: Optional[int] = Field( default=None, description="Number of API records that matched the specified filters.", diff --git a/pyatlan/model/assets/a_d_l_s.py b/pyatlan/model/assets/a_d_l_s.py index 5e10e6a84..e61128c1d 100644 --- a/pyatlan/model/assets/a_d_l_s.py +++ b/pyatlan/model/assets/a_d_l_s.py @@ -52,9 +52,7 @@ def __setattr__(self, name, value): """ Resource identifier of this asset in Azure. """ - AZURE_LOCATION: ClassVar[KeywordField] = KeywordField( - "azureLocation", "azureLocation" - ) + AZURE_LOCATION: ClassVar[KeywordField] = KeywordField("azureLocation", "azureLocation") """ Location of this asset in Azure. """ @@ -80,11 +78,7 @@ def __setattr__(self, name, value): @property def adls_account_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adls_account_qualified_name - ) + return None if self.attributes is None else self.attributes.adls_account_qualified_name @adls_account_qualified_name.setter def adls_account_qualified_name(self, adls_account_qualified_name: Optional[str]): @@ -124,21 +118,13 @@ def azure_location(self, azure_location: Optional[str]): @property def adls_account_secondary_location(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adls_account_secondary_location - ) + return None if self.attributes is None else self.attributes.adls_account_secondary_location @adls_account_secondary_location.setter - def adls_account_secondary_location( - self, adls_account_secondary_location: Optional[str] - ): + def adls_account_secondary_location(self, adls_account_secondary_location: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adls_account_secondary_location = ( - adls_account_secondary_location - ) + self.attributes.adls_account_secondary_location = adls_account_secondary_location @property def azure_tags(self) -> Optional[List[AzureTag]]: @@ -155,9 +141,7 @@ class Attributes(ObjectStore.Attributes): adls_account_name: Optional[str] = Field(default=None, description="") azure_resource_id: Optional[str] = Field(default=None, description="") azure_location: Optional[str] = Field(default=None, description="") - adls_account_secondary_location: Optional[str] = Field( - default=None, description="" - ) + adls_account_secondary_location: Optional[str] = Field(default=None, description="") azure_tags: Optional[List[AzureTag]] = Field(default=None, description="") attributes: ADLS.Attributes = Field( diff --git a/pyatlan/model/assets/a_d_l_s_account.py b/pyatlan/model/assets/a_d_l_s_account.py index b7b9322fc..9ac1fb743 100644 --- a/pyatlan/model/assets/a_d_l_s_account.py +++ b/pyatlan/model/assets/a_d_l_s_account.py @@ -35,28 +35,19 @@ class ADLSAccount(ADLS): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> ADLSAccount: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) - attributes = ADLSAccount.Attributes.create( - name=name, connection_qualified_name=connection_qualified_name - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + attributes = ADLSAccount.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) return cls(attributes=attributes) @classmethod @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> ADLSAccount: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + return cls.creator(name=name, connection_qualified_name=connection_qualified_name) type_name: str = Field(default="ADLSAccount", allow_mutation=False) @@ -75,9 +66,7 @@ def __setattr__(self, name, value): """ Entity tag for the asset. An entity tag is a hash of the object and represents changes to the contents of an object only, not its metadata. """ # noqa: E501 - ADLS_ENCRYPTION_TYPE: ClassVar[KeywordField] = KeywordField( - "adlsEncryptionType", "adlsEncryptionType" - ) + ADLS_ENCRYPTION_TYPE: ClassVar[KeywordField] = KeywordField("adlsEncryptionType", "adlsEncryptionType") """ Type of encryption for this account. """ @@ -97,27 +86,19 @@ def __setattr__(self, name, value): """ Subscription for this account. """ - ADLS_ACCOUNT_PERFORMANCE: ClassVar[KeywordField] = KeywordField( - "adlsAccountPerformance", "adlsAccountPerformance" - ) + ADLS_ACCOUNT_PERFORMANCE: ClassVar[KeywordField] = KeywordField("adlsAccountPerformance", "adlsAccountPerformance") """ Performance of this account. """ - ADLS_ACCOUNT_REPLICATION: ClassVar[KeywordField] = KeywordField( - "adlsAccountReplication", "adlsAccountReplication" - ) + ADLS_ACCOUNT_REPLICATION: ClassVar[KeywordField] = KeywordField("adlsAccountReplication", "adlsAccountReplication") """ Replication of this account. """ - ADLS_ACCOUNT_KIND: ClassVar[KeywordField] = KeywordField( - "adlsAccountKind", "adlsAccountKind" - ) + ADLS_ACCOUNT_KIND: ClassVar[KeywordField] = KeywordField("adlsAccountKind", "adlsAccountKind") """ Kind of this account. """ - ADLS_PRIMARY_DISK_STATE: ClassVar[KeywordField] = KeywordField( - "adlsPrimaryDiskState", "adlsPrimaryDiskState" - ) + ADLS_PRIMARY_DISK_STATE: ClassVar[KeywordField] = KeywordField("adlsPrimaryDiskState", "adlsPrimaryDiskState") """ Primary disk state of this account. """ @@ -127,9 +108,7 @@ def __setattr__(self, name, value): """ Provision state of this account. """ - ADLS_ACCOUNT_ACCESS_TIER: ClassVar[KeywordField] = KeywordField( - "adlsAccountAccessTier", "adlsAccountAccessTier" - ) + ADLS_ACCOUNT_ACCESS_TIER: ClassVar[KeywordField] = KeywordField("adlsAccountAccessTier", "adlsAccountAccessTier") """ Access tier of this account. """ @@ -175,11 +154,7 @@ def adls_encryption_type(self, adls_encryption_type: Optional[ADLSEncryptionType @property def adls_account_resource_group(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adls_account_resource_group - ) + return None if self.attributes is None else self.attributes.adls_account_resource_group @adls_account_resource_group.setter def adls_account_resource_group(self, adls_account_resource_group: Optional[str]): @@ -189,11 +164,7 @@ def adls_account_resource_group(self, adls_account_resource_group: Optional[str] @property def adls_account_subscription(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adls_account_subscription - ) + return None if self.attributes is None else self.attributes.adls_account_subscription @adls_account_subscription.setter def adls_account_subscription(self, adls_account_subscription: Optional[str]): @@ -203,32 +174,20 @@ def adls_account_subscription(self, adls_account_subscription: Optional[str]): @property def adls_account_performance(self) -> Optional[ADLSPerformance]: - return ( - None - if self.attributes is None - else self.attributes.adls_account_performance - ) + return None if self.attributes is None else self.attributes.adls_account_performance @adls_account_performance.setter - def adls_account_performance( - self, adls_account_performance: Optional[ADLSPerformance] - ): + def adls_account_performance(self, adls_account_performance: Optional[ADLSPerformance]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_account_performance = adls_account_performance @property def adls_account_replication(self) -> Optional[ADLSReplicationType]: - return ( - None - if self.attributes is None - else self.attributes.adls_account_replication - ) + return None if self.attributes is None else self.attributes.adls_account_replication @adls_account_replication.setter - def adls_account_replication( - self, adls_account_replication: Optional[ADLSReplicationType] - ): + def adls_account_replication(self, adls_account_replication: Optional[ADLSReplicationType]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_account_replication = adls_account_replication @@ -245,46 +204,30 @@ def adls_account_kind(self, adls_account_kind: Optional[ADLSStorageKind]): @property def adls_primary_disk_state(self) -> Optional[ADLSAccountStatus]: - return ( - None if self.attributes is None else self.attributes.adls_primary_disk_state - ) + return None if self.attributes is None else self.attributes.adls_primary_disk_state @adls_primary_disk_state.setter - def adls_primary_disk_state( - self, adls_primary_disk_state: Optional[ADLSAccountStatus] - ): + def adls_primary_disk_state(self, adls_primary_disk_state: Optional[ADLSAccountStatus]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_primary_disk_state = adls_primary_disk_state @property def adls_account_provision_state(self) -> Optional[ADLSProvisionState]: - return ( - None - if self.attributes is None - else self.attributes.adls_account_provision_state - ) + return None if self.attributes is None else self.attributes.adls_account_provision_state @adls_account_provision_state.setter - def adls_account_provision_state( - self, adls_account_provision_state: Optional[ADLSProvisionState] - ): + def adls_account_provision_state(self, adls_account_provision_state: Optional[ADLSProvisionState]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_account_provision_state = adls_account_provision_state @property def adls_account_access_tier(self) -> Optional[ADLSAccessTier]: - return ( - None - if self.attributes is None - else self.attributes.adls_account_access_tier - ) + return None if self.attributes is None else self.attributes.adls_account_access_tier @adls_account_access_tier.setter - def adls_account_access_tier( - self, adls_account_access_tier: Optional[ADLSAccessTier] - ): + def adls_account_access_tier(self, adls_account_access_tier: Optional[ADLSAccessTier]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_account_access_tier = adls_account_access_tier @@ -301,48 +244,26 @@ def adls_containers(self, adls_containers: Optional[List[ADLSContainer]]): class Attributes(ADLS.Attributes): adls_e_tag: Optional[str] = Field(default=None, description="") - adls_encryption_type: Optional[ADLSEncryptionTypes] = Field( - default=None, description="" - ) + adls_encryption_type: Optional[ADLSEncryptionTypes] = Field(default=None, description="") adls_account_resource_group: Optional[str] = Field(default=None, description="") adls_account_subscription: Optional[str] = Field(default=None, description="") - adls_account_performance: Optional[ADLSPerformance] = Field( - default=None, description="" - ) - adls_account_replication: Optional[ADLSReplicationType] = Field( - default=None, description="" - ) - adls_account_kind: Optional[ADLSStorageKind] = Field( - default=None, description="" - ) - adls_primary_disk_state: Optional[ADLSAccountStatus] = Field( - default=None, description="" - ) - adls_account_provision_state: Optional[ADLSProvisionState] = Field( - default=None, description="" - ) - adls_account_access_tier: Optional[ADLSAccessTier] = Field( - default=None, description="" - ) - adls_containers: Optional[List[ADLSContainer]] = Field( - default=None, description="" - ) # relationship + adls_account_performance: Optional[ADLSPerformance] = Field(default=None, description="") + adls_account_replication: Optional[ADLSReplicationType] = Field(default=None, description="") + adls_account_kind: Optional[ADLSStorageKind] = Field(default=None, description="") + adls_primary_disk_state: Optional[ADLSAccountStatus] = Field(default=None, description="") + adls_account_provision_state: Optional[ADLSProvisionState] = Field(default=None, description="") + adls_account_access_tier: Optional[ADLSAccessTier] = Field(default=None, description="") + adls_containers: Optional[List[ADLSContainer]] = Field(default=None, description="") # relationship @classmethod @init_guid - def create( - cls, *, name: str, connection_qualified_name: str - ) -> ADLSAccount.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + def create(cls, *, name: str, connection_qualified_name: str) -> ADLSAccount.Attributes: + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return ADLSAccount.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: ADLSAccount.Attributes = Field( diff --git a/pyatlan/model/assets/a_d_l_s_container.py b/pyatlan/model/assets/a_d_l_s_container.py index 055c19add..afd6e03a7 100644 --- a/pyatlan/model/assets/a_d_l_s_container.py +++ b/pyatlan/model/assets/a_d_l_s_container.py @@ -53,9 +53,7 @@ def creator( adls_account_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> ADLSContainer: - validate_required_fields( - ["name", "adls_account_qualified_name"], [name, adls_account_qualified_name] - ) + validate_required_fields(["name", "adls_account_qualified_name"], [name, adls_account_qualified_name]) attributes = ADLSContainer.Attributes.create( name=name, adls_account_qualified_name=adls_account_qualified_name, @@ -67,16 +65,11 @@ def creator( @init_guid def create(cls, *, name: str, adls_account_qualified_name: str) -> ADLSContainer: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, adls_account_qualified_name=adls_account_qualified_name - ) + return cls.creator(name=name, adls_account_qualified_name=adls_account_qualified_name) type_name: str = Field(default="ADLSContainer", allow_mutation=False) @@ -115,18 +108,14 @@ def __setattr__(self, name, value): """ Encryption scope of this container. """ - ADLS_CONTAINER_VERSION_LEVEL_IMMUTABILITY_SUPPORT: ClassVar[BooleanField] = ( - BooleanField( - "adlsContainerVersionLevelImmutabilitySupport", - "adlsContainerVersionLevelImmutabilitySupport", - ) + ADLS_CONTAINER_VERSION_LEVEL_IMMUTABILITY_SUPPORT: ClassVar[BooleanField] = BooleanField( + "adlsContainerVersionLevelImmutabilitySupport", + "adlsContainerVersionLevelImmutabilitySupport", ) """ Whether this container supports version-level immutability (true) or not (false). """ - ADLS_OBJECT_COUNT: ClassVar[NumericField] = NumericField( - "adlsObjectCount", "adlsObjectCount" - ) + ADLS_OBJECT_COUNT: ClassVar[NumericField] = NumericField("adlsObjectCount", "adlsObjectCount") """ Number of objects that exist within this container. """ @@ -163,61 +152,37 @@ def adls_container_url(self, adls_container_url: Optional[str]): @property def adls_container_lease_state(self) -> Optional[ADLSLeaseState]: - return ( - None - if self.attributes is None - else self.attributes.adls_container_lease_state - ) + return None if self.attributes is None else self.attributes.adls_container_lease_state @adls_container_lease_state.setter - def adls_container_lease_state( - self, adls_container_lease_state: Optional[ADLSLeaseState] - ): + def adls_container_lease_state(self, adls_container_lease_state: Optional[ADLSLeaseState]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_container_lease_state = adls_container_lease_state @property def adls_container_lease_status(self) -> Optional[ADLSLeaseStatus]: - return ( - None - if self.attributes is None - else self.attributes.adls_container_lease_status - ) + return None if self.attributes is None else self.attributes.adls_container_lease_status @adls_container_lease_status.setter - def adls_container_lease_status( - self, adls_container_lease_status: Optional[ADLSLeaseStatus] - ): + def adls_container_lease_status(self, adls_container_lease_status: Optional[ADLSLeaseStatus]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_container_lease_status = adls_container_lease_status @property def adls_container_encryption_scope(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adls_container_encryption_scope - ) + return None if self.attributes is None else self.attributes.adls_container_encryption_scope @adls_container_encryption_scope.setter - def adls_container_encryption_scope( - self, adls_container_encryption_scope: Optional[str] - ): + def adls_container_encryption_scope(self, adls_container_encryption_scope: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adls_container_encryption_scope = ( - adls_container_encryption_scope - ) + self.attributes.adls_container_encryption_scope = adls_container_encryption_scope @property def adls_container_version_level_immutability_support(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.adls_container_version_level_immutability_support - ) + return None if self.attributes is None else self.attributes.adls_container_version_level_immutability_support @adls_container_version_level_immutability_support.setter def adls_container_version_level_immutability_support( @@ -261,25 +226,13 @@ def adls_objects(self, adls_objects: Optional[List[ADLSObject]]): class Attributes(ADLS.Attributes): adls_container_url: Optional[str] = Field(default=None, description="") - adls_container_lease_state: Optional[ADLSLeaseState] = Field( - default=None, description="" - ) - adls_container_lease_status: Optional[ADLSLeaseStatus] = Field( - default=None, description="" - ) - adls_container_encryption_scope: Optional[str] = Field( - default=None, description="" - ) - adls_container_version_level_immutability_support: Optional[bool] = Field( - default=None, description="" - ) + adls_container_lease_state: Optional[ADLSLeaseState] = Field(default=None, description="") + adls_container_lease_status: Optional[ADLSLeaseStatus] = Field(default=None, description="") + adls_container_encryption_scope: Optional[str] = Field(default=None, description="") + adls_container_version_level_immutability_support: Optional[bool] = Field(default=None, description="") adls_object_count: Optional[int] = Field(default=None, description="") - adls_account: Optional[ADLSAccount] = Field( - default=None, description="" - ) # relationship - adls_objects: Optional[List[ADLSObject]] = Field( - default=None, description="" - ) # relationship + adls_account: Optional[ADLSAccount] = Field(default=None, description="") # relationship + adls_objects: Optional[List[ADLSObject]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -295,9 +248,7 @@ def create( [name, adls_account_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( adls_account_qualified_name, "adls_account_qualified_name", 4 @@ -306,9 +257,7 @@ def create( return ADLSContainer.Attributes( name=name, qualified_name=f"{adls_account_qualified_name}/{name}", - adls_account=ADLSAccount.ref_by_qualified_name( - adls_account_qualified_name - ), + adls_account=ADLSAccount.ref_by_qualified_name(adls_account_qualified_name), adls_account_qualified_name=adls_account_qualified_name, adls_account_name=adls_account_qualified_name.split("/")[-1], connector_name=connector_name, diff --git a/pyatlan/model/assets/a_d_l_s_object.py b/pyatlan/model/assets/a_d_l_s_object.py index b917ea8ba..6efefa443 100644 --- a/pyatlan/model/assets/a_d_l_s_object.py +++ b/pyatlan/model/assets/a_d_l_s_object.py @@ -85,16 +85,11 @@ def create( adls_container_qualified_name: str, ) -> ADLSObject: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, adls_container_qualified_name=adls_container_qualified_name - ) + return cls.creator(name=name, adls_container_qualified_name=adls_container_qualified_name) type_name: str = Field(default="ADLSObject", allow_mutation=False) @@ -115,27 +110,19 @@ def __setattr__(self, name, value): """ URL of this object. """ - ADLS_OBJECT_VERSION_ID: ClassVar[KeywordField] = KeywordField( - "adlsObjectVersionId", "adlsObjectVersionId" - ) + ADLS_OBJECT_VERSION_ID: ClassVar[KeywordField] = KeywordField("adlsObjectVersionId", "adlsObjectVersionId") """ Identifier of the version of this object, from ADLS. """ - ADLS_OBJECT_TYPE: ClassVar[KeywordField] = KeywordField( - "adlsObjectType", "adlsObjectType" - ) + ADLS_OBJECT_TYPE: ClassVar[KeywordField] = KeywordField("adlsObjectType", "adlsObjectType") """ Type of this object. """ - ADLS_OBJECT_SIZE: ClassVar[NumericField] = NumericField( - "adlsObjectSize", "adlsObjectSize" - ) + ADLS_OBJECT_SIZE: ClassVar[NumericField] = NumericField("adlsObjectSize", "adlsObjectSize") """ Size of this object. """ - ADLS_OBJECT_ACCESS_TIER: ClassVar[KeywordField] = KeywordField( - "adlsObjectAccessTier", "adlsObjectAccessTier" - ) + ADLS_OBJECT_ACCESS_TIER: ClassVar[KeywordField] = KeywordField("adlsObjectAccessTier", "adlsObjectAccessTier") """ Access tier of this object. """ @@ -157,24 +144,18 @@ def __setattr__(self, name, value): """ Whether this object is server encrypted (true) or not (false). """ - ADLS_OBJECT_VERSION_LEVEL_IMMUTABILITY_SUPPORT: ClassVar[BooleanField] = ( - BooleanField( - "adlsObjectVersionLevelImmutabilitySupport", - "adlsObjectVersionLevelImmutabilitySupport", - ) + ADLS_OBJECT_VERSION_LEVEL_IMMUTABILITY_SUPPORT: ClassVar[BooleanField] = BooleanField( + "adlsObjectVersionLevelImmutabilitySupport", + "adlsObjectVersionLevelImmutabilitySupport", ) """ Whether this object supports version-level immutability (true) or not (false). """ - ADLS_OBJECT_CACHE_CONTROL: ClassVar[TextField] = TextField( - "adlsObjectCacheControl", "adlsObjectCacheControl" - ) + ADLS_OBJECT_CACHE_CONTROL: ClassVar[TextField] = TextField("adlsObjectCacheControl", "adlsObjectCacheControl") """ Cache control of this object. """ - ADLS_OBJECT_CONTENT_TYPE: ClassVar[TextField] = TextField( - "adlsObjectContentType", "adlsObjectContentType" - ) + ADLS_OBJECT_CONTENT_TYPE: ClassVar[TextField] = TextField("adlsObjectContentType", "adlsObjectContentType") """ Content type of this object. """ @@ -192,21 +173,15 @@ def __setattr__(self, name, value): """ Language of this object's contents. """ - ADLS_OBJECT_LEASE_STATUS: ClassVar[KeywordField] = KeywordField( - "adlsObjectLeaseStatus", "adlsObjectLeaseStatus" - ) + ADLS_OBJECT_LEASE_STATUS: ClassVar[KeywordField] = KeywordField("adlsObjectLeaseStatus", "adlsObjectLeaseStatus") """ Status of this object's lease. """ - ADLS_OBJECT_LEASE_STATE: ClassVar[KeywordField] = KeywordField( - "adlsObjectLeaseState", "adlsObjectLeaseState" - ) + ADLS_OBJECT_LEASE_STATE: ClassVar[KeywordField] = KeywordField("adlsObjectLeaseState", "adlsObjectLeaseState") """ State of this object's lease. """ - ADLS_OBJECT_METADATA: ClassVar[KeywordField] = KeywordField( - "adlsObjectMetadata", "adlsObjectMetadata" - ) + ADLS_OBJECT_METADATA: ClassVar[KeywordField] = KeywordField("adlsObjectMetadata", "adlsObjectMetadata") """ Metadata associated with this object, from ADLS. """ @@ -266,9 +241,7 @@ def adls_object_url(self, adls_object_url: Optional[str]): @property def adls_object_version_id(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.adls_object_version_id - ) + return None if self.attributes is None else self.attributes.adls_object_version_id @adls_object_version_id.setter def adls_object_version_id(self, adls_object_version_id: Optional[str]): @@ -298,25 +271,17 @@ def adls_object_size(self, adls_object_size: Optional[int]): @property def adls_object_access_tier(self) -> Optional[ADLSAccessTier]: - return ( - None if self.attributes is None else self.attributes.adls_object_access_tier - ) + return None if self.attributes is None else self.attributes.adls_object_access_tier @adls_object_access_tier.setter - def adls_object_access_tier( - self, adls_object_access_tier: Optional[ADLSAccessTier] - ): + def adls_object_access_tier(self, adls_object_access_tier: Optional[ADLSAccessTier]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_access_tier = adls_object_access_tier @property def adls_object_access_tier_last_modified_time(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.adls_object_access_tier_last_modified_time - ) + return None if self.attributes is None else self.attributes.adls_object_access_tier_last_modified_time @adls_object_access_tier_last_modified_time.setter def adls_object_access_tier_last_modified_time( @@ -324,49 +289,31 @@ def adls_object_access_tier_last_modified_time( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adls_object_access_tier_last_modified_time = ( - adls_object_access_tier_last_modified_time - ) + self.attributes.adls_object_access_tier_last_modified_time = adls_object_access_tier_last_modified_time @property def adls_object_archive_status(self) -> Optional[ADLSObjectArchiveStatus]: - return ( - None - if self.attributes is None - else self.attributes.adls_object_archive_status - ) + return None if self.attributes is None else self.attributes.adls_object_archive_status @adls_object_archive_status.setter - def adls_object_archive_status( - self, adls_object_archive_status: Optional[ADLSObjectArchiveStatus] - ): + def adls_object_archive_status(self, adls_object_archive_status: Optional[ADLSObjectArchiveStatus]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_archive_status = adls_object_archive_status @property def adls_object_server_encrypted(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.adls_object_server_encrypted - ) + return None if self.attributes is None else self.attributes.adls_object_server_encrypted @adls_object_server_encrypted.setter - def adls_object_server_encrypted( - self, adls_object_server_encrypted: Optional[bool] - ): + def adls_object_server_encrypted(self, adls_object_server_encrypted: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_server_encrypted = adls_object_server_encrypted @property def adls_object_version_level_immutability_support(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.adls_object_version_level_immutability_support - ) + return None if self.attributes is None else self.attributes.adls_object_version_level_immutability_support @adls_object_version_level_immutability_support.setter def adls_object_version_level_immutability_support( @@ -374,17 +321,11 @@ def adls_object_version_level_immutability_support( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adls_object_version_level_immutability_support = ( - adls_object_version_level_immutability_support - ) + self.attributes.adls_object_version_level_immutability_support = adls_object_version_level_immutability_support @property def adls_object_cache_control(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adls_object_cache_control - ) + return None if self.attributes is None else self.attributes.adls_object_cache_control @adls_object_cache_control.setter def adls_object_cache_control(self, adls_object_cache_control: Optional[str]): @@ -394,11 +335,7 @@ def adls_object_cache_control(self, adls_object_cache_control: Optional[str]): @property def adls_object_content_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adls_object_content_type - ) + return None if self.attributes is None else self.attributes.adls_object_content_type @adls_object_content_type.setter def adls_object_content_type(self, adls_object_content_type: Optional[str]): @@ -408,27 +345,17 @@ def adls_object_content_type(self, adls_object_content_type: Optional[str]): @property def adls_object_content_m_d5_hash(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adls_object_content_m_d5_hash - ) + return None if self.attributes is None else self.attributes.adls_object_content_m_d5_hash @adls_object_content_m_d5_hash.setter - def adls_object_content_m_d5_hash( - self, adls_object_content_m_d5_hash: Optional[str] - ): + def adls_object_content_m_d5_hash(self, adls_object_content_m_d5_hash: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_content_m_d5_hash = adls_object_content_m_d5_hash @property def adls_object_content_language(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adls_object_content_language - ) + return None if self.attributes is None else self.attributes.adls_object_content_language @adls_object_content_language.setter def adls_object_content_language(self, adls_object_content_language: Optional[str]): @@ -438,30 +365,20 @@ def adls_object_content_language(self, adls_object_content_language: Optional[st @property def adls_object_lease_status(self) -> Optional[ADLSLeaseStatus]: - return ( - None - if self.attributes is None - else self.attributes.adls_object_lease_status - ) + return None if self.attributes is None else self.attributes.adls_object_lease_status @adls_object_lease_status.setter - def adls_object_lease_status( - self, adls_object_lease_status: Optional[ADLSLeaseStatus] - ): + def adls_object_lease_status(self, adls_object_lease_status: Optional[ADLSLeaseStatus]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_lease_status = adls_object_lease_status @property def adls_object_lease_state(self) -> Optional[ADLSLeaseState]: - return ( - None if self.attributes is None else self.attributes.adls_object_lease_state - ) + return None if self.attributes is None else self.attributes.adls_object_lease_state @adls_object_lease_state.setter - def adls_object_lease_state( - self, adls_object_lease_state: Optional[ADLSLeaseState] - ): + def adls_object_lease_state(self, adls_object_lease_state: Optional[ADLSLeaseState]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_lease_state = adls_object_lease_state @@ -478,16 +395,10 @@ def adls_object_metadata(self, adls_object_metadata: Optional[Dict[str, str]]): @property def adls_container_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adls_container_qualified_name - ) + return None if self.attributes is None else self.attributes.adls_container_qualified_name @adls_container_qualified_name.setter - def adls_container_qualified_name( - self, adls_container_qualified_name: Optional[str] - ): + def adls_container_qualified_name(self, adls_container_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_container_qualified_name = adls_container_qualified_name @@ -517,45 +428,21 @@ class Attributes(ADLS.Attributes): adls_object_version_id: Optional[str] = Field(default=None, description="") adls_object_type: Optional[ADLSObjectType] = Field(default=None, description="") adls_object_size: Optional[int] = Field(default=None, description="") - adls_object_access_tier: Optional[ADLSAccessTier] = Field( - default=None, description="" - ) - adls_object_access_tier_last_modified_time: Optional[datetime] = Field( - default=None, description="" - ) - adls_object_archive_status: Optional[ADLSObjectArchiveStatus] = Field( - default=None, description="" - ) - adls_object_server_encrypted: Optional[bool] = Field( - default=None, description="" - ) - adls_object_version_level_immutability_support: Optional[bool] = Field( - default=None, description="" - ) + adls_object_access_tier: Optional[ADLSAccessTier] = Field(default=None, description="") + adls_object_access_tier_last_modified_time: Optional[datetime] = Field(default=None, description="") + adls_object_archive_status: Optional[ADLSObjectArchiveStatus] = Field(default=None, description="") + adls_object_server_encrypted: Optional[bool] = Field(default=None, description="") + adls_object_version_level_immutability_support: Optional[bool] = Field(default=None, description="") adls_object_cache_control: Optional[str] = Field(default=None, description="") adls_object_content_type: Optional[str] = Field(default=None, description="") - adls_object_content_m_d5_hash: Optional[str] = Field( - default=None, description="" - ) - adls_object_content_language: Optional[str] = Field( - default=None, description="" - ) - adls_object_lease_status: Optional[ADLSLeaseStatus] = Field( - default=None, description="" - ) - adls_object_lease_state: Optional[ADLSLeaseState] = Field( - default=None, description="" - ) - adls_object_metadata: Optional[Dict[str, str]] = Field( - default=None, description="" - ) - adls_container_qualified_name: Optional[str] = Field( - default=None, description="" - ) + adls_object_content_m_d5_hash: Optional[str] = Field(default=None, description="") + adls_object_content_language: Optional[str] = Field(default=None, description="") + adls_object_lease_status: Optional[ADLSLeaseStatus] = Field(default=None, description="") + adls_object_lease_state: Optional[ADLSLeaseState] = Field(default=None, description="") + adls_object_metadata: Optional[Dict[str, str]] = Field(default=None, description="") + adls_container_qualified_name: Optional[str] = Field(default=None, description="") adls_container_name: Optional[str] = Field(default=None, description="") - adls_container: Optional[ADLSContainer] = Field( - default=None, description="" - ) # relationship + adls_container: Optional[ADLSContainer] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -572,16 +459,13 @@ def create( [name, adls_container_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( adls_container_qualified_name, "adls_container_qualified_name", 5 ) - adls_account_qualified_name = ( - adls_account_qualified_name - or get_parent_qualified_name(adls_container_qualified_name) + adls_account_qualified_name = adls_account_qualified_name or get_parent_qualified_name( + adls_container_qualified_name ) return ADLSObject.Attributes( name=name, @@ -590,9 +474,7 @@ def create( qualified_name=f"{adls_container_qualified_name}/{name}", connector_name=connector_name, connection_qualified_name=connection_qualified_name or connection_qn, - adls_container=ADLSContainer.ref_by_qualified_name( - adls_container_qualified_name - ), + adls_container=ADLSContainer.ref_by_qualified_name(adls_container_qualified_name), adls_account_qualified_name=adls_account_qualified_name, adls_account_name=adls_account_qualified_name.split("/")[-1], ) diff --git a/pyatlan/model/assets/a_p_i.py b/pyatlan/model/assets/a_p_i.py index e71226a9f..8d0f36cff 100644 --- a/pyatlan/model/assets/a_p_i.py +++ b/pyatlan/model/assets/a_p_i.py @@ -37,15 +37,11 @@ def __setattr__(self, name, value): """ Type of API, for example: OpenAPI, GraphQL, etc. """ - API_SPEC_VERSION: ClassVar[KeywordField] = KeywordField( - "apiSpecVersion", "apiSpecVersion" - ) + API_SPEC_VERSION: ClassVar[KeywordField] = KeywordField("apiSpecVersion", "apiSpecVersion") """ Version of the API specification. """ - API_SPEC_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "apiSpecName", "apiSpecName.keyword", "apiSpecName" - ) + API_SPEC_NAME: ClassVar[KeywordTextField] = KeywordTextField("apiSpecName", "apiSpecName.keyword", "apiSpecName") """ Simple name of the API spec, if this asset is contained in an API spec. """ @@ -55,27 +51,19 @@ def __setattr__(self, name, value): """ Unique name of the API spec, if this asset is contained in an API spec. """ - API_EXTERNAL_DOCS: ClassVar[KeywordField] = KeywordField( - "apiExternalDocs", "apiExternalDocs" - ) + API_EXTERNAL_DOCS: ClassVar[KeywordField] = KeywordField("apiExternalDocs", "apiExternalDocs") """ External documentation of the API. """ - API_IS_AUTH_OPTIONAL: ClassVar[BooleanField] = BooleanField( - "apiIsAuthOptional", "apiIsAuthOptional" - ) + API_IS_AUTH_OPTIONAL: ClassVar[BooleanField] = BooleanField("apiIsAuthOptional", "apiIsAuthOptional") """ Whether authentication is optional (true) or required (false). """ - API_IS_OBJECT_REFERENCE: ClassVar[BooleanField] = BooleanField( - "apiIsObjectReference", "apiIsObjectReference" - ) + API_IS_OBJECT_REFERENCE: ClassVar[BooleanField] = BooleanField("apiIsObjectReference", "apiIsObjectReference") """ If this asset refers to an APIObject """ - API_OBJECT_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "apiObjectQualifiedName", "apiObjectQualifiedName" - ) + API_OBJECT_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("apiObjectQualifiedName", "apiObjectQualifiedName") """ Qualified name of the APIObject that is referred to by this asset. When apiIsObjectReference is true. """ @@ -123,9 +111,7 @@ def api_spec_name(self, api_spec_name: Optional[str]): @property def api_spec_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.api_spec_qualified_name - ) + return None if self.attributes is None else self.attributes.api_spec_qualified_name @api_spec_qualified_name.setter def api_spec_qualified_name(self, api_spec_qualified_name: Optional[str]): @@ -155,9 +141,7 @@ def api_is_auth_optional(self, api_is_auth_optional: Optional[bool]): @property def api_is_object_reference(self) -> Optional[bool]: - return ( - None if self.attributes is None else self.attributes.api_is_object_reference - ) + return None if self.attributes is None else self.attributes.api_is_object_reference @api_is_object_reference.setter def api_is_object_reference(self, api_is_object_reference: Optional[bool]): @@ -167,11 +151,7 @@ def api_is_object_reference(self, api_is_object_reference: Optional[bool]): @property def api_object_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.api_object_qualified_name - ) + return None if self.attributes is None else self.attributes.api_object_qualified_name @api_object_qualified_name.setter def api_object_qualified_name(self, api_object_qualified_name: Optional[str]): @@ -184,9 +164,7 @@ class Attributes(Catalog.Attributes): api_spec_version: Optional[str] = Field(default=None, description="") api_spec_name: Optional[str] = Field(default=None, description="") api_spec_qualified_name: Optional[str] = Field(default=None, description="") - api_external_docs: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + api_external_docs: Optional[Dict[str, str]] = Field(default=None, description="") api_is_auth_optional: Optional[bool] = Field(default=None, description="") api_is_object_reference: Optional[bool] = Field(default=None, description="") api_object_qualified_name: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/a_p_i_field.py b/pyatlan/model/assets/a_p_i_field.py index b7143e396..d42753431 100644 --- a/pyatlan/model/assets/a_p_i_field.py +++ b/pyatlan/model/assets/a_p_i_field.py @@ -126,12 +126,10 @@ def creator( validate_required_fields(["name"], [name]) # valid checker - for either to have a value ONLY if parent_api_object_qualified_name is None or ( - isinstance(parent_api_object_qualified_name, str) - and not parent_api_object_qualified_name.strip() + isinstance(parent_api_object_qualified_name, str) and not parent_api_object_qualified_name.strip() ): if parent_api_query_qualified_name is None or ( - isinstance(parent_api_query_qualified_name, str) - and not parent_api_query_qualified_name.strip() + isinstance(parent_api_query_qualified_name, str) and not parent_api_query_qualified_name.strip() ): raise ValueError( ( @@ -139,10 +137,7 @@ def creator( "parent_api_query_qualified_name requires a valid value" ) ) - elif ( - isinstance(parent_api_query_qualified_name, str) - and parent_api_query_qualified_name.strip() - ): + elif isinstance(parent_api_query_qualified_name, str) and parent_api_query_qualified_name.strip(): raise ValueError( "Both parent_api_object_qualified_name and parent_api_query_qualified_name cannot be valid" ) @@ -150,21 +145,16 @@ def creator( # is api object reference - checker if is_api_object_reference: if not reference_api_object_qualified_name or ( - isinstance(reference_api_object_qualified_name, str) - and not reference_api_object_qualified_name.strip() + isinstance(reference_api_object_qualified_name, str) and not reference_api_object_qualified_name.strip() ): - raise ValueError( - "Set valid qualified name for reference_api_object_qualified_name" - ) + raise ValueError("Set valid qualified name for reference_api_object_qualified_name") else: if ( reference_api_object_qualified_name and isinstance(reference_api_object_qualified_name, str) and reference_api_object_qualified_name.strip() ): - raise ValueError( - "Set is_api_object_reference to true to set reference_api_object_qualified_name" - ) + raise ValueError("Set is_api_object_reference to true to set reference_api_object_qualified_name") attributes = APIField.Attributes.creator( name=name, @@ -192,21 +182,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - API_FIELD_TYPE: ClassVar[KeywordField] = KeywordField( - "apiFieldType", "apiFieldType" - ) + API_FIELD_TYPE: ClassVar[KeywordField] = KeywordField("apiFieldType", "apiFieldType") """ Type of APIField. E.g. STRING, NUMBER etc. It is free text. """ - API_FIELD_TYPE_SECONDARY: ClassVar[KeywordField] = KeywordField( - "apiFieldTypeSecondary", "apiFieldTypeSecondary" - ) + API_FIELD_TYPE_SECONDARY: ClassVar[KeywordField] = KeywordField("apiFieldTypeSecondary", "apiFieldTypeSecondary") """ Secondary Type of APIField. E.g. LIST/STRING, then LIST would be the secondary type. """ - API_QUERY_PARAM_TYPE: ClassVar[KeywordField] = KeywordField( - "apiQueryParamType", "apiQueryParamType" - ) + API_QUERY_PARAM_TYPE: ClassVar[KeywordField] = KeywordField("apiQueryParamType", "apiQueryParamType") """ If parent relationship type is APIQuery, then this attribute denotes if this is input or output parameter. """ @@ -240,11 +224,7 @@ def api_field_type(self, api_field_type: Optional[str]): @property def api_field_type_secondary(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.api_field_type_secondary - ) + return None if self.attributes is None else self.attributes.api_field_type_secondary @api_field_type_secondary.setter def api_field_type_secondary(self, api_field_type_secondary: Optional[str]): @@ -257,9 +237,7 @@ def api_query_param_type(self) -> Optional[APIQueryParamTypeEnum]: return None if self.attributes is None else self.attributes.api_query_param_type @api_query_param_type.setter - def api_query_param_type( - self, api_query_param_type: Optional[APIQueryParamTypeEnum] - ): + def api_query_param_type(self, api_query_param_type: Optional[APIQueryParamTypeEnum]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.api_query_param_type = api_query_param_type @@ -287,15 +265,9 @@ def api_object(self, api_object: Optional[APIObject]): class Attributes(API.Attributes): api_field_type: Optional[str] = Field(default=None, description="") api_field_type_secondary: Optional[str] = Field(default=None, description="") - api_query_param_type: Optional[APIQueryParamTypeEnum] = Field( - default=None, description="" - ) - api_query: Optional[APIQuery] = Field( - default=None, description="" - ) # relationship - api_object: Optional[APIObject] = Field( - default=None, description="" - ) # relationship + api_query_param_type: Optional[APIQueryParamTypeEnum] = Field(default=None, description="") + api_query: Optional[APIQuery] = Field(default=None, description="") # relationship + api_object: Optional[APIObject] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -314,12 +286,10 @@ def creator( ) -> APIField.Attributes: validate_required_fields(["name"], [name]) if parent_api_object_qualified_name is None or ( - isinstance(parent_api_object_qualified_name, str) - and not parent_api_object_qualified_name.strip() + isinstance(parent_api_object_qualified_name, str) and not parent_api_object_qualified_name.strip() ): if parent_api_query_qualified_name is None or ( - isinstance(parent_api_query_qualified_name, str) - and not parent_api_query_qualified_name.strip() + isinstance(parent_api_query_qualified_name, str) and not parent_api_query_qualified_name.strip() ): raise ValueError( ( @@ -327,10 +297,7 @@ def creator( "parent_api_query_qualified_name requires a valid value" ) ) - elif ( - isinstance(parent_api_query_qualified_name, str) - and parent_api_query_qualified_name.strip() - ): + elif isinstance(parent_api_query_qualified_name, str) and parent_api_query_qualified_name.strip(): raise ValueError( "Both parent_api_object_qualified_name and parent_api_query_qualified_name cannot be valid" ) @@ -340,24 +307,18 @@ def creator( isinstance(reference_api_object_qualified_name, str) and not reference_api_object_qualified_name.strip() ): - raise ValueError( - "Set valid qualified name for reference_api_object_qualified_name" - ) + raise ValueError("Set valid qualified name for reference_api_object_qualified_name") else: if ( reference_api_object_qualified_name and isinstance(reference_api_object_qualified_name, str) and reference_api_object_qualified_name.strip() ): - raise ValueError( - "Set is_api_object_reference to true to set reference_api_object_qualified_name" - ) + raise ValueError("Set is_api_object_reference to true to set reference_api_object_qualified_name") # connector-name if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) connection_qn = connection_qualified_name elif parent_api_object_qualified_name: connection_qn, connector_name = AtlanConnectorType.get_connector_name( @@ -382,13 +343,9 @@ def creator( api_field_type_secondary=api_field_type_secondary, api_is_object_reference=is_api_object_reference, api_object_qualified_name=( - reference_api_object_qualified_name - if is_api_object_reference - else None - ), - api_object=APIObject.ref_by_qualified_name( - str(parent_api_object_qualified_name) + reference_api_object_qualified_name if is_api_object_reference else None ), + api_object=APIObject.ref_by_qualified_name(str(parent_api_object_qualified_name)), api_query_param_type=api_query_param_type, ) else: @@ -401,13 +358,9 @@ def creator( api_field_type_secondary=api_field_type_secondary, api_is_object_reference=is_api_object_reference, api_object_qualified_name=( - reference_api_object_qualified_name - if is_api_object_reference - else None - ), - api_query=APIQuery.ref_by_qualified_name( - str(parent_api_query_qualified_name) + reference_api_object_qualified_name if is_api_object_reference else None ), + api_query=APIQuery.ref_by_qualified_name(str(parent_api_query_qualified_name)), api_query_param_type=api_query_param_type, ) diff --git a/pyatlan/model/assets/a_p_i_object.py b/pyatlan/model/assets/a_p_i_object.py index 95812bf67..202028836 100644 --- a/pyatlan/model/assets/a_p_i_object.py +++ b/pyatlan/model/assets/a_p_i_object.py @@ -46,9 +46,7 @@ def creator( connection_qualified_name: str, api_field_count: Optional[int] = None, ) -> APIObject: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) attributes = APIObject.Attributes.creator( name=name, connection_qualified_name=connection_qualified_name, @@ -69,9 +67,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - API_FIELD_COUNT: ClassVar[NumericField] = NumericField( - "apiFieldCount", "apiFieldCount" - ) + API_FIELD_COUNT: ClassVar[NumericField] = NumericField("apiFieldCount", "apiFieldCount") """ Count of the APIField of this object. """ @@ -108,9 +104,7 @@ def api_fields(self, api_fields: Optional[List[APIField]]): class Attributes(API.Attributes): api_field_count: Optional[int] = Field(default=None, description="") - api_fields: Optional[List[APIField]] = Field( - default=None, description="" - ) # relationship + api_fields: Optional[List[APIField]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -121,16 +115,12 @@ def creator( connection_qualified_name: str, api_field_count: Optional[int] = None, ) -> APIObject.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return APIObject.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), api_field_count=api_field_count, ) diff --git a/pyatlan/model/assets/a_p_i_path.py b/pyatlan/model/assets/a_p_i_path.py index 27cc186ee..985d9e852 100644 --- a/pyatlan/model/assets/a_p_i_path.py +++ b/pyatlan/model/assets/a_p_i_path.py @@ -53,9 +53,7 @@ def creator( spec_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> APIPath: - validate_required_fields( - ["path_raw_uri", "spec_qualified_name"], [path_raw_uri, spec_qualified_name] - ) + validate_required_fields(["path_raw_uri", "spec_qualified_name"], [path_raw_uri, spec_qualified_name]) attributes = APIPath.Attributes.create( path_raw_uri=path_raw_uri, spec_qualified_name=spec_qualified_name, @@ -67,16 +65,11 @@ def creator( @init_guid def create(cls, *, path_raw_uri: str, spec_qualified_name: str) -> APIPath: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - path_raw_uri=path_raw_uri, spec_qualified_name=spec_qualified_name - ) + return cls.creator(path_raw_uri=path_raw_uri, spec_qualified_name=spec_qualified_name) type_name: str = Field(default="APIPath", allow_mutation=False) @@ -91,9 +84,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - API_PATH_SUMMARY: ClassVar[TextField] = TextField( - "apiPathSummary", "apiPathSummary" - ) + API_PATH_SUMMARY: ClassVar[TextField] = TextField("apiPathSummary", "apiPathSummary") """ Descriptive summary intended to apply to all operations in this path. """ @@ -103,9 +94,7 @@ def __setattr__(self, name, value): """ Absolute path to an individual endpoint. """ - API_PATH_IS_TEMPLATED: ClassVar[BooleanField] = BooleanField( - "apiPathIsTemplated", "apiPathIsTemplated" - ) + API_PATH_IS_TEMPLATED: ClassVar[BooleanField] = BooleanField("apiPathIsTemplated", "apiPathIsTemplated") """ Whether the endpoint's path contains replaceable parameters (true) or not (false). """ @@ -165,9 +154,7 @@ def api_path_raw_u_r_i(self, api_path_raw_u_r_i: Optional[str]): @property def api_path_is_templated(self) -> Optional[bool]: - return ( - None if self.attributes is None else self.attributes.api_path_is_templated - ) + return None if self.attributes is None else self.attributes.api_path_is_templated @api_path_is_templated.setter def api_path_is_templated(self, api_path_is_templated: Optional[bool]): @@ -177,45 +164,27 @@ def api_path_is_templated(self, api_path_is_templated: Optional[bool]): @property def api_path_available_operations(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.api_path_available_operations - ) + return None if self.attributes is None else self.attributes.api_path_available_operations @api_path_available_operations.setter - def api_path_available_operations( - self, api_path_available_operations: Optional[Set[str]] - ): + def api_path_available_operations(self, api_path_available_operations: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.api_path_available_operations = api_path_available_operations @property def api_path_available_response_codes(self) -> Optional[Dict[str, str]]: - return ( - None - if self.attributes is None - else self.attributes.api_path_available_response_codes - ) + return None if self.attributes is None else self.attributes.api_path_available_response_codes @api_path_available_response_codes.setter - def api_path_available_response_codes( - self, api_path_available_response_codes: Optional[Dict[str, str]] - ): + def api_path_available_response_codes(self, api_path_available_response_codes: Optional[Dict[str, str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.api_path_available_response_codes = ( - api_path_available_response_codes - ) + self.attributes.api_path_available_response_codes = api_path_available_response_codes @property def api_path_is_ingress_exposed(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.api_path_is_ingress_exposed - ) + return None if self.attributes is None else self.attributes.api_path_is_ingress_exposed @api_path_is_ingress_exposed.setter def api_path_is_ingress_exposed(self, api_path_is_ingress_exposed: Optional[bool]): @@ -237,18 +206,10 @@ class Attributes(API.Attributes): api_path_summary: Optional[str] = Field(default=None, description="") api_path_raw_u_r_i: Optional[str] = Field(default=None, description="") api_path_is_templated: Optional[bool] = Field(default=None, description="") - api_path_available_operations: Optional[Set[str]] = Field( - default=None, description="" - ) - api_path_available_response_codes: Optional[Dict[str, str]] = Field( - default=None, description="" - ) - api_path_is_ingress_exposed: Optional[bool] = Field( - default=None, description="" - ) - api_spec: Optional[APISpec] = Field( - default=None, description="" - ) # relationship + api_path_available_operations: Optional[Set[str]] = Field(default=None, description="") + api_path_available_response_codes: Optional[Dict[str, str]] = Field(default=None, description="") + api_path_is_ingress_exposed: Optional[bool] = Field(default=None, description="") + api_spec: Optional[APISpec] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -264,9 +225,7 @@ def create( [path_raw_uri, spec_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( spec_qualified_name, "spec_qualified_name", 4 diff --git a/pyatlan/model/assets/a_p_i_query.py b/pyatlan/model/assets/a_p_i_query.py index 2420096ee..24fa4d4ec 100644 --- a/pyatlan/model/assets/a_p_i_query.py +++ b/pyatlan/model/assets/a_p_i_query.py @@ -76,14 +76,11 @@ def creator( is_object_reference: Optional[bool] = False, reference_api_object_qualified_name: Optional[str] = None, ) -> APIQuery: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) # is api object reference - checker if is_object_reference: if not reference_api_object_qualified_name or ( - isinstance(reference_api_object_qualified_name, str) - and not reference_api_object_qualified_name.strip() + isinstance(reference_api_object_qualified_name, str) and not reference_api_object_qualified_name.strip() ): raise ValueError( "Set valid qualified name for reference_api_object_qualified_name when is_object_reference is true" @@ -94,9 +91,7 @@ def creator( and isinstance(reference_api_object_qualified_name, str) and reference_api_object_qualified_name.strip() ): - raise ValueError( - "Set is_object_reference to true to set reference_api_object_qualified_name" - ) + raise ValueError("Set is_object_reference to true to set reference_api_object_qualified_name") attributes = APIQuery.Attributes.creator( name=name, @@ -122,15 +117,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - API_INPUT_FIELD_COUNT: ClassVar[NumericField] = NumericField( - "apiInputFieldCount", "apiInputFieldCount" - ) + API_INPUT_FIELD_COUNT: ClassVar[NumericField] = NumericField("apiInputFieldCount", "apiInputFieldCount") """ Count of the APIField of this query that are input to it. """ - API_QUERY_OUTPUT_TYPE: ClassVar[KeywordField] = KeywordField( - "apiQueryOutputType", "apiQueryOutputType" - ) + API_QUERY_OUTPUT_TYPE: ClassVar[KeywordField] = KeywordField("apiQueryOutputType", "apiQueryOutputType") """ Type of APIQueryOutput. E.g. STRING, NUMBER etc. It is free text. """ @@ -155,9 +146,7 @@ def __setattr__(self, name, value): @property def api_input_field_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.api_input_field_count - ) + return None if self.attributes is None else self.attributes.api_input_field_count @api_input_field_count.setter def api_input_field_count(self, api_input_field_count: Optional[int]): @@ -167,9 +156,7 @@ def api_input_field_count(self, api_input_field_count: Optional[int]): @property def api_query_output_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.api_query_output_type - ) + return None if self.attributes is None else self.attributes.api_query_output_type @api_query_output_type.setter def api_query_output_type(self, api_query_output_type: Optional[str]): @@ -179,21 +166,13 @@ def api_query_output_type(self, api_query_output_type: Optional[str]): @property def api_query_output_type_secondary(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.api_query_output_type_secondary - ) + return None if self.attributes is None else self.attributes.api_query_output_type_secondary @api_query_output_type_secondary.setter - def api_query_output_type_secondary( - self, api_query_output_type_secondary: Optional[str] - ): + def api_query_output_type_secondary(self, api_query_output_type_secondary: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.api_query_output_type_secondary = ( - api_query_output_type_secondary - ) + self.attributes.api_query_output_type_secondary = api_query_output_type_secondary @property def api_fields(self) -> Optional[List[APIField]]: @@ -208,12 +187,8 @@ def api_fields(self, api_fields: Optional[List[APIField]]): class Attributes(API.Attributes): api_input_field_count: Optional[int] = Field(default=None, description="") api_query_output_type: Optional[str] = Field(default=None, description="") - api_query_output_type_secondary: Optional[str] = Field( - default=None, description="" - ) - api_fields: Optional[List[APIField]] = Field( - default=None, description="" - ) # relationship + api_query_output_type_secondary: Optional[str] = Field(default=None, description="") + api_fields: Optional[List[APIField]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -228,42 +203,32 @@ def creator( is_object_reference: Optional[bool] = False, reference_api_object_qualified_name: Optional[str] = None, ) -> APIQuery.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) # is api object reference - checker if is_object_reference: if not reference_api_object_qualified_name or ( isinstance(reference_api_object_qualified_name, str) and not reference_api_object_qualified_name.strip() ): - raise ValueError( - "Set valid qualified name for reference_api_object_qualified_name" - ) + raise ValueError("Set valid qualified name for reference_api_object_qualified_name") else: if ( reference_api_object_qualified_name and isinstance(reference_api_object_qualified_name, str) and reference_api_object_qualified_name.strip() ): - raise ValueError( - "Set is_object_reference to true to set reference_api_object_qualified_name" - ) + raise ValueError("Set is_object_reference to true to set reference_api_object_qualified_name") return APIQuery.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), api_input_field_count=api_input_field_count, api_query_output_type=api_query_output_type, api_query_output_type_secondary=api_query_output_type_secondary, api_is_object_reference=is_object_reference, - api_object_qualified_name=( - reference_api_object_qualified_name if is_object_reference else None - ), + api_object_qualified_name=(reference_api_object_qualified_name if is_object_reference else None), ) attributes: APIQuery.Attributes = Field( diff --git a/pyatlan/model/assets/a_p_i_spec.py b/pyatlan/model/assets/a_p_i_spec.py index 5838c13e6..3e6085718 100644 --- a/pyatlan/model/assets/a_p_i_spec.py +++ b/pyatlan/model/assets/a_p_i_spec.py @@ -26,28 +26,19 @@ class APISpec(API): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> APISpec: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) - attributes = APISpec.Attributes.create( - name=name, connection_qualified_name=connection_qualified_name - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + attributes = APISpec.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) return cls(attributes=attributes) @classmethod @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> APISpec: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + return cls.creator(name=name, connection_qualified_name=connection_qualified_name) type_name: str = Field(default="APISpec", allow_mutation=False) @@ -100,9 +91,7 @@ def __setattr__(self, name, value): """ URL to the license under which the API specification is available. """ - API_SPEC_CONTRACT_VERSION: ClassVar[KeywordField] = KeywordField( - "apiSpecContractVersion", "apiSpecContractVersion" - ) + API_SPEC_CONTRACT_VERSION: ClassVar[KeywordField] = KeywordField("apiSpecContractVersion", "apiSpecContractVersion") """ Version of the contract for the API specification. """ @@ -132,25 +121,17 @@ def __setattr__(self, name, value): @property def api_spec_terms_of_service_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.api_spec_terms_of_service_url - ) + return None if self.attributes is None else self.attributes.api_spec_terms_of_service_url @api_spec_terms_of_service_url.setter - def api_spec_terms_of_service_url( - self, api_spec_terms_of_service_url: Optional[str] - ): + def api_spec_terms_of_service_url(self, api_spec_terms_of_service_url: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.api_spec_terms_of_service_url = api_spec_terms_of_service_url @property def api_spec_contact_email(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.api_spec_contact_email - ) + return None if self.attributes is None else self.attributes.api_spec_contact_email @api_spec_contact_email.setter def api_spec_contact_email(self, api_spec_contact_email: Optional[str]): @@ -160,9 +141,7 @@ def api_spec_contact_email(self, api_spec_contact_email: Optional[str]): @property def api_spec_contact_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.api_spec_contact_name - ) + return None if self.attributes is None else self.attributes.api_spec_contact_name @api_spec_contact_name.setter def api_spec_contact_name(self, api_spec_contact_name: Optional[str]): @@ -182,9 +161,7 @@ def api_spec_contact_url(self, api_spec_contact_url: Optional[str]): @property def api_spec_license_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.api_spec_license_name - ) + return None if self.attributes is None else self.attributes.api_spec_license_name @api_spec_license_name.setter def api_spec_license_name(self, api_spec_license_name: Optional[str]): @@ -204,11 +181,7 @@ def api_spec_license_url(self, api_spec_license_url: Optional[str]): @property def api_spec_contract_version(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.api_spec_contract_version - ) + return None if self.attributes is None else self.attributes.api_spec_contract_version @api_spec_contract_version.setter def api_spec_contract_version(self, api_spec_contract_version: Optional[str]): @@ -218,9 +191,7 @@ def api_spec_contract_version(self, api_spec_contract_version: Optional[str]): @property def api_spec_service_alias(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.api_spec_service_alias - ) + return None if self.attributes is None else self.attributes.api_spec_service_alias @api_spec_service_alias.setter def api_spec_service_alias(self, api_spec_service_alias: Optional[str]): @@ -239,9 +210,7 @@ def api_paths(self, api_paths: Optional[List[APIPath]]): self.attributes.api_paths = api_paths class Attributes(API.Attributes): - api_spec_terms_of_service_url: Optional[str] = Field( - default=None, description="" - ) + api_spec_terms_of_service_url: Optional[str] = Field(default=None, description="") api_spec_contact_email: Optional[str] = Field(default=None, description="") api_spec_contact_name: Optional[str] = Field(default=None, description="") api_spec_contact_url: Optional[str] = Field(default=None, description="") @@ -249,25 +218,17 @@ class Attributes(API.Attributes): api_spec_license_url: Optional[str] = Field(default=None, description="") api_spec_contract_version: Optional[str] = Field(default=None, description="") api_spec_service_alias: Optional[str] = Field(default=None, description="") - api_paths: Optional[List[APIPath]] = Field( - default=None, description="" - ) # relationship + api_paths: Optional[List[APIPath]] = Field(default=None, description="") # relationship @classmethod @init_guid - def create( - cls, *, name: str, connection_qualified_name: str - ) -> APISpec.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + def create(cls, *, name: str, connection_qualified_name: str) -> APISpec.Attributes: + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return APISpec.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: APISpec.Attributes = Field( diff --git a/pyatlan/model/assets/a_w_s.py b/pyatlan/model/assets/a_w_s.py index 440417bdf..df7182712 100644 --- a/pyatlan/model/assets/a_w_s.py +++ b/pyatlan/model/assets/a_w_s.py @@ -30,9 +30,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AWS_ARN: ClassVar[KeywordTextField] = KeywordTextField( - "awsArn", "awsArn", "awsArn.text" - ) + AWS_ARN: ClassVar[KeywordTextField] = KeywordTextField("awsArn", "awsArn", "awsArn.text") """ Amazon Resource Name (ARN) for this asset. This uniquely identifies the asset in AWS, and thus must be unique across all AWS asset instances. """ # noqa: E501 @@ -48,21 +46,15 @@ def __setattr__(self, name, value): """ Physical region where the data center in which the asset exists is clustered. """ - AWS_ACCOUNT_ID: ClassVar[KeywordField] = KeywordField( - "awsAccountId", "awsAccountId" - ) + AWS_ACCOUNT_ID: ClassVar[KeywordField] = KeywordField("awsAccountId", "awsAccountId") """ 12-digit number that uniquely identifies an AWS account. """ - AWS_RESOURCE_ID: ClassVar[KeywordField] = KeywordField( - "awsResourceId", "awsResourceId" - ) + AWS_RESOURCE_ID: ClassVar[KeywordField] = KeywordField("awsResourceId", "awsResourceId") """ Unique resource ID assigned when a new resource is created. """ - AWS_OWNER_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "awsOwnerName", "awsOwnerName", "awsOwnerName.text" - ) + AWS_OWNER_NAME: ClassVar[KeywordTextField] = KeywordTextField("awsOwnerName", "awsOwnerName", "awsOwnerName.text") """ Root user's name. """ diff --git a/pyatlan/model/assets/anaplan.py b/pyatlan/model/assets/anaplan.py index c593ed72a..77ae08135 100644 --- a/pyatlan/model/assets/anaplan.py +++ b/pyatlan/model/assets/anaplan.py @@ -35,9 +35,7 @@ def __setattr__(self, name, value): """ Unique name of the AnaplanWorkspace asset that contains this asset(AnaplanModel and everthing under it's hierarchy). """ - ANAPLAN_WORKSPACE_NAME: ClassVar[KeywordField] = KeywordField( - "anaplanWorkspaceName", "anaplanWorkspaceName" - ) + ANAPLAN_WORKSPACE_NAME: ClassVar[KeywordField] = KeywordField("anaplanWorkspaceName", "anaplanWorkspaceName") """ Simple name of the AnaplanWorkspace asset that contains this asset(AnaplanModel and everthing under it's hierarchy). """ @@ -47,9 +45,7 @@ def __setattr__(self, name, value): """ Unique name of the AnaplanModel asset that contains this asset(AnaplanModule and everthing under it's hierarchy). """ - ANAPLAN_MODEL_NAME: ClassVar[KeywordField] = KeywordField( - "anaplanModelName", "anaplanModelName" - ) + ANAPLAN_MODEL_NAME: ClassVar[KeywordField] = KeywordField("anaplanModelName", "anaplanModelName") """ Simple name of the AnaplanModel asset that contains this asset(AnaplanModule and everthing under it's hierarchy). """ @@ -59,15 +55,11 @@ def __setattr__(self, name, value): """ Unique name of the AnaplanModule asset that contains this asset(AnaplanLineItem, AnaplanList, AnaplanView and everthing under their hierarchy). """ # noqa: E501 - ANAPLAN_MODULE_NAME: ClassVar[KeywordField] = KeywordField( - "anaplanModuleName", "anaplanModuleName" - ) + ANAPLAN_MODULE_NAME: ClassVar[KeywordField] = KeywordField("anaplanModuleName", "anaplanModuleName") """ Simple name of the AnaplanModule asset that contains this asset(AnaplanLineItem, AnaplanList, AnaplanView and everthing under their hierarchy). """ # noqa: E501 - ANAPLAN_SOURCE_ID: ClassVar[KeywordField] = KeywordField( - "anaplanSourceId", "anaplanSourceId" - ) + ANAPLAN_SOURCE_ID: ClassVar[KeywordField] = KeywordField("anaplanSourceId", "anaplanSourceId") """ Id/Guid of the Anaplan asset in the source system. """ @@ -84,27 +76,17 @@ def __setattr__(self, name, value): @property def anaplan_workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anaplan_workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.anaplan_workspace_qualified_name @anaplan_workspace_qualified_name.setter - def anaplan_workspace_qualified_name( - self, anaplan_workspace_qualified_name: Optional[str] - ): + def anaplan_workspace_qualified_name(self, anaplan_workspace_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anaplan_workspace_qualified_name = ( - anaplan_workspace_qualified_name - ) + self.attributes.anaplan_workspace_qualified_name = anaplan_workspace_qualified_name @property def anaplan_workspace_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.anaplan_workspace_name - ) + return None if self.attributes is None else self.attributes.anaplan_workspace_name @anaplan_workspace_name.setter def anaplan_workspace_name(self, anaplan_workspace_name: Optional[str]): @@ -114,11 +96,7 @@ def anaplan_workspace_name(self, anaplan_workspace_name: Optional[str]): @property def anaplan_model_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anaplan_model_qualified_name - ) + return None if self.attributes is None else self.attributes.anaplan_model_qualified_name @anaplan_model_qualified_name.setter def anaplan_model_qualified_name(self, anaplan_model_qualified_name: Optional[str]): @@ -138,16 +116,10 @@ def anaplan_model_name(self, anaplan_model_name: Optional[str]): @property def anaplan_module_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anaplan_module_qualified_name - ) + return None if self.attributes is None else self.attributes.anaplan_module_qualified_name @anaplan_module_qualified_name.setter - def anaplan_module_qualified_name( - self, anaplan_module_qualified_name: Optional[str] - ): + def anaplan_module_qualified_name(self, anaplan_module_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anaplan_module_qualified_name = anaplan_module_qualified_name @@ -173,17 +145,11 @@ def anaplan_source_id(self, anaplan_source_id: Optional[str]): self.attributes.anaplan_source_id = anaplan_source_id class Attributes(BI.Attributes): - anaplan_workspace_qualified_name: Optional[str] = Field( - default=None, description="" - ) + anaplan_workspace_qualified_name: Optional[str] = Field(default=None, description="") anaplan_workspace_name: Optional[str] = Field(default=None, description="") - anaplan_model_qualified_name: Optional[str] = Field( - default=None, description="" - ) + anaplan_model_qualified_name: Optional[str] = Field(default=None, description="") anaplan_model_name: Optional[str] = Field(default=None, description="") - anaplan_module_qualified_name: Optional[str] = Field( - default=None, description="" - ) + anaplan_module_qualified_name: Optional[str] = Field(default=None, description="") anaplan_module_name: Optional[str] = Field(default=None, description="") anaplan_source_id: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/anaplan_app.py b/pyatlan/model/assets/anaplan_app.py index e7cc9212a..3d1d4b212 100644 --- a/pyatlan/model/assets/anaplan_app.py +++ b/pyatlan/model/assets/anaplan_app.py @@ -21,12 +21,8 @@ class AnaplanApp(Anaplan): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> AnaplanApp: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) - attributes = AnaplanApp.Attributes.create( - name=name, connection_qualified_name=connection_qualified_name - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + attributes = AnaplanApp.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) return cls(attributes=attributes) type_name: str = Field(default="AnaplanApp", allow_mutation=False) @@ -62,25 +58,17 @@ def anaplan_pages(self, anaplan_pages: Optional[List[AnaplanPage]]): self.attributes.anaplan_pages = anaplan_pages class Attributes(Anaplan.Attributes): - anaplan_pages: Optional[List[AnaplanPage]] = Field( - default=None, description="" - ) # relationship + anaplan_pages: Optional[List[AnaplanPage]] = Field(default=None, description="") # relationship @classmethod @init_guid - def create( - cls, *, name: str, connection_qualified_name: str - ) -> AnaplanApp.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + def create(cls, *, name: str, connection_qualified_name: str) -> AnaplanApp.Attributes: + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return AnaplanApp.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: AnaplanApp.Attributes = Field( diff --git a/pyatlan/model/assets/anaplan_dimension.py b/pyatlan/model/assets/anaplan_dimension.py index 7bb8621f2..82cb14adb 100644 --- a/pyatlan/model/assets/anaplan_dimension.py +++ b/pyatlan/model/assets/anaplan_dimension.py @@ -46,9 +46,7 @@ def creator( model_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanDimension: - validate_required_fields( - ["name", "model_qualified_name"], [name, model_qualified_name] - ) + validate_required_fields(["name", "model_qualified_name"], [name, model_qualified_name]) attributes = AnaplanDimension.Attributes.create( name=name, model_qualified_name=model_qualified_name, @@ -149,21 +147,11 @@ def anaplan_row_views(self, anaplan_row_views: Optional[List[AnaplanView]]): self.attributes.anaplan_row_views = anaplan_row_views class Attributes(Anaplan.Attributes): - anaplan_page_views: Optional[List[AnaplanView]] = Field( - default=None, description="" - ) # relationship - anaplan_column_views: Optional[List[AnaplanView]] = Field( - default=None, description="" - ) # relationship - anaplan_line_items: Optional[List[AnaplanLineItem]] = Field( - default=None, description="" - ) # relationship - anaplan_model: Optional[AnaplanModel] = Field( - default=None, description="" - ) # relationship - anaplan_row_views: Optional[List[AnaplanView]] = Field( - default=None, description="" - ) # relationship + anaplan_page_views: Optional[List[AnaplanView]] = Field(default=None, description="") # relationship + anaplan_column_views: Optional[List[AnaplanView]] = Field(default=None, description="") # relationship + anaplan_line_items: Optional[List[AnaplanLineItem]] = Field(default=None, description="") # relationship + anaplan_model: Optional[AnaplanModel] = Field(default=None, description="") # relationship + anaplan_row_views: Optional[List[AnaplanView]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -179,9 +167,7 @@ def create( [name, model_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( model_qualified_name, "model_qualified_name", 5 diff --git a/pyatlan/model/assets/anaplan_line_item.py b/pyatlan/model/assets/anaplan_line_item.py index b22fe1e7a..e214a8bdf 100644 --- a/pyatlan/model/assets/anaplan_line_item.py +++ b/pyatlan/model/assets/anaplan_line_item.py @@ -46,9 +46,7 @@ def creator( module_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanLineItem: - validate_required_fields( - ["name", "module_qualified_name"], [name, module_qualified_name] - ) + validate_required_fields(["name", "module_qualified_name"], [name, module_qualified_name]) attributes = AnaplanLineItem.Attributes.create( name=name, module_qualified_name=module_qualified_name, @@ -69,9 +67,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ANAPLAN_LINE_ITEM_FORMULA: ClassVar[KeywordField] = KeywordField( - "anaplanLineItemFormula", "anaplanLineItemFormula" - ) + ANAPLAN_LINE_ITEM_FORMULA: ClassVar[KeywordField] = KeywordField("anaplanLineItemFormula", "anaplanLineItemFormula") """ Formula of the AnaplanLineItem from the source system. """ @@ -98,11 +94,7 @@ def __setattr__(self, name, value): @property def anaplan_line_item_formula(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anaplan_line_item_formula - ) + return None if self.attributes is None else self.attributes.anaplan_line_item_formula @anaplan_line_item_formula.setter def anaplan_line_item_formula(self, anaplan_line_item_formula: Optional[str]): @@ -142,15 +134,9 @@ def anaplan_dimensions(self, anaplan_dimensions: Optional[List[AnaplanDimension] class Attributes(Anaplan.Attributes): anaplan_line_item_formula: Optional[str] = Field(default=None, description="") - anaplan_module: Optional[AnaplanModule] = Field( - default=None, description="" - ) # relationship - anaplan_lists: Optional[List[AnaplanList]] = Field( - default=None, description="" - ) # relationship - anaplan_dimensions: Optional[List[AnaplanDimension]] = Field( - default=None, description="" - ) # relationship + anaplan_module: Optional[AnaplanModule] = Field(default=None, description="") # relationship + anaplan_lists: Optional[List[AnaplanList]] = Field(default=None, description="") # relationship + anaplan_dimensions: Optional[List[AnaplanDimension]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -166,9 +152,7 @@ def create( [name, module_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( module_qualified_name, "module_qualified_name", 6 @@ -190,9 +174,7 @@ def create( anaplan_model_name=model_name, anaplan_module_qualified_name=module_qualified_name, anaplan_module_name=module_name, - anaplan_module=AnaplanModule.ref_by_qualified_name( - module_qualified_name - ), + anaplan_module=AnaplanModule.ref_by_qualified_name(module_qualified_name), ) attributes: AnaplanLineItem.Attributes = Field( diff --git a/pyatlan/model/assets/anaplan_list.py b/pyatlan/model/assets/anaplan_list.py index 83755036c..0a729a805 100644 --- a/pyatlan/model/assets/anaplan_list.py +++ b/pyatlan/model/assets/anaplan_list.py @@ -46,9 +46,7 @@ def creator( model_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanList: - validate_required_fields( - ["name", "model_qualified_name"], [name, model_qualified_name] - ) + validate_required_fields(["name", "model_qualified_name"], [name, model_qualified_name]) attributes = AnaplanList.Attributes.create( name=name, model_qualified_name=model_qualified_name, @@ -69,9 +67,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ANAPLAN_LIST_ITEM_COUNT: ClassVar[NumericField] = NumericField( - "anaplanListItemCount", "anaplanListItemCount" - ) + ANAPLAN_LIST_ITEM_COUNT: ClassVar[NumericField] = NumericField("anaplanListItemCount", "anaplanListItemCount") """ Item Count of the AnaplanList from the source system. """ @@ -93,9 +89,7 @@ def __setattr__(self, name, value): @property def anaplan_list_item_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.anaplan_list_item_count - ) + return None if self.attributes is None else self.attributes.anaplan_list_item_count @anaplan_list_item_count.setter def anaplan_list_item_count(self, anaplan_list_item_count: Optional[int]): @@ -125,12 +119,8 @@ def anaplan_model(self, anaplan_model: Optional[AnaplanModel]): class Attributes(Anaplan.Attributes): anaplan_list_item_count: Optional[int] = Field(default=None, description="") - anaplan_line_items: Optional[List[AnaplanLineItem]] = Field( - default=None, description="" - ) # relationship - anaplan_model: Optional[AnaplanModel] = Field( - default=None, description="" - ) # relationship + anaplan_line_items: Optional[List[AnaplanLineItem]] = Field(default=None, description="") # relationship + anaplan_model: Optional[AnaplanModel] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -146,9 +136,7 @@ def create( [name, model_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( model_qualified_name, "model_qualified_name", 5 diff --git a/pyatlan/model/assets/anaplan_model.py b/pyatlan/model/assets/anaplan_model.py index 33be8dbcc..9430f556c 100644 --- a/pyatlan/model/assets/anaplan_model.py +++ b/pyatlan/model/assets/anaplan_model.py @@ -46,9 +46,7 @@ def creator( workspace_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanModel: - validate_required_fields( - ["name", "workspace_qualified_name"], [name, workspace_qualified_name] - ) + validate_required_fields(["name", "workspace_qualified_name"], [name, workspace_qualified_name]) attributes = AnaplanModel.Attributes.create( name=name, workspace_qualified_name=workspace_qualified_name, @@ -149,21 +147,11 @@ def anaplan_dimensions(self, anaplan_dimensions: Optional[List[AnaplanDimension] self.attributes.anaplan_dimensions = anaplan_dimensions class Attributes(Anaplan.Attributes): - anaplan_workspace: Optional[AnaplanWorkspace] = Field( - default=None, description="" - ) # relationship - anaplan_modules: Optional[List[AnaplanModule]] = Field( - default=None, description="" - ) # relationship - anaplan_pages: Optional[List[AnaplanPage]] = Field( - default=None, description="" - ) # relationship - anaplan_lists: Optional[List[AnaplanList]] = Field( - default=None, description="" - ) # relationship - anaplan_dimensions: Optional[List[AnaplanDimension]] = Field( - default=None, description="" - ) # relationship + anaplan_workspace: Optional[AnaplanWorkspace] = Field(default=None, description="") # relationship + anaplan_modules: Optional[List[AnaplanModule]] = Field(default=None, description="") # relationship + anaplan_pages: Optional[List[AnaplanPage]] = Field(default=None, description="") # relationship + anaplan_lists: Optional[List[AnaplanList]] = Field(default=None, description="") # relationship + anaplan_dimensions: Optional[List[AnaplanDimension]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -179,9 +167,7 @@ def create( [name, workspace_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( workspace_qualified_name, "workspace_qualified_name", 4 @@ -196,9 +182,7 @@ def create( connector_name=connector_name, anaplan_workspace_qualified_name=workspace_qualified_name, anaplan_workspace_name=workspace_name, - anaplan_workspace=AnaplanWorkspace.ref_by_qualified_name( - workspace_qualified_name - ), + anaplan_workspace=AnaplanWorkspace.ref_by_qualified_name(workspace_qualified_name), ) attributes: AnaplanModel.Attributes = Field( diff --git a/pyatlan/model/assets/anaplan_module.py b/pyatlan/model/assets/anaplan_module.py index 98963bb8a..8942cced9 100644 --- a/pyatlan/model/assets/anaplan_module.py +++ b/pyatlan/model/assets/anaplan_module.py @@ -46,9 +46,7 @@ def creator( model_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanModule: - validate_required_fields( - ["name", "model_qualified_name"], [name, model_qualified_name] - ) + validate_required_fields(["name", "model_qualified_name"], [name, model_qualified_name]) attributes = AnaplanModule.Attributes.create( name=name, model_qualified_name=model_qualified_name, @@ -119,15 +117,9 @@ def anaplan_model(self, anaplan_model: Optional[AnaplanModel]): self.attributes.anaplan_model = anaplan_model class Attributes(Anaplan.Attributes): - anaplan_views: Optional[List[AnaplanView]] = Field( - default=None, description="" - ) # relationship - anaplan_line_items: Optional[List[AnaplanLineItem]] = Field( - default=None, description="" - ) # relationship - anaplan_model: Optional[AnaplanModel] = Field( - default=None, description="" - ) # relationship + anaplan_views: Optional[List[AnaplanView]] = Field(default=None, description="") # relationship + anaplan_line_items: Optional[List[AnaplanLineItem]] = Field(default=None, description="") # relationship + anaplan_model: Optional[AnaplanModel] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -143,9 +135,7 @@ def create( [name, model_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( model_qualified_name, "model_qualified_name", 5 diff --git a/pyatlan/model/assets/anaplan_page.py b/pyatlan/model/assets/anaplan_page.py index 3c48a9039..447e0610b 100644 --- a/pyatlan/model/assets/anaplan_page.py +++ b/pyatlan/model/assets/anaplan_page.py @@ -46,9 +46,7 @@ def creator( app_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanPage: - validate_required_fields( - ["name", "app_qualified_name"], [name, app_qualified_name] - ) + validate_required_fields(["name", "app_qualified_name"], [name, app_qualified_name]) attributes = AnaplanPage.Attributes.create( name=name, app_qualified_name=app_qualified_name, @@ -81,9 +79,7 @@ def __setattr__(self, name, value): """ Category Name of the AnaplanPage from the source system. """ - ANAPLAN_PAGE_TYPE: ClassVar[KeywordField] = KeywordField( - "anaplanPageType", "anaplanPageType" - ) + ANAPLAN_PAGE_TYPE: ClassVar[KeywordField] = KeywordField("anaplanPageType", "anaplanPageType") """ Type of the AnaplanPage from the source system. """ @@ -107,11 +103,7 @@ def __setattr__(self, name, value): @property def anaplan_app_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anaplan_app_qualified_name - ) + return None if self.attributes is None else self.attributes.anaplan_app_qualified_name @anaplan_app_qualified_name.setter def anaplan_app_qualified_name(self, anaplan_app_qualified_name: Optional[str]): @@ -121,11 +113,7 @@ def anaplan_app_qualified_name(self, anaplan_app_qualified_name: Optional[str]): @property def anaplan_page_category_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anaplan_page_category_name - ) + return None if self.attributes is None else self.attributes.anaplan_page_category_name @anaplan_page_category_name.setter def anaplan_page_category_name(self, anaplan_page_category_name: Optional[str]): @@ -167,12 +155,8 @@ class Attributes(Anaplan.Attributes): anaplan_app_qualified_name: Optional[str] = Field(default=None, description="") anaplan_page_category_name: Optional[str] = Field(default=None, description="") anaplan_page_type: Optional[str] = Field(default=None, description="") - anaplan_models: Optional[List[AnaplanModel]] = Field( - default=None, description="" - ) # relationship - anaplan_app: Optional[AnaplanApp] = Field( - default=None, description="" - ) # relationship + anaplan_models: Optional[List[AnaplanModel]] = Field(default=None, description="") # relationship + anaplan_app: Optional[AnaplanApp] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -188,9 +172,7 @@ def create( [name, app_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( app_qualified_name, "app_qualified_name", 4 diff --git a/pyatlan/model/assets/anaplan_system_dimension.py b/pyatlan/model/assets/anaplan_system_dimension.py index 4bc539b9a..f4e9a8fe3 100644 --- a/pyatlan/model/assets/anaplan_system_dimension.py +++ b/pyatlan/model/assets/anaplan_system_dimension.py @@ -19,19 +19,13 @@ class AnaplanSystemDimension(Anaplan): @classmethod @init_guid - def creator( - cls, *, name: str, connection_qualified_name: str - ) -> AnaplanSystemDimension: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + def creator(cls, *, name: str, connection_qualified_name: str) -> AnaplanSystemDimension: + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) attributes = AnaplanSystemDimension.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) return cls(attributes=attributes) diff --git a/pyatlan/model/assets/anaplan_view.py b/pyatlan/model/assets/anaplan_view.py index 42a30ade6..172eea8bf 100644 --- a/pyatlan/model/assets/anaplan_view.py +++ b/pyatlan/model/assets/anaplan_view.py @@ -46,9 +46,7 @@ def creator( module_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanView: - validate_required_fields( - ["name", "module_qualified_name"], [name, module_qualified_name] - ) + validate_required_fields(["name", "module_qualified_name"], [name, module_qualified_name]) attributes = AnaplanView.Attributes.create( name=name, module_qualified_name=module_qualified_name, @@ -73,21 +71,15 @@ def __setattr__(self, name, value): """ TBC """ - ANAPLAN_PAGE_DIMENSIONS: ClassVar[RelationField] = RelationField( - "anaplanPageDimensions" - ) + ANAPLAN_PAGE_DIMENSIONS: ClassVar[RelationField] = RelationField("anaplanPageDimensions") """ TBC """ - ANAPLAN_ROW_DIMENSIONS: ClassVar[RelationField] = RelationField( - "anaplanRowDimensions" - ) + ANAPLAN_ROW_DIMENSIONS: ClassVar[RelationField] = RelationField("anaplanRowDimensions") """ TBC """ - ANAPLAN_COLUMN_DIMENSIONS: ClassVar[RelationField] = RelationField( - "anaplanColumnDimensions" - ) + ANAPLAN_COLUMN_DIMENSIONS: ClassVar[RelationField] = RelationField("anaplanColumnDimensions") """ TBC """ @@ -111,58 +103,38 @@ def anaplan_module(self, anaplan_module: Optional[AnaplanModule]): @property def anaplan_page_dimensions(self) -> Optional[List[AnaplanDimension]]: - return ( - None if self.attributes is None else self.attributes.anaplan_page_dimensions - ) + return None if self.attributes is None else self.attributes.anaplan_page_dimensions @anaplan_page_dimensions.setter - def anaplan_page_dimensions( - self, anaplan_page_dimensions: Optional[List[AnaplanDimension]] - ): + def anaplan_page_dimensions(self, anaplan_page_dimensions: Optional[List[AnaplanDimension]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anaplan_page_dimensions = anaplan_page_dimensions @property def anaplan_row_dimensions(self) -> Optional[List[AnaplanDimension]]: - return ( - None if self.attributes is None else self.attributes.anaplan_row_dimensions - ) + return None if self.attributes is None else self.attributes.anaplan_row_dimensions @anaplan_row_dimensions.setter - def anaplan_row_dimensions( - self, anaplan_row_dimensions: Optional[List[AnaplanDimension]] - ): + def anaplan_row_dimensions(self, anaplan_row_dimensions: Optional[List[AnaplanDimension]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anaplan_row_dimensions = anaplan_row_dimensions @property def anaplan_column_dimensions(self) -> Optional[List[AnaplanDimension]]: - return ( - None - if self.attributes is None - else self.attributes.anaplan_column_dimensions - ) + return None if self.attributes is None else self.attributes.anaplan_column_dimensions @anaplan_column_dimensions.setter - def anaplan_column_dimensions( - self, anaplan_column_dimensions: Optional[List[AnaplanDimension]] - ): + def anaplan_column_dimensions(self, anaplan_column_dimensions: Optional[List[AnaplanDimension]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anaplan_column_dimensions = anaplan_column_dimensions class Attributes(Anaplan.Attributes): - anaplan_module: Optional[AnaplanModule] = Field( - default=None, description="" - ) # relationship - anaplan_page_dimensions: Optional[List[AnaplanDimension]] = Field( - default=None, description="" - ) # relationship - anaplan_row_dimensions: Optional[List[AnaplanDimension]] = Field( - default=None, description="" - ) # relationship + anaplan_module: Optional[AnaplanModule] = Field(default=None, description="") # relationship + anaplan_page_dimensions: Optional[List[AnaplanDimension]] = Field(default=None, description="") # relationship + anaplan_row_dimensions: Optional[List[AnaplanDimension]] = Field(default=None, description="") # relationship anaplan_column_dimensions: Optional[List[AnaplanDimension]] = Field( default=None, description="" ) # relationship @@ -181,9 +153,7 @@ def create( [name, module_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( module_qualified_name, "module_qualified_name", 6 @@ -205,9 +175,7 @@ def create( anaplan_model_name=model_name, anaplan_module_qualified_name=module_qualified_name, anaplan_module_name=module_name, - anaplan_module=AnaplanModule.ref_by_qualified_name( - module_qualified_name - ), + anaplan_module=AnaplanModule.ref_by_qualified_name(module_qualified_name), ) attributes: AnaplanView.Attributes = Field( diff --git a/pyatlan/model/assets/anaplan_workspace.py b/pyatlan/model/assets/anaplan_workspace.py index bc4ee51e1..c63f10199 100644 --- a/pyatlan/model/assets/anaplan_workspace.py +++ b/pyatlan/model/assets/anaplan_workspace.py @@ -21,12 +21,8 @@ class AnaplanWorkspace(Anaplan): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> AnaplanWorkspace: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) - attributes = AnaplanWorkspace.Attributes.create( - name=name, connection_qualified_name=connection_qualified_name - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + attributes = AnaplanWorkspace.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) return cls(attributes=attributes) type_name: str = Field(default="AnaplanWorkspace", allow_mutation=False) @@ -68,37 +64,23 @@ def __setattr__(self, name, value): @property def anaplan_workspace_current_size(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.anaplan_workspace_current_size - ) + return None if self.attributes is None else self.attributes.anaplan_workspace_current_size @anaplan_workspace_current_size.setter - def anaplan_workspace_current_size( - self, anaplan_workspace_current_size: Optional[int] - ): + def anaplan_workspace_current_size(self, anaplan_workspace_current_size: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anaplan_workspace_current_size = anaplan_workspace_current_size @property def anaplan_workspace_allowance_size(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.anaplan_workspace_allowance_size - ) + return None if self.attributes is None else self.attributes.anaplan_workspace_allowance_size @anaplan_workspace_allowance_size.setter - def anaplan_workspace_allowance_size( - self, anaplan_workspace_allowance_size: Optional[int] - ): + def anaplan_workspace_allowance_size(self, anaplan_workspace_allowance_size: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anaplan_workspace_allowance_size = ( - anaplan_workspace_allowance_size - ) + self.attributes.anaplan_workspace_allowance_size = anaplan_workspace_allowance_size @property def anaplan_models(self) -> Optional[List[AnaplanModel]]: @@ -111,31 +93,19 @@ def anaplan_models(self, anaplan_models: Optional[List[AnaplanModel]]): self.attributes.anaplan_models = anaplan_models class Attributes(Anaplan.Attributes): - anaplan_workspace_current_size: Optional[int] = Field( - default=None, description="" - ) - anaplan_workspace_allowance_size: Optional[int] = Field( - default=None, description="" - ) - anaplan_models: Optional[List[AnaplanModel]] = Field( - default=None, description="" - ) # relationship + anaplan_workspace_current_size: Optional[int] = Field(default=None, description="") + anaplan_workspace_allowance_size: Optional[int] = Field(default=None, description="") + anaplan_models: Optional[List[AnaplanModel]] = Field(default=None, description="") # relationship @classmethod @init_guid - def create( - cls, *, name: str, connection_qualified_name: str - ) -> AnaplanWorkspace.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + def create(cls, *, name: str, connection_qualified_name: str) -> AnaplanWorkspace.Attributes: + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return AnaplanWorkspace.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: AnaplanWorkspace.Attributes = Field( diff --git a/pyatlan/model/assets/auth_service.py b/pyatlan/model/assets/auth_service.py index f353c1f2d..7e5769764 100644 --- a/pyatlan/model/assets/auth_service.py +++ b/pyatlan/model/assets/auth_service.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AUTH_SERVICE_TYPE: ClassVar[KeywordField] = KeywordField( - "authServiceType", "authServiceType" - ) + AUTH_SERVICE_TYPE: ClassVar[KeywordField] = KeywordField("authServiceType", "authServiceType") """ TBC """ @@ -39,15 +37,11 @@ def __setattr__(self, name, value): """ TBC """ - AUTH_SERVICE_IS_ENABLED: ClassVar[BooleanField] = BooleanField( - "authServiceIsEnabled", "authServiceIsEnabled" - ) + AUTH_SERVICE_IS_ENABLED: ClassVar[BooleanField] = BooleanField("authServiceIsEnabled", "authServiceIsEnabled") """ TBC """ - AUTH_SERVICE_CONFIG: ClassVar[KeywordField] = KeywordField( - "authServiceConfig", "authServiceConfig" - ) + AUTH_SERVICE_CONFIG: ClassVar[KeywordField] = KeywordField("authServiceConfig", "authServiceConfig") """ TBC """ @@ -88,9 +82,7 @@ def tag_service(self, tag_service: Optional[str]): @property def auth_service_is_enabled(self) -> Optional[bool]: - return ( - None if self.attributes is None else self.attributes.auth_service_is_enabled - ) + return None if self.attributes is None else self.attributes.auth_service_is_enabled @auth_service_is_enabled.setter def auth_service_is_enabled(self, auth_service_is_enabled: Optional[bool]): @@ -110,16 +102,10 @@ def auth_service_config(self, auth_service_config: Optional[Dict[str, str]]): @property def auth_service_policy_last_sync(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.auth_service_policy_last_sync - ) + return None if self.attributes is None else self.attributes.auth_service_policy_last_sync @auth_service_policy_last_sync.setter - def auth_service_policy_last_sync( - self, auth_service_policy_last_sync: Optional[int] - ): + def auth_service_policy_last_sync(self, auth_service_policy_last_sync: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.auth_service_policy_last_sync = auth_service_policy_last_sync @@ -128,12 +114,8 @@ class Attributes(Asset.Attributes): auth_service_type: Optional[str] = Field(default=None, description="") tag_service: Optional[str] = Field(default=None, description="") auth_service_is_enabled: Optional[bool] = Field(default=None, description="") - auth_service_config: Optional[Dict[str, str]] = Field( - default=None, description="" - ) - auth_service_policy_last_sync: Optional[int] = Field( - default=None, description="" - ) + auth_service_config: Optional[Dict[str, str]] = Field(default=None, description="") + auth_service_policy_last_sync: Optional[int] = Field(default=None, description="") attributes: AuthService.Attributes = Field( default_factory=lambda: AuthService.Attributes(), diff --git a/pyatlan/model/assets/azure.py b/pyatlan/model/assets/azure.py index 7ec82c82e..a1700d5b5 100644 --- a/pyatlan/model/assets/azure.py +++ b/pyatlan/model/assets/azure.py @@ -36,9 +36,7 @@ def __setattr__(self, name, value): """ Resource identifier of this asset in Azure. """ - AZURE_LOCATION: ClassVar[KeywordField] = KeywordField( - "azureLocation", "azureLocation" - ) + AZURE_LOCATION: ClassVar[KeywordField] = KeywordField("azureLocation", "azureLocation") """ Location of this asset in Azure. """ @@ -82,21 +80,13 @@ def azure_location(self, azure_location: Optional[str]): @property def adls_account_secondary_location(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adls_account_secondary_location - ) + return None if self.attributes is None else self.attributes.adls_account_secondary_location @adls_account_secondary_location.setter - def adls_account_secondary_location( - self, adls_account_secondary_location: Optional[str] - ): + def adls_account_secondary_location(self, adls_account_secondary_location: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adls_account_secondary_location = ( - adls_account_secondary_location - ) + self.attributes.adls_account_secondary_location = adls_account_secondary_location @property def azure_tags(self) -> Optional[List[AzureTag]]: @@ -111,9 +101,7 @@ def azure_tags(self, azure_tags: Optional[List[AzureTag]]): class Attributes(Cloud.Attributes): azure_resource_id: Optional[str] = Field(default=None, description="") azure_location: Optional[str] = Field(default=None, description="") - adls_account_secondary_location: Optional[str] = Field( - default=None, description="" - ) + adls_account_secondary_location: Optional[str] = Field(default=None, description="") azure_tags: Optional[List[AzureTag]] = Field(default=None, description="") attributes: Azure.Attributes = Field( diff --git a/pyatlan/model/assets/azure_event_hub.py b/pyatlan/model/assets/azure_event_hub.py index 589f16594..fb4eae95c 100644 --- a/pyatlan/model/assets/azure_event_hub.py +++ b/pyatlan/model/assets/azure_event_hub.py @@ -21,12 +21,8 @@ class AzureEventHub(KafkaTopic): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> AzureEventHub: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) - attributes = AzureEventHub.Attributes.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + attributes = AzureEventHub.Attributes.creator(name=name, connection_qualified_name=connection_qualified_name) return cls(attributes=attributes) type_name: str = Field(default="AzureEventHub", allow_mutation=False) @@ -42,9 +38,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AZURE_EVENT_HUB_STATUS: ClassVar[KeywordField] = KeywordField( - "azureEventHubStatus", "azureEventHubStatus" - ) + AZURE_EVENT_HUB_STATUS: ClassVar[KeywordField] = KeywordField("azureEventHubStatus", "azureEventHubStatus") """ """ @@ -55,9 +49,7 @@ def __setattr__(self, name, value): @property def azure_event_hub_status(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.azure_event_hub_status - ) + return None if self.attributes is None else self.attributes.azure_event_hub_status @azure_event_hub_status.setter def azure_event_hub_status(self, azure_event_hub_status: Optional[str]): @@ -70,19 +62,13 @@ class Attributes(KafkaTopic.Attributes): @classmethod @init_guid - def creator( - cls, *, name: str, connection_qualified_name: str - ) -> AzureEventHub.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + def creator(cls, *, name: str, connection_qualified_name: str) -> AzureEventHub.Attributes: + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return AzureEventHub.Attributes( name=name, qualified_name=f"{connection_qualified_name}/topic/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: AzureEventHub.Attributes = Field( diff --git a/pyatlan/model/assets/azure_service_bus.py b/pyatlan/model/assets/azure_service_bus.py index 6c370e27e..7de9e9492 100644 --- a/pyatlan/model/assets/azure_service_bus.py +++ b/pyatlan/model/assets/azure_service_bus.py @@ -58,68 +58,38 @@ def __setattr__(self, name, value): @property def azure_service_bus_namespace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.azure_service_bus_namespace_qualified_name - ) + return None if self.attributes is None else self.attributes.azure_service_bus_namespace_qualified_name @azure_service_bus_namespace_qualified_name.setter - def azure_service_bus_namespace_qualified_name( - self, azure_service_bus_namespace_qualified_name: Optional[str] - ): + def azure_service_bus_namespace_qualified_name(self, azure_service_bus_namespace_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.azure_service_bus_namespace_qualified_name = ( - azure_service_bus_namespace_qualified_name - ) + self.attributes.azure_service_bus_namespace_qualified_name = azure_service_bus_namespace_qualified_name @property def azure_service_bus_namespace_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.azure_service_bus_namespace_name - ) + return None if self.attributes is None else self.attributes.azure_service_bus_namespace_name @azure_service_bus_namespace_name.setter - def azure_service_bus_namespace_name( - self, azure_service_bus_namespace_name: Optional[str] - ): + def azure_service_bus_namespace_name(self, azure_service_bus_namespace_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.azure_service_bus_namespace_name = ( - azure_service_bus_namespace_name - ) + self.attributes.azure_service_bus_namespace_name = azure_service_bus_namespace_name @property def azure_service_bus_schema_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.azure_service_bus_schema_qualified_name - ) + return None if self.attributes is None else self.attributes.azure_service_bus_schema_qualified_name @azure_service_bus_schema_qualified_name.setter - def azure_service_bus_schema_qualified_name( - self, azure_service_bus_schema_qualified_name: Optional[str] - ): + def azure_service_bus_schema_qualified_name(self, azure_service_bus_schema_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.azure_service_bus_schema_qualified_name = ( - azure_service_bus_schema_qualified_name - ) + self.attributes.azure_service_bus_schema_qualified_name = azure_service_bus_schema_qualified_name class Attributes(EventStore.Attributes): - azure_service_bus_namespace_qualified_name: Optional[str] = Field( - default=None, description="" - ) - azure_service_bus_namespace_name: Optional[str] = Field( - default=None, description="" - ) - azure_service_bus_schema_qualified_name: Optional[str] = Field( - default=None, description="" - ) + azure_service_bus_namespace_qualified_name: Optional[str] = Field(default=None, description="") + azure_service_bus_namespace_name: Optional[str] = Field(default=None, description="") + azure_service_bus_schema_qualified_name: Optional[str] = Field(default=None, description="") attributes: AzureServiceBus.Attributes = Field( default_factory=lambda: AzureServiceBus.Attributes(), diff --git a/pyatlan/model/assets/azure_service_bus_namespace.py b/pyatlan/model/assets/azure_service_bus_namespace.py index 1ca3b68d6..bbc2004cf 100644 --- a/pyatlan/model/assets/azure_service_bus_namespace.py +++ b/pyatlan/model/assets/azure_service_bus_namespace.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AZURE_SERVICE_BUS_TOPICS: ClassVar[RelationField] = RelationField( - "azureServiceBusTopics" - ) + AZURE_SERVICE_BUS_TOPICS: ClassVar[RelationField] = RelationField("azureServiceBusTopics") """ TBC """ @@ -42,16 +40,10 @@ def __setattr__(self, name, value): @property def azure_service_bus_topics(self) -> Optional[List[AzureServiceBusTopic]]: - return ( - None - if self.attributes is None - else self.attributes.azure_service_bus_topics - ) + return None if self.attributes is None else self.attributes.azure_service_bus_topics @azure_service_bus_topics.setter - def azure_service_bus_topics( - self, azure_service_bus_topics: Optional[List[AzureServiceBusTopic]] - ): + def azure_service_bus_topics(self, azure_service_bus_topics: Optional[List[AzureServiceBusTopic]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.azure_service_bus_topics = azure_service_bus_topics diff --git a/pyatlan/model/assets/azure_service_bus_schema.py b/pyatlan/model/assets/azure_service_bus_schema.py index 59074ae12..dc4e0b3cb 100644 --- a/pyatlan/model/assets/azure_service_bus_schema.py +++ b/pyatlan/model/assets/azure_service_bus_schema.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AZURE_SERVICE_BUS_TOPICS: ClassVar[RelationField] = RelationField( - "azureServiceBusTopics" - ) + AZURE_SERVICE_BUS_TOPICS: ClassVar[RelationField] = RelationField("azureServiceBusTopics") """ TBC """ @@ -42,16 +40,10 @@ def __setattr__(self, name, value): @property def azure_service_bus_topics(self) -> Optional[List[AzureServiceBusTopic]]: - return ( - None - if self.attributes is None - else self.attributes.azure_service_bus_topics - ) + return None if self.attributes is None else self.attributes.azure_service_bus_topics @azure_service_bus_topics.setter - def azure_service_bus_topics( - self, azure_service_bus_topics: Optional[List[AzureServiceBusTopic]] - ): + def azure_service_bus_topics(self, azure_service_bus_topics: Optional[List[AzureServiceBusTopic]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.azure_service_bus_topics = azure_service_bus_topics diff --git a/pyatlan/model/assets/azure_service_bus_topic.py b/pyatlan/model/assets/azure_service_bus_topic.py index 7c3791784..d4dff7f5f 100644 --- a/pyatlan/model/assets/azure_service_bus_topic.py +++ b/pyatlan/model/assets/azure_service_bus_topic.py @@ -29,15 +29,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AZURE_SERVICE_BUS_SCHEMAS: ClassVar[RelationField] = RelationField( - "azureServiceBusSchemas" - ) + AZURE_SERVICE_BUS_SCHEMAS: ClassVar[RelationField] = RelationField("azureServiceBusSchemas") """ TBC """ - AZURE_SERVICE_BUS_NAMESPACE: ClassVar[RelationField] = RelationField( - "azureServiceBusNamespace" - ) + AZURE_SERVICE_BUS_NAMESPACE: ClassVar[RelationField] = RelationField("azureServiceBusNamespace") """ TBC """ @@ -49,32 +45,20 @@ def __setattr__(self, name, value): @property def azure_service_bus_schemas(self) -> Optional[List[AzureServiceBusSchema]]: - return ( - None - if self.attributes is None - else self.attributes.azure_service_bus_schemas - ) + return None if self.attributes is None else self.attributes.azure_service_bus_schemas @azure_service_bus_schemas.setter - def azure_service_bus_schemas( - self, azure_service_bus_schemas: Optional[List[AzureServiceBusSchema]] - ): + def azure_service_bus_schemas(self, azure_service_bus_schemas: Optional[List[AzureServiceBusSchema]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.azure_service_bus_schemas = azure_service_bus_schemas @property def azure_service_bus_namespace(self) -> Optional[AzureServiceBusNamespace]: - return ( - None - if self.attributes is None - else self.attributes.azure_service_bus_namespace - ) + return None if self.attributes is None else self.attributes.azure_service_bus_namespace @azure_service_bus_namespace.setter - def azure_service_bus_namespace( - self, azure_service_bus_namespace: Optional[AzureServiceBusNamespace] - ): + def azure_service_bus_namespace(self, azure_service_bus_namespace: Optional[AzureServiceBusNamespace]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.azure_service_bus_namespace = azure_service_bus_namespace diff --git a/pyatlan/model/assets/badge.py b/pyatlan/model/assets/badge.py index 53c2b6475..ffb3a22bc 100644 --- a/pyatlan/model/assets/badge.py +++ b/pyatlan/model/assets/badge.py @@ -51,10 +51,7 @@ def create( badge_conditions: List[BadgeCondition], ) -> Badge: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -78,15 +75,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - BADGE_CONDITIONS: ClassVar[KeywordField] = KeywordField( - "badgeConditions", "badgeConditions" - ) + BADGE_CONDITIONS: ClassVar[KeywordField] = KeywordField("badgeConditions", "badgeConditions") """ List of conditions that determine the colors to diplay for various values. """ - BADGE_METADATA_ATTRIBUTE: ClassVar[KeywordField] = KeywordField( - "badgeMetadataAttribute", "badgeMetadataAttribute" - ) + BADGE_METADATA_ATTRIBUTE: ClassVar[KeywordField] = KeywordField("badgeMetadataAttribute", "badgeMetadataAttribute") """ Custom metadata attribute for which to show the badge. """ @@ -108,11 +101,7 @@ def badge_conditions(self, badge_conditions: Optional[List[BadgeCondition]]): @property def badge_metadata_attribute(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.badge_metadata_attribute - ) + return None if self.attributes is None else self.attributes.badge_metadata_attribute @badge_metadata_attribute.setter def badge_metadata_attribute(self, badge_metadata_attribute: Optional[str]): @@ -121,9 +110,7 @@ def badge_metadata_attribute(self, badge_metadata_attribute: Optional[str]): self.attributes.badge_metadata_attribute = badge_metadata_attribute class Attributes(Asset.Attributes): - badge_conditions: Optional[List[BadgeCondition]] = Field( - default=None, description="" - ) + badge_conditions: Optional[List[BadgeCondition]] = Field(default=None, description="") badge_metadata_attribute: Optional[str] = Field(default=None, description="") @classmethod @@ -143,9 +130,7 @@ def create( from pyatlan.cache.custom_metadata_cache import CustomMetadataCache cm_id = CustomMetadataCache.get_id_for_name(cm_name) - cm_attr_id = CustomMetadataCache.get_attr_id_for_name( - set_name=cm_name, attr_name=cm_attribute - ) + cm_attr_id = CustomMetadataCache.get_attr_id_for_name(set_name=cm_name, attr_name=cm_attribute) return Badge.Attributes( name=name, qualified_name=f"badges/global/{cm_id}.{cm_attr_id}", diff --git a/pyatlan/model/assets/bigquery_tag.py b/pyatlan/model/assets/bigquery_tag.py index 98b9c715e..6227ea840 100644 --- a/pyatlan/model/assets/bigquery_tag.py +++ b/pyatlan/model/assets/bigquery_tag.py @@ -37,15 +37,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - BIGQUERY_TAG_TYPE: ClassVar[KeywordField] = KeywordField( - "bigqueryTagType", "bigqueryTagType" - ) + BIGQUERY_TAG_TYPE: ClassVar[KeywordField] = KeywordField("bigqueryTagType", "bigqueryTagType") """ The specific type or category of the Bigquery tag, which can be used for classification and organization of Bigquery assets. """ # noqa: E501 - BIGQUERY_TAG_HIERARCHY: ClassVar[KeywordField] = KeywordField( - "bigqueryTagHierarchy", "bigqueryTagHierarchy" - ) + BIGQUERY_TAG_HIERARCHY: ClassVar[KeywordField] = KeywordField("bigqueryTagHierarchy", "bigqueryTagHierarchy") """ List of top-level upstream nested bigquery tags. """ @@ -59,9 +55,7 @@ def __setattr__(self, name, value): """ Unique identifier of the tag in the source system. """ - TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( - "tagAttributes", "tagAttributes" - ) + TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("tagAttributes", "tagAttributes") """ Attributes associated with the tag in the source system. """ @@ -81,69 +75,47 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( - "queryUserCount", "queryUserCount" - ) + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( - "queryUserMap", "queryUserMap" - ) + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( - "queryCountUpdatedAt", "queryCountUpdatedAt" - ) + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "databaseName", "databaseName.keyword", "databaseName" - ) + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "databaseQualifiedName", "databaseQualifiedName" - ) + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "schemaName", "schemaName.keyword", "schemaName" - ) + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "schemaQualifiedName", "schemaQualifiedName" - ) + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "tableName", "tableName.keyword", "tableName" - ) + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "tableQualifiedName", "tableQualifiedName" - ) + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "viewName", "viewName.keyword", "viewName" - ) + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "viewQualifiedName", "viewQualifiedName" - ) + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -163,9 +135,7 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( - "lastProfiledAt", "lastProfiledAt" - ) + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -234,35 +204,23 @@ def bigquery_tag_type(self, bigquery_tag_type: Optional[str]): @property def bigquery_tag_hierarchy(self) -> Optional[List[Dict[str, str]]]: - return ( - None if self.attributes is None else self.attributes.bigquery_tag_hierarchy - ) + return None if self.attributes is None else self.attributes.bigquery_tag_hierarchy @bigquery_tag_hierarchy.setter - def bigquery_tag_hierarchy( - self, bigquery_tag_hierarchy: Optional[List[Dict[str, str]]] - ): + def bigquery_tag_hierarchy(self, bigquery_tag_hierarchy: Optional[List[Dict[str, str]]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.bigquery_tag_hierarchy = bigquery_tag_hierarchy @property def bigquery_tag_taxonomy_properties(self) -> Optional[Dict[str, str]]: - return ( - None - if self.attributes is None - else self.attributes.bigquery_tag_taxonomy_properties - ) + return None if self.attributes is None else self.attributes.bigquery_tag_taxonomy_properties @bigquery_tag_taxonomy_properties.setter - def bigquery_tag_taxonomy_properties( - self, bigquery_tag_taxonomy_properties: Optional[Dict[str, str]] - ): + def bigquery_tag_taxonomy_properties(self, bigquery_tag_taxonomy_properties: Optional[Dict[str, str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.bigquery_tag_taxonomy_properties = ( - bigquery_tag_taxonomy_properties - ) + self.attributes.bigquery_tag_taxonomy_properties = bigquery_tag_taxonomy_properties @property def tag_id(self) -> Optional[str]: @@ -296,9 +254,7 @@ def tag_allowed_values(self, tag_allowed_values: Optional[Set[str]]): @property def mapped_atlan_tag_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.mapped_atlan_tag_name - ) + return None if self.attributes is None else self.attributes.mapped_atlan_tag_name @mapped_atlan_tag_name.setter def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): @@ -338,9 +294,7 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.query_count_updated_at - ) + return None if self.attributes is None else self.attributes.query_count_updated_at @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -360,9 +314,7 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.database_qualified_name - ) + return None if self.attributes is None else self.attributes.database_qualified_name @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -382,9 +334,7 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.schema_qualified_name - ) + return None if self.attributes is None else self.attributes.schema_qualified_name @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -434,9 +384,7 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.calculation_view_name - ) + return None if self.attributes is None else self.attributes.calculation_view_name @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -446,21 +394,13 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_qualified_name - ) + return None if self.attributes is None else self.attributes.calculation_view_qualified_name @calculation_view_qualified_name.setter - def calculation_view_qualified_name( - self, calculation_view_qualified_name: Optional[str] - ): + def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = ( - calculation_view_qualified_name - ) + self.attributes.calculation_view_qualified_name = calculation_view_qualified_name @property def is_profiled(self) -> Optional[bool]: @@ -534,16 +474,10 @@ def dbt_models(self, dbt_models: Optional[List[DbtModel]]): class Attributes(Tag.Attributes): bigquery_tag_type: Optional[str] = Field(default=None, description="") - bigquery_tag_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - bigquery_tag_taxonomy_properties: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + bigquery_tag_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + bigquery_tag_taxonomy_properties: Optional[Dict[str, str]] = Field(default=None, description="") tag_id: Optional[str] = Field(default=None, description="") - tag_attributes: Optional[List[SourceTagAttribute]] = Field( - default=None, description="" - ) + tag_attributes: Optional[List[SourceTagAttribute]] = Field(default=None, description="") tag_allowed_values: Optional[Set[str]] = Field(default=None, description="") mapped_atlan_tag_name: Optional[str] = Field(default=None, description="") query_count: Optional[int] = Field(default=None, description="") @@ -559,26 +493,14 @@ class Attributes(Tag.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field( - default=None, description="" - ) + calculation_view_qualified_name: Optional[str] = Field(default=None, description="") is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship - dbt_tests: Optional[List[DbtTest]] = Field( - default=None, description="" - ) # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship + dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship attributes: BigqueryTag.Attributes = Field( default_factory=lambda: BigqueryTag.Attributes(), diff --git a/pyatlan/model/assets/business_policy.py b/pyatlan/model/assets/business_policy.py index eed3a35fd..67bec76e6 100644 --- a/pyatlan/model/assets/business_policy.py +++ b/pyatlan/model/assets/business_policy.py @@ -36,15 +36,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - BUSINESS_POLICY_TYPE: ClassVar[KeywordField] = KeywordField( - "businessPolicyType", "businessPolicyType" - ) + BUSINESS_POLICY_TYPE: ClassVar[KeywordField] = KeywordField("businessPolicyType", "businessPolicyType") """ Type of business policy """ - BUSINESS_POLICY_LONG_DESCRIPTION: ClassVar[RelationField] = RelationField( - "businessPolicyLongDescription" - ) + BUSINESS_POLICY_LONG_DESCRIPTION: ClassVar[RelationField] = RelationField("businessPolicyLongDescription") """ Body of the business policy, a long readme like document """ @@ -60,9 +56,7 @@ def __setattr__(self, name, value): """ Validity start date of the policy """ - BUSINESS_POLICY_VERSION: ClassVar[NumericField] = NumericField( - "businessPolicyVersion", "businessPolicyVersion" - ) + BUSINESS_POLICY_VERSION: ClassVar[NumericField] = NumericField("businessPolicyVersion", "businessPolicyVersion") """ Version of the policy """ @@ -72,9 +66,7 @@ def __setattr__(self, name, value): """ Duration for the business policy to complete review. """ - BUSINESS_POLICY_FILTER_DSL: ClassVar[TextField] = TextField( - "businessPolicyFilterDSL", "businessPolicyFilterDSL" - ) + BUSINESS_POLICY_FILTER_DSL: ClassVar[TextField] = TextField("businessPolicyFilterDSL", "businessPolicyFilterDSL") """ Business Policy Filter ES DSL to denote the associate asset/s involved. """ @@ -90,22 +82,16 @@ def __setattr__(self, name, value): """ Selected approval workflow id for business policy """ - BUSINESS_POLICY_RULES: ClassVar[KeywordField] = KeywordField( - "businessPolicyRules", "businessPolicyRules" - ) + BUSINESS_POLICY_RULES: ClassVar[KeywordField] = KeywordField("businessPolicyRules", "businessPolicyRules") """ List of rules applied to this business policy. """ - EXCEPTIONS_FOR_BUSINESS_POLICY: ClassVar[RelationField] = RelationField( - "exceptionsForBusinessPolicy" - ) + EXCEPTIONS_FOR_BUSINESS_POLICY: ClassVar[RelationField] = RelationField("exceptionsForBusinessPolicy") """ TBC """ - RELATED_BUSINESS_POLICIES: ClassVar[RelationField] = RelationField( - "relatedBusinessPolicies" - ) + RELATED_BUSINESS_POLICIES: ClassVar[RelationField] = RelationField("relatedBusinessPolicies") """ TBC """ @@ -137,59 +123,37 @@ def business_policy_type(self, business_policy_type: Optional[str]): @property def business_policy_long_description(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_long_description - ) + return None if self.attributes is None else self.attributes.business_policy_long_description @business_policy_long_description.setter - def business_policy_long_description( - self, business_policy_long_description: Optional[str] - ): + def business_policy_long_description(self, business_policy_long_description: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_long_description = ( - business_policy_long_description - ) + self.attributes.business_policy_long_description = business_policy_long_description @property def business_policy_valid_till(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_valid_till - ) + return None if self.attributes is None else self.attributes.business_policy_valid_till @business_policy_valid_till.setter - def business_policy_valid_till( - self, business_policy_valid_till: Optional[datetime] - ): + def business_policy_valid_till(self, business_policy_valid_till: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_valid_till = business_policy_valid_till @property def business_policy_valid_from(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_valid_from - ) + return None if self.attributes is None else self.attributes.business_policy_valid_from @business_policy_valid_from.setter - def business_policy_valid_from( - self, business_policy_valid_from: Optional[datetime] - ): + def business_policy_valid_from(self, business_policy_valid_from: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_valid_from = business_policy_valid_from @property def business_policy_version(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.business_policy_version - ) + return None if self.attributes is None else self.attributes.business_policy_version @business_policy_version.setter def business_policy_version(self, business_policy_version: Optional[int]): @@ -199,27 +163,17 @@ def business_policy_version(self, business_policy_version: Optional[int]): @property def business_policy_review_period(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_review_period - ) + return None if self.attributes is None else self.attributes.business_policy_review_period @business_policy_review_period.setter - def business_policy_review_period( - self, business_policy_review_period: Optional[str] - ): + def business_policy_review_period(self, business_policy_review_period: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_review_period = business_policy_review_period @property def business_policy_filter_d_s_l(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_filter_d_s_l - ) + return None if self.attributes is None else self.attributes.business_policy_filter_d_s_l @business_policy_filter_d_s_l.setter def business_policy_filter_d_s_l(self, business_policy_filter_d_s_l: Optional[str]): @@ -229,119 +183,69 @@ def business_policy_filter_d_s_l(self, business_policy_filter_d_s_l: Optional[st @property def business_policy_base_parent_guid(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_base_parent_guid - ) + return None if self.attributes is None else self.attributes.business_policy_base_parent_guid @business_policy_base_parent_guid.setter - def business_policy_base_parent_guid( - self, business_policy_base_parent_guid: Optional[str] - ): + def business_policy_base_parent_guid(self, business_policy_base_parent_guid: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_base_parent_guid = ( - business_policy_base_parent_guid - ) + self.attributes.business_policy_base_parent_guid = business_policy_base_parent_guid @property def business_policy_selected_approval_w_f(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_selected_approval_w_f - ) + return None if self.attributes is None else self.attributes.business_policy_selected_approval_w_f @business_policy_selected_approval_w_f.setter - def business_policy_selected_approval_w_f( - self, business_policy_selected_approval_w_f: Optional[str] - ): + def business_policy_selected_approval_w_f(self, business_policy_selected_approval_w_f: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_selected_approval_w_f = ( - business_policy_selected_approval_w_f - ) + self.attributes.business_policy_selected_approval_w_f = business_policy_selected_approval_w_f @property def business_policy_rules(self) -> Optional[List[BusinessPolicyRule]]: - return ( - None if self.attributes is None else self.attributes.business_policy_rules - ) + return None if self.attributes is None else self.attributes.business_policy_rules @business_policy_rules.setter - def business_policy_rules( - self, business_policy_rules: Optional[List[BusinessPolicyRule]] - ): + def business_policy_rules(self, business_policy_rules: Optional[List[BusinessPolicyRule]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_rules = business_policy_rules @property def exceptions_for_business_policy(self) -> Optional[List[BusinessPolicyException]]: - return ( - None - if self.attributes is None - else self.attributes.exceptions_for_business_policy - ) + return None if self.attributes is None else self.attributes.exceptions_for_business_policy @exceptions_for_business_policy.setter - def exceptions_for_business_policy( - self, exceptions_for_business_policy: Optional[List[BusinessPolicyException]] - ): + def exceptions_for_business_policy(self, exceptions_for_business_policy: Optional[List[BusinessPolicyException]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.exceptions_for_business_policy = exceptions_for_business_policy @property def related_business_policies(self) -> Optional[List[BusinessPolicy]]: - return ( - None - if self.attributes is None - else self.attributes.related_business_policies - ) + return None if self.attributes is None else self.attributes.related_business_policies @related_business_policies.setter - def related_business_policies( - self, related_business_policies: Optional[List[BusinessPolicy]] - ): + def related_business_policies(self, related_business_policies: Optional[List[BusinessPolicy]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.related_business_policies = related_business_policies class Attributes(Asset.Attributes): business_policy_type: Optional[str] = Field(default=None, description="") - business_policy_long_description: Optional[str] = Field( - default=None, description="" - ) - business_policy_valid_till: Optional[datetime] = Field( - default=None, description="" - ) - business_policy_valid_from: Optional[datetime] = Field( - default=None, description="" - ) + business_policy_long_description: Optional[str] = Field(default=None, description="") + business_policy_valid_till: Optional[datetime] = Field(default=None, description="") + business_policy_valid_from: Optional[datetime] = Field(default=None, description="") business_policy_version: Optional[int] = Field(default=None, description="") - business_policy_review_period: Optional[str] = Field( - default=None, description="" - ) - business_policy_filter_d_s_l: Optional[str] = Field( - default=None, description="" - ) - business_policy_base_parent_guid: Optional[str] = Field( - default=None, description="" - ) - business_policy_selected_approval_w_f: Optional[str] = Field( - default=None, description="" - ) - business_policy_rules: Optional[List[BusinessPolicyRule]] = Field( - default=None, description="" - ) + business_policy_review_period: Optional[str] = Field(default=None, description="") + business_policy_filter_d_s_l: Optional[str] = Field(default=None, description="") + business_policy_base_parent_guid: Optional[str] = Field(default=None, description="") + business_policy_selected_approval_w_f: Optional[str] = Field(default=None, description="") + business_policy_rules: Optional[List[BusinessPolicyRule]] = Field(default=None, description="") exceptions_for_business_policy: Optional[List[BusinessPolicyException]] = Field( default=None, description="" ) # relationship - related_business_policies: Optional[List[BusinessPolicy]] = Field( - default=None, description="" - ) # relationship + related_business_policies: Optional[List[BusinessPolicy]] = Field(default=None, description="") # relationship attributes: BusinessPolicy.Attributes = Field( default_factory=lambda: BusinessPolicy.Attributes(), diff --git a/pyatlan/model/assets/business_policy_exception.py b/pyatlan/model/assets/business_policy_exception.py index 3b36f2436..bf2fb4072 100644 --- a/pyatlan/model/assets/business_policy_exception.py +++ b/pyatlan/model/assets/business_policy_exception.py @@ -61,9 +61,7 @@ def __setattr__(self, name, value): Business Policy Exception Filter ES DSL to denote the associate asset/s involved. """ - BUSINESS_POLICY_FOR_EXCEPTION: ClassVar[RelationField] = RelationField( - "businessPolicyForException" - ) + BUSINESS_POLICY_FOR_EXCEPTION: ClassVar[RelationField] = RelationField("businessPolicyForException") """ TBC """ @@ -78,106 +76,60 @@ def __setattr__(self, name, value): @property def business_policy_exception_users(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_exception_users - ) + return None if self.attributes is None else self.attributes.business_policy_exception_users @business_policy_exception_users.setter - def business_policy_exception_users( - self, business_policy_exception_users: Optional[Set[str]] - ): + def business_policy_exception_users(self, business_policy_exception_users: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_exception_users = ( - business_policy_exception_users - ) + self.attributes.business_policy_exception_users = business_policy_exception_users @property def business_policy_exception_groups(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_exception_groups - ) + return None if self.attributes is None else self.attributes.business_policy_exception_groups @business_policy_exception_groups.setter - def business_policy_exception_groups( - self, business_policy_exception_groups: Optional[Set[str]] - ): + def business_policy_exception_groups(self, business_policy_exception_groups: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_exception_groups = ( - business_policy_exception_groups - ) + self.attributes.business_policy_exception_groups = business_policy_exception_groups @property def business_policy_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_qualified_name - ) + return None if self.attributes is None else self.attributes.business_policy_qualified_name @business_policy_qualified_name.setter - def business_policy_qualified_name( - self, business_policy_qualified_name: Optional[str] - ): + def business_policy_qualified_name(self, business_policy_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_qualified_name = business_policy_qualified_name @property def business_policy_exception_filter_d_s_l(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_exception_filter_d_s_l - ) + return None if self.attributes is None else self.attributes.business_policy_exception_filter_d_s_l @business_policy_exception_filter_d_s_l.setter - def business_policy_exception_filter_d_s_l( - self, business_policy_exception_filter_d_s_l: Optional[str] - ): + def business_policy_exception_filter_d_s_l(self, business_policy_exception_filter_d_s_l: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_exception_filter_d_s_l = ( - business_policy_exception_filter_d_s_l - ) + self.attributes.business_policy_exception_filter_d_s_l = business_policy_exception_filter_d_s_l @property def business_policy_for_exception(self) -> Optional[BusinessPolicy]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_for_exception - ) + return None if self.attributes is None else self.attributes.business_policy_for_exception @business_policy_for_exception.setter - def business_policy_for_exception( - self, business_policy_for_exception: Optional[BusinessPolicy] - ): + def business_policy_for_exception(self, business_policy_for_exception: Optional[BusinessPolicy]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_for_exception = business_policy_for_exception class Attributes(Asset.Attributes): - business_policy_exception_users: Optional[Set[str]] = Field( - default=None, description="" - ) - business_policy_exception_groups: Optional[Set[str]] = Field( - default=None, description="" - ) - business_policy_qualified_name: Optional[str] = Field( - default=None, description="" - ) - business_policy_exception_filter_d_s_l: Optional[str] = Field( - default=None, description="" - ) - business_policy_for_exception: Optional[BusinessPolicy] = Field( - default=None, description="" - ) # relationship + business_policy_exception_users: Optional[Set[str]] = Field(default=None, description="") + business_policy_exception_groups: Optional[Set[str]] = Field(default=None, description="") + business_policy_qualified_name: Optional[str] = Field(default=None, description="") + business_policy_exception_filter_d_s_l: Optional[str] = Field(default=None, description="") + business_policy_for_exception: Optional[BusinessPolicy] = Field(default=None, description="") # relationship attributes: BusinessPolicyException.Attributes = Field( default_factory=lambda: BusinessPolicyException.Attributes(), diff --git a/pyatlan/model/assets/business_policy_incident.py b/pyatlan/model/assets/business_policy_incident.py index 711c8e91d..12bdbd2dd 100644 --- a/pyatlan/model/assets/business_policy_incident.py +++ b/pyatlan/model/assets/business_policy_incident.py @@ -36,11 +36,9 @@ def __setattr__(self, name, value): """ count of noncompliant assets in the incident """ - BUSINESS_POLICY_INCIDENT_RELATED_POLICY_GUIDS: ClassVar[KeywordField] = ( - KeywordField( - "businessPolicyIncidentRelatedPolicyGUIDs", - "businessPolicyIncidentRelatedPolicyGUIDs", - ) + BUSINESS_POLICY_INCIDENT_RELATED_POLICY_GUIDS: ClassVar[KeywordField] = KeywordField( + "businessPolicyIncidentRelatedPolicyGUIDs", + "businessPolicyIncidentRelatedPolicyGUIDs", ) """ policy ids related to this incident @@ -60,29 +58,17 @@ def __setattr__(self, name, value): @property def business_policy_incident_noncompliant_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_incident_noncompliant_count - ) + return None if self.attributes is None else self.attributes.business_policy_incident_noncompliant_count @business_policy_incident_noncompliant_count.setter - def business_policy_incident_noncompliant_count( - self, business_policy_incident_noncompliant_count: Optional[int] - ): + def business_policy_incident_noncompliant_count(self, business_policy_incident_noncompliant_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_incident_noncompliant_count = ( - business_policy_incident_noncompliant_count - ) + self.attributes.business_policy_incident_noncompliant_count = business_policy_incident_noncompliant_count @property def business_policy_incident_related_policy_g_u_i_ds(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_incident_related_policy_g_u_i_ds - ) + return None if self.attributes is None else self.attributes.business_policy_incident_related_policy_g_u_i_ds @business_policy_incident_related_policy_g_u_i_ds.setter def business_policy_incident_related_policy_g_u_i_ds( @@ -96,32 +82,18 @@ def business_policy_incident_related_policy_g_u_i_ds( @property def business_policy_incident_filter_d_s_l(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_incident_filter_d_s_l - ) + return None if self.attributes is None else self.attributes.business_policy_incident_filter_d_s_l @business_policy_incident_filter_d_s_l.setter - def business_policy_incident_filter_d_s_l( - self, business_policy_incident_filter_d_s_l: Optional[str] - ): + def business_policy_incident_filter_d_s_l(self, business_policy_incident_filter_d_s_l: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_incident_filter_d_s_l = ( - business_policy_incident_filter_d_s_l - ) + self.attributes.business_policy_incident_filter_d_s_l = business_policy_incident_filter_d_s_l class Attributes(Incident.Attributes): - business_policy_incident_noncompliant_count: Optional[int] = Field( - default=None, description="" - ) - business_policy_incident_related_policy_g_u_i_ds: Optional[Set[str]] = Field( - default=None, description="" - ) - business_policy_incident_filter_d_s_l: Optional[str] = Field( - default=None, description="" - ) + business_policy_incident_noncompliant_count: Optional[int] = Field(default=None, description="") + business_policy_incident_related_policy_g_u_i_ds: Optional[Set[str]] = Field(default=None, description="") + business_policy_incident_filter_d_s_l: Optional[str] = Field(default=None, description="") attributes: BusinessPolicyIncident.Attributes = Field( default_factory=lambda: BusinessPolicyIncident.Attributes(), diff --git a/pyatlan/model/assets/business_policy_log.py b/pyatlan/model/assets/business_policy_log.py index 1183261e1..bb98cc56f 100644 --- a/pyatlan/model/assets/business_policy_log.py +++ b/pyatlan/model/assets/business_policy_log.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - BUSINESS_POLICY_ID: ClassVar[KeywordField] = KeywordField( - "businessPolicyId", "businessPolicyId" - ) + BUSINESS_POLICY_ID: ClassVar[KeywordField] = KeywordField("businessPolicyId", "businessPolicyId") """ business policy guid for which log are created """ @@ -41,21 +39,15 @@ def __setattr__(self, name, value): """ business policy type for which log are created """ - GOVERNED_ASSETS_COUNT: ClassVar[NumericField] = NumericField( - "governedAssetsCount", "governedAssetsCount" - ) + GOVERNED_ASSETS_COUNT: ClassVar[NumericField] = NumericField("governedAssetsCount", "governedAssetsCount") """ number of governed assets in the policy """ - NON_GOVERNED_ASSETS_COUNT: ClassVar[NumericField] = NumericField( - "nonGovernedAssetsCount", "nonGovernedAssetsCount" - ) + NON_GOVERNED_ASSETS_COUNT: ClassVar[NumericField] = NumericField("nonGovernedAssetsCount", "nonGovernedAssetsCount") """ number of non governed assets in the policy """ - COMPLIANT_ASSETS_COUNT: ClassVar[NumericField] = NumericField( - "compliantAssetsCount", "compliantAssetsCount" - ) + COMPLIANT_ASSETS_COUNT: ClassVar[NumericField] = NumericField("compliantAssetsCount", "compliantAssetsCount") """ number of compliant assets in the policy """ @@ -87,27 +79,17 @@ def business_policy_id(self, business_policy_id: Optional[str]): @property def business_policy_log_policy_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.business_policy_log_policy_type - ) + return None if self.attributes is None else self.attributes.business_policy_log_policy_type @business_policy_log_policy_type.setter - def business_policy_log_policy_type( - self, business_policy_log_policy_type: Optional[str] - ): + def business_policy_log_policy_type(self, business_policy_log_policy_type: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_log_policy_type = ( - business_policy_log_policy_type - ) + self.attributes.business_policy_log_policy_type = business_policy_log_policy_type @property def governed_assets_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.governed_assets_count - ) + return None if self.attributes is None else self.attributes.governed_assets_count @governed_assets_count.setter def governed_assets_count(self, governed_assets_count: Optional[int]): @@ -117,11 +99,7 @@ def governed_assets_count(self, governed_assets_count: Optional[int]): @property def non_governed_assets_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.non_governed_assets_count - ) + return None if self.attributes is None else self.attributes.non_governed_assets_count @non_governed_assets_count.setter def non_governed_assets_count(self, non_governed_assets_count: Optional[int]): @@ -131,9 +109,7 @@ def non_governed_assets_count(self, non_governed_assets_count: Optional[int]): @property def compliant_assets_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.compliant_assets_count - ) + return None if self.attributes is None else self.attributes.compliant_assets_count @compliant_assets_count.setter def compliant_assets_count(self, compliant_assets_count: Optional[int]): @@ -143,11 +119,7 @@ def compliant_assets_count(self, compliant_assets_count: Optional[int]): @property def non_compliant_assets_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.non_compliant_assets_count - ) + return None if self.attributes is None else self.attributes.non_compliant_assets_count @non_compliant_assets_count.setter def non_compliant_assets_count(self, non_compliant_assets_count: Optional[int]): @@ -157,9 +129,7 @@ def non_compliant_assets_count(self, non_compliant_assets_count: Optional[int]): class Attributes(Asset.Attributes): business_policy_id: Optional[str] = Field(default=None, description="") - business_policy_log_policy_type: Optional[str] = Field( - default=None, description="" - ) + business_policy_log_policy_type: Optional[str] = Field(default=None, description="") governed_assets_count: Optional[int] = Field(default=None, description="") non_governed_assets_count: Optional[int] = Field(default=None, description="") compliant_assets_count: Optional[int] = Field(default=None, description="") diff --git a/pyatlan/model/assets/cognite3_d_model.py b/pyatlan/model/assets/cognite3_d_model.py index 2aa949b13..8c6f3de87 100644 --- a/pyatlan/model/assets/cognite3_d_model.py +++ b/pyatlan/model/assets/cognite3_d_model.py @@ -49,9 +49,7 @@ def cognite_asset(self, cognite_asset: Optional[CogniteAsset]): self.attributes.cognite_asset = cognite_asset class Attributes(Cognite.Attributes): - cognite_asset: Optional[CogniteAsset] = Field( - default=None, description="" - ) # relationship + cognite_asset: Optional[CogniteAsset] = Field(default=None, description="") # relationship attributes: Cognite3DModel.Attributes = Field( default_factory=lambda: Cognite3DModel.Attributes(), diff --git a/pyatlan/model/assets/cognite_asset.py b/pyatlan/model/assets/cognite_asset.py index b0a7fb570..eed8604ec 100644 --- a/pyatlan/model/assets/cognite_asset.py +++ b/pyatlan/model/assets/cognite_asset.py @@ -109,21 +109,11 @@ def cognite_sequences(self, cognite_sequences: Optional[List[CogniteSequence]]): self.attributes.cognite_sequences = cognite_sequences class Attributes(Cognite.Attributes): - cognite_events: Optional[List[CogniteEvent]] = Field( - default=None, description="" - ) # relationship - cognite_timeseries: Optional[List[CogniteTimeSeries]] = Field( - default=None, description="" - ) # relationship - cognite3dmodels: Optional[List[Cognite3DModel]] = Field( - default=None, description="" - ) # relationship - cognite_files: Optional[List[CogniteFile]] = Field( - default=None, description="" - ) # relationship - cognite_sequences: Optional[List[CogniteSequence]] = Field( - default=None, description="" - ) # relationship + cognite_events: Optional[List[CogniteEvent]] = Field(default=None, description="") # relationship + cognite_timeseries: Optional[List[CogniteTimeSeries]] = Field(default=None, description="") # relationship + cognite3dmodels: Optional[List[Cognite3DModel]] = Field(default=None, description="") # relationship + cognite_files: Optional[List[CogniteFile]] = Field(default=None, description="") # relationship + cognite_sequences: Optional[List[CogniteSequence]] = Field(default=None, description="") # relationship attributes: CogniteAsset.Attributes = Field( default_factory=lambda: CogniteAsset.Attributes(), diff --git a/pyatlan/model/assets/cognite_event.py b/pyatlan/model/assets/cognite_event.py index b2eb4c13b..3e544c3d1 100644 --- a/pyatlan/model/assets/cognite_event.py +++ b/pyatlan/model/assets/cognite_event.py @@ -49,9 +49,7 @@ def cognite_asset(self, cognite_asset: Optional[CogniteAsset]): self.attributes.cognite_asset = cognite_asset class Attributes(Cognite.Attributes): - cognite_asset: Optional[CogniteAsset] = Field( - default=None, description="" - ) # relationship + cognite_asset: Optional[CogniteAsset] = Field(default=None, description="") # relationship attributes: CogniteEvent.Attributes = Field( default_factory=lambda: CogniteEvent.Attributes(), diff --git a/pyatlan/model/assets/cognite_file.py b/pyatlan/model/assets/cognite_file.py index f4a3353d8..9d22ab254 100644 --- a/pyatlan/model/assets/cognite_file.py +++ b/pyatlan/model/assets/cognite_file.py @@ -49,9 +49,7 @@ def cognite_asset(self, cognite_asset: Optional[CogniteAsset]): self.attributes.cognite_asset = cognite_asset class Attributes(Cognite.Attributes): - cognite_asset: Optional[CogniteAsset] = Field( - default=None, description="" - ) # relationship + cognite_asset: Optional[CogniteAsset] = Field(default=None, description="") # relationship attributes: CogniteFile.Attributes = Field( default_factory=lambda: CogniteFile.Attributes(), diff --git a/pyatlan/model/assets/cognite_sequence.py b/pyatlan/model/assets/cognite_sequence.py index 9ae5c38c8..eff5ba2e7 100644 --- a/pyatlan/model/assets/cognite_sequence.py +++ b/pyatlan/model/assets/cognite_sequence.py @@ -49,9 +49,7 @@ def cognite_asset(self, cognite_asset: Optional[CogniteAsset]): self.attributes.cognite_asset = cognite_asset class Attributes(Cognite.Attributes): - cognite_asset: Optional[CogniteAsset] = Field( - default=None, description="" - ) # relationship + cognite_asset: Optional[CogniteAsset] = Field(default=None, description="") # relationship attributes: CogniteSequence.Attributes = Field( default_factory=lambda: CogniteSequence.Attributes(), diff --git a/pyatlan/model/assets/cognite_time_series.py b/pyatlan/model/assets/cognite_time_series.py index 41d07504c..5163d63c4 100644 --- a/pyatlan/model/assets/cognite_time_series.py +++ b/pyatlan/model/assets/cognite_time_series.py @@ -49,9 +49,7 @@ def cognite_asset(self, cognite_asset: Optional[CogniteAsset]): self.attributes.cognite_asset = cognite_asset class Attributes(Cognite.Attributes): - cognite_asset: Optional[CogniteAsset] = Field( - default=None, description="" - ) # relationship + cognite_asset: Optional[CogniteAsset] = Field(default=None, description="") # relationship attributes: CogniteTimeSeries.Attributes = Field( default_factory=lambda: CogniteTimeSeries.Attributes(), diff --git a/pyatlan/model/assets/cognos.py b/pyatlan/model/assets/cognos.py index df298bd11..3858a863b 100644 --- a/pyatlan/model/assets/cognos.py +++ b/pyatlan/model/assets/cognos.py @@ -54,9 +54,7 @@ def __setattr__(self, name, value): """ Qualified name of the parent asset in Cognos """ - COGNOS_VERSION: ClassVar[KeywordField] = KeywordField( - "cognosVersion", "cognosVersion" - ) + COGNOS_VERSION: ClassVar[KeywordField] = KeywordField("cognosVersion", "cognosVersion") """ Version of the Cognos asset """ @@ -64,21 +62,15 @@ def __setattr__(self, name, value): """ Cognos type of the Cognos asset. E.g. report, dashboard, package, etc. """ - COGNOS_IS_HIDDEN: ClassVar[BooleanField] = BooleanField( - "cognosIsHidden", "cognosIsHidden" - ) + COGNOS_IS_HIDDEN: ClassVar[BooleanField] = BooleanField("cognosIsHidden", "cognosIsHidden") """ Whether the Cognos asset is hidden from the ui """ - COGNOS_IS_DISABLED: ClassVar[BooleanField] = BooleanField( - "cognosIsDisabled", "cognosIsDisabled" - ) + COGNOS_IS_DISABLED: ClassVar[BooleanField] = BooleanField("cognosIsDisabled", "cognosIsDisabled") """ Whether the Cognos asset is diabled """ - COGNOS_DEFAULT_SCREEN_TIP: ClassVar[TextField] = TextField( - "cognosDefaultScreenTip", "cognosDefaultScreenTip" - ) + COGNOS_DEFAULT_SCREEN_TIP: ClassVar[TextField] = TextField("cognosDefaultScreenTip", "cognosDefaultScreenTip") """ Tooltip text present for the Cognos asset """ @@ -127,11 +119,7 @@ def cognos_parent_name(self, cognos_parent_name: Optional[str]): @property def cognos_parent_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cognos_parent_qualified_name - ) + return None if self.attributes is None else self.attributes.cognos_parent_qualified_name @cognos_parent_qualified_name.setter def cognos_parent_qualified_name(self, cognos_parent_qualified_name: Optional[str]): @@ -181,11 +169,7 @@ def cognos_is_disabled(self, cognos_is_disabled: Optional[bool]): @property def cognos_default_screen_tip(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cognos_default_screen_tip - ) + return None if self.attributes is None else self.attributes.cognos_default_screen_tip @cognos_default_screen_tip.setter def cognos_default_screen_tip(self, cognos_default_screen_tip: Optional[str]): @@ -197,9 +181,7 @@ class Attributes(BI.Attributes): cognos_id: Optional[str] = Field(default=None, description="") cognos_path: Optional[str] = Field(default=None, description="") cognos_parent_name: Optional[str] = Field(default=None, description="") - cognos_parent_qualified_name: Optional[str] = Field( - default=None, description="" - ) + cognos_parent_qualified_name: Optional[str] = Field(default=None, description="") cognos_version: Optional[str] = Field(default=None, description="") cognos_type: Optional[str] = Field(default=None, description="") cognos_is_hidden: Optional[bool] = Field(default=None, description="") diff --git a/pyatlan/model/assets/cognos_dashboard.py b/pyatlan/model/assets/cognos_dashboard.py index 8d3fc0e4c..409883094 100644 --- a/pyatlan/model/assets/cognos_dashboard.py +++ b/pyatlan/model/assets/cognos_dashboard.py @@ -49,9 +49,7 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field( - default=None, description="" - ) # relationship + cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship attributes: CognosDashboard.Attributes = Field( default_factory=lambda: CognosDashboard.Attributes(), diff --git a/pyatlan/model/assets/cognos_datasource.py b/pyatlan/model/assets/cognos_datasource.py index bf1b4fd67..29dbdee3b 100644 --- a/pyatlan/model/assets/cognos_datasource.py +++ b/pyatlan/model/assets/cognos_datasource.py @@ -42,26 +42,16 @@ def __setattr__(self, name, value): @property def cognos_datasource_connection_string(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cognos_datasource_connection_string - ) + return None if self.attributes is None else self.attributes.cognos_datasource_connection_string @cognos_datasource_connection_string.setter - def cognos_datasource_connection_string( - self, cognos_datasource_connection_string: Optional[str] - ): + def cognos_datasource_connection_string(self, cognos_datasource_connection_string: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cognos_datasource_connection_string = ( - cognos_datasource_connection_string - ) + self.attributes.cognos_datasource_connection_string = cognos_datasource_connection_string class Attributes(Cognos.Attributes): - cognos_datasource_connection_string: Optional[str] = Field( - default=None, description="" - ) + cognos_datasource_connection_string: Optional[str] = Field(default=None, description="") attributes: CognosDatasource.Attributes = Field( default_factory=lambda: CognosDatasource.Attributes(), diff --git a/pyatlan/model/assets/cognos_exploration.py b/pyatlan/model/assets/cognos_exploration.py index 4590fa35d..dd0839c2e 100644 --- a/pyatlan/model/assets/cognos_exploration.py +++ b/pyatlan/model/assets/cognos_exploration.py @@ -49,9 +49,7 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field( - default=None, description="" - ) # relationship + cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship attributes: CognosExploration.Attributes = Field( default_factory=lambda: CognosExploration.Attributes(), diff --git a/pyatlan/model/assets/cognos_file.py b/pyatlan/model/assets/cognos_file.py index fed312a15..882d47f80 100644 --- a/pyatlan/model/assets/cognos_file.py +++ b/pyatlan/model/assets/cognos_file.py @@ -49,9 +49,7 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field( - default=None, description="" - ) # relationship + cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship attributes: CognosFile.Attributes = Field( default_factory=lambda: CognosFile.Attributes(), diff --git a/pyatlan/model/assets/cognos_folder.py b/pyatlan/model/assets/cognos_folder.py index bf3d74f2e..b0749d555 100644 --- a/pyatlan/model/assets/cognos_folder.py +++ b/pyatlan/model/assets/cognos_folder.py @@ -90,37 +90,23 @@ def __setattr__(self, name, value): @property def cognos_folder_sub_folder_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.cognos_folder_sub_folder_count - ) + return None if self.attributes is None else self.attributes.cognos_folder_sub_folder_count @cognos_folder_sub_folder_count.setter - def cognos_folder_sub_folder_count( - self, cognos_folder_sub_folder_count: Optional[int] - ): + def cognos_folder_sub_folder_count(self, cognos_folder_sub_folder_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cognos_folder_sub_folder_count = cognos_folder_sub_folder_count @property def cognos_folder_child_objects_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.cognos_folder_child_objects_count - ) + return None if self.attributes is None else self.attributes.cognos_folder_child_objects_count @cognos_folder_child_objects_count.setter - def cognos_folder_child_objects_count( - self, cognos_folder_child_objects_count: Optional[int] - ): + def cognos_folder_child_objects_count(self, cognos_folder_child_objects_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cognos_folder_child_objects_count = ( - cognos_folder_child_objects_count - ) + self.attributes.cognos_folder_child_objects_count = cognos_folder_child_objects_count @property def cognos_packages(self) -> Optional[List[CognosPackage]]: @@ -197,44 +183,22 @@ def cognos_explorations(self) -> Optional[List[CognosExploration]]: return None if self.attributes is None else self.attributes.cognos_explorations @cognos_explorations.setter - def cognos_explorations( - self, cognos_explorations: Optional[List[CognosExploration]] - ): + def cognos_explorations(self, cognos_explorations: Optional[List[CognosExploration]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cognos_explorations = cognos_explorations class Attributes(Cognos.Attributes): - cognos_folder_sub_folder_count: Optional[int] = Field( - default=None, description="" - ) - cognos_folder_child_objects_count: Optional[int] = Field( - default=None, description="" - ) - cognos_packages: Optional[List[CognosPackage]] = Field( - default=None, description="" - ) # relationship - cognos_reports: Optional[List[CognosReport]] = Field( - default=None, description="" - ) # relationship - cognos_dashboards: Optional[List[CognosDashboard]] = Field( - default=None, description="" - ) # relationship - cognos_sub_folders: Optional[List[CognosFolder]] = Field( - default=None, description="" - ) # relationship - cognos_folder: Optional[CognosFolder] = Field( - default=None, description="" - ) # relationship - cognos_modules: Optional[List[CognosModule]] = Field( - default=None, description="" - ) # relationship - cognos_files: Optional[List[CognosFile]] = Field( - default=None, description="" - ) # relationship - cognos_explorations: Optional[List[CognosExploration]] = Field( - default=None, description="" - ) # relationship + cognos_folder_sub_folder_count: Optional[int] = Field(default=None, description="") + cognos_folder_child_objects_count: Optional[int] = Field(default=None, description="") + cognos_packages: Optional[List[CognosPackage]] = Field(default=None, description="") # relationship + cognos_reports: Optional[List[CognosReport]] = Field(default=None, description="") # relationship + cognos_dashboards: Optional[List[CognosDashboard]] = Field(default=None, description="") # relationship + cognos_sub_folders: Optional[List[CognosFolder]] = Field(default=None, description="") # relationship + cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship + cognos_modules: Optional[List[CognosModule]] = Field(default=None, description="") # relationship + cognos_files: Optional[List[CognosFile]] = Field(default=None, description="") # relationship + cognos_explorations: Optional[List[CognosExploration]] = Field(default=None, description="") # relationship attributes: CognosFolder.Attributes = Field( default_factory=lambda: CognosFolder.Attributes(), diff --git a/pyatlan/model/assets/cognos_module.py b/pyatlan/model/assets/cognos_module.py index b0e037d2b..8faab9c32 100644 --- a/pyatlan/model/assets/cognos_module.py +++ b/pyatlan/model/assets/cognos_module.py @@ -49,9 +49,7 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field( - default=None, description="" - ) # relationship + cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship attributes: CognosModule.Attributes = Field( default_factory=lambda: CognosModule.Attributes(), diff --git a/pyatlan/model/assets/cognos_package.py b/pyatlan/model/assets/cognos_package.py index 7cfadf8bb..f5a49dd03 100644 --- a/pyatlan/model/assets/cognos_package.py +++ b/pyatlan/model/assets/cognos_package.py @@ -49,9 +49,7 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field( - default=None, description="" - ) # relationship + cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship attributes: CognosPackage.Attributes = Field( default_factory=lambda: CognosPackage.Attributes(), diff --git a/pyatlan/model/assets/cognos_report.py b/pyatlan/model/assets/cognos_report.py index b901e1354..7a7cd5d54 100644 --- a/pyatlan/model/assets/cognos_report.py +++ b/pyatlan/model/assets/cognos_report.py @@ -49,9 +49,7 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field( - default=None, description="" - ) # relationship + cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship attributes: CognosReport.Attributes = Field( default_factory=lambda: CognosReport.Attributes(), diff --git a/pyatlan/model/assets/collection.py b/pyatlan/model/assets/collection.py index 1c3086424..d91f73c5e 100644 --- a/pyatlan/model/assets/collection.py +++ b/pyatlan/model/assets/collection.py @@ -40,9 +40,7 @@ def _generate_qualified_name(cls, client: AtlanClient): username = client.user.get_current().username return f"default/collection/{username}/{uuid4()}" except AtlanError as e: - raise ErrorCode.UNABLE_TO_GENERATE_QN.exception_with_parameters( - cls.__name__, e - ) from e + raise ErrorCode.UNABLE_TO_GENERATE_QN.exception_with_parameters(cls.__name__, e) from e type_name: str = Field(default="Collection", allow_mutation=False) diff --git a/pyatlan/model/assets/connection.py b/pyatlan/model/assets/connection.py index 33726ce24..eb0f06a3d 100644 --- a/pyatlan/model/assets/connection.py +++ b/pyatlan/model/assets/connection.py @@ -40,9 +40,7 @@ def creator( ) -> Connection: validate_required_fields(["name", "connector_type"], [name, connector_type]) if not admin_users and not admin_groups and not admin_roles: - raise ValueError( - "One of admin_user, admin_groups or admin_roles is required" - ) + raise ValueError("One of admin_user, admin_groups or admin_roles is required") attr = cls.Attributes( name=name, qualified_name=connector_type.to_qualified_name(), @@ -68,10 +66,7 @@ def create( admin_roles: Optional[List[str]] = None, ) -> Connection: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -116,15 +111,11 @@ def __setattr__(self, name, value): """ Whether using this connection to run queries on the source is allowed (true) or not (false). """ - ALLOW_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( - "allowQueryPreview", "allowQueryPreview" - ) + ALLOW_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("allowQueryPreview", "allowQueryPreview") """ Whether using this connection to run preview queries on the source is allowed (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( - "queryPreviewConfig", "queryPreviewConfig" - ) + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") """ Configuration for preview queries. """ @@ -132,9 +123,7 @@ def __setattr__(self, name, value): """ Query config for this connection. """ - CREDENTIAL_STRATEGY: ClassVar[TextField] = TextField( - "credentialStrategy", "credentialStrategy" - ) + CREDENTIAL_STRATEGY: ClassVar[TextField] = TextField("credentialStrategy", "credentialStrategy") """ Credential strategy to use for this connection for queries. """ @@ -144,9 +133,7 @@ def __setattr__(self, name, value): """ Credential strategy to use for this connection for preview queries. """ - POLICY_STRATEGY: ClassVar[KeywordField] = KeywordField( - "policyStrategy", "policyStrategy" - ) + POLICY_STRATEGY: ClassVar[KeywordField] = KeywordField("policyStrategy", "policyStrategy") """ Policy strategy is a configuration that determines whether the Atlan policy will be applied to the results of insight queries and whether the query will be rewritten, applicable for stream api call made from insight screen """ # noqa: E501 @@ -156,9 +143,7 @@ def __setattr__(self, name, value): """ Policy strategy is a configuration that determines whether the Atlan policy will be applied to the results of insight queries and whether the query will be rewritten. policyStrategyForSamplePreview config is applicable for sample preview call from assets screen """ # noqa: E501 - QUERY_USERNAME_STRATEGY: ClassVar[KeywordField] = KeywordField( - "queryUsernameStrategy", "queryUsernameStrategy" - ) + QUERY_USERNAME_STRATEGY: ClassVar[KeywordField] = KeywordField("queryUsernameStrategy", "queryUsernameStrategy") """ Username strategy to use for this connection for queries. """ @@ -170,9 +155,7 @@ def __setattr__(self, name, value): """ Maximum time a query should be allowed to run before timing out. """ - DEFAULT_CREDENTIAL_GUID: ClassVar[TextField] = TextField( - "defaultCredentialGuid", "defaultCredentialGuid" - ) + DEFAULT_CREDENTIAL_GUID: ClassVar[TextField] = TextField("defaultCredentialGuid", "defaultCredentialGuid") """ Unique identifier (GUID) for the default credentials to use for this connection. """ @@ -200,9 +183,7 @@ def __setattr__(self, name, value): """ Number of days over which popularity is calculated, for example 30 days. """ - HAS_POPULARITY_INSIGHTS: ClassVar[BooleanField] = BooleanField( - "hasPopularityInsights", "hasPopularityInsights" - ) + HAS_POPULARITY_INSIGHTS: ClassVar[BooleanField] = BooleanField("hasPopularityInsights", "hasPopularityInsights") """ Whether this connection has popularity insights (true) or not (false). """ @@ -218,9 +199,7 @@ def __setattr__(self, name, value): """ Unique identifier (GUID) for the SSO credentials to use for this connection. """ - USE_OBJECT_STORAGE: ClassVar[BooleanField] = BooleanField( - "useObjectStorage", "useObjectStorage" - ) + USE_OBJECT_STORAGE: ClassVar[BooleanField] = BooleanField("useObjectStorage", "useObjectStorage") """ Whether to upload to S3, GCP, or another storage location (true) or not (false). """ @@ -366,11 +345,7 @@ def credential_strategy(self, credential_strategy: Optional[str]): @property def preview_credential_strategy(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.preview_credential_strategy - ) + return None if self.attributes is None else self.attributes.preview_credential_strategy @preview_credential_strategy.setter def preview_credential_strategy(self, preview_credential_strategy: Optional[str]): @@ -390,32 +365,20 @@ def policy_strategy(self, policy_strategy: Optional[str]): @property def policy_strategy_for_sample_preview(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.policy_strategy_for_sample_preview - ) + return None if self.attributes is None else self.attributes.policy_strategy_for_sample_preview @policy_strategy_for_sample_preview.setter - def policy_strategy_for_sample_preview( - self, policy_strategy_for_sample_preview: Optional[str] - ): + def policy_strategy_for_sample_preview(self, policy_strategy_for_sample_preview: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.policy_strategy_for_sample_preview = ( - policy_strategy_for_sample_preview - ) + self.attributes.policy_strategy_for_sample_preview = policy_strategy_for_sample_preview @property def query_username_strategy(self) -> Optional[QueryUsernameStrategy]: - return ( - None if self.attributes is None else self.attributes.query_username_strategy - ) + return None if self.attributes is None else self.attributes.query_username_strategy @query_username_strategy.setter - def query_username_strategy( - self, query_username_strategy: Optional[QueryUsernameStrategy] - ): + def query_username_strategy(self, query_username_strategy: Optional[QueryUsernameStrategy]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.query_username_strategy = query_username_strategy @@ -442,9 +405,7 @@ def query_timeout(self, query_timeout: Optional[int]): @property def default_credential_guid(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.default_credential_guid - ) + return None if self.attributes is None else self.attributes.default_credential_guid @default_credential_guid.setter def default_credential_guid(self, default_credential_guid: Optional[str]): @@ -484,41 +445,27 @@ def source_logo(self, source_logo: Optional[str]): @property def is_sample_data_preview_enabled(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.is_sample_data_preview_enabled - ) + return None if self.attributes is None else self.attributes.is_sample_data_preview_enabled @is_sample_data_preview_enabled.setter - def is_sample_data_preview_enabled( - self, is_sample_data_preview_enabled: Optional[bool] - ): + def is_sample_data_preview_enabled(self, is_sample_data_preview_enabled: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.is_sample_data_preview_enabled = is_sample_data_preview_enabled @property def popularity_insights_timeframe(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.popularity_insights_timeframe - ) + return None if self.attributes is None else self.attributes.popularity_insights_timeframe @popularity_insights_timeframe.setter - def popularity_insights_timeframe( - self, popularity_insights_timeframe: Optional[int] - ): + def popularity_insights_timeframe(self, popularity_insights_timeframe: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.popularity_insights_timeframe = popularity_insights_timeframe @property def has_popularity_insights(self) -> Optional[bool]: - return ( - None if self.attributes is None else self.attributes.has_popularity_insights - ) + return None if self.attributes is None else self.attributes.has_popularity_insights @has_popularity_insights.setter def has_popularity_insights(self, has_popularity_insights: Optional[bool]): @@ -528,37 +475,23 @@ def has_popularity_insights(self, has_popularity_insights: Optional[bool]): @property def connection_dbt_environments(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.connection_dbt_environments - ) + return None if self.attributes is None else self.attributes.connection_dbt_environments @connection_dbt_environments.setter - def connection_dbt_environments( - self, connection_dbt_environments: Optional[Set[str]] - ): + def connection_dbt_environments(self, connection_dbt_environments: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.connection_dbt_environments = connection_dbt_environments @property def connection_s_s_o_credential_guid(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.connection_s_s_o_credential_guid - ) + return None if self.attributes is None else self.attributes.connection_s_s_o_credential_guid @connection_s_s_o_credential_guid.setter - def connection_s_s_o_credential_guid( - self, connection_s_s_o_credential_guid: Optional[str] - ): + def connection_s_s_o_credential_guid(self, connection_s_s_o_credential_guid: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.connection_s_s_o_credential_guid = ( - connection_s_s_o_credential_guid - ) + self.attributes.connection_s_s_o_credential_guid = connection_s_s_o_credential_guid @property def use_object_storage(self) -> Optional[bool]: @@ -572,29 +505,17 @@ def use_object_storage(self, use_object_storage: Optional[bool]): @property def object_storage_upload_threshold(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.object_storage_upload_threshold - ) + return None if self.attributes is None else self.attributes.object_storage_upload_threshold @object_storage_upload_threshold.setter - def object_storage_upload_threshold( - self, object_storage_upload_threshold: Optional[int] - ): + def object_storage_upload_threshold(self, object_storage_upload_threshold: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.object_storage_upload_threshold = ( - object_storage_upload_threshold - ) + self.attributes.object_storage_upload_threshold = object_storage_upload_threshold @property def vector_embeddings_enabled(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.vector_embeddings_enabled - ) + return None if self.attributes is None else self.attributes.vector_embeddings_enabled @vector_embeddings_enabled.setter def vector_embeddings_enabled(self, vector_embeddings_enabled: Optional[bool]): @@ -604,16 +525,10 @@ def vector_embeddings_enabled(self, vector_embeddings_enabled: Optional[bool]): @property def vector_embeddings_updated_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.vector_embeddings_updated_at - ) + return None if self.attributes is None else self.attributes.vector_embeddings_updated_at @vector_embeddings_updated_at.setter - def vector_embeddings_updated_at( - self, vector_embeddings_updated_at: Optional[datetime] - ): + def vector_embeddings_updated_at(self, vector_embeddings_updated_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.vector_embeddings_updated_at = vector_embeddings_updated_at @@ -625,46 +540,28 @@ class Attributes(Asset.Attributes): port: Optional[int] = Field(default=None, description="") allow_query: Optional[bool] = Field(default=None, description="") allow_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") query_config: Optional[str] = Field(default=None, description="") credential_strategy: Optional[str] = Field(default=None, description="") preview_credential_strategy: Optional[str] = Field(default=None, description="") policy_strategy: Optional[str] = Field(default=None, description="") - policy_strategy_for_sample_preview: Optional[str] = Field( - default=None, description="" - ) - query_username_strategy: Optional[QueryUsernameStrategy] = Field( - default=None, description="" - ) + policy_strategy_for_sample_preview: Optional[str] = Field(default=None, description="") + query_username_strategy: Optional[QueryUsernameStrategy] = Field(default=None, description="") row_limit: Optional[int] = Field(default=None, description="") query_timeout: Optional[int] = Field(default=None, description="") default_credential_guid: Optional[str] = Field(default=None, description="") connector_icon: Optional[str] = Field(default=None, description="") connector_image: Optional[str] = Field(default=None, description="") source_logo: Optional[str] = Field(default=None, description="") - is_sample_data_preview_enabled: Optional[bool] = Field( - default=None, description="" - ) - popularity_insights_timeframe: Optional[int] = Field( - default=None, description="" - ) + is_sample_data_preview_enabled: Optional[bool] = Field(default=None, description="") + popularity_insights_timeframe: Optional[int] = Field(default=None, description="") has_popularity_insights: Optional[bool] = Field(default=None, description="") - connection_dbt_environments: Optional[Set[str]] = Field( - default=None, description="" - ) - connection_s_s_o_credential_guid: Optional[str] = Field( - default=None, description="" - ) + connection_dbt_environments: Optional[Set[str]] = Field(default=None, description="") + connection_s_s_o_credential_guid: Optional[str] = Field(default=None, description="") use_object_storage: Optional[bool] = Field(default=None, description="") - object_storage_upload_threshold: Optional[int] = Field( - default=None, description="" - ) + object_storage_upload_threshold: Optional[int] = Field(default=None, description="") vector_embeddings_enabled: Optional[bool] = Field(default=None, description="") - vector_embeddings_updated_at: Optional[datetime] = Field( - default=None, description="" - ) + vector_embeddings_updated_at: Optional[datetime] = Field(default=None, description="") is_loaded: bool = Field(default=True) diff --git a/pyatlan/model/assets/core/a_d_f.py b/pyatlan/model/assets/core/a_d_f.py index 6806470ff..89a8121b6 100644 --- a/pyatlan/model/assets/core/a_d_f.py +++ b/pyatlan/model/assets/core/a_d_f.py @@ -29,15 +29,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ADF_FACTORY_NAME: ClassVar[TextField] = TextField( - "adfFactoryName", "adfFactoryName" - ) + ADF_FACTORY_NAME: ClassVar[TextField] = TextField("adfFactoryName", "adfFactoryName") """ Defines the name of the factory in which this asset exists. """ - ADF_ASSET_FOLDER_PATH: ClassVar[TextField] = TextField( - "adfAssetFolderPath", "adfAssetFolderPath" - ) + ADF_ASSET_FOLDER_PATH: ClassVar[TextField] = TextField("adfAssetFolderPath", "adfAssetFolderPath") """ Defines the folder path in which this ADF asset exists. """ @@ -59,9 +55,7 @@ def adf_factory_name(self, adf_factory_name: Optional[str]): @property def adf_asset_folder_path(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.adf_asset_folder_path - ) + return None if self.attributes is None else self.attributes.adf_asset_folder_path @adf_asset_folder_path.setter def adf_asset_folder_path(self, adf_asset_folder_path: Optional[str]): diff --git a/pyatlan/model/assets/core/access_control.py b/pyatlan/model/assets/core/access_control.py index f0cf58cae..fd26a983d 100644 --- a/pyatlan/model/assets/core/access_control.py +++ b/pyatlan/model/assets/core/access_control.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - IS_ACCESS_CONTROL_ENABLED: ClassVar[BooleanField] = BooleanField( - "isAccessControlEnabled", "isAccessControlEnabled" - ) + IS_ACCESS_CONTROL_ENABLED: ClassVar[BooleanField] = BooleanField("isAccessControlEnabled", "isAccessControlEnabled") """ TBC """ @@ -46,15 +44,11 @@ def __setattr__(self, name, value): """ TBC """ - DENY_ASSET_TABS: ClassVar[KeywordField] = KeywordField( - "denyAssetTabs", "denyAssetTabs" - ) + DENY_ASSET_TABS: ClassVar[KeywordField] = KeywordField("denyAssetTabs", "denyAssetTabs") """ TBC """ - DENY_ASSET_FILTERS: ClassVar[TextField] = TextField( - "denyAssetFilters", "denyAssetFilters" - ) + DENY_ASSET_FILTERS: ClassVar[TextField] = TextField("denyAssetFilters", "denyAssetFilters") """ TBC """ @@ -62,27 +56,19 @@ def __setattr__(self, name, value): """ TBC """ - DENY_ASSET_TYPES: ClassVar[TextField] = TextField( - "denyAssetTypes", "denyAssetTypes" - ) + DENY_ASSET_TYPES: ClassVar[TextField] = TextField("denyAssetTypes", "denyAssetTypes") """ TBC """ - DENY_NAVIGATION_PAGES: ClassVar[TextField] = TextField( - "denyNavigationPages", "denyNavigationPages" - ) + DENY_NAVIGATION_PAGES: ClassVar[TextField] = TextField("denyNavigationPages", "denyNavigationPages") """ TBC """ - DEFAULT_NAVIGATION: ClassVar[TextField] = TextField( - "defaultNavigation", "defaultNavigation" - ) + DEFAULT_NAVIGATION: ClassVar[TextField] = TextField("defaultNavigation", "defaultNavigation") """ TBC """ - DISPLAY_PREFERENCES: ClassVar[KeywordField] = KeywordField( - "displayPreferences", "displayPreferences" - ) + DISPLAY_PREFERENCES: ClassVar[KeywordField] = KeywordField("displayPreferences", "displayPreferences") """ TBC """ @@ -107,11 +93,7 @@ def __setattr__(self, name, value): @property def is_access_control_enabled(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.is_access_control_enabled - ) + return None if self.attributes is None else self.attributes.is_access_control_enabled @is_access_control_enabled.setter def is_access_control_enabled(self, is_access_control_enabled: Optional[bool]): @@ -121,16 +103,10 @@ def is_access_control_enabled(self, is_access_control_enabled: Optional[bool]): @property def deny_custom_metadata_guids(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.deny_custom_metadata_guids - ) + return None if self.attributes is None else self.attributes.deny_custom_metadata_guids @deny_custom_metadata_guids.setter - def deny_custom_metadata_guids( - self, deny_custom_metadata_guids: Optional[Set[str]] - ): + def deny_custom_metadata_guids(self, deny_custom_metadata_guids: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.deny_custom_metadata_guids = deny_custom_metadata_guids @@ -177,9 +153,7 @@ def deny_asset_types(self, deny_asset_types: Optional[Set[str]]): @property def deny_navigation_pages(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.deny_navigation_pages - ) + return None if self.attributes is None else self.attributes.deny_navigation_pages @deny_navigation_pages.setter def deny_navigation_pages(self, deny_navigation_pages: Optional[Set[str]]): @@ -219,9 +193,7 @@ def policies(self, policies: Optional[List[AuthPolicy]]): class Attributes(Asset.Attributes): is_access_control_enabled: Optional[bool] = Field(default=None, description="") - deny_custom_metadata_guids: Optional[Set[str]] = Field( - default=None, description="" - ) + deny_custom_metadata_guids: Optional[Set[str]] = Field(default=None, description="") deny_asset_tabs: Optional[Set[str]] = Field(default=None, description="") deny_asset_filters: Optional[Set[str]] = Field(default=None, description="") channel_link: Optional[str] = Field(default=None, description="") @@ -229,9 +201,7 @@ class Attributes(Asset.Attributes): deny_navigation_pages: Optional[Set[str]] = Field(default=None, description="") default_navigation: Optional[str] = Field(default=None, description="") display_preferences: Optional[Set[str]] = Field(default=None, description="") - policies: Optional[List[AuthPolicy]] = Field( - default=None, description="" - ) # relationship + policies: Optional[List[AuthPolicy]] = Field(default=None, description="") # relationship attributes: AccessControl.Attributes = Field( default_factory=lambda: AccessControl.Attributes(), diff --git a/pyatlan/model/assets/core/adf_activity.py b/pyatlan/model/assets/core/adf_activity.py index 5852c0c31..03a68a189 100644 --- a/pyatlan/model/assets/core/adf_activity.py +++ b/pyatlan/model/assets/core/adf_activity.py @@ -37,9 +37,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ADF_ACTIVITY_TYPE: ClassVar[KeywordField] = KeywordField( - "adfActivityType", "adfActivityType" - ) + ADF_ACTIVITY_TYPE: ClassVar[KeywordField] = KeywordField("adfActivityType", "adfActivityType") """ The type of the ADF activity. """ @@ -49,9 +47,7 @@ def __setattr__(self, name, value): """ The list of ADF activities on which this ADF activity depends on. """ - ADF_ACTIVITY_POLICY_TIMEOUT: ClassVar[TextField] = TextField( - "adfActivityPolicyTimeout", "adfActivityPolicyTimeout" - ) + ADF_ACTIVITY_POLICY_TIMEOUT: ClassVar[TextField] = TextField("adfActivityPolicyTimeout", "adfActivityPolicyTimeout") """ The timout defined for the ADF activity. """ @@ -61,45 +57,31 @@ def __setattr__(self, name, value): """ The retry interval in seconds for the ADF activity. """ - ADF_ACTIVITY_STATE: ClassVar[KeywordField] = KeywordField( - "adfActivityState", "adfActivityState" - ) + ADF_ACTIVITY_STATE: ClassVar[KeywordField] = KeywordField("adfActivityState", "adfActivityState") """ Defines the state (Active or Inactive) of an ADF activity whether it is active or not. """ - ADF_ACTIVITY_SOURCES: ClassVar[TextField] = TextField( - "adfActivitySources", "adfActivitySources" - ) + ADF_ACTIVITY_SOURCES: ClassVar[TextField] = TextField("adfActivitySources", "adfActivitySources") """ The list of names of sources for the ADF activity. """ - ADF_ACTIVITY_SINKS: ClassVar[TextField] = TextField( - "adfActivitySinks", "adfActivitySinks" - ) + ADF_ACTIVITY_SINKS: ClassVar[TextField] = TextField("adfActivitySinks", "adfActivitySinks") """ The list of names of sinks for the ADF activity. """ - ADF_ACTIVITY_SOURCE_TYPE: ClassVar[TextField] = TextField( - "adfActivitySourceType", "adfActivitySourceType" - ) + ADF_ACTIVITY_SOURCE_TYPE: ClassVar[TextField] = TextField("adfActivitySourceType", "adfActivitySourceType") """ Defines the type of the source of the ADF activtity. """ - ADF_ACTIVITY_SINK_TYPE: ClassVar[TextField] = TextField( - "adfActivitySinkType", "adfActivitySinkType" - ) + ADF_ACTIVITY_SINK_TYPE: ClassVar[TextField] = TextField("adfActivitySinkType", "adfActivitySinkType") """ Defines the type of the sink of the ADF activtity. """ - ADF_ACTIVITY_RUNS: ClassVar[KeywordField] = KeywordField( - "adfActivityRuns", "adfActivityRuns" - ) + ADF_ACTIVITY_RUNS: ClassVar[KeywordField] = KeywordField("adfActivityRuns", "adfActivityRuns") """ List of objects of activity runs for a particular activity. """ - ADF_ACTIVITY_NOTEBOOK_PATH: ClassVar[TextField] = TextField( - "adfActivityNotebookPath", "adfActivityNotebookPath" - ) + ADF_ACTIVITY_NOTEBOOK_PATH: ClassVar[TextField] = TextField("adfActivityNotebookPath", "adfActivityNotebookPath") """ Defines the path of the notebook in the databricks notebook activity. """ @@ -121,9 +103,7 @@ def __setattr__(self, name, value): """ Indicates whether to import only first row only or not in Lookup activity. """ - ADF_ACTIVITY_BATCH_COUNT: ClassVar[NumericField] = NumericField( - "adfActivityBatchCount", "adfActivityBatchCount" - ) + ADF_ACTIVITY_BATCH_COUNT: ClassVar[NumericField] = NumericField("adfActivityBatchCount", "adfActivityBatchCount") """ Defines the batch count of activity to runs in ForEach activity. """ @@ -133,9 +113,7 @@ def __setattr__(self, name, value): """ Indicates whether the activity processing is sequential or not inside the ForEach activity. """ - ADF_ACTIVITY_SUB_ACTIVITIES: ClassVar[TextField] = TextField( - "adfActivitySubActivities", "adfActivitySubActivities" - ) + ADF_ACTIVITY_SUB_ACTIVITIES: ClassVar[TextField] = TextField("adfActivitySubActivities", "adfActivitySubActivities") """ The list of activities to be run inside a ForEach activity. """ @@ -214,29 +192,17 @@ def adf_activity_type(self, adf_activity_type: Optional[str]): @property def adf_activity_preceding_dependency(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_preceding_dependency - ) + return None if self.attributes is None else self.attributes.adf_activity_preceding_dependency @adf_activity_preceding_dependency.setter - def adf_activity_preceding_dependency( - self, adf_activity_preceding_dependency: Optional[Set[str]] - ): + def adf_activity_preceding_dependency(self, adf_activity_preceding_dependency: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_activity_preceding_dependency = ( - adf_activity_preceding_dependency - ) + self.attributes.adf_activity_preceding_dependency = adf_activity_preceding_dependency @property def adf_activity_policy_timeout(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_policy_timeout - ) + return None if self.attributes is None else self.attributes.adf_activity_policy_timeout @adf_activity_policy_timeout.setter def adf_activity_policy_timeout(self, adf_activity_policy_timeout: Optional[str]): @@ -246,21 +212,13 @@ def adf_activity_policy_timeout(self, adf_activity_policy_timeout: Optional[str] @property def adf_activity_polict_retry_interval(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_polict_retry_interval - ) + return None if self.attributes is None else self.attributes.adf_activity_polict_retry_interval @adf_activity_polict_retry_interval.setter - def adf_activity_polict_retry_interval( - self, adf_activity_polict_retry_interval: Optional[int] - ): + def adf_activity_polict_retry_interval(self, adf_activity_polict_retry_interval: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_activity_polict_retry_interval = ( - adf_activity_polict_retry_interval - ) + self.attributes.adf_activity_polict_retry_interval = adf_activity_polict_retry_interval @property def adf_activity_state(self) -> Optional[AdfActivityState]: @@ -294,11 +252,7 @@ def adf_activity_sinks(self, adf_activity_sinks: Optional[Set[str]]): @property def adf_activity_source_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_source_type - ) + return None if self.attributes is None else self.attributes.adf_activity_source_type @adf_activity_source_type.setter def adf_activity_source_type(self, adf_activity_source_type: Optional[str]): @@ -308,9 +262,7 @@ def adf_activity_source_type(self, adf_activity_source_type: Optional[str]): @property def adf_activity_sink_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.adf_activity_sink_type - ) + return None if self.attributes is None else self.attributes.adf_activity_sink_type @adf_activity_sink_type.setter def adf_activity_sink_type(self, adf_activity_sink_type: Optional[str]): @@ -330,11 +282,7 @@ def adf_activity_runs(self, adf_activity_runs: Optional[List[Dict[str, str]]]): @property def adf_activity_notebook_path(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_notebook_path - ) + return None if self.attributes is None else self.attributes.adf_activity_notebook_path @adf_activity_notebook_path.setter def adf_activity_notebook_path(self, adf_activity_notebook_path: Optional[str]): @@ -344,11 +292,7 @@ def adf_activity_notebook_path(self, adf_activity_notebook_path: Optional[str]): @property def adf_activity_main_class_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_main_class_name - ) + return None if self.attributes is None else self.attributes.adf_activity_main_class_name @adf_activity_main_class_name.setter def adf_activity_main_class_name(self, adf_activity_main_class_name: Optional[str]): @@ -358,27 +302,17 @@ def adf_activity_main_class_name(self, adf_activity_main_class_name: Optional[st @property def adf_activity_python_file_path(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_python_file_path - ) + return None if self.attributes is None else self.attributes.adf_activity_python_file_path @adf_activity_python_file_path.setter - def adf_activity_python_file_path( - self, adf_activity_python_file_path: Optional[str] - ): + def adf_activity_python_file_path(self, adf_activity_python_file_path: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adf_activity_python_file_path = adf_activity_python_file_path @property def adf_activity_first_row_only(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_first_row_only - ) + return None if self.attributes is None else self.attributes.adf_activity_first_row_only @adf_activity_first_row_only.setter def adf_activity_first_row_only(self, adf_activity_first_row_only: Optional[bool]): @@ -388,11 +322,7 @@ def adf_activity_first_row_only(self, adf_activity_first_row_only: Optional[bool @property def adf_activity_batch_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_batch_count - ) + return None if self.attributes is None else self.attributes.adf_activity_batch_count @adf_activity_batch_count.setter def adf_activity_batch_count(self, adf_activity_batch_count: Optional[int]): @@ -402,11 +332,7 @@ def adf_activity_batch_count(self, adf_activity_batch_count: Optional[int]): @property def adf_activity_is_sequential(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_is_sequential - ) + return None if self.attributes is None else self.attributes.adf_activity_is_sequential @adf_activity_is_sequential.setter def adf_activity_is_sequential(self, adf_activity_is_sequential: Optional[bool]): @@ -416,45 +342,27 @@ def adf_activity_is_sequential(self, adf_activity_is_sequential: Optional[bool]) @property def adf_activity_sub_activities(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_sub_activities - ) + return None if self.attributes is None else self.attributes.adf_activity_sub_activities @adf_activity_sub_activities.setter - def adf_activity_sub_activities( - self, adf_activity_sub_activities: Optional[Set[str]] - ): + def adf_activity_sub_activities(self, adf_activity_sub_activities: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adf_activity_sub_activities = adf_activity_sub_activities @property def adf_activity_reference_dataflow(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_activity_reference_dataflow - ) + return None if self.attributes is None else self.attributes.adf_activity_reference_dataflow @adf_activity_reference_dataflow.setter - def adf_activity_reference_dataflow( - self, adf_activity_reference_dataflow: Optional[str] - ): + def adf_activity_reference_dataflow(self, adf_activity_reference_dataflow: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_activity_reference_dataflow = ( - adf_activity_reference_dataflow - ) + self.attributes.adf_activity_reference_dataflow = adf_activity_reference_dataflow @property def adf_pipeline_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_pipeline_qualified_name - ) + return None if self.attributes is None else self.attributes.adf_pipeline_qualified_name @adf_pipeline_qualified_name.setter def adf_pipeline_qualified_name(self, adf_pipeline_qualified_name: Optional[str]): @@ -514,57 +422,29 @@ def adf_dataflow(self, adf_dataflow: Optional[AdfDataflow]): class Attributes(ADF.Attributes): adf_activity_type: Optional[str] = Field(default=None, description="") - adf_activity_preceding_dependency: Optional[Set[str]] = Field( - default=None, description="" - ) + adf_activity_preceding_dependency: Optional[Set[str]] = Field(default=None, description="") adf_activity_policy_timeout: Optional[str] = Field(default=None, description="") - adf_activity_polict_retry_interval: Optional[int] = Field( - default=None, description="" - ) - adf_activity_state: Optional[AdfActivityState] = Field( - default=None, description="" - ) + adf_activity_polict_retry_interval: Optional[int] = Field(default=None, description="") + adf_activity_state: Optional[AdfActivityState] = Field(default=None, description="") adf_activity_sources: Optional[Set[str]] = Field(default=None, description="") adf_activity_sinks: Optional[Set[str]] = Field(default=None, description="") adf_activity_source_type: Optional[str] = Field(default=None, description="") adf_activity_sink_type: Optional[str] = Field(default=None, description="") - adf_activity_runs: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) + adf_activity_runs: Optional[List[Dict[str, str]]] = Field(default=None, description="") adf_activity_notebook_path: Optional[str] = Field(default=None, description="") - adf_activity_main_class_name: Optional[str] = Field( - default=None, description="" - ) - adf_activity_python_file_path: Optional[str] = Field( - default=None, description="" - ) - adf_activity_first_row_only: Optional[bool] = Field( - default=None, description="" - ) + adf_activity_main_class_name: Optional[str] = Field(default=None, description="") + adf_activity_python_file_path: Optional[str] = Field(default=None, description="") + adf_activity_first_row_only: Optional[bool] = Field(default=None, description="") adf_activity_batch_count: Optional[int] = Field(default=None, description="") adf_activity_is_sequential: Optional[bool] = Field(default=None, description="") - adf_activity_sub_activities: Optional[Set[str]] = Field( - default=None, description="" - ) - adf_activity_reference_dataflow: Optional[str] = Field( - default=None, description="" - ) + adf_activity_sub_activities: Optional[Set[str]] = Field(default=None, description="") + adf_activity_reference_dataflow: Optional[str] = Field(default=None, description="") adf_pipeline_qualified_name: Optional[str] = Field(default=None, description="") - adf_linkedservices: Optional[List[AdfLinkedservice]] = Field( - default=None, description="" - ) # relationship - adf_datasets: Optional[List[AdfDataset]] = Field( - default=None, description="" - ) # relationship - processes: Optional[List[Process]] = Field( - default=None, description="" - ) # relationship - adf_pipeline: Optional[AdfPipeline] = Field( - default=None, description="" - ) # relationship - adf_dataflow: Optional[AdfDataflow] = Field( - default=None, description="" - ) # relationship + adf_linkedservices: Optional[List[AdfLinkedservice]] = Field(default=None, description="") # relationship + adf_datasets: Optional[List[AdfDataset]] = Field(default=None, description="") # relationship + processes: Optional[List[Process]] = Field(default=None, description="") # relationship + adf_pipeline: Optional[AdfPipeline] = Field(default=None, description="") # relationship + adf_dataflow: Optional[AdfDataflow] = Field(default=None, description="") # relationship attributes: AdfActivity.Attributes = Field( default_factory=lambda: AdfActivity.Attributes(), diff --git a/pyatlan/model/assets/core/adf_dataflow.py b/pyatlan/model/assets/core/adf_dataflow.py index 99eb7a46a..0d3ac81f5 100644 --- a/pyatlan/model/assets/core/adf_dataflow.py +++ b/pyatlan/model/assets/core/adf_dataflow.py @@ -29,21 +29,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ADF_DATAFLOW_SOURCES: ClassVar[TextField] = TextField( - "adfDataflowSources", "adfDataflowSources" - ) + ADF_DATAFLOW_SOURCES: ClassVar[TextField] = TextField("adfDataflowSources", "adfDataflowSources") """ The list of names of sources for this dataflow. """ - ADF_DATAFLOW_SINKS: ClassVar[TextField] = TextField( - "adfDataflowSinks", "adfDataflowSinks" - ) + ADF_DATAFLOW_SINKS: ClassVar[TextField] = TextField("adfDataflowSinks", "adfDataflowSinks") """ The list of names of sinks for this dataflow. """ - ADF_DATAFLOW_SCRIPT: ClassVar[TextField] = TextField( - "adfDataflowScript", "adfDataflowScript" - ) + ADF_DATAFLOW_SCRIPT: ClassVar[TextField] = TextField("adfDataflowScript", "adfDataflowScript") """ The gererated script for the dataflow. """ @@ -149,18 +143,10 @@ class Attributes(ADF.Attributes): adf_dataflow_sources: Optional[Set[str]] = Field(default=None, description="") adf_dataflow_sinks: Optional[Set[str]] = Field(default=None, description="") adf_dataflow_script: Optional[str] = Field(default=None, description="") - adf_linkedservices: Optional[List[AdfLinkedservice]] = Field( - default=None, description="" - ) # relationship - adf_datasets: Optional[List[AdfDataset]] = Field( - default=None, description="" - ) # relationship - adf_activities: Optional[List[AdfActivity]] = Field( - default=None, description="" - ) # relationship - adf_pipelines: Optional[List[AdfPipeline]] = Field( - default=None, description="" - ) # relationship + adf_linkedservices: Optional[List[AdfLinkedservice]] = Field(default=None, description="") # relationship + adf_datasets: Optional[List[AdfDataset]] = Field(default=None, description="") # relationship + adf_activities: Optional[List[AdfActivity]] = Field(default=None, description="") # relationship + adf_pipelines: Optional[List[AdfPipeline]] = Field(default=None, description="") # relationship attributes: AdfDataflow.Attributes = Field( default_factory=lambda: AdfDataflow.Attributes(), diff --git a/pyatlan/model/assets/core/adf_dataset.py b/pyatlan/model/assets/core/adf_dataset.py index fbe1c1e68..d5845b5d4 100644 --- a/pyatlan/model/assets/core/adf_dataset.py +++ b/pyatlan/model/assets/core/adf_dataset.py @@ -29,15 +29,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ADF_DATASET_TYPE: ClassVar[KeywordField] = KeywordField( - "adfDatasetType", "adfDatasetType" - ) + ADF_DATASET_TYPE: ClassVar[KeywordField] = KeywordField("adfDatasetType", "adfDatasetType") """ Defines the type of the dataset. """ - ADF_DATASET_ANNOTATIONS: ClassVar[TextField] = TextField( - "adfDatasetAnnotations", "adfDatasetAnnotations" - ) + ADF_DATASET_ANNOTATIONS: ClassVar[TextField] = TextField("adfDatasetAnnotations", "adfDatasetAnnotations") """ The list of annotation assigned to a dataset. """ @@ -47,21 +43,15 @@ def __setattr__(self, name, value): """ Defines the name of the linked service used to create this dataset. """ - ADF_DATASET_COLLECTION_NAME: ClassVar[TextField] = TextField( - "adfDatasetCollectionName", "adfDatasetCollectionName" - ) + ADF_DATASET_COLLECTION_NAME: ClassVar[TextField] = TextField("adfDatasetCollectionName", "adfDatasetCollectionName") """ Defines the name collection in the cosmos dataset. """ - ADF_DATASET_STORAGE_TYPE: ClassVar[TextField] = TextField( - "adfDatasetStorageType", "adfDatasetStorageType" - ) + ADF_DATASET_STORAGE_TYPE: ClassVar[TextField] = TextField("adfDatasetStorageType", "adfDatasetStorageType") """ Defines the storage type of storage file system dataset. """ - ADF_DATASET_FILE_NAME: ClassVar[TextField] = TextField( - "adfDatasetFileName", "adfDatasetFileName" - ) + ADF_DATASET_FILE_NAME: ClassVar[TextField] = TextField("adfDatasetFileName", "adfDatasetFileName") """ Defines the name of the file in the storage file system dataset. """ @@ -71,27 +61,19 @@ def __setattr__(self, name, value): """ Defines the folder path of the file in the storage file system dataset. """ - ADF_DATASET_CONTAINER_NAME: ClassVar[TextField] = TextField( - "adfDatasetContainerName", "adfDatasetContainerName" - ) + ADF_DATASET_CONTAINER_NAME: ClassVar[TextField] = TextField("adfDatasetContainerName", "adfDatasetContainerName") """ Defines the container or bucket name in the storage file system dataset. """ - ADF_DATASET_SCHEMA_NAME: ClassVar[TextField] = TextField( - "adfDatasetSchemaName", "adfDatasetSchemaName" - ) + ADF_DATASET_SCHEMA_NAME: ClassVar[TextField] = TextField("adfDatasetSchemaName", "adfDatasetSchemaName") """ Defines the name of the schema used in the snowflake, mssql, azure sql database type of dataset. """ - ADF_DATASET_TABLE_NAME: ClassVar[TextField] = TextField( - "adfDatasetTableName", "adfDatasetTableName" - ) + ADF_DATASET_TABLE_NAME: ClassVar[TextField] = TextField("adfDatasetTableName", "adfDatasetTableName") """ Defines the name of the table used in the snowflake, mssql, azure sql database type of dataset. """ - ADF_DATASET_DATABASE_NAME: ClassVar[TextField] = TextField( - "adfDatasetDatabaseName", "adfDatasetDatabaseName" - ) + ADF_DATASET_DATABASE_NAME: ClassVar[TextField] = TextField("adfDatasetDatabaseName", "adfDatasetDatabaseName") """ Defines the name of the database used in the azure delta lake type of dataset. """ @@ -143,9 +125,7 @@ def adf_dataset_type(self, adf_dataset_type: Optional[str]): @property def adf_dataset_annotations(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.adf_dataset_annotations - ) + return None if self.attributes is None else self.attributes.adf_dataset_annotations @adf_dataset_annotations.setter def adf_dataset_annotations(self, adf_dataset_annotations: Optional[Set[str]]): @@ -155,11 +135,7 @@ def adf_dataset_annotations(self, adf_dataset_annotations: Optional[Set[str]]): @property def adf_dataset_linked_service(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_dataset_linked_service - ) + return None if self.attributes is None else self.attributes.adf_dataset_linked_service @adf_dataset_linked_service.setter def adf_dataset_linked_service(self, adf_dataset_linked_service: Optional[str]): @@ -169,11 +145,7 @@ def adf_dataset_linked_service(self, adf_dataset_linked_service: Optional[str]): @property def adf_dataset_collection_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_dataset_collection_name - ) + return None if self.attributes is None else self.attributes.adf_dataset_collection_name @adf_dataset_collection_name.setter def adf_dataset_collection_name(self, adf_dataset_collection_name: Optional[str]): @@ -183,11 +155,7 @@ def adf_dataset_collection_name(self, adf_dataset_collection_name: Optional[str] @property def adf_dataset_storage_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_dataset_storage_type - ) + return None if self.attributes is None else self.attributes.adf_dataset_storage_type @adf_dataset_storage_type.setter def adf_dataset_storage_type(self, adf_dataset_storage_type: Optional[str]): @@ -197,9 +165,7 @@ def adf_dataset_storage_type(self, adf_dataset_storage_type: Optional[str]): @property def adf_dataset_file_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.adf_dataset_file_name - ) + return None if self.attributes is None else self.attributes.adf_dataset_file_name @adf_dataset_file_name.setter def adf_dataset_file_name(self, adf_dataset_file_name: Optional[str]): @@ -209,11 +175,7 @@ def adf_dataset_file_name(self, adf_dataset_file_name: Optional[str]): @property def adf_dataset_file_folder_path(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_dataset_file_folder_path - ) + return None if self.attributes is None else self.attributes.adf_dataset_file_folder_path @adf_dataset_file_folder_path.setter def adf_dataset_file_folder_path(self, adf_dataset_file_folder_path: Optional[str]): @@ -223,11 +185,7 @@ def adf_dataset_file_folder_path(self, adf_dataset_file_folder_path: Optional[st @property def adf_dataset_container_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_dataset_container_name - ) + return None if self.attributes is None else self.attributes.adf_dataset_container_name @adf_dataset_container_name.setter def adf_dataset_container_name(self, adf_dataset_container_name: Optional[str]): @@ -237,9 +195,7 @@ def adf_dataset_container_name(self, adf_dataset_container_name: Optional[str]): @property def adf_dataset_schema_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.adf_dataset_schema_name - ) + return None if self.attributes is None else self.attributes.adf_dataset_schema_name @adf_dataset_schema_name.setter def adf_dataset_schema_name(self, adf_dataset_schema_name: Optional[str]): @@ -249,9 +205,7 @@ def adf_dataset_schema_name(self, adf_dataset_schema_name: Optional[str]): @property def adf_dataset_table_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.adf_dataset_table_name - ) + return None if self.attributes is None else self.attributes.adf_dataset_table_name @adf_dataset_table_name.setter def adf_dataset_table_name(self, adf_dataset_table_name: Optional[str]): @@ -261,11 +215,7 @@ def adf_dataset_table_name(self, adf_dataset_table_name: Optional[str]): @property def adf_dataset_database_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_dataset_database_name - ) + return None if self.attributes is None else self.attributes.adf_dataset_database_name @adf_dataset_database_name.setter def adf_dataset_database_name(self, adf_dataset_database_name: Optional[str]): @@ -315,32 +265,20 @@ def adf_pipelines(self, adf_pipelines: Optional[List[AdfPipeline]]): class Attributes(ADF.Attributes): adf_dataset_type: Optional[str] = Field(default=None, description="") - adf_dataset_annotations: Optional[Set[str]] = Field( - default=None, description="" - ) + adf_dataset_annotations: Optional[Set[str]] = Field(default=None, description="") adf_dataset_linked_service: Optional[str] = Field(default=None, description="") adf_dataset_collection_name: Optional[str] = Field(default=None, description="") adf_dataset_storage_type: Optional[str] = Field(default=None, description="") adf_dataset_file_name: Optional[str] = Field(default=None, description="") - adf_dataset_file_folder_path: Optional[str] = Field( - default=None, description="" - ) + adf_dataset_file_folder_path: Optional[str] = Field(default=None, description="") adf_dataset_container_name: Optional[str] = Field(default=None, description="") adf_dataset_schema_name: Optional[str] = Field(default=None, description="") adf_dataset_table_name: Optional[str] = Field(default=None, description="") adf_dataset_database_name: Optional[str] = Field(default=None, description="") - adf_linkedservice: Optional[AdfLinkedservice] = Field( - default=None, description="" - ) # relationship - adf_activities: Optional[List[AdfActivity]] = Field( - default=None, description="" - ) # relationship - adf_dataflows: Optional[List[AdfDataflow]] = Field( - default=None, description="" - ) # relationship - adf_pipelines: Optional[List[AdfPipeline]] = Field( - default=None, description="" - ) # relationship + adf_linkedservice: Optional[AdfLinkedservice] = Field(default=None, description="") # relationship + adf_activities: Optional[List[AdfActivity]] = Field(default=None, description="") # relationship + adf_dataflows: Optional[List[AdfDataflow]] = Field(default=None, description="") # relationship + adf_pipelines: Optional[List[AdfPipeline]] = Field(default=None, description="") # relationship attributes: AdfDataset.Attributes = Field( default_factory=lambda: AdfDataset.Attributes(), diff --git a/pyatlan/model/assets/core/adf_linkedservice.py b/pyatlan/model/assets/core/adf_linkedservice.py index 36356fff5..ac72d16d4 100644 --- a/pyatlan/model/assets/core/adf_linkedservice.py +++ b/pyatlan/model/assets/core/adf_linkedservice.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ADF_LINKEDSERVICE_TYPE: ClassVar[KeywordField] = KeywordField( - "adfLinkedserviceType", "adfLinkedserviceType" - ) + ADF_LINKEDSERVICE_TYPE: ClassVar[KeywordField] = KeywordField("adfLinkedserviceType", "adfLinkedserviceType") """ Defines the type of the linked service. """ @@ -64,9 +62,7 @@ def __setattr__(self, name, value): """ Indicates whether the service version is above 3.2 or not in the cosmos linked service. """ - ADF_LINKEDSERVICE_VERSION: ClassVar[TextField] = TextField( - "adfLinkedserviceVersion", "adfLinkedserviceVersion" - ) + ADF_LINKEDSERVICE_VERSION: ClassVar[TextField] = TextField("adfLinkedserviceVersion", "adfLinkedserviceVersion") """ Defines the version of the linked service in the cosmos linked service. """ @@ -82,9 +78,7 @@ def __setattr__(self, name, value): """ Defines the type of credential, authentication being used in the ADLS, snowflake, azure sql linked service. """ - ADF_LINKEDSERVICE_TENANT: ClassVar[TextField] = TextField( - "adfLinkedserviceTenant", "adfLinkedserviceTenant" - ) + ADF_LINKEDSERVICE_TENANT: ClassVar[TextField] = TextField("adfLinkedserviceTenant", "adfLinkedserviceTenant") """ Defines the tenant of cloud being used in the ADLS linked service. """ @@ -106,9 +100,7 @@ def __setattr__(self, name, value): """ Defines the resource id in the Azure databricks delta lake linked service. """ - ADF_LINKEDSERVICE_USER_NAME: ClassVar[TextField] = TextField( - "adfLinkedserviceUserName", "adfLinkedserviceUserName" - ) + ADF_LINKEDSERVICE_USER_NAME: ClassVar[TextField] = TextField("adfLinkedserviceUserName", "adfLinkedserviceUserName") """ Defines the name of the db user in the snowflake linked service. """ @@ -118,9 +110,7 @@ def __setattr__(self, name, value): """ Defines the name of the warehouse in the snowflake linked service. """ - ADF_LINKEDSERVICE_ROLE_NAME: ClassVar[TextField] = TextField( - "adfLinkedserviceRoleName", "adfLinkedserviceRoleName" - ) + ADF_LINKEDSERVICE_ROLE_NAME: ClassVar[TextField] = TextField("adfLinkedserviceRoleName", "adfLinkedserviceRoleName") """ Defines the name of the role in the snowflake linked service. """ @@ -166,9 +156,7 @@ def __setattr__(self, name, value): @property def adf_linkedservice_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.adf_linkedservice_type - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_type @adf_linkedservice_type.setter def adf_linkedservice_type(self, adf_linkedservice_type: Optional[str]): @@ -178,79 +166,47 @@ def adf_linkedservice_type(self, adf_linkedservice_type: Optional[str]): @property def adf_linkedservice_annotations(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_annotations - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_annotations @adf_linkedservice_annotations.setter - def adf_linkedservice_annotations( - self, adf_linkedservice_annotations: Optional[Set[str]] - ): + def adf_linkedservice_annotations(self, adf_linkedservice_annotations: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adf_linkedservice_annotations = adf_linkedservice_annotations @property def adf_linkedservice_account_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_account_name - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_account_name @adf_linkedservice_account_name.setter - def adf_linkedservice_account_name( - self, adf_linkedservice_account_name: Optional[str] - ): + def adf_linkedservice_account_name(self, adf_linkedservice_account_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adf_linkedservice_account_name = adf_linkedservice_account_name @property def adf_linkedservice_database_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_database_name - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_database_name @adf_linkedservice_database_name.setter - def adf_linkedservice_database_name( - self, adf_linkedservice_database_name: Optional[str] - ): + def adf_linkedservice_database_name(self, adf_linkedservice_database_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_database_name = ( - adf_linkedservice_database_name - ) + self.attributes.adf_linkedservice_database_name = adf_linkedservice_database_name @property def adf_linkedservice_version_above(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_version_above - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_version_above @adf_linkedservice_version_above.setter - def adf_linkedservice_version_above( - self, adf_linkedservice_version_above: Optional[bool] - ): + def adf_linkedservice_version_above(self, adf_linkedservice_version_above: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_version_above = ( - adf_linkedservice_version_above - ) + self.attributes.adf_linkedservice_version_above = adf_linkedservice_version_above @property def adf_linkedservice_version(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_version - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_version @adf_linkedservice_version.setter def adf_linkedservice_version(self, adf_linkedservice_version: Optional[str]): @@ -260,47 +216,27 @@ def adf_linkedservice_version(self, adf_linkedservice_version: Optional[str]): @property def adf_linkedservice_azure_cloud_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_azure_cloud_type - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_azure_cloud_type @adf_linkedservice_azure_cloud_type.setter - def adf_linkedservice_azure_cloud_type( - self, adf_linkedservice_azure_cloud_type: Optional[str] - ): + def adf_linkedservice_azure_cloud_type(self, adf_linkedservice_azure_cloud_type: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_azure_cloud_type = ( - adf_linkedservice_azure_cloud_type - ) + self.attributes.adf_linkedservice_azure_cloud_type = adf_linkedservice_azure_cloud_type @property def adf_linkedservice_credential_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_credential_type - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_credential_type @adf_linkedservice_credential_type.setter - def adf_linkedservice_credential_type( - self, adf_linkedservice_credential_type: Optional[str] - ): + def adf_linkedservice_credential_type(self, adf_linkedservice_credential_type: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_credential_type = ( - adf_linkedservice_credential_type - ) + self.attributes.adf_linkedservice_credential_type = adf_linkedservice_credential_type @property def adf_linkedservice_tenant(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_tenant - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_tenant @adf_linkedservice_tenant.setter def adf_linkedservice_tenant(self, adf_linkedservice_tenant: Optional[str]): @@ -310,29 +246,17 @@ def adf_linkedservice_tenant(self, adf_linkedservice_tenant: Optional[str]): @property def adf_linkedservice_domain_endpoint(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_domain_endpoint - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_domain_endpoint @adf_linkedservice_domain_endpoint.setter - def adf_linkedservice_domain_endpoint( - self, adf_linkedservice_domain_endpoint: Optional[str] - ): + def adf_linkedservice_domain_endpoint(self, adf_linkedservice_domain_endpoint: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_domain_endpoint = ( - adf_linkedservice_domain_endpoint - ) + self.attributes.adf_linkedservice_domain_endpoint = adf_linkedservice_domain_endpoint @property def adf_linkedservice_cluster_id(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_cluster_id - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_cluster_id @adf_linkedservice_cluster_id.setter def adf_linkedservice_cluster_id(self, adf_linkedservice_cluster_id: Optional[str]): @@ -342,27 +266,17 @@ def adf_linkedservice_cluster_id(self, adf_linkedservice_cluster_id: Optional[st @property def adf_linkedservice_resource_id(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_resource_id - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_resource_id @adf_linkedservice_resource_id.setter - def adf_linkedservice_resource_id( - self, adf_linkedservice_resource_id: Optional[str] - ): + def adf_linkedservice_resource_id(self, adf_linkedservice_resource_id: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adf_linkedservice_resource_id = adf_linkedservice_resource_id @property def adf_linkedservice_user_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_user_name - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_user_name @adf_linkedservice_user_name.setter def adf_linkedservice_user_name(self, adf_linkedservice_user_name: Optional[str]): @@ -372,29 +286,17 @@ def adf_linkedservice_user_name(self, adf_linkedservice_user_name: Optional[str] @property def adf_linkedservice_warehouse_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_warehouse_name - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_warehouse_name @adf_linkedservice_warehouse_name.setter - def adf_linkedservice_warehouse_name( - self, adf_linkedservice_warehouse_name: Optional[str] - ): + def adf_linkedservice_warehouse_name(self, adf_linkedservice_warehouse_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_warehouse_name = ( - adf_linkedservice_warehouse_name - ) + self.attributes.adf_linkedservice_warehouse_name = adf_linkedservice_warehouse_name @property def adf_linkedservice_role_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.adf_linkedservice_role_name - ) + return None if self.attributes is None else self.attributes.adf_linkedservice_role_name @adf_linkedservice_role_name.setter def adf_linkedservice_role_name(self, adf_linkedservice_role_name: Optional[str]): @@ -444,52 +346,24 @@ def adf_pipelines(self, adf_pipelines: Optional[List[AdfPipeline]]): class Attributes(ADF.Attributes): adf_linkedservice_type: Optional[str] = Field(default=None, description="") - adf_linkedservice_annotations: Optional[Set[str]] = Field( - default=None, description="" - ) - adf_linkedservice_account_name: Optional[str] = Field( - default=None, description="" - ) - adf_linkedservice_database_name: Optional[str] = Field( - default=None, description="" - ) - adf_linkedservice_version_above: Optional[bool] = Field( - default=None, description="" - ) + adf_linkedservice_annotations: Optional[Set[str]] = Field(default=None, description="") + adf_linkedservice_account_name: Optional[str] = Field(default=None, description="") + adf_linkedservice_database_name: Optional[str] = Field(default=None, description="") + adf_linkedservice_version_above: Optional[bool] = Field(default=None, description="") adf_linkedservice_version: Optional[str] = Field(default=None, description="") - adf_linkedservice_azure_cloud_type: Optional[str] = Field( - default=None, description="" - ) - adf_linkedservice_credential_type: Optional[str] = Field( - default=None, description="" - ) + adf_linkedservice_azure_cloud_type: Optional[str] = Field(default=None, description="") + adf_linkedservice_credential_type: Optional[str] = Field(default=None, description="") adf_linkedservice_tenant: Optional[str] = Field(default=None, description="") - adf_linkedservice_domain_endpoint: Optional[str] = Field( - default=None, description="" - ) - adf_linkedservice_cluster_id: Optional[str] = Field( - default=None, description="" - ) - adf_linkedservice_resource_id: Optional[str] = Field( - default=None, description="" - ) + adf_linkedservice_domain_endpoint: Optional[str] = Field(default=None, description="") + adf_linkedservice_cluster_id: Optional[str] = Field(default=None, description="") + adf_linkedservice_resource_id: Optional[str] = Field(default=None, description="") adf_linkedservice_user_name: Optional[str] = Field(default=None, description="") - adf_linkedservice_warehouse_name: Optional[str] = Field( - default=None, description="" - ) + adf_linkedservice_warehouse_name: Optional[str] = Field(default=None, description="") adf_linkedservice_role_name: Optional[str] = Field(default=None, description="") - adf_datasets: Optional[List[AdfDataset]] = Field( - default=None, description="" - ) # relationship - adf_activities: Optional[List[AdfActivity]] = Field( - default=None, description="" - ) # relationship - adf_dataflows: Optional[List[AdfDataflow]] = Field( - default=None, description="" - ) # relationship - adf_pipelines: Optional[List[AdfPipeline]] = Field( - default=None, description="" - ) # relationship + adf_datasets: Optional[List[AdfDataset]] = Field(default=None, description="") # relationship + adf_activities: Optional[List[AdfActivity]] = Field(default=None, description="") # relationship + adf_dataflows: Optional[List[AdfDataflow]] = Field(default=None, description="") # relationship + adf_pipelines: Optional[List[AdfPipeline]] = Field(default=None, description="") # relationship attributes: AdfLinkedservice.Attributes = Field( default_factory=lambda: AdfLinkedservice.Attributes(), diff --git a/pyatlan/model/assets/core/adf_pipeline.py b/pyatlan/model/assets/core/adf_pipeline.py index 74a5e3425..4cd82d152 100644 --- a/pyatlan/model/assets/core/adf_pipeline.py +++ b/pyatlan/model/assets/core/adf_pipeline.py @@ -40,15 +40,11 @@ def __setattr__(self, name, value): """ Defines the count of activities in the pipline. """ - ADF_PIPELINE_RUNS: ClassVar[KeywordField] = KeywordField( - "adfPipelineRuns", "adfPipelineRuns" - ) + ADF_PIPELINE_RUNS: ClassVar[KeywordField] = KeywordField("adfPipelineRuns", "adfPipelineRuns") """ List of objects of pipeline runs for a particular pipeline. """ - ADF_PIPELINE_ANNOTATIONS: ClassVar[TextField] = TextField( - "adfPipelineAnnotations", "adfPipelineAnnotations" - ) + ADF_PIPELINE_ANNOTATIONS: ClassVar[TextField] = TextField("adfPipelineAnnotations", "adfPipelineAnnotations") """ The list of annotation assigned to a pipeline. """ @@ -82,11 +78,7 @@ def __setattr__(self, name, value): @property def adf_pipeline_activity_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.adf_pipeline_activity_count - ) + return None if self.attributes is None else self.attributes.adf_pipeline_activity_count @adf_pipeline_activity_count.setter def adf_pipeline_activity_count(self, adf_pipeline_activity_count: Optional[int]): @@ -106,11 +98,7 @@ def adf_pipeline_runs(self, adf_pipeline_runs: Optional[List[Dict[str, str]]]): @property def adf_pipeline_annotations(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.adf_pipeline_annotations - ) + return None if self.attributes is None else self.attributes.adf_pipeline_annotations @adf_pipeline_annotations.setter def adf_pipeline_annotations(self, adf_pipeline_annotations: Optional[Set[str]]): @@ -160,24 +148,12 @@ def adf_dataflows(self, adf_dataflows: Optional[List[AdfDataflow]]): class Attributes(ADF.Attributes): adf_pipeline_activity_count: Optional[int] = Field(default=None, description="") - adf_pipeline_runs: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - adf_pipeline_annotations: Optional[Set[str]] = Field( - default=None, description="" - ) - adf_linkedservices: Optional[List[AdfLinkedservice]] = Field( - default=None, description="" - ) # relationship - adf_datasets: Optional[List[AdfDataset]] = Field( - default=None, description="" - ) # relationship - adf_activities: Optional[List[AdfActivity]] = Field( - default=None, description="" - ) # relationship - adf_dataflows: Optional[List[AdfDataflow]] = Field( - default=None, description="" - ) # relationship + adf_pipeline_runs: Optional[List[Dict[str, str]]] = Field(default=None, description="") + adf_pipeline_annotations: Optional[Set[str]] = Field(default=None, description="") + adf_linkedservices: Optional[List[AdfLinkedservice]] = Field(default=None, description="") # relationship + adf_datasets: Optional[List[AdfDataset]] = Field(default=None, description="") # relationship + adf_activities: Optional[List[AdfActivity]] = Field(default=None, description="") # relationship + adf_dataflows: Optional[List[AdfDataflow]] = Field(default=None, description="") # relationship attributes: AdfPipeline.Attributes = Field( default_factory=lambda: AdfPipeline.Attributes(), diff --git a/pyatlan/model/assets/core/airflow.py b/pyatlan/model/assets/core/airflow.py index 811b624d6..7a83a92a4 100644 --- a/pyatlan/model/assets/core/airflow.py +++ b/pyatlan/model/assets/core/airflow.py @@ -35,9 +35,7 @@ def __setattr__(self, name, value): """ Tags assigned to the asset in Airflow. """ - AIRFLOW_RUN_VERSION: ClassVar[KeywordField] = KeywordField( - "airflowRunVersion", "airflowRunVersion" - ) + AIRFLOW_RUN_VERSION: ClassVar[KeywordField] = KeywordField("airflowRunVersion", "airflowRunVersion") """ Version of the run in Airflow. """ @@ -47,27 +45,19 @@ def __setattr__(self, name, value): """ Version of the run in OpenLineage. """ - AIRFLOW_RUN_NAME: ClassVar[KeywordField] = KeywordField( - "airflowRunName", "airflowRunName" - ) + AIRFLOW_RUN_NAME: ClassVar[KeywordField] = KeywordField("airflowRunName", "airflowRunName") """ Name of the run. """ - AIRFLOW_RUN_TYPE: ClassVar[KeywordField] = KeywordField( - "airflowRunType", "airflowRunType" - ) + AIRFLOW_RUN_TYPE: ClassVar[KeywordField] = KeywordField("airflowRunType", "airflowRunType") """ Type of the run. """ - AIRFLOW_RUN_START_TIME: ClassVar[NumericField] = NumericField( - "airflowRunStartTime", "airflowRunStartTime" - ) + AIRFLOW_RUN_START_TIME: ClassVar[NumericField] = NumericField("airflowRunStartTime", "airflowRunStartTime") """ Start time of the run. """ - AIRFLOW_RUN_END_TIME: ClassVar[NumericField] = NumericField( - "airflowRunEndTime", "airflowRunEndTime" - ) + AIRFLOW_RUN_END_TIME: ClassVar[NumericField] = NumericField("airflowRunEndTime", "airflowRunEndTime") """ End time of the run. """ @@ -111,21 +101,13 @@ def airflow_run_version(self, airflow_run_version: Optional[str]): @property def airflow_run_open_lineage_version(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.airflow_run_open_lineage_version - ) + return None if self.attributes is None else self.attributes.airflow_run_open_lineage_version @airflow_run_open_lineage_version.setter - def airflow_run_open_lineage_version( - self, airflow_run_open_lineage_version: Optional[str] - ): + def airflow_run_open_lineage_version(self, airflow_run_open_lineage_version: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.airflow_run_open_lineage_version = ( - airflow_run_open_lineage_version - ) + self.attributes.airflow_run_open_lineage_version = airflow_run_open_lineage_version @property def airflow_run_name(self) -> Optional[str]: @@ -149,9 +131,7 @@ def airflow_run_type(self, airflow_run_type: Optional[str]): @property def airflow_run_start_time(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.airflow_run_start_time - ) + return None if self.attributes is None else self.attributes.airflow_run_start_time @airflow_run_start_time.setter def airflow_run_start_time(self, airflow_run_start_time: Optional[datetime]): @@ -171,16 +151,10 @@ def airflow_run_end_time(self, airflow_run_end_time: Optional[datetime]): @property def airflow_run_open_lineage_state(self) -> Optional[OpenLineageRunState]: - return ( - None - if self.attributes is None - else self.attributes.airflow_run_open_lineage_state - ) + return None if self.attributes is None else self.attributes.airflow_run_open_lineage_state @airflow_run_open_lineage_state.setter - def airflow_run_open_lineage_state( - self, airflow_run_open_lineage_state: Optional[OpenLineageRunState] - ): + def airflow_run_open_lineage_state(self, airflow_run_open_lineage_state: Optional[OpenLineageRunState]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.airflow_run_open_lineage_state = airflow_run_open_lineage_state @@ -188,16 +162,12 @@ def airflow_run_open_lineage_state( class Attributes(Catalog.Attributes): airflow_tags: Optional[Set[str]] = Field(default=None, description="") airflow_run_version: Optional[str] = Field(default=None, description="") - airflow_run_open_lineage_version: Optional[str] = Field( - default=None, description="" - ) + airflow_run_open_lineage_version: Optional[str] = Field(default=None, description="") airflow_run_name: Optional[str] = Field(default=None, description="") airflow_run_type: Optional[str] = Field(default=None, description="") airflow_run_start_time: Optional[datetime] = Field(default=None, description="") airflow_run_end_time: Optional[datetime] = Field(default=None, description="") - airflow_run_open_lineage_state: Optional[OpenLineageRunState] = Field( - default=None, description="" - ) + airflow_run_open_lineage_state: Optional[OpenLineageRunState] = Field(default=None, description="") attributes: Airflow.Attributes = Field( default_factory=lambda: Airflow.Attributes(), diff --git a/pyatlan/model/assets/core/airflow_dag.py b/pyatlan/model/assets/core/airflow_dag.py index 63eeaeece..15fd7053d 100644 --- a/pyatlan/model/assets/core/airflow_dag.py +++ b/pyatlan/model/assets/core/airflow_dag.py @@ -49,9 +49,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AIRFLOW_DAG_SCHEDULE: ClassVar[KeywordField] = KeywordField( - "airflowDagSchedule", "airflowDagSchedule" - ) + AIRFLOW_DAG_SCHEDULE: ClassVar[KeywordField] = KeywordField("airflowDagSchedule", "airflowDagSchedule") """ Schedule for the DAG. """ @@ -85,11 +83,7 @@ def airflow_dag_schedule(self, airflow_dag_schedule: Optional[str]): @property def airflow_dag_schedule_delta(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.airflow_dag_schedule_delta - ) + return None if self.attributes is None else self.attributes.airflow_dag_schedule_delta @airflow_dag_schedule_delta.setter def airflow_dag_schedule_delta(self, airflow_dag_schedule_delta: Optional[int]): @@ -110,9 +104,7 @@ def airflow_tasks(self, airflow_tasks: Optional[List[AirflowTask]]): class Attributes(Airflow.Attributes): airflow_dag_schedule: Optional[str] = Field(default=None, description="") airflow_dag_schedule_delta: Optional[int] = Field(default=None, description="") - airflow_tasks: Optional[List[AirflowTask]] = Field( - default=None, description="" - ) # relationship + airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -122,16 +114,12 @@ def creator( name: str, connection_qualified_name: str, ) -> AirflowDag.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return AirflowDag.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: AirflowDag.Attributes = Field( diff --git a/pyatlan/model/assets/core/airflow_task.py b/pyatlan/model/assets/core/airflow_task.py index 9c1ec11c7..37de54293 100644 --- a/pyatlan/model/assets/core/airflow_task.py +++ b/pyatlan/model/assets/core/airflow_task.py @@ -104,33 +104,23 @@ def __setattr__(self, name, value): """ Identifier for the connection this task accesses. """ - AIRFLOW_TASK_SQL: ClassVar[TextField] = TextField( - "airflowTaskSql", "airflowTaskSql" - ) + AIRFLOW_TASK_SQL: ClassVar[TextField] = TextField("airflowTaskSql", "airflowTaskSql") """ SQL code that executes through this task. """ - AIRFLOW_TASK_RETRY_NUMBER: ClassVar[NumericField] = NumericField( - "airflowTaskRetryNumber", "airflowTaskRetryNumber" - ) + AIRFLOW_TASK_RETRY_NUMBER: ClassVar[NumericField] = NumericField("airflowTaskRetryNumber", "airflowTaskRetryNumber") """ Retry count for this task running. """ - AIRFLOW_TASK_POOL: ClassVar[KeywordField] = KeywordField( - "airflowTaskPool", "airflowTaskPool" - ) + AIRFLOW_TASK_POOL: ClassVar[KeywordField] = KeywordField("airflowTaskPool", "airflowTaskPool") """ Pool on which this run happened. """ - AIRFLOW_TASK_POOL_SLOTS: ClassVar[NumericField] = NumericField( - "airflowTaskPoolSlots", "airflowTaskPoolSlots" - ) + AIRFLOW_TASK_POOL_SLOTS: ClassVar[NumericField] = NumericField("airflowTaskPoolSlots", "airflowTaskPoolSlots") """ Pool slots used for the run. """ - AIRFLOW_TASK_QUEUE: ClassVar[KeywordField] = KeywordField( - "airflowTaskQueue", "airflowTaskQueue" - ) + AIRFLOW_TASK_QUEUE: ClassVar[KeywordField] = KeywordField("airflowTaskQueue", "airflowTaskQueue") """ Queue on which this run happened. """ @@ -140,15 +130,11 @@ def __setattr__(self, name, value): """ Priority of the run. """ - AIRFLOW_TASK_TRIGGER_RULE: ClassVar[KeywordField] = KeywordField( - "airflowTaskTriggerRule", "airflowTaskTriggerRule" - ) + AIRFLOW_TASK_TRIGGER_RULE: ClassVar[KeywordField] = KeywordField("airflowTaskTriggerRule", "airflowTaskTriggerRule") """ Trigger for the run. """ - AIRFLOW_TASK_GROUP_NAME: ClassVar[KeywordField] = KeywordField( - "airflowTaskGroupName", "airflowTaskGroupName" - ) + AIRFLOW_TASK_GROUP_NAME: ClassVar[KeywordField] = KeywordField("airflowTaskGroupName", "airflowTaskGroupName") """ Group name for the task. """ @@ -191,11 +177,7 @@ def __setattr__(self, name, value): @property def airflow_task_operator_class(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.airflow_task_operator_class - ) + return None if self.attributes is None else self.attributes.airflow_task_operator_class @airflow_task_operator_class.setter def airflow_task_operator_class(self, airflow_task_operator_class: Optional[str]): @@ -215,11 +197,7 @@ def airflow_dag_name(self, airflow_dag_name: Optional[str]): @property def airflow_dag_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.airflow_dag_qualified_name - ) + return None if self.attributes is None else self.attributes.airflow_dag_qualified_name @airflow_dag_qualified_name.setter def airflow_dag_qualified_name(self, airflow_dag_qualified_name: Optional[str]): @@ -229,11 +207,7 @@ def airflow_dag_qualified_name(self, airflow_dag_qualified_name: Optional[str]): @property def airflow_task_connection_id(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.airflow_task_connection_id - ) + return None if self.attributes is None else self.attributes.airflow_task_connection_id @airflow_task_connection_id.setter def airflow_task_connection_id(self, airflow_task_connection_id: Optional[str]): @@ -253,11 +227,7 @@ def airflow_task_sql(self, airflow_task_sql: Optional[str]): @property def airflow_task_retry_number(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.airflow_task_retry_number - ) + return None if self.attributes is None else self.attributes.airflow_task_retry_number @airflow_task_retry_number.setter def airflow_task_retry_number(self, airflow_task_retry_number: Optional[int]): @@ -277,9 +247,7 @@ def airflow_task_pool(self, airflow_task_pool: Optional[str]): @property def airflow_task_pool_slots(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.airflow_task_pool_slots - ) + return None if self.attributes is None else self.attributes.airflow_task_pool_slots @airflow_task_pool_slots.setter def airflow_task_pool_slots(self, airflow_task_pool_slots: Optional[int]): @@ -299,11 +267,7 @@ def airflow_task_queue(self, airflow_task_queue: Optional[str]): @property def airflow_task_priority_weight(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.airflow_task_priority_weight - ) + return None if self.attributes is None else self.attributes.airflow_task_priority_weight @airflow_task_priority_weight.setter def airflow_task_priority_weight(self, airflow_task_priority_weight: Optional[int]): @@ -313,11 +277,7 @@ def airflow_task_priority_weight(self, airflow_task_priority_weight: Optional[in @property def airflow_task_trigger_rule(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.airflow_task_trigger_rule - ) + return None if self.attributes is None else self.attributes.airflow_task_trigger_rule @airflow_task_trigger_rule.setter def airflow_task_trigger_rule(self, airflow_task_trigger_rule: Optional[str]): @@ -327,9 +287,7 @@ def airflow_task_trigger_rule(self, airflow_task_trigger_rule: Optional[str]): @property def airflow_task_group_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.airflow_task_group_name - ) + return None if self.attributes is None else self.attributes.airflow_task_group_name @airflow_task_group_name.setter def airflow_task_group_name(self, airflow_task_group_name: Optional[str]): @@ -387,21 +345,13 @@ class Attributes(Airflow.Attributes): airflow_task_pool: Optional[str] = Field(default=None, description="") airflow_task_pool_slots: Optional[int] = Field(default=None, description="") airflow_task_queue: Optional[str] = Field(default=None, description="") - airflow_task_priority_weight: Optional[int] = Field( - default=None, description="" - ) + airflow_task_priority_weight: Optional[int] = Field(default=None, description="") airflow_task_trigger_rule: Optional[str] = Field(default=None, description="") airflow_task_group_name: Optional[str] = Field(default=None, description="") - outputs: Optional[List[Catalog]] = Field( - default=None, description="" - ) # relationship - inputs: Optional[List[Catalog]] = Field( - default=None, description="" - ) # relationship + outputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship + inputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship process: Optional[Process] = Field(default=None, description="") # relationship - airflow_dag: Optional[AirflowDag] = Field( - default=None, description="" - ) # relationship + airflow_dag: Optional[AirflowDag] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -417,9 +367,7 @@ def creator( [name, airflow_dag_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( airflow_dag_qualified_name, "airflow_dag_qualified_name", 4 @@ -431,9 +379,7 @@ def creator( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{airflow_dag_qualified_name}/{name}", connector_name=connector_name, - airflow_dag=AirflowDag.ref_by_qualified_name( - airflow_dag_qualified_name - ), + airflow_dag=AirflowDag.ref_by_qualified_name(airflow_dag_qualified_name), ) attributes: AirflowTask.Attributes = Field( diff --git a/pyatlan/model/assets/core/anomalo_check.py b/pyatlan/model/assets/core/anomalo_check.py index 203ce870d..5439cd0ad 100644 --- a/pyatlan/model/assets/core/anomalo_check.py +++ b/pyatlan/model/assets/core/anomalo_check.py @@ -48,9 +48,7 @@ def __setattr__(self, name, value): """ Category type of the check in Anomalo """ - ANOMALO_CHECK_TYPE: ClassVar[KeywordField] = KeywordField( - "anomaloCheckType", "anomaloCheckType" - ) + ANOMALO_CHECK_TYPE: ClassVar[KeywordField] = KeywordField("anomaloCheckType", "anomaloCheckType") """ Type of check in Anomalo """ @@ -66,9 +64,7 @@ def __setattr__(self, name, value): """ Flag to indicate if the check is an out of the box available check """ - ANOMALO_CHECK_STATUS: ClassVar[KeywordField] = KeywordField( - "anomaloCheckStatus", "anomaloCheckStatus" - ) + ANOMALO_CHECK_STATUS: ClassVar[KeywordField] = KeywordField("anomaloCheckStatus", "anomaloCheckStatus") """ Status of the check in Anomalo """ @@ -90,9 +86,7 @@ def __setattr__(self, name, value): """ Evaluated message of the latest check run. """ - ANOMALO_CHECK_LAST_RUN_URL: ClassVar[TextField] = TextField( - "anomaloCheckLastRunUrl", "anomaloCheckLastRunUrl" - ) + ANOMALO_CHECK_LAST_RUN_URL: ClassVar[TextField] = TextField("anomaloCheckLastRunUrl", "anomaloCheckLastRunUrl") """ URL to the latest check run. """ @@ -125,29 +119,17 @@ def __setattr__(self, name, value): @property def anomalo_check_linked_asset_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anomalo_check_linked_asset_qualified_name - ) + return None if self.attributes is None else self.attributes.anomalo_check_linked_asset_qualified_name @anomalo_check_linked_asset_qualified_name.setter - def anomalo_check_linked_asset_qualified_name( - self, anomalo_check_linked_asset_qualified_name: Optional[str] - ): + def anomalo_check_linked_asset_qualified_name(self, anomalo_check_linked_asset_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anomalo_check_linked_asset_qualified_name = ( - anomalo_check_linked_asset_qualified_name - ) + self.attributes.anomalo_check_linked_asset_qualified_name = anomalo_check_linked_asset_qualified_name @property def anomalo_check_category_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anomalo_check_category_type - ) + return None if self.attributes is None else self.attributes.anomalo_check_category_type @anomalo_check_category_type.setter def anomalo_check_category_type(self, anomalo_check_category_type: Optional[str]): @@ -167,11 +149,7 @@ def anomalo_check_type(self, anomalo_check_type: Optional[str]): @property def anomalo_check_priority_level(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anomalo_check_priority_level - ) + return None if self.attributes is None else self.attributes.anomalo_check_priority_level @anomalo_check_priority_level.setter def anomalo_check_priority_level(self, anomalo_check_priority_level: Optional[str]): @@ -181,16 +159,10 @@ def anomalo_check_priority_level(self, anomalo_check_priority_level: Optional[st @property def anomalo_check_is_system_added(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.anomalo_check_is_system_added - ) + return None if self.attributes is None else self.attributes.anomalo_check_is_system_added @anomalo_check_is_system_added.setter - def anomalo_check_is_system_added( - self, anomalo_check_is_system_added: Optional[bool] - ): + def anomalo_check_is_system_added(self, anomalo_check_is_system_added: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anomalo_check_is_system_added = anomalo_check_is_system_added @@ -207,63 +179,37 @@ def anomalo_check_status(self, anomalo_check_status: Optional[str]): @property def anomalo_check_status_image_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anomalo_check_status_image_url - ) + return None if self.attributes is None else self.attributes.anomalo_check_status_image_url @anomalo_check_status_image_url.setter - def anomalo_check_status_image_url( - self, anomalo_check_status_image_url: Optional[str] - ): + def anomalo_check_status_image_url(self, anomalo_check_status_image_url: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anomalo_check_status_image_url = anomalo_check_status_image_url @property def anomalo_check_last_run_completed_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.anomalo_check_last_run_completed_at - ) + return None if self.attributes is None else self.attributes.anomalo_check_last_run_completed_at @anomalo_check_last_run_completed_at.setter - def anomalo_check_last_run_completed_at( - self, anomalo_check_last_run_completed_at: Optional[datetime] - ): + def anomalo_check_last_run_completed_at(self, anomalo_check_last_run_completed_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anomalo_check_last_run_completed_at = ( - anomalo_check_last_run_completed_at - ) + self.attributes.anomalo_check_last_run_completed_at = anomalo_check_last_run_completed_at @property def anomalo_check_last_run_evaluated_message(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anomalo_check_last_run_evaluated_message - ) + return None if self.attributes is None else self.attributes.anomalo_check_last_run_evaluated_message @anomalo_check_last_run_evaluated_message.setter - def anomalo_check_last_run_evaluated_message( - self, anomalo_check_last_run_evaluated_message: Optional[str] - ): + def anomalo_check_last_run_evaluated_message(self, anomalo_check_last_run_evaluated_message: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anomalo_check_last_run_evaluated_message = ( - anomalo_check_last_run_evaluated_message - ) + self.attributes.anomalo_check_last_run_evaluated_message = anomalo_check_last_run_evaluated_message @property def anomalo_check_last_run_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anomalo_check_last_run_url - ) + return None if self.attributes is None else self.attributes.anomalo_check_last_run_url @anomalo_check_last_run_url.setter def anomalo_check_last_run_url(self, anomalo_check_last_run_url: Optional[str]): @@ -273,21 +219,13 @@ def anomalo_check_last_run_url(self, anomalo_check_last_run_url: Optional[str]): @property def anomalo_check_historic_run_status(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.anomalo_check_historic_run_status - ) + return None if self.attributes is None else self.attributes.anomalo_check_historic_run_status @anomalo_check_historic_run_status.setter - def anomalo_check_historic_run_status( - self, anomalo_check_historic_run_status: Optional[str] - ): + def anomalo_check_historic_run_status(self, anomalo_check_historic_run_status: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anomalo_check_historic_run_status = ( - anomalo_check_historic_run_status - ) + self.attributes.anomalo_check_historic_run_status = anomalo_check_historic_run_status @property def anomalo_check_asset(self) -> Optional[Asset]: @@ -300,34 +238,18 @@ def anomalo_check_asset(self, anomalo_check_asset: Optional[Asset]): self.attributes.anomalo_check_asset = anomalo_check_asset class Attributes(Anomalo.Attributes): - anomalo_check_linked_asset_qualified_name: Optional[str] = Field( - default=None, description="" - ) + anomalo_check_linked_asset_qualified_name: Optional[str] = Field(default=None, description="") anomalo_check_category_type: Optional[str] = Field(default=None, description="") anomalo_check_type: Optional[str] = Field(default=None, description="") - anomalo_check_priority_level: Optional[str] = Field( - default=None, description="" - ) - anomalo_check_is_system_added: Optional[bool] = Field( - default=None, description="" - ) + anomalo_check_priority_level: Optional[str] = Field(default=None, description="") + anomalo_check_is_system_added: Optional[bool] = Field(default=None, description="") anomalo_check_status: Optional[str] = Field(default=None, description="") - anomalo_check_status_image_url: Optional[str] = Field( - default=None, description="" - ) - anomalo_check_last_run_completed_at: Optional[datetime] = Field( - default=None, description="" - ) - anomalo_check_last_run_evaluated_message: Optional[str] = Field( - default=None, description="" - ) + anomalo_check_status_image_url: Optional[str] = Field(default=None, description="") + anomalo_check_last_run_completed_at: Optional[datetime] = Field(default=None, description="") + anomalo_check_last_run_evaluated_message: Optional[str] = Field(default=None, description="") anomalo_check_last_run_url: Optional[str] = Field(default=None, description="") - anomalo_check_historic_run_status: Optional[str] = Field( - default=None, description="" - ) - anomalo_check_asset: Optional[Asset] = Field( - default=None, description="" - ) # relationship + anomalo_check_historic_run_status: Optional[str] = Field(default=None, description="") + anomalo_check_asset: Optional[Asset] = Field(default=None, description="") # relationship attributes: AnomaloCheck.Attributes = Field( default_factory=lambda: AnomaloCheck.Attributes(), diff --git a/pyatlan/model/assets/core/application.py b/pyatlan/model/assets/core/application.py index 241c9fd36..89590f64c 100644 --- a/pyatlan/model/assets/core/application.py +++ b/pyatlan/model/assets/core/application.py @@ -26,9 +26,7 @@ def creator( name: str, connection_qualified_name: str, ) -> Application: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) attributes = Application.Attributes.creator( name=name, connection_qualified_name=connection_qualified_name, @@ -48,15 +46,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - APPLICATION_OWNED_ASSETS: ClassVar[RelationField] = RelationField( - "applicationOwnedAssets" - ) + APPLICATION_OWNED_ASSETS: ClassVar[RelationField] = RelationField("applicationOwnedAssets") """ TBC """ - APPLICATION_CHILD_FIELDS: ClassVar[RelationField] = RelationField( - "applicationChildFields" - ) + APPLICATION_CHILD_FIELDS: ClassVar[RelationField] = RelationField("applicationChildFields") """ TBC """ @@ -68,11 +62,7 @@ def __setattr__(self, name, value): @property def application_owned_assets(self) -> Optional[List[Asset]]: - return ( - None - if self.attributes is None - else self.attributes.application_owned_assets - ) + return None if self.attributes is None else self.attributes.application_owned_assets @application_owned_assets.setter def application_owned_assets(self, application_owned_assets: Optional[List[Asset]]): @@ -82,27 +72,17 @@ def application_owned_assets(self, application_owned_assets: Optional[List[Asset @property def application_child_fields(self) -> Optional[List[ApplicationField]]: - return ( - None - if self.attributes is None - else self.attributes.application_child_fields - ) + return None if self.attributes is None else self.attributes.application_child_fields @application_child_fields.setter - def application_child_fields( - self, application_child_fields: Optional[List[ApplicationField]] - ): + def application_child_fields(self, application_child_fields: Optional[List[ApplicationField]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.application_child_fields = application_child_fields class Attributes(App.Attributes): - application_owned_assets: Optional[List[Asset]] = Field( - default=None, description="" - ) # relationship - application_child_fields: Optional[List[ApplicationField]] = Field( - default=None, description="" - ) # relationship + application_owned_assets: Optional[List[Asset]] = Field(default=None, description="") # relationship + application_child_fields: Optional[List[ApplicationField]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -112,16 +92,12 @@ def creator( name: str, connection_qualified_name: str, ) -> Application.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return Application.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: Application.Attributes = Field( diff --git a/pyatlan/model/assets/core/application_field.py b/pyatlan/model/assets/core/application_field.py index 8354700df..2baaa8db5 100644 --- a/pyatlan/model/assets/core/application_field.py +++ b/pyatlan/model/assets/core/application_field.py @@ -46,9 +46,7 @@ def creator( application_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> ApplicationField: - validate_required_fields( - ["name", "application_qualified_name"], [name, application_qualified_name] - ) + validate_required_fields(["name", "application_qualified_name"], [name, application_qualified_name]) attributes = ApplicationField.Attributes.create( name=name, application_qualified_name=application_qualified_name, @@ -80,9 +78,7 @@ def __setattr__(self, name, value): """ TBC """ - APPLICATION_FIELD_OWNED_ASSETS: ClassVar[RelationField] = RelationField( - "applicationFieldOwnedAssets" - ) + APPLICATION_FIELD_OWNED_ASSETS: ClassVar[RelationField] = RelationField("applicationFieldOwnedAssets") """ TBC """ @@ -95,21 +91,13 @@ def __setattr__(self, name, value): @property def application_parent_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.application_parent_qualified_name - ) + return None if self.attributes is None else self.attributes.application_parent_qualified_name @application_parent_qualified_name.setter - def application_parent_qualified_name( - self, application_parent_qualified_name: Optional[str] - ): + def application_parent_qualified_name(self, application_parent_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.application_parent_qualified_name = ( - application_parent_qualified_name - ) + self.attributes.application_parent_qualified_name = application_parent_qualified_name @property def application_parent(self) -> Optional[Application]: @@ -123,30 +111,18 @@ def application_parent(self, application_parent: Optional[Application]): @property def application_field_owned_assets(self) -> Optional[List[Asset]]: - return ( - None - if self.attributes is None - else self.attributes.application_field_owned_assets - ) + return None if self.attributes is None else self.attributes.application_field_owned_assets @application_field_owned_assets.setter - def application_field_owned_assets( - self, application_field_owned_assets: Optional[List[Asset]] - ): + def application_field_owned_assets(self, application_field_owned_assets: Optional[List[Asset]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.application_field_owned_assets = application_field_owned_assets class Attributes(App.Attributes): - application_parent_qualified_name: Optional[str] = Field( - default=None, description="" - ) - application_parent: Optional[Application] = Field( - default=None, description="" - ) # relationship - application_field_owned_assets: Optional[List[Asset]] = Field( - default=None, description="" - ) # relationship + application_parent_qualified_name: Optional[str] = Field(default=None, description="") + application_parent: Optional[Application] = Field(default=None, description="") # relationship + application_field_owned_assets: Optional[List[Asset]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -162,9 +138,7 @@ def create( [name, application_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( application_qualified_name, "application_qualified_name", 4 @@ -176,9 +150,7 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, connector_name=connector_name, application_parent_qualified_name=application_qualified_name, - application_parent=Application.ref_by_qualified_name( - application_qualified_name - ), + application_parent=Application.ref_by_qualified_name(application_qualified_name), ) attributes: ApplicationField.Attributes = Field( diff --git a/pyatlan/model/assets/core/asset.py b/pyatlan/model/assets/core/asset.py index 8242d9707..154a13d15 100644 --- a/pyatlan/model/assets/core/asset.py +++ b/pyatlan/model/assets/core/asset.py @@ -46,9 +46,7 @@ def __init_subclass__(cls, type_name=None): cls._subtypes_[type_name or cls.__name__.lower()] = cls def trim_to_required(self: SelfAsset) -> SelfAsset: - return self.create_for_modification( - qualified_name=self.qualified_name or "", name=self.name or "" - ) + return self.create_for_modification(qualified_name=self.qualified_name or "", name=self.name or "") def trim_to_reference(self: SelfAsset) -> SelfAsset: if self.guid and self.guid.strip(): @@ -77,10 +75,7 @@ def creator(cls: Type[SelfAsset], *args, **kwargs) -> SelfAsset: @init_guid def create(cls: Type[SelfAsset], *args, **kwargs) -> SelfAsset: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -88,9 +83,7 @@ def create(cls: Type[SelfAsset], *args, **kwargs) -> SelfAsset: @classmethod @init_guid - def updater( - cls: type[SelfAsset], qualified_name: str = "", name: str = "" - ) -> SelfAsset: + def updater(cls: type[SelfAsset], qualified_name: str = "", name: str = "") -> SelfAsset: if cls.__name__ == "Asset": raise ErrorCode.METHOD_CAN_NOT_BE_INVOKED_ON_ASSET.exception_with_parameters() validate_required_fields( @@ -100,23 +93,16 @@ def updater( return cls(attributes=cls.Attributes(qualified_name=qualified_name, name=name)) @classmethod - def create_for_modification( - cls: type[SelfAsset], qualified_name: str = "", name: str = "" - ) -> SelfAsset: + def create_for_modification(cls: type[SelfAsset], qualified_name: str = "", name: str = "") -> SelfAsset: warn( - ( - "This method is deprecated, please use 'updater' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) return cls.updater(qualified_name=qualified_name, name=name) @classmethod - def ref_by_guid( - cls: type[SelfAsset], guid: str, semantic: SaveSemantic = SaveSemantic.REPLACE - ) -> SelfAsset: + def ref_by_guid(cls: type[SelfAsset], guid: str, semantic: SaveSemantic = SaveSemantic.REPLACE) -> SelfAsset: retval: SelfAsset = cls(attributes=cls.Attributes()) retval.guid = guid retval.semantic = semantic @@ -128,9 +114,7 @@ def ref_by_qualified_name( qualified_name: str, semantic: SaveSemantic = SaveSemantic.REPLACE, ) -> SelfAsset: - ret_value: SelfAsset = cls( - attributes=cls.Attributes(name="", qualified_name=qualified_name) - ) + ret_value: SelfAsset = cls(attributes=cls.Attributes(name="", qualified_name=qualified_name)) ret_value.unique_attributes = {"qualifiedName": qualified_name} ret_value.semantic = semantic return ret_value @@ -148,9 +132,7 @@ def _convert_to_real_type_(cls, data): if isinstance(data, list): # Recursively process lists return [cls._convert_to_real_type_(item) for item in data] - data_type = ( - data.get("type_name") if "type_name" in data else data.get("typeName") - ) + data_type = data.get("type_name") if "type_name" in data else data.get("typeName") if not data_type: if issubclass(cls, Asset): return cls(**data) @@ -190,12 +172,7 @@ def lineage(cls, guid: str, include_archived: bool = False) -> "FluentLineage": return FluentLineage(starting_guid=guid) def has_announcement(self) -> bool: - return bool( - self.attributes - and ( - self.attributes.announcement_title or self.attributes.announcement_type - ) - ) + return bool(self.attributes and (self.attributes.announcement_title or self.attributes.announcement_type)) def set_announcement(self, announcement: Announcement) -> None: self.attributes.announcement_type = announcement.announcement_type.value @@ -205,9 +182,7 @@ def set_announcement(self, announcement: Announcement) -> None: def get_announcment(self) -> Optional[Announcement]: if self.attributes.announcement_type and self.attributes.announcement_title: return Announcement( - announcement_type=AnnouncementType[ - self.attributes.announcement_type.upper() - ], + announcement_type=AnnouncementType[self.attributes.announcement_type.upper()], announcement_title=self.attributes.announcement_title, announcement_message=self.attributes.announcement_message, ) @@ -241,21 +216,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( - "name", "name.keyword", "name", "name.stemmed" - ) + NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField("name", "name.keyword", "name", "name.stemmed") """ Name of this asset. Fallback for display purposes, if displayName is empty. """ - DISPLAY_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "displayName", "displayName.keyword", "displayName" - ) + DISPLAY_NAME: ClassVar[KeywordTextField] = KeywordTextField("displayName", "displayName.keyword", "displayName") """ Human-readable name of this asset used for display purposes (in user interface). """ - DESCRIPTION: ClassVar[KeywordTextField] = KeywordTextField( - "description", "description.keyword", "description" - ) + DESCRIPTION: ClassVar[KeywordTextField] = KeywordTextField("description", "description.keyword", "description") """ Description of this asset, for example as crawled from a source. Fallback for display purposes, if userDescription is empty. """ # noqa: E501 @@ -275,51 +244,35 @@ def __setattr__(self, name, value): """ Status of this asset's certification. """ - CERTIFICATE_STATUS_MESSAGE: ClassVar[TextField] = TextField( - "certificateStatusMessage", "certificateStatusMessage" - ) + CERTIFICATE_STATUS_MESSAGE: ClassVar[TextField] = TextField("certificateStatusMessage", "certificateStatusMessage") """ Human-readable descriptive message used to provide further detail to certificateStatus. """ - CERTIFICATE_UPDATED_BY: ClassVar[KeywordField] = KeywordField( - "certificateUpdatedBy", "certificateUpdatedBy" - ) + CERTIFICATE_UPDATED_BY: ClassVar[KeywordField] = KeywordField("certificateUpdatedBy", "certificateUpdatedBy") """ Name of the user who last updated the certification of this asset. """ - CERTIFICATE_UPDATED_AT: ClassVar[NumericField] = NumericField( - "certificateUpdatedAt", "certificateUpdatedAt" - ) + CERTIFICATE_UPDATED_AT: ClassVar[NumericField] = NumericField("certificateUpdatedAt", "certificateUpdatedAt") """ Time (epoch) at which the certification was last updated, in milliseconds. """ - ANNOUNCEMENT_TITLE: ClassVar[TextField] = TextField( - "announcementTitle", "announcementTitle" - ) + ANNOUNCEMENT_TITLE: ClassVar[TextField] = TextField("announcementTitle", "announcementTitle") """ Brief title for the announcement on this asset. Required when announcementType is specified. """ - ANNOUNCEMENT_MESSAGE: ClassVar[TextField] = TextField( - "announcementMessage", "announcementMessage" - ) + ANNOUNCEMENT_MESSAGE: ClassVar[TextField] = TextField("announcementMessage", "announcementMessage") """ Detailed message to include in the announcement on this asset. """ - ANNOUNCEMENT_TYPE: ClassVar[KeywordField] = KeywordField( - "announcementType", "announcementType" - ) + ANNOUNCEMENT_TYPE: ClassVar[KeywordField] = KeywordField("announcementType", "announcementType") """ Type of announcement on this asset. """ - ANNOUNCEMENT_UPDATED_AT: ClassVar[NumericField] = NumericField( - "announcementUpdatedAt", "announcementUpdatedAt" - ) + ANNOUNCEMENT_UPDATED_AT: ClassVar[NumericField] = NumericField("announcementUpdatedAt", "announcementUpdatedAt") """ Time (epoch) at which the announcement was last updated, in milliseconds. """ - ANNOUNCEMENT_UPDATED_BY: ClassVar[KeywordField] = KeywordField( - "announcementUpdatedBy", "announcementUpdatedBy" - ) + ANNOUNCEMENT_UPDATED_BY: ClassVar[KeywordField] = KeywordField("announcementUpdatedBy", "announcementUpdatedBy") """ Name of the user who last updated the announcement. """ @@ -347,9 +300,7 @@ def __setattr__(self, name, value): """ List of groups who can view assets contained in a collection. (This is only used for certain asset types.) """ - CONNECTOR_NAME: ClassVar[KeywordField] = KeywordField( - "connectorName", "connectorName" - ) + CONNECTOR_NAME: ClassVar[KeywordField] = KeywordField("connectorName", "connectorName") """ Type of the connector through which this asset is accessible. """ @@ -371,9 +322,7 @@ def __setattr__(self, name, value): """ Whether this asset has lineage (true) or not (false). """ - IS_DISCOVERABLE: ClassVar[BooleanField] = BooleanField( - "isDiscoverable", "isDiscoverable" - ) + IS_DISCOVERABLE: ClassVar[BooleanField] = BooleanField("isDiscoverable", "isDiscoverable") """ Whether this asset is discoverable through the UI (true) or not (false). """ @@ -385,9 +334,7 @@ def __setattr__(self, name, value): """ Subtype of this asset. """ - VIEW_SCORE: ClassVar[NumericRankField] = NumericRankField( - "viewScore", "viewScore", "viewScore.rank_feature" - ) + VIEW_SCORE: ClassVar[NumericRankField] = NumericRankField("viewScore", "viewScore", "viewScore.rank_feature") """ View score for this asset. """ @@ -401,27 +348,19 @@ def __setattr__(self, name, value): """ List of owners of this asset, in the source system. """ - SOURCE_CREATED_BY: ClassVar[KeywordField] = KeywordField( - "sourceCreatedBy", "sourceCreatedBy" - ) + SOURCE_CREATED_BY: ClassVar[KeywordField] = KeywordField("sourceCreatedBy", "sourceCreatedBy") """ Name of the user who created this asset, in the source system. """ - SOURCE_CREATED_AT: ClassVar[NumericField] = NumericField( - "sourceCreatedAt", "sourceCreatedAt" - ) + SOURCE_CREATED_AT: ClassVar[NumericField] = NumericField("sourceCreatedAt", "sourceCreatedAt") """ Time (epoch) at which this asset was created in the source system, in milliseconds. """ - SOURCE_UPDATED_AT: ClassVar[NumericField] = NumericField( - "sourceUpdatedAt", "sourceUpdatedAt" - ) + SOURCE_UPDATED_AT: ClassVar[NumericField] = NumericField("sourceUpdatedAt", "sourceUpdatedAt") """ Time (epoch) at which this asset was last updated in the source system, in milliseconds. """ - SOURCE_UPDATED_BY: ClassVar[KeywordField] = KeywordField( - "sourceUpdatedBy", "sourceUpdatedBy" - ) + SOURCE_UPDATED_BY: ClassVar[KeywordField] = KeywordField("sourceUpdatedBy", "sourceUpdatedBy") """ Name of the user who last updated this asset, in the source system. """ @@ -429,21 +368,15 @@ def __setattr__(self, name, value): """ URL to the resource within the source application, used to create a button to view this asset in the source application. """ # noqa: E501 - SOURCE_EMBED_URL: ClassVar[KeywordField] = KeywordField( - "sourceEmbedURL", "sourceEmbedURL" - ) + SOURCE_EMBED_URL: ClassVar[KeywordField] = KeywordField("sourceEmbedURL", "sourceEmbedURL") """ URL to create an embed for a resource (for example, an image of a dashboard) within Atlan. """ - LAST_SYNC_WORKFLOW_NAME: ClassVar[KeywordField] = KeywordField( - "lastSyncWorkflowName", "lastSyncWorkflowName" - ) + LAST_SYNC_WORKFLOW_NAME: ClassVar[KeywordField] = KeywordField("lastSyncWorkflowName", "lastSyncWorkflowName") """ Name of the crawler that last synchronized this asset. """ - LAST_SYNC_RUN_AT: ClassVar[NumericField] = NumericField( - "lastSyncRunAt", "lastSyncRunAt" - ) + LAST_SYNC_RUN_AT: ClassVar[NumericField] = NumericField("lastSyncRunAt", "lastSyncRunAt") """ Time (epoch) at which this asset was last crawled, in milliseconds. """ @@ -455,45 +388,31 @@ def __setattr__(self, name, value): """ List of roles who administer this asset. (This is only used for Connection assets.) """ - SOURCE_READ_COUNT: ClassVar[NumericField] = NumericField( - "sourceReadCount", "sourceReadCount" - ) + SOURCE_READ_COUNT: ClassVar[NumericField] = NumericField("sourceReadCount", "sourceReadCount") """ Total count of all read operations at source. """ - SOURCE_READ_USER_COUNT: ClassVar[NumericField] = NumericField( - "sourceReadUserCount", "sourceReadUserCount" - ) + SOURCE_READ_USER_COUNT: ClassVar[NumericField] = NumericField("sourceReadUserCount", "sourceReadUserCount") """ Total number of unique users that read data from asset. """ - SOURCE_LAST_READ_AT: ClassVar[NumericField] = NumericField( - "sourceLastReadAt", "sourceLastReadAt" - ) + SOURCE_LAST_READ_AT: ClassVar[NumericField] = NumericField("sourceLastReadAt", "sourceLastReadAt") """ Timestamp of most recent read operation. """ - LAST_ROW_CHANGED_AT: ClassVar[NumericField] = NumericField( - "lastRowChangedAt", "lastRowChangedAt" - ) + LAST_ROW_CHANGED_AT: ClassVar[NumericField] = NumericField("lastRowChangedAt", "lastRowChangedAt") """ Time (epoch) of the last operation that inserted, updated, or deleted rows, in milliseconds. """ - SOURCE_TOTAL_COST: ClassVar[NumericField] = NumericField( - "sourceTotalCost", "sourceTotalCost" - ) + SOURCE_TOTAL_COST: ClassVar[NumericField] = NumericField("sourceTotalCost", "sourceTotalCost") """ Total cost of all operations at source. """ - SOURCE_COST_UNIT: ClassVar[KeywordField] = KeywordField( - "sourceCostUnit", "sourceCostUnit" - ) + SOURCE_COST_UNIT: ClassVar[KeywordField] = KeywordField("sourceCostUnit", "sourceCostUnit") """ The unit of measure for sourceTotalCost. """ - SOURCE_READ_QUERY_COST: ClassVar[NumericField] = NumericField( - "sourceReadQueryCost", "sourceReadQueryCost" - ) + SOURCE_READ_QUERY_COST: ClassVar[NumericField] = NumericField("sourceReadQueryCost", "sourceReadQueryCost") """ Total cost of read queries at source. """ @@ -509,9 +428,7 @@ def __setattr__(self, name, value): """ List of usernames with extra insights for the most recent users who read this asset. """ - SOURCE_READ_TOP_USER_LIST: ClassVar[KeywordField] = KeywordField( - "sourceReadTopUserList", "sourceReadTopUserList" - ) + SOURCE_READ_TOP_USER_LIST: ClassVar[KeywordField] = KeywordField("sourceReadTopUserList", "sourceReadTopUserList") """ List of usernames of the users who read this asset the most. """ @@ -603,21 +520,15 @@ def __setattr__(self, name, value): """ Name of the job that materialized this asset in dbt. """ - ASSET_DBT_JOB_SCHEDULE: ClassVar[KeywordField] = KeywordField( - "assetDbtJobSchedule", "assetDbtJobSchedule" - ) + ASSET_DBT_JOB_SCHEDULE: ClassVar[KeywordField] = KeywordField("assetDbtJobSchedule", "assetDbtJobSchedule") """ Schedule of the job that materialized this asset in dbt. """ - ASSET_DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( - "assetDbtJobStatus", "assetDbtJobStatus" - ) + ASSET_DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("assetDbtJobStatus", "assetDbtJobStatus") """ Status of the job that materialized this asset in dbt. """ - ASSET_DBT_TEST_STATUS: ClassVar[KeywordField] = KeywordField( - "assetDbtTestStatus", "assetDbtTestStatus" - ) + ASSET_DBT_TEST_STATUS: ClassVar[KeywordField] = KeywordField("assetDbtTestStatus", "assetDbtTestStatus") """ All associated dbt test statuses. """ @@ -627,15 +538,11 @@ def __setattr__(self, name, value): """ Human-readable cron schedule of the job that materialized this asset in dbt. """ - ASSET_DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( - "assetDbtJobLastRun", "assetDbtJobLastRun" - ) + ASSET_DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("assetDbtJobLastRun", "assetDbtJobLastRun") """ Time (epoch) at which the job that materialized this asset in dbt last ran, in milliseconds. """ - ASSET_DBT_JOB_LAST_RUN_URL: ClassVar[KeywordField] = KeywordField( - "assetDbtJobLastRunUrl", "assetDbtJobLastRunUrl" - ) + ASSET_DBT_JOB_LAST_RUN_URL: ClassVar[KeywordField] = KeywordField("assetDbtJobLastRunUrl", "assetDbtJobLastRunUrl") """ URL of the last run of the job that materialized this asset in dbt. """ @@ -682,11 +589,9 @@ def __setattr__(self, name, value): """ Total duration the job that materialized this asset in dbt spent being queued. """ - ASSET_DBT_JOB_LAST_RUN_QUEUED_DURATION_HUMANIZED: ClassVar[KeywordField] = ( - KeywordField( - "assetDbtJobLastRunQueuedDurationHumanized", - "assetDbtJobLastRunQueuedDurationHumanized", - ) + ASSET_DBT_JOB_LAST_RUN_QUEUED_DURATION_HUMANIZED: ClassVar[KeywordField] = KeywordField( + "assetDbtJobLastRunQueuedDurationHumanized", + "assetDbtJobLastRunQueuedDurationHumanized", ) """ Human-readable total duration of the last run of the job that materialized this asset in dbt spend being queued. @@ -697,11 +602,9 @@ def __setattr__(self, name, value): """ Run duration of the last run of the job that materialized this asset in dbt. """ - ASSET_DBT_JOB_LAST_RUN_RUN_DURATION_HUMANIZED: ClassVar[KeywordField] = ( - KeywordField( - "assetDbtJobLastRunRunDurationHumanized", - "assetDbtJobLastRunRunDurationHumanized", - ) + ASSET_DBT_JOB_LAST_RUN_RUN_DURATION_HUMANIZED: ClassVar[KeywordField] = KeywordField( + "assetDbtJobLastRunRunDurationHumanized", + "assetDbtJobLastRunRunDurationHumanized", ) """ Human-readable run duration of the last run of the job that materialized this asset in dbt. @@ -720,12 +623,10 @@ def __setattr__(self, name, value): """ SHA hash in git for the last run of the job that materialized this asset in dbt. """ - ASSET_DBT_JOB_LAST_RUN_STATUS_MESSAGE: ClassVar[KeywordTextField] = ( - KeywordTextField( - "assetDbtJobLastRunStatusMessage", - "assetDbtJobLastRunStatusMessage.keyword", - "assetDbtJobLastRunStatusMessage", - ) + ASSET_DBT_JOB_LAST_RUN_STATUS_MESSAGE: ClassVar[KeywordTextField] = KeywordTextField( + "assetDbtJobLastRunStatusMessage", + "assetDbtJobLastRunStatusMessage.keyword", + "assetDbtJobLastRunStatusMessage", ) """ Status message of the last run of the job that materialized this asset in dbt. @@ -772,9 +673,7 @@ def __setattr__(self, name, value): """ Whether notifications were sent from the last run of the job that materialized this asset in dbt (true) or not (false). """ # noqa: E501 - ASSET_DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( - "assetDbtJobNextRun", "assetDbtJobNextRun" - ) + ASSET_DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("assetDbtJobNextRun", "assetDbtJobNextRun") """ Time (epoch) when the next run of the job that materializes this asset in dbt is scheduled. """ @@ -800,9 +699,7 @@ def __setattr__(self, name, value): """ Version of the environment in which this asset is materialized in dbt. """ - ASSET_DBT_TAGS: ClassVar[KeywordTextField] = KeywordTextField( - "assetDbtTags", "assetDbtTags", "assetDbtTags.text" - ) + ASSET_DBT_TAGS: ClassVar[KeywordTextField] = KeywordTextField("assetDbtTags", "assetDbtTags", "assetDbtTags.text") """ List of tags attached to this asset in dbt. """ @@ -824,9 +721,7 @@ def __setattr__(self, name, value): """ URL for sample data for this asset. """ - ASSET_TAGS: ClassVar[KeywordTextField] = KeywordTextField( - "assetTags", "assetTags", "assetTags.text" - ) + ASSET_TAGS: ClassVar[KeywordTextField] = KeywordTextField("assetTags", "assetTags", "assetTags.text") """ List of tags attached to this asset. """ @@ -866,15 +761,11 @@ def __setattr__(self, name, value): """ List of unique Monte Carlo monitor names attached to this asset. """ - ASSET_MC_MONITOR_STATUSES: ClassVar[KeywordField] = KeywordField( - "assetMcMonitorStatuses", "assetMcMonitorStatuses" - ) + ASSET_MC_MONITOR_STATUSES: ClassVar[KeywordField] = KeywordField("assetMcMonitorStatuses", "assetMcMonitorStatuses") """ Statuses of all associated Monte Carlo monitors. """ - ASSET_MC_MONITOR_TYPES: ClassVar[KeywordField] = KeywordField( - "assetMcMonitorTypes", "assetMcMonitorTypes" - ) + ASSET_MC_MONITOR_TYPES: ClassVar[KeywordField] = KeywordField("assetMcMonitorTypes", "assetMcMonitorTypes") """ Types of all associated Monte Carlo monitors. """ @@ -884,9 +775,7 @@ def __setattr__(self, name, value): """ Schedules of all associated Monte Carlo monitors. """ - ASSET_MC_INCIDENT_TYPES: ClassVar[KeywordField] = KeywordField( - "assetMcIncidentTypes", "assetMcIncidentTypes" - ) + ASSET_MC_INCIDENT_TYPES: ClassVar[KeywordField] = KeywordField("assetMcIncidentTypes", "assetMcIncidentTypes") """ List of Monte Carlo incident types associated with this asset. """ @@ -908,21 +797,15 @@ def __setattr__(self, name, value): """ List of Monte Carlo incident priorities associated with this asset. """ - ASSET_MC_INCIDENT_STATES: ClassVar[KeywordField] = KeywordField( - "assetMcIncidentStates", "assetMcIncidentStates" - ) + ASSET_MC_INCIDENT_STATES: ClassVar[KeywordField] = KeywordField("assetMcIncidentStates", "assetMcIncidentStates") """ List of Monte Carlo incident states associated with this asset. """ - ASSET_MC_IS_MONITORED: ClassVar[BooleanField] = BooleanField( - "assetMcIsMonitored", "assetMcIsMonitored" - ) + ASSET_MC_IS_MONITORED: ClassVar[BooleanField] = BooleanField("assetMcIsMonitored", "assetMcIsMonitored") """ Tracks whether this asset is monitored by MC or not """ - ASSET_MC_LAST_SYNC_RUN_AT: ClassVar[NumericField] = NumericField( - "assetMcLastSyncRunAt", "assetMcLastSyncRunAt" - ) + ASSET_MC_LAST_SYNC_RUN_AT: ClassVar[NumericField] = NumericField("assetMcLastSyncRunAt", "assetMcLastSyncRunAt") """ Time (epoch) at which this asset was last synced from Monte Carlo. """ @@ -930,9 +813,7 @@ def __setattr__(self, name, value): """ Users who have starred this asset. """ - STARRED_DETAILS_LIST: ClassVar[KeywordField] = KeywordField( - "starredDetailsList", "starredDetailsList" - ) + STARRED_DETAILS_LIST: ClassVar[KeywordField] = KeywordField("starredDetailsList", "starredDetailsList") """ List of usernames with extra information of the users who have starred an asset. """ @@ -940,15 +821,11 @@ def __setattr__(self, name, value): """ Number of users who have starred this asset. """ - ASSET_ANOMALO_DQ_STATUS: ClassVar[KeywordField] = KeywordField( - "assetAnomaloDQStatus", "assetAnomaloDQStatus" - ) + ASSET_ANOMALO_DQ_STATUS: ClassVar[KeywordField] = KeywordField("assetAnomaloDQStatus", "assetAnomaloDQStatus") """ Status of data quality from Anomalo. """ - ASSET_ANOMALO_CHECK_COUNT: ClassVar[NumericField] = NumericField( - "assetAnomaloCheckCount", "assetAnomaloCheckCount" - ) + ASSET_ANOMALO_CHECK_COUNT: ClassVar[NumericField] = NumericField("assetAnomaloCheckCount", "assetAnomaloCheckCount") """ Total number of checks present in Anomalo for this asset. """ @@ -982,21 +859,15 @@ def __setattr__(self, name, value): """ All associated Anomalo failed check types. """ - ASSET_ANOMALO_SOURCE_URL: ClassVar[TextField] = TextField( - "assetAnomaloSourceUrl", "assetAnomaloSourceUrl" - ) + ASSET_ANOMALO_SOURCE_URL: ClassVar[TextField] = TextField("assetAnomaloSourceUrl", "assetAnomaloSourceUrl") """ URL of the source in Anomalo. """ - ASSET_SODA_DQ_STATUS: ClassVar[KeywordField] = KeywordField( - "assetSodaDQStatus", "assetSodaDQStatus" - ) + ASSET_SODA_DQ_STATUS: ClassVar[KeywordField] = KeywordField("assetSodaDQStatus", "assetSodaDQStatus") """ Status of data quality from Soda. """ - ASSET_SODA_CHECK_COUNT: ClassVar[NumericField] = NumericField( - "assetSodaCheckCount", "assetSodaCheckCount" - ) + ASSET_SODA_CHECK_COUNT: ClassVar[NumericField] = NumericField("assetSodaCheckCount", "assetSodaCheckCount") """ Number of checks done via Soda. """ @@ -1006,21 +877,15 @@ def __setattr__(self, name, value): """ """ - ASSET_SODA_LAST_SCAN_AT: ClassVar[NumericField] = NumericField( - "assetSodaLastScanAt", "assetSodaLastScanAt" - ) + ASSET_SODA_LAST_SCAN_AT: ClassVar[NumericField] = NumericField("assetSodaLastScanAt", "assetSodaLastScanAt") """ """ - ASSET_SODA_CHECK_STATUSES: ClassVar[TextField] = TextField( - "assetSodaCheckStatuses", "assetSodaCheckStatuses" - ) + ASSET_SODA_CHECK_STATUSES: ClassVar[TextField] = TextField("assetSodaCheckStatuses", "assetSodaCheckStatuses") """ All associated Soda check statuses. """ - ASSET_SODA_SOURCE_URL: ClassVar[KeywordField] = KeywordField( - "assetSodaSourceURL", "assetSodaSourceURL" - ) + ASSET_SODA_SOURCE_URL: ClassVar[KeywordField] = KeywordField("assetSodaSourceURL", "assetSodaSourceURL") """ """ @@ -1032,15 +897,11 @@ def __setattr__(self, name, value): """ TBC """ - IS_AI_GENERATED: ClassVar[BooleanField] = BooleanField( - "isAIGenerated", "isAIGenerated" - ) + IS_AI_GENERATED: ClassVar[BooleanField] = BooleanField("isAIGenerated", "isAIGenerated") """ """ - ASSET_COVER_IMAGE: ClassVar[TextField] = TextField( - "assetCoverImage", "assetCoverImage" - ) + ASSET_COVER_IMAGE: ClassVar[TextField] = TextField("assetCoverImage", "assetCoverImage") """ TBC """ @@ -1058,15 +919,11 @@ def __setattr__(self, name, value): """ Whether this asset has contract (true) or not (false). """ - ASSET_POLICY_GUIDS: ClassVar[KeywordField] = KeywordField( - "assetPolicyGUIDs", "assetPolicyGUIDs" - ) + ASSET_POLICY_GUIDS: ClassVar[KeywordField] = KeywordField("assetPolicyGUIDs", "assetPolicyGUIDs") """ Array of policy ids governing this asset """ - ASSET_POLICIES_COUNT: ClassVar[NumericField] = NumericField( - "assetPoliciesCount", "assetPoliciesCount" - ) + ASSET_POLICIES_COUNT: ClassVar[NumericField] = NumericField("assetPoliciesCount", "assetPoliciesCount") """ Count of policies inside the asset """ @@ -1093,15 +950,11 @@ def __setattr__(self, name, value): Qualified name of the ApplicationField that contains this asset. """ - SCHEMA_REGISTRY_SUBJECTS: ClassVar[RelationField] = RelationField( - "schemaRegistrySubjects" - ) + SCHEMA_REGISTRY_SUBJECTS: ClassVar[RelationField] = RelationField("schemaRegistrySubjects") """ TBC """ - DATA_CONTRACT_LATEST_CERTIFIED: ClassVar[RelationField] = RelationField( - "dataContractLatestCertified" - ) + DATA_CONTRACT_LATEST_CERTIFIED: ClassVar[RelationField] = RelationField("dataContractLatestCertified") """ TBC """ @@ -1109,21 +962,15 @@ def __setattr__(self, name, value): """ TBC """ - USER_DEF_RELATIONSHIP_TO: ClassVar[RelationField] = RelationField( - "userDefRelationshipTo" - ) + USER_DEF_RELATIONSHIP_TO: ClassVar[RelationField] = RelationField("userDefRelationshipTo") """ TBC """ - OUTPUT_PORT_DATA_PRODUCTS: ClassVar[RelationField] = RelationField( - "outputPortDataProducts" - ) + OUTPUT_PORT_DATA_PRODUCTS: ClassVar[RelationField] = RelationField("outputPortDataProducts") """ TBC """ - USER_DEF_RELATIONSHIP_FROM: ClassVar[RelationField] = RelationField( - "userDefRelationshipFrom" - ) + USER_DEF_RELATIONSHIP_FROM: ClassVar[RelationField] = RelationField("userDefRelationshipFrom") """ TBC """ @@ -1163,9 +1010,7 @@ def __setattr__(self, name, value): """ TBC """ - INPUT_PORT_DATA_PRODUCTS: ClassVar[RelationField] = RelationField( - "inputPortDataProducts" - ) + INPUT_PORT_DATA_PRODUCTS: ClassVar[RelationField] = RelationField("inputPortDataProducts") """ TBC """ @@ -1402,11 +1247,7 @@ def certificate_status(self, certificate_status: Optional[CertificateStatus]): @property def certificate_status_message(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.certificate_status_message - ) + return None if self.attributes is None else self.attributes.certificate_status_message @certificate_status_message.setter def certificate_status_message(self, certificate_status_message: Optional[str]): @@ -1416,9 +1257,7 @@ def certificate_status_message(self, certificate_status_message: Optional[str]): @property def certificate_updated_by(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.certificate_updated_by - ) + return None if self.attributes is None else self.attributes.certificate_updated_by @certificate_updated_by.setter def certificate_updated_by(self, certificate_updated_by: Optional[str]): @@ -1428,9 +1267,7 @@ def certificate_updated_by(self, certificate_updated_by: Optional[str]): @property def certificate_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.certificate_updated_at - ) + return None if self.attributes is None else self.attributes.certificate_updated_at @certificate_updated_at.setter def certificate_updated_at(self, certificate_updated_at: Optional[datetime]): @@ -1470,9 +1307,7 @@ def announcement_type(self, announcement_type: Optional[str]): @property def announcement_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.announcement_updated_at - ) + return None if self.attributes is None else self.attributes.announcement_updated_at @announcement_updated_at.setter def announcement_updated_at(self, announcement_updated_at: Optional[datetime]): @@ -1482,9 +1317,7 @@ def announcement_updated_at(self, announcement_updated_at: Optional[datetime]): @property def announcement_updated_by(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.announcement_updated_by - ) + return None if self.attributes is None else self.attributes.announcement_updated_by @announcement_updated_by.setter def announcement_updated_by(self, announcement_updated_by: Optional[str]): @@ -1574,11 +1407,7 @@ def connection_name(self, connection_name: Optional[str]): @property def connection_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.connection_qualified_name - ) + return None if self.attributes is None else self.attributes.connection_qualified_name @connection_qualified_name.setter def connection_qualified_name(self, connection_qualified_name: Optional[str]): @@ -1718,9 +1547,7 @@ def source_embed_url(self, source_embed_url: Optional[str]): @property def last_sync_workflow_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.last_sync_workflow_name - ) + return None if self.attributes is None else self.attributes.last_sync_workflow_name @last_sync_workflow_name.setter def last_sync_workflow_name(self, last_sync_workflow_name: Optional[str]): @@ -1770,9 +1597,7 @@ def source_read_count(self, source_read_count: Optional[int]): @property def source_read_user_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.source_read_user_count - ) + return None if self.attributes is None else self.attributes.source_read_user_count @source_read_user_count.setter def source_read_user_count(self, source_read_user_count: Optional[int]): @@ -1822,9 +1647,7 @@ def source_cost_unit(self, source_cost_unit: Optional[SourceCostUnitType]): @property def source_read_query_cost(self) -> Optional[float]: - return ( - None if self.attributes is None else self.attributes.source_read_query_cost - ) + return None if self.attributes is None else self.attributes.source_read_query_cost @source_read_query_cost.setter def source_read_query_cost(self, source_read_query_cost: Optional[float]): @@ -1834,27 +1657,17 @@ def source_read_query_cost(self, source_read_query_cost: Optional[float]): @property def source_read_recent_user_list(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.source_read_recent_user_list - ) + return None if self.attributes is None else self.attributes.source_read_recent_user_list @source_read_recent_user_list.setter - def source_read_recent_user_list( - self, source_read_recent_user_list: Optional[Set[str]] - ): + def source_read_recent_user_list(self, source_read_recent_user_list: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.source_read_recent_user_list = source_read_recent_user_list @property def source_read_recent_user_record_list(self) -> Optional[List[PopularityInsights]]: - return ( - None - if self.attributes is None - else self.attributes.source_read_recent_user_record_list - ) + return None if self.attributes is None else self.attributes.source_read_recent_user_record_list @source_read_recent_user_record_list.setter def source_read_recent_user_record_list( @@ -1862,17 +1675,11 @@ def source_read_recent_user_record_list( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_read_recent_user_record_list = ( - source_read_recent_user_record_list - ) + self.attributes.source_read_recent_user_record_list = source_read_recent_user_record_list @property def source_read_top_user_list(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.source_read_top_user_list - ) + return None if self.attributes is None else self.attributes.source_read_top_user_list @source_read_top_user_list.setter def source_read_top_user_list(self, source_read_top_user_list: Optional[Set[str]]): @@ -1882,31 +1689,19 @@ def source_read_top_user_list(self, source_read_top_user_list: Optional[Set[str] @property def source_read_top_user_record_list(self) -> Optional[List[PopularityInsights]]: - return ( - None - if self.attributes is None - else self.attributes.source_read_top_user_record_list - ) + return None if self.attributes is None else self.attributes.source_read_top_user_record_list @source_read_top_user_record_list.setter - def source_read_top_user_record_list( - self, source_read_top_user_record_list: Optional[List[PopularityInsights]] - ): + def source_read_top_user_record_list(self, source_read_top_user_record_list: Optional[List[PopularityInsights]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_read_top_user_record_list = ( - source_read_top_user_record_list - ) + self.attributes.source_read_top_user_record_list = source_read_top_user_record_list @property def source_read_popular_query_record_list( self, ) -> Optional[List[PopularityInsights]]: - return ( - None - if self.attributes is None - else self.attributes.source_read_popular_query_record_list - ) + return None if self.attributes is None else self.attributes.source_read_popular_query_record_list @source_read_popular_query_record_list.setter def source_read_popular_query_record_list( @@ -1914,19 +1709,13 @@ def source_read_popular_query_record_list( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_read_popular_query_record_list = ( - source_read_popular_query_record_list - ) + self.attributes.source_read_popular_query_record_list = source_read_popular_query_record_list @property def source_read_expensive_query_record_list( self, ) -> Optional[List[PopularityInsights]]: - return ( - None - if self.attributes is None - else self.attributes.source_read_expensive_query_record_list - ) + return None if self.attributes is None else self.attributes.source_read_expensive_query_record_list @source_read_expensive_query_record_list.setter def source_read_expensive_query_record_list( @@ -1935,17 +1724,11 @@ def source_read_expensive_query_record_list( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_read_expensive_query_record_list = ( - source_read_expensive_query_record_list - ) + self.attributes.source_read_expensive_query_record_list = source_read_expensive_query_record_list @property def source_read_slow_query_record_list(self) -> Optional[List[PopularityInsights]]: - return ( - None - if self.attributes is None - else self.attributes.source_read_slow_query_record_list - ) + return None if self.attributes is None else self.attributes.source_read_slow_query_record_list @source_read_slow_query_record_list.setter def source_read_slow_query_record_list( @@ -1953,22 +1736,14 @@ def source_read_slow_query_record_list( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_read_slow_query_record_list = ( - source_read_slow_query_record_list - ) + self.attributes.source_read_slow_query_record_list = source_read_slow_query_record_list @property def source_query_compute_cost_list(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.source_query_compute_cost_list - ) + return None if self.attributes is None else self.attributes.source_query_compute_cost_list @source_query_compute_cost_list.setter - def source_query_compute_cost_list( - self, source_query_compute_cost_list: Optional[Set[str]] - ): + def source_query_compute_cost_list(self, source_query_compute_cost_list: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.source_query_compute_cost_list = source_query_compute_cost_list @@ -1977,11 +1752,7 @@ def source_query_compute_cost_list( def source_query_compute_cost_record_list( self, ) -> Optional[List[PopularityInsights]]: - return ( - None - if self.attributes is None - else self.attributes.source_query_compute_cost_record_list - ) + return None if self.attributes is None else self.attributes.source_query_compute_cost_record_list @source_query_compute_cost_record_list.setter def source_query_compute_cost_record_list( @@ -1989,9 +1760,7 @@ def source_query_compute_cost_record_list( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_query_compute_cost_record_list = ( - source_query_compute_cost_record_list - ) + self.attributes.source_query_compute_cost_record_list = source_query_compute_cost_record_list @property def dbt_qualified_name(self) -> Optional[str]: @@ -2005,21 +1774,13 @@ def dbt_qualified_name(self, dbt_qualified_name: Optional[str]): @property def asset_dbt_workflow_last_updated(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_workflow_last_updated - ) + return None if self.attributes is None else self.attributes.asset_dbt_workflow_last_updated @asset_dbt_workflow_last_updated.setter - def asset_dbt_workflow_last_updated( - self, asset_dbt_workflow_last_updated: Optional[str] - ): + def asset_dbt_workflow_last_updated(self, asset_dbt_workflow_last_updated: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_workflow_last_updated = ( - asset_dbt_workflow_last_updated - ) + self.attributes.asset_dbt_workflow_last_updated = asset_dbt_workflow_last_updated @property def asset_dbt_alias(self) -> Optional[str]: @@ -2053,9 +1814,7 @@ def asset_dbt_unique_id(self, asset_dbt_unique_id: Optional[str]): @property def asset_dbt_account_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.asset_dbt_account_name - ) + return None if self.attributes is None else self.attributes.asset_dbt_account_name @asset_dbt_account_name.setter def asset_dbt_account_name(self, asset_dbt_account_name: Optional[str]): @@ -2065,9 +1824,7 @@ def asset_dbt_account_name(self, asset_dbt_account_name: Optional[str]): @property def asset_dbt_project_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.asset_dbt_project_name - ) + return None if self.attributes is None else self.attributes.asset_dbt_project_name @asset_dbt_project_name.setter def asset_dbt_project_name(self, asset_dbt_project_name: Optional[str]): @@ -2077,9 +1834,7 @@ def asset_dbt_project_name(self, asset_dbt_project_name: Optional[str]): @property def asset_dbt_package_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.asset_dbt_package_name - ) + return None if self.attributes is None else self.attributes.asset_dbt_package_name @asset_dbt_package_name.setter def asset_dbt_package_name(self, asset_dbt_package_name: Optional[str]): @@ -2099,9 +1854,7 @@ def asset_dbt_job_name(self, asset_dbt_job_name: Optional[str]): @property def asset_dbt_job_schedule(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.asset_dbt_job_schedule - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_schedule @asset_dbt_job_schedule.setter def asset_dbt_job_schedule(self, asset_dbt_job_schedule: Optional[str]): @@ -2121,9 +1874,7 @@ def asset_dbt_job_status(self, asset_dbt_job_status: Optional[str]): @property def asset_dbt_test_status(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.asset_dbt_test_status - ) + return None if self.attributes is None else self.attributes.asset_dbt_test_status @asset_dbt_test_status.setter def asset_dbt_test_status(self, asset_dbt_test_status: Optional[str]): @@ -2133,27 +1884,17 @@ def asset_dbt_test_status(self, asset_dbt_test_status: Optional[str]): @property def asset_dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_schedule_cron_humanized - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_schedule_cron_humanized @asset_dbt_job_schedule_cron_humanized.setter - def asset_dbt_job_schedule_cron_humanized( - self, asset_dbt_job_schedule_cron_humanized: Optional[str] - ): + def asset_dbt_job_schedule_cron_humanized(self, asset_dbt_job_schedule_cron_humanized: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_schedule_cron_humanized = ( - asset_dbt_job_schedule_cron_humanized - ) + self.attributes.asset_dbt_job_schedule_cron_humanized = asset_dbt_job_schedule_cron_humanized @property def asset_dbt_job_last_run(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.asset_dbt_job_last_run - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run @asset_dbt_job_last_run.setter def asset_dbt_job_last_run(self, asset_dbt_job_last_run: Optional[datetime]): @@ -2163,11 +1904,7 @@ def asset_dbt_job_last_run(self, asset_dbt_job_last_run: Optional[datetime]): @property def asset_dbt_job_last_run_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_url - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_url @asset_dbt_job_last_run_url.setter def asset_dbt_job_last_run_url(self, asset_dbt_job_last_run_url: Optional[str]): @@ -2177,101 +1914,57 @@ def asset_dbt_job_last_run_url(self, asset_dbt_job_last_run_url: Optional[str]): @property def asset_dbt_job_last_run_created_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_created_at - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_created_at @asset_dbt_job_last_run_created_at.setter - def asset_dbt_job_last_run_created_at( - self, asset_dbt_job_last_run_created_at: Optional[datetime] - ): + def asset_dbt_job_last_run_created_at(self, asset_dbt_job_last_run_created_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_created_at = ( - asset_dbt_job_last_run_created_at - ) + self.attributes.asset_dbt_job_last_run_created_at = asset_dbt_job_last_run_created_at @property def asset_dbt_job_last_run_updated_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_updated_at - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_updated_at @asset_dbt_job_last_run_updated_at.setter - def asset_dbt_job_last_run_updated_at( - self, asset_dbt_job_last_run_updated_at: Optional[datetime] - ): + def asset_dbt_job_last_run_updated_at(self, asset_dbt_job_last_run_updated_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_updated_at = ( - asset_dbt_job_last_run_updated_at - ) + self.attributes.asset_dbt_job_last_run_updated_at = asset_dbt_job_last_run_updated_at @property def asset_dbt_job_last_run_dequed_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_dequed_at - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_dequed_at @asset_dbt_job_last_run_dequed_at.setter - def asset_dbt_job_last_run_dequed_at( - self, asset_dbt_job_last_run_dequed_at: Optional[datetime] - ): + def asset_dbt_job_last_run_dequed_at(self, asset_dbt_job_last_run_dequed_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_dequed_at = ( - asset_dbt_job_last_run_dequed_at - ) + self.attributes.asset_dbt_job_last_run_dequed_at = asset_dbt_job_last_run_dequed_at @property def asset_dbt_job_last_run_started_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_started_at - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_started_at @asset_dbt_job_last_run_started_at.setter - def asset_dbt_job_last_run_started_at( - self, asset_dbt_job_last_run_started_at: Optional[datetime] - ): + def asset_dbt_job_last_run_started_at(self, asset_dbt_job_last_run_started_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_started_at = ( - asset_dbt_job_last_run_started_at - ) + self.attributes.asset_dbt_job_last_run_started_at = asset_dbt_job_last_run_started_at @property def asset_dbt_job_last_run_total_duration(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_total_duration - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_total_duration @asset_dbt_job_last_run_total_duration.setter - def asset_dbt_job_last_run_total_duration( - self, asset_dbt_job_last_run_total_duration: Optional[str] - ): + def asset_dbt_job_last_run_total_duration(self, asset_dbt_job_last_run_total_duration: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_total_duration = ( - asset_dbt_job_last_run_total_duration - ) + self.attributes.asset_dbt_job_last_run_total_duration = asset_dbt_job_last_run_total_duration @property def asset_dbt_job_last_run_total_duration_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_total_duration_humanized - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_total_duration_humanized @asset_dbt_job_last_run_total_duration_humanized.setter def asset_dbt_job_last_run_total_duration_humanized( @@ -2285,29 +1978,17 @@ def asset_dbt_job_last_run_total_duration_humanized( @property def asset_dbt_job_last_run_queued_duration(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_queued_duration - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_queued_duration @asset_dbt_job_last_run_queued_duration.setter - def asset_dbt_job_last_run_queued_duration( - self, asset_dbt_job_last_run_queued_duration: Optional[str] - ): + def asset_dbt_job_last_run_queued_duration(self, asset_dbt_job_last_run_queued_duration: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_queued_duration = ( - asset_dbt_job_last_run_queued_duration - ) + self.attributes.asset_dbt_job_last_run_queued_duration = asset_dbt_job_last_run_queued_duration @property def asset_dbt_job_last_run_queued_duration_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_queued_duration_humanized - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_queued_duration_humanized @asset_dbt_job_last_run_queued_duration_humanized.setter def asset_dbt_job_last_run_queued_duration_humanized( @@ -2321,29 +2002,17 @@ def asset_dbt_job_last_run_queued_duration_humanized( @property def asset_dbt_job_last_run_run_duration(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_run_duration - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_run_duration @asset_dbt_job_last_run_run_duration.setter - def asset_dbt_job_last_run_run_duration( - self, asset_dbt_job_last_run_run_duration: Optional[str] - ): + def asset_dbt_job_last_run_run_duration(self, asset_dbt_job_last_run_run_duration: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_run_duration = ( - asset_dbt_job_last_run_run_duration - ) + self.attributes.asset_dbt_job_last_run_run_duration = asset_dbt_job_last_run_run_duration @property def asset_dbt_job_last_run_run_duration_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_run_duration_humanized - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_run_duration_humanized @asset_dbt_job_last_run_run_duration_humanized.setter def asset_dbt_job_last_run_run_duration_humanized( @@ -2351,159 +2020,91 @@ def asset_dbt_job_last_run_run_duration_humanized( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_run_duration_humanized = ( - asset_dbt_job_last_run_run_duration_humanized - ) + self.attributes.asset_dbt_job_last_run_run_duration_humanized = asset_dbt_job_last_run_run_duration_humanized @property def asset_dbt_job_last_run_git_branch(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_git_branch - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_git_branch @asset_dbt_job_last_run_git_branch.setter - def asset_dbt_job_last_run_git_branch( - self, asset_dbt_job_last_run_git_branch: Optional[str] - ): + def asset_dbt_job_last_run_git_branch(self, asset_dbt_job_last_run_git_branch: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_git_branch = ( - asset_dbt_job_last_run_git_branch - ) + self.attributes.asset_dbt_job_last_run_git_branch = asset_dbt_job_last_run_git_branch @property def asset_dbt_job_last_run_git_sha(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_git_sha - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_git_sha @asset_dbt_job_last_run_git_sha.setter - def asset_dbt_job_last_run_git_sha( - self, asset_dbt_job_last_run_git_sha: Optional[str] - ): + def asset_dbt_job_last_run_git_sha(self, asset_dbt_job_last_run_git_sha: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_dbt_job_last_run_git_sha = asset_dbt_job_last_run_git_sha @property def asset_dbt_job_last_run_status_message(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_status_message - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_status_message @asset_dbt_job_last_run_status_message.setter - def asset_dbt_job_last_run_status_message( - self, asset_dbt_job_last_run_status_message: Optional[str] - ): + def asset_dbt_job_last_run_status_message(self, asset_dbt_job_last_run_status_message: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_status_message = ( - asset_dbt_job_last_run_status_message - ) + self.attributes.asset_dbt_job_last_run_status_message = asset_dbt_job_last_run_status_message @property def asset_dbt_job_last_run_owner_thread_id(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_owner_thread_id - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_owner_thread_id @asset_dbt_job_last_run_owner_thread_id.setter - def asset_dbt_job_last_run_owner_thread_id( - self, asset_dbt_job_last_run_owner_thread_id: Optional[str] - ): + def asset_dbt_job_last_run_owner_thread_id(self, asset_dbt_job_last_run_owner_thread_id: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_owner_thread_id = ( - asset_dbt_job_last_run_owner_thread_id - ) + self.attributes.asset_dbt_job_last_run_owner_thread_id = asset_dbt_job_last_run_owner_thread_id @property def asset_dbt_job_last_run_executed_by_thread_id(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_executed_by_thread_id - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_executed_by_thread_id @asset_dbt_job_last_run_executed_by_thread_id.setter - def asset_dbt_job_last_run_executed_by_thread_id( - self, asset_dbt_job_last_run_executed_by_thread_id: Optional[str] - ): + def asset_dbt_job_last_run_executed_by_thread_id(self, asset_dbt_job_last_run_executed_by_thread_id: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_executed_by_thread_id = ( - asset_dbt_job_last_run_executed_by_thread_id - ) + self.attributes.asset_dbt_job_last_run_executed_by_thread_id = asset_dbt_job_last_run_executed_by_thread_id @property def asset_dbt_job_last_run_artifacts_saved(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_artifacts_saved - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_artifacts_saved @asset_dbt_job_last_run_artifacts_saved.setter - def asset_dbt_job_last_run_artifacts_saved( - self, asset_dbt_job_last_run_artifacts_saved: Optional[bool] - ): + def asset_dbt_job_last_run_artifacts_saved(self, asset_dbt_job_last_run_artifacts_saved: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_artifacts_saved = ( - asset_dbt_job_last_run_artifacts_saved - ) + self.attributes.asset_dbt_job_last_run_artifacts_saved = asset_dbt_job_last_run_artifacts_saved @property def asset_dbt_job_last_run_artifact_s3_path(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_artifact_s3_path - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_artifact_s3_path @asset_dbt_job_last_run_artifact_s3_path.setter - def asset_dbt_job_last_run_artifact_s3_path( - self, asset_dbt_job_last_run_artifact_s3_path: Optional[str] - ): + def asset_dbt_job_last_run_artifact_s3_path(self, asset_dbt_job_last_run_artifact_s3_path: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_artifact_s3_path = ( - asset_dbt_job_last_run_artifact_s3_path - ) + self.attributes.asset_dbt_job_last_run_artifact_s3_path = asset_dbt_job_last_run_artifact_s3_path @property def asset_dbt_job_last_run_has_docs_generated(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_has_docs_generated - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_has_docs_generated @asset_dbt_job_last_run_has_docs_generated.setter - def asset_dbt_job_last_run_has_docs_generated( - self, asset_dbt_job_last_run_has_docs_generated: Optional[bool] - ): + def asset_dbt_job_last_run_has_docs_generated(self, asset_dbt_job_last_run_has_docs_generated: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_has_docs_generated = ( - asset_dbt_job_last_run_has_docs_generated - ) + self.attributes.asset_dbt_job_last_run_has_docs_generated = asset_dbt_job_last_run_has_docs_generated @property def asset_dbt_job_last_run_has_sources_generated(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_has_sources_generated - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_has_sources_generated @asset_dbt_job_last_run_has_sources_generated.setter def asset_dbt_job_last_run_has_sources_generated( @@ -2511,33 +2112,21 @@ def asset_dbt_job_last_run_has_sources_generated( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_has_sources_generated = ( - asset_dbt_job_last_run_has_sources_generated - ) + self.attributes.asset_dbt_job_last_run_has_sources_generated = asset_dbt_job_last_run_has_sources_generated @property def asset_dbt_job_last_run_notifications_sent(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_last_run_notifications_sent - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_notifications_sent @asset_dbt_job_last_run_notifications_sent.setter - def asset_dbt_job_last_run_notifications_sent( - self, asset_dbt_job_last_run_notifications_sent: Optional[bool] - ): + def asset_dbt_job_last_run_notifications_sent(self, asset_dbt_job_last_run_notifications_sent: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_notifications_sent = ( - asset_dbt_job_last_run_notifications_sent - ) + self.attributes.asset_dbt_job_last_run_notifications_sent = asset_dbt_job_last_run_notifications_sent @property def asset_dbt_job_next_run(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.asset_dbt_job_next_run - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_next_run @asset_dbt_job_next_run.setter def asset_dbt_job_next_run(self, asset_dbt_job_next_run: Optional[datetime]): @@ -2547,29 +2136,17 @@ def asset_dbt_job_next_run(self, asset_dbt_job_next_run: Optional[datetime]): @property def asset_dbt_job_next_run_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_job_next_run_humanized - ) + return None if self.attributes is None else self.attributes.asset_dbt_job_next_run_humanized @asset_dbt_job_next_run_humanized.setter - def asset_dbt_job_next_run_humanized( - self, asset_dbt_job_next_run_humanized: Optional[str] - ): + def asset_dbt_job_next_run_humanized(self, asset_dbt_job_next_run_humanized: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_next_run_humanized = ( - asset_dbt_job_next_run_humanized - ) + self.attributes.asset_dbt_job_next_run_humanized = asset_dbt_job_next_run_humanized @property def asset_dbt_environment_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_environment_name - ) + return None if self.attributes is None else self.attributes.asset_dbt_environment_name @asset_dbt_environment_name.setter def asset_dbt_environment_name(self, asset_dbt_environment_name: Optional[str]): @@ -2579,21 +2156,13 @@ def asset_dbt_environment_name(self, asset_dbt_environment_name: Optional[str]): @property def asset_dbt_environment_dbt_version(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_environment_dbt_version - ) + return None if self.attributes is None else self.attributes.asset_dbt_environment_dbt_version @asset_dbt_environment_dbt_version.setter - def asset_dbt_environment_dbt_version( - self, asset_dbt_environment_dbt_version: Optional[str] - ): + def asset_dbt_environment_dbt_version(self, asset_dbt_environment_dbt_version: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_environment_dbt_version = ( - asset_dbt_environment_dbt_version - ) + self.attributes.asset_dbt_environment_dbt_version = asset_dbt_environment_dbt_version @property def asset_dbt_tags(self) -> Optional[Set[str]]: @@ -2607,39 +2176,23 @@ def asset_dbt_tags(self, asset_dbt_tags: Optional[Set[str]]): @property def asset_dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_semantic_layer_proxy_url - ) + return None if self.attributes is None else self.attributes.asset_dbt_semantic_layer_proxy_url @asset_dbt_semantic_layer_proxy_url.setter - def asset_dbt_semantic_layer_proxy_url( - self, asset_dbt_semantic_layer_proxy_url: Optional[str] - ): + def asset_dbt_semantic_layer_proxy_url(self, asset_dbt_semantic_layer_proxy_url: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_semantic_layer_proxy_url = ( - asset_dbt_semantic_layer_proxy_url - ) + self.attributes.asset_dbt_semantic_layer_proxy_url = asset_dbt_semantic_layer_proxy_url @property def asset_dbt_source_freshness_criteria(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_dbt_source_freshness_criteria - ) + return None if self.attributes is None else self.attributes.asset_dbt_source_freshness_criteria @asset_dbt_source_freshness_criteria.setter - def asset_dbt_source_freshness_criteria( - self, asset_dbt_source_freshness_criteria: Optional[str] - ): + def asset_dbt_source_freshness_criteria(self, asset_dbt_source_freshness_criteria: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_source_freshness_criteria = ( - asset_dbt_source_freshness_criteria - ) + self.attributes.asset_dbt_source_freshness_criteria = asset_dbt_source_freshness_criteria @property def sample_data_url(self) -> Optional[str]: @@ -2663,9 +2216,7 @@ def asset_tags(self, asset_tags: Optional[Set[str]]): @property def asset_mc_incident_names(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.asset_mc_incident_names - ) + return None if self.attributes is None else self.attributes.asset_mc_incident_names @asset_mc_incident_names.setter def asset_mc_incident_names(self, asset_mc_incident_names: Optional[Set[str]]): @@ -2675,43 +2226,27 @@ def asset_mc_incident_names(self, asset_mc_incident_names: Optional[Set[str]]): @property def asset_mc_incident_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.asset_mc_incident_qualified_names - ) + return None if self.attributes is None else self.attributes.asset_mc_incident_qualified_names @asset_mc_incident_qualified_names.setter - def asset_mc_incident_qualified_names( - self, asset_mc_incident_qualified_names: Optional[Set[str]] - ): + def asset_mc_incident_qualified_names(self, asset_mc_incident_qualified_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_mc_incident_qualified_names = ( - asset_mc_incident_qualified_names - ) + self.attributes.asset_mc_incident_qualified_names = asset_mc_incident_qualified_names @property def asset_mc_alert_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.asset_mc_alert_qualified_names - ) + return None if self.attributes is None else self.attributes.asset_mc_alert_qualified_names @asset_mc_alert_qualified_names.setter - def asset_mc_alert_qualified_names( - self, asset_mc_alert_qualified_names: Optional[Set[str]] - ): + def asset_mc_alert_qualified_names(self, asset_mc_alert_qualified_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_mc_alert_qualified_names = asset_mc_alert_qualified_names @property def asset_mc_monitor_names(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.asset_mc_monitor_names - ) + return None if self.attributes is None else self.attributes.asset_mc_monitor_names @asset_mc_monitor_names.setter def asset_mc_monitor_names(self, asset_mc_monitor_names: Optional[Set[str]]): @@ -2721,29 +2256,17 @@ def asset_mc_monitor_names(self, asset_mc_monitor_names: Optional[Set[str]]): @property def asset_mc_monitor_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.asset_mc_monitor_qualified_names - ) + return None if self.attributes is None else self.attributes.asset_mc_monitor_qualified_names @asset_mc_monitor_qualified_names.setter - def asset_mc_monitor_qualified_names( - self, asset_mc_monitor_qualified_names: Optional[Set[str]] - ): + def asset_mc_monitor_qualified_names(self, asset_mc_monitor_qualified_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_mc_monitor_qualified_names = ( - asset_mc_monitor_qualified_names - ) + self.attributes.asset_mc_monitor_qualified_names = asset_mc_monitor_qualified_names @property def asset_mc_monitor_statuses(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.asset_mc_monitor_statuses - ) + return None if self.attributes is None else self.attributes.asset_mc_monitor_statuses @asset_mc_monitor_statuses.setter def asset_mc_monitor_statuses(self, asset_mc_monitor_statuses: Optional[Set[str]]): @@ -2753,9 +2276,7 @@ def asset_mc_monitor_statuses(self, asset_mc_monitor_statuses: Optional[Set[str] @property def asset_mc_monitor_types(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.asset_mc_monitor_types - ) + return None if self.attributes is None else self.attributes.asset_mc_monitor_types @asset_mc_monitor_types.setter def asset_mc_monitor_types(self, asset_mc_monitor_types: Optional[Set[str]]): @@ -2765,27 +2286,17 @@ def asset_mc_monitor_types(self, asset_mc_monitor_types: Optional[Set[str]]): @property def asset_mc_monitor_schedule_types(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.asset_mc_monitor_schedule_types - ) + return None if self.attributes is None else self.attributes.asset_mc_monitor_schedule_types @asset_mc_monitor_schedule_types.setter - def asset_mc_monitor_schedule_types( - self, asset_mc_monitor_schedule_types: Optional[Set[str]] - ): + def asset_mc_monitor_schedule_types(self, asset_mc_monitor_schedule_types: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_mc_monitor_schedule_types = ( - asset_mc_monitor_schedule_types - ) + self.attributes.asset_mc_monitor_schedule_types = asset_mc_monitor_schedule_types @property def asset_mc_incident_types(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.asset_mc_incident_types - ) + return None if self.attributes is None else self.attributes.asset_mc_incident_types @asset_mc_incident_types.setter def asset_mc_incident_types(self, asset_mc_incident_types: Optional[Set[str]]): @@ -2795,59 +2306,37 @@ def asset_mc_incident_types(self, asset_mc_incident_types: Optional[Set[str]]): @property def asset_mc_incident_sub_types(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.asset_mc_incident_sub_types - ) + return None if self.attributes is None else self.attributes.asset_mc_incident_sub_types @asset_mc_incident_sub_types.setter - def asset_mc_incident_sub_types( - self, asset_mc_incident_sub_types: Optional[Set[str]] - ): + def asset_mc_incident_sub_types(self, asset_mc_incident_sub_types: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_mc_incident_sub_types = asset_mc_incident_sub_types @property def asset_mc_incident_severities(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.asset_mc_incident_severities - ) + return None if self.attributes is None else self.attributes.asset_mc_incident_severities @asset_mc_incident_severities.setter - def asset_mc_incident_severities( - self, asset_mc_incident_severities: Optional[Set[str]] - ): + def asset_mc_incident_severities(self, asset_mc_incident_severities: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_mc_incident_severities = asset_mc_incident_severities @property def asset_mc_incident_priorities(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.asset_mc_incident_priorities - ) + return None if self.attributes is None else self.attributes.asset_mc_incident_priorities @asset_mc_incident_priorities.setter - def asset_mc_incident_priorities( - self, asset_mc_incident_priorities: Optional[Set[str]] - ): + def asset_mc_incident_priorities(self, asset_mc_incident_priorities: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_mc_incident_priorities = asset_mc_incident_priorities @property def asset_mc_incident_states(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.asset_mc_incident_states - ) + return None if self.attributes is None else self.attributes.asset_mc_incident_states @asset_mc_incident_states.setter def asset_mc_incident_states(self, asset_mc_incident_states: Optional[Set[str]]): @@ -2857,9 +2346,7 @@ def asset_mc_incident_states(self, asset_mc_incident_states: Optional[Set[str]]) @property def asset_mc_is_monitored(self) -> Optional[bool]: - return ( - None if self.attributes is None else self.attributes.asset_mc_is_monitored - ) + return None if self.attributes is None else self.attributes.asset_mc_is_monitored @asset_mc_is_monitored.setter def asset_mc_is_monitored(self, asset_mc_is_monitored: Optional[bool]): @@ -2869,11 +2356,7 @@ def asset_mc_is_monitored(self, asset_mc_is_monitored: Optional[bool]): @property def asset_mc_last_sync_run_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.asset_mc_last_sync_run_at - ) + return None if self.attributes is None else self.attributes.asset_mc_last_sync_run_at @asset_mc_last_sync_run_at.setter def asset_mc_last_sync_run_at(self, asset_mc_last_sync_run_at: Optional[datetime]): @@ -2896,9 +2379,7 @@ def starred_details_list(self) -> Optional[List[StarredDetails]]: return None if self.attributes is None else self.attributes.starred_details_list @starred_details_list.setter - def starred_details_list( - self, starred_details_list: Optional[List[StarredDetails]] - ): + def starred_details_list(self, starred_details_list: Optional[List[StarredDetails]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.starred_details_list = starred_details_list @@ -2915,11 +2396,7 @@ def starred_count(self, starred_count: Optional[int]): @property def asset_anomalo_d_q_status(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_anomalo_d_q_status - ) + return None if self.attributes is None else self.attributes.asset_anomalo_d_q_status @asset_anomalo_d_q_status.setter def asset_anomalo_d_q_status(self, asset_anomalo_d_q_status: Optional[str]): @@ -2929,11 +2406,7 @@ def asset_anomalo_d_q_status(self, asset_anomalo_d_q_status: Optional[str]): @property def asset_anomalo_check_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.asset_anomalo_check_count - ) + return None if self.attributes is None else self.attributes.asset_anomalo_check_count @asset_anomalo_check_count.setter def asset_anomalo_check_count(self, asset_anomalo_check_count: Optional[int]): @@ -2943,29 +2416,17 @@ def asset_anomalo_check_count(self, asset_anomalo_check_count: Optional[int]): @property def asset_anomalo_failed_check_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.asset_anomalo_failed_check_count - ) + return None if self.attributes is None else self.attributes.asset_anomalo_failed_check_count @asset_anomalo_failed_check_count.setter - def asset_anomalo_failed_check_count( - self, asset_anomalo_failed_check_count: Optional[int] - ): + def asset_anomalo_failed_check_count(self, asset_anomalo_failed_check_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_anomalo_failed_check_count = ( - asset_anomalo_failed_check_count - ) + self.attributes.asset_anomalo_failed_check_count = asset_anomalo_failed_check_count @property def asset_anomalo_check_statuses(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_anomalo_check_statuses - ) + return None if self.attributes is None else self.attributes.asset_anomalo_check_statuses @asset_anomalo_check_statuses.setter def asset_anomalo_check_statuses(self, asset_anomalo_check_statuses: Optional[str]): @@ -2975,65 +2436,37 @@ def asset_anomalo_check_statuses(self, asset_anomalo_check_statuses: Optional[st @property def asset_anomalo_last_check_run_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.asset_anomalo_last_check_run_at - ) + return None if self.attributes is None else self.attributes.asset_anomalo_last_check_run_at @asset_anomalo_last_check_run_at.setter - def asset_anomalo_last_check_run_at( - self, asset_anomalo_last_check_run_at: Optional[datetime] - ): + def asset_anomalo_last_check_run_at(self, asset_anomalo_last_check_run_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_anomalo_last_check_run_at = ( - asset_anomalo_last_check_run_at - ) + self.attributes.asset_anomalo_last_check_run_at = asset_anomalo_last_check_run_at @property def asset_anomalo_applied_check_types(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.asset_anomalo_applied_check_types - ) + return None if self.attributes is None else self.attributes.asset_anomalo_applied_check_types @asset_anomalo_applied_check_types.setter - def asset_anomalo_applied_check_types( - self, asset_anomalo_applied_check_types: Optional[Set[str]] - ): + def asset_anomalo_applied_check_types(self, asset_anomalo_applied_check_types: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_anomalo_applied_check_types = ( - asset_anomalo_applied_check_types - ) + self.attributes.asset_anomalo_applied_check_types = asset_anomalo_applied_check_types @property def asset_anomalo_failed_check_types(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.asset_anomalo_failed_check_types - ) + return None if self.attributes is None else self.attributes.asset_anomalo_failed_check_types @asset_anomalo_failed_check_types.setter - def asset_anomalo_failed_check_types( - self, asset_anomalo_failed_check_types: Optional[Set[str]] - ): + def asset_anomalo_failed_check_types(self, asset_anomalo_failed_check_types: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_anomalo_failed_check_types = ( - asset_anomalo_failed_check_types - ) + self.attributes.asset_anomalo_failed_check_types = asset_anomalo_failed_check_types @property def asset_anomalo_source_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_anomalo_source_url - ) + return None if self.attributes is None else self.attributes.asset_anomalo_source_url @asset_anomalo_source_url.setter def asset_anomalo_source_url(self, asset_anomalo_source_url: Optional[str]): @@ -3043,9 +2476,7 @@ def asset_anomalo_source_url(self, asset_anomalo_source_url: Optional[str]): @property def asset_soda_d_q_status(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.asset_soda_d_q_status - ) + return None if self.attributes is None else self.attributes.asset_soda_d_q_status @asset_soda_d_q_status.setter def asset_soda_d_q_status(self, asset_soda_d_q_status: Optional[str]): @@ -3055,9 +2486,7 @@ def asset_soda_d_q_status(self, asset_soda_d_q_status: Optional[str]): @property def asset_soda_check_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.asset_soda_check_count - ) + return None if self.attributes is None else self.attributes.asset_soda_check_count @asset_soda_check_count.setter def asset_soda_check_count(self, asset_soda_check_count: Optional[int]): @@ -3067,25 +2496,17 @@ def asset_soda_check_count(self, asset_soda_check_count: Optional[int]): @property def asset_soda_last_sync_run_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.asset_soda_last_sync_run_at - ) + return None if self.attributes is None else self.attributes.asset_soda_last_sync_run_at @asset_soda_last_sync_run_at.setter - def asset_soda_last_sync_run_at( - self, asset_soda_last_sync_run_at: Optional[datetime] - ): + def asset_soda_last_sync_run_at(self, asset_soda_last_sync_run_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_soda_last_sync_run_at = asset_soda_last_sync_run_at @property def asset_soda_last_scan_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.asset_soda_last_scan_at - ) + return None if self.attributes is None else self.attributes.asset_soda_last_scan_at @asset_soda_last_scan_at.setter def asset_soda_last_scan_at(self, asset_soda_last_scan_at: Optional[datetime]): @@ -3095,11 +2516,7 @@ def asset_soda_last_scan_at(self, asset_soda_last_scan_at: Optional[datetime]): @property def asset_soda_check_statuses(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.asset_soda_check_statuses - ) + return None if self.attributes is None else self.attributes.asset_soda_check_statuses @asset_soda_check_statuses.setter def asset_soda_check_statuses(self, asset_soda_check_statuses: Optional[str]): @@ -3109,9 +2526,7 @@ def asset_soda_check_statuses(self, asset_soda_check_statuses: Optional[str]): @property def asset_soda_source_url(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.asset_soda_source_url - ) + return None if self.attributes is None else self.attributes.asset_soda_source_url @asset_soda_source_url.setter def asset_soda_source_url(self, asset_soda_source_url: Optional[str]): @@ -3171,11 +2586,7 @@ def asset_theme_hex(self, asset_theme_hex: Optional[str]): @property def lexicographical_sort_order(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.lexicographical_sort_order - ) + return None if self.attributes is None else self.attributes.lexicographical_sort_order @lexicographical_sort_order.setter def lexicographical_sort_order(self, lexicographical_sort_order: Optional[str]): @@ -3195,9 +2606,7 @@ def has_contract(self, has_contract: Optional[bool]): @property def asset_policy_g_u_i_ds(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.asset_policy_g_u_i_ds - ) + return None if self.attributes is None else self.attributes.asset_policy_g_u_i_ds @asset_policy_g_u_i_ds.setter def asset_policy_g_u_i_ds(self, asset_policy_g_u_i_ds: Optional[Set[str]]): @@ -3227,29 +2636,17 @@ def domain_g_u_i_ds(self, domain_g_u_i_ds: Optional[Set[str]]): @property def non_compliant_asset_policy_g_u_i_ds(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.non_compliant_asset_policy_g_u_i_ds - ) + return None if self.attributes is None else self.attributes.non_compliant_asset_policy_g_u_i_ds @non_compliant_asset_policy_g_u_i_ds.setter - def non_compliant_asset_policy_g_u_i_ds( - self, non_compliant_asset_policy_g_u_i_ds: Optional[Set[str]] - ): + def non_compliant_asset_policy_g_u_i_ds(self, non_compliant_asset_policy_g_u_i_ds: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.non_compliant_asset_policy_g_u_i_ds = ( - non_compliant_asset_policy_g_u_i_ds - ) + self.attributes.non_compliant_asset_policy_g_u_i_ds = non_compliant_asset_policy_g_u_i_ds @property def application_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.application_qualified_name - ) + return None if self.attributes is None else self.attributes.application_qualified_name @application_qualified_name.setter def application_qualified_name(self, application_qualified_name: Optional[str]): @@ -3259,50 +2656,30 @@ def application_qualified_name(self, application_qualified_name: Optional[str]): @property def application_field_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.application_field_qualified_name - ) + return None if self.attributes is None else self.attributes.application_field_qualified_name @application_field_qualified_name.setter - def application_field_qualified_name( - self, application_field_qualified_name: Optional[str] - ): + def application_field_qualified_name(self, application_field_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.application_field_qualified_name = ( - application_field_qualified_name - ) + self.attributes.application_field_qualified_name = application_field_qualified_name @property def schema_registry_subjects(self) -> Optional[List[SchemaRegistrySubject]]: - return ( - None - if self.attributes is None - else self.attributes.schema_registry_subjects - ) + return None if self.attributes is None else self.attributes.schema_registry_subjects @schema_registry_subjects.setter - def schema_registry_subjects( - self, schema_registry_subjects: Optional[List[SchemaRegistrySubject]] - ): + def schema_registry_subjects(self, schema_registry_subjects: Optional[List[SchemaRegistrySubject]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.schema_registry_subjects = schema_registry_subjects @property def data_contract_latest_certified(self) -> Optional[DataContract]: - return ( - None - if self.attributes is None - else self.attributes.data_contract_latest_certified - ) + return None if self.attributes is None else self.attributes.data_contract_latest_certified @data_contract_latest_certified.setter - def data_contract_latest_certified( - self, data_contract_latest_certified: Optional[DataContract] - ): + def data_contract_latest_certified(self, data_contract_latest_certified: Optional[DataContract]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_contract_latest_certified = data_contract_latest_certified @@ -3319,48 +2696,30 @@ def anomalo_checks(self, anomalo_checks: Optional[List[AnomaloCheck]]): @property def user_def_relationship_to(self) -> Optional[List[Referenceable]]: - return ( - None - if self.attributes is None - else self.attributes.user_def_relationship_to - ) + return None if self.attributes is None else self.attributes.user_def_relationship_to @user_def_relationship_to.setter - def user_def_relationship_to( - self, user_def_relationship_to: Optional[List[Referenceable]] - ): + def user_def_relationship_to(self, user_def_relationship_to: Optional[List[Referenceable]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.user_def_relationship_to = user_def_relationship_to @property def output_port_data_products(self) -> Optional[List[DataProduct]]: - return ( - None - if self.attributes is None - else self.attributes.output_port_data_products - ) + return None if self.attributes is None else self.attributes.output_port_data_products @output_port_data_products.setter - def output_port_data_products( - self, output_port_data_products: Optional[List[DataProduct]] - ): + def output_port_data_products(self, output_port_data_products: Optional[List[DataProduct]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.output_port_data_products = output_port_data_products @property def user_def_relationship_from(self) -> Optional[List[Referenceable]]: - return ( - None - if self.attributes is None - else self.attributes.user_def_relationship_from - ) + return None if self.attributes is None else self.attributes.user_def_relationship_from @user_def_relationship_from.setter - def user_def_relationship_from( - self, user_def_relationship_from: Optional[List[Referenceable]] - ): + def user_def_relationship_from(self, user_def_relationship_from: Optional[List[Referenceable]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.user_def_relationship_from = user_def_relationship_from @@ -3467,16 +2826,10 @@ def metrics(self, metrics: Optional[List[Metric]]): @property def input_port_data_products(self) -> Optional[List[DataProduct]]: - return ( - None - if self.attributes is None - else self.attributes.input_port_data_products - ) + return None if self.attributes is None else self.attributes.input_port_data_products @input_port_data_products.setter - def input_port_data_products( - self, input_port_data_products: Optional[List[DataProduct]] - ): + def input_port_data_products(self, input_port_data_products: Optional[List[DataProduct]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.input_port_data_products = input_port_data_products @@ -3497,18 +2850,14 @@ class Attributes(Referenceable.Attributes): description: Optional[str] = Field(default=None, description="") user_description: Optional[str] = Field(default=None, description="") tenant_id: Optional[str] = Field(default=None, description="") - certificate_status: Optional[CertificateStatus] = Field( - default=None, description="" - ) + certificate_status: Optional[CertificateStatus] = Field(default=None, description="") certificate_status_message: Optional[str] = Field(default=None, description="") certificate_updated_by: Optional[str] = Field(default=None, description="") certificate_updated_at: Optional[datetime] = Field(default=None, description="") announcement_title: Optional[str] = Field(default=None, description="") announcement_message: Optional[str] = Field(default=None, description="") announcement_type: Optional[str] = Field(default=None, description="") - announcement_updated_at: Optional[datetime] = Field( - default=None, description="" - ) + announcement_updated_at: Optional[datetime] = Field(default=None, description="") announcement_updated_by: Optional[str] = Field(default=None, description="") owner_users: Optional[Set[str]] = Field(default=None, description="") owner_groups: Optional[Set[str]] = Field(default=None, description="") @@ -3541,41 +2890,21 @@ class Attributes(Referenceable.Attributes): source_last_read_at: Optional[datetime] = Field(default=None, description="") last_row_changed_at: Optional[datetime] = Field(default=None, description="") source_total_cost: Optional[float] = Field(default=None, description="") - source_cost_unit: Optional[SourceCostUnitType] = Field( - default=None, description="" - ) + source_cost_unit: Optional[SourceCostUnitType] = Field(default=None, description="") source_read_query_cost: Optional[float] = Field(default=None, description="") - source_read_recent_user_list: Optional[Set[str]] = Field( - default=None, description="" - ) - source_read_recent_user_record_list: Optional[List[PopularityInsights]] = Field( - default=None, description="" - ) - source_read_top_user_list: Optional[Set[str]] = Field( - default=None, description="" - ) - source_read_top_user_record_list: Optional[List[PopularityInsights]] = Field( + source_read_recent_user_list: Optional[Set[str]] = Field(default=None, description="") + source_read_recent_user_record_list: Optional[List[PopularityInsights]] = Field(default=None, description="") + source_read_top_user_list: Optional[Set[str]] = Field(default=None, description="") + source_read_top_user_record_list: Optional[List[PopularityInsights]] = Field(default=None, description="") + source_read_popular_query_record_list: Optional[List[PopularityInsights]] = Field(default=None, description="") + source_read_expensive_query_record_list: Optional[List[PopularityInsights]] = Field( default=None, description="" ) - source_read_popular_query_record_list: Optional[List[PopularityInsights]] = ( - Field(default=None, description="") - ) - source_read_expensive_query_record_list: Optional[List[PopularityInsights]] = ( - Field(default=None, description="") - ) - source_read_slow_query_record_list: Optional[List[PopularityInsights]] = Field( - default=None, description="" - ) - source_query_compute_cost_list: Optional[Set[str]] = Field( - default=None, description="" - ) - source_query_compute_cost_record_list: Optional[List[PopularityInsights]] = ( - Field(default=None, description="") - ) + source_read_slow_query_record_list: Optional[List[PopularityInsights]] = Field(default=None, description="") + source_query_compute_cost_list: Optional[Set[str]] = Field(default=None, description="") + source_query_compute_cost_record_list: Optional[List[PopularityInsights]] = Field(default=None, description="") dbt_qualified_name: Optional[str] = Field(default=None, description="") - asset_dbt_workflow_last_updated: Optional[str] = Field( - default=None, description="" - ) + asset_dbt_workflow_last_updated: Optional[str] = Field(default=None, description="") asset_dbt_alias: Optional[str] = Field(default=None, description="") asset_dbt_meta: Optional[str] = Field(default=None, description="") asset_dbt_unique_id: Optional[str] = Field(default=None, description="") @@ -3586,158 +2915,68 @@ class Attributes(Referenceable.Attributes): asset_dbt_job_schedule: Optional[str] = Field(default=None, description="") asset_dbt_job_status: Optional[str] = Field(default=None, description="") asset_dbt_test_status: Optional[str] = Field(default=None, description="") - asset_dbt_job_schedule_cron_humanized: Optional[str] = Field( - default=None, description="" - ) + asset_dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") asset_dbt_job_last_run: Optional[datetime] = Field(default=None, description="") asset_dbt_job_last_run_url: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_created_at: Optional[datetime] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_updated_at: Optional[datetime] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_dequed_at: Optional[datetime] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_started_at: Optional[datetime] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_total_duration: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_total_duration_humanized: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_queued_duration: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_queued_duration_humanized: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_run_duration: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_run_duration_humanized: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_git_branch: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_git_sha: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_status_message: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_owner_thread_id: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_executed_by_thread_id: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_artifacts_saved: Optional[bool] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_artifact_s3_path: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_has_docs_generated: Optional[bool] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_has_sources_generated: Optional[bool] = Field( - default=None, description="" - ) - asset_dbt_job_last_run_notifications_sent: Optional[bool] = Field( - default=None, description="" - ) + asset_dbt_job_last_run_created_at: Optional[datetime] = Field(default=None, description="") + asset_dbt_job_last_run_updated_at: Optional[datetime] = Field(default=None, description="") + asset_dbt_job_last_run_dequed_at: Optional[datetime] = Field(default=None, description="") + asset_dbt_job_last_run_started_at: Optional[datetime] = Field(default=None, description="") + asset_dbt_job_last_run_total_duration: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_total_duration_humanized: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_queued_duration: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_queued_duration_humanized: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_run_duration: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_run_duration_humanized: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_git_branch: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_git_sha: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_status_message: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_owner_thread_id: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_executed_by_thread_id: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_artifacts_saved: Optional[bool] = Field(default=None, description="") + asset_dbt_job_last_run_artifact_s3_path: Optional[str] = Field(default=None, description="") + asset_dbt_job_last_run_has_docs_generated: Optional[bool] = Field(default=None, description="") + asset_dbt_job_last_run_has_sources_generated: Optional[bool] = Field(default=None, description="") + asset_dbt_job_last_run_notifications_sent: Optional[bool] = Field(default=None, description="") asset_dbt_job_next_run: Optional[datetime] = Field(default=None, description="") - asset_dbt_job_next_run_humanized: Optional[str] = Field( - default=None, description="" - ) + asset_dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") asset_dbt_environment_name: Optional[str] = Field(default=None, description="") - asset_dbt_environment_dbt_version: Optional[str] = Field( - default=None, description="" - ) + asset_dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") asset_dbt_tags: Optional[Set[str]] = Field(default=None, description="") - asset_dbt_semantic_layer_proxy_url: Optional[str] = Field( - default=None, description="" - ) - asset_dbt_source_freshness_criteria: Optional[str] = Field( - default=None, description="" - ) + asset_dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") + asset_dbt_source_freshness_criteria: Optional[str] = Field(default=None, description="") sample_data_url: Optional[str] = Field(default=None, description="") asset_tags: Optional[Set[str]] = Field(default=None, description="") - asset_mc_incident_names: Optional[Set[str]] = Field( - default=None, description="" - ) - asset_mc_incident_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) - asset_mc_alert_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) + asset_mc_incident_names: Optional[Set[str]] = Field(default=None, description="") + asset_mc_incident_qualified_names: Optional[Set[str]] = Field(default=None, description="") + asset_mc_alert_qualified_names: Optional[Set[str]] = Field(default=None, description="") asset_mc_monitor_names: Optional[Set[str]] = Field(default=None, description="") - asset_mc_monitor_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) - asset_mc_monitor_statuses: Optional[Set[str]] = Field( - default=None, description="" - ) + asset_mc_monitor_qualified_names: Optional[Set[str]] = Field(default=None, description="") + asset_mc_monitor_statuses: Optional[Set[str]] = Field(default=None, description="") asset_mc_monitor_types: Optional[Set[str]] = Field(default=None, description="") - asset_mc_monitor_schedule_types: Optional[Set[str]] = Field( - default=None, description="" - ) - asset_mc_incident_types: Optional[Set[str]] = Field( - default=None, description="" - ) - asset_mc_incident_sub_types: Optional[Set[str]] = Field( - default=None, description="" - ) - asset_mc_incident_severities: Optional[Set[str]] = Field( - default=None, description="" - ) - asset_mc_incident_priorities: Optional[Set[str]] = Field( - default=None, description="" - ) - asset_mc_incident_states: Optional[Set[str]] = Field( - default=None, description="" - ) + asset_mc_monitor_schedule_types: Optional[Set[str]] = Field(default=None, description="") + asset_mc_incident_types: Optional[Set[str]] = Field(default=None, description="") + asset_mc_incident_sub_types: Optional[Set[str]] = Field(default=None, description="") + asset_mc_incident_severities: Optional[Set[str]] = Field(default=None, description="") + asset_mc_incident_priorities: Optional[Set[str]] = Field(default=None, description="") + asset_mc_incident_states: Optional[Set[str]] = Field(default=None, description="") asset_mc_is_monitored: Optional[bool] = Field(default=None, description="") - asset_mc_last_sync_run_at: Optional[datetime] = Field( - default=None, description="" - ) + asset_mc_last_sync_run_at: Optional[datetime] = Field(default=None, description="") starred_by: Optional[Set[str]] = Field(default=None, description="") - starred_details_list: Optional[List[StarredDetails]] = Field( - default=None, description="" - ) + starred_details_list: Optional[List[StarredDetails]] = Field(default=None, description="") starred_count: Optional[int] = Field(default=None, description="") asset_anomalo_d_q_status: Optional[str] = Field(default=None, description="") asset_anomalo_check_count: Optional[int] = Field(default=None, description="") - asset_anomalo_failed_check_count: Optional[int] = Field( - default=None, description="" - ) - asset_anomalo_check_statuses: Optional[str] = Field( - default=None, description="" - ) - asset_anomalo_last_check_run_at: Optional[datetime] = Field( - default=None, description="" - ) - asset_anomalo_applied_check_types: Optional[Set[str]] = Field( - default=None, description="" - ) - asset_anomalo_failed_check_types: Optional[Set[str]] = Field( - default=None, description="" - ) + asset_anomalo_failed_check_count: Optional[int] = Field(default=None, description="") + asset_anomalo_check_statuses: Optional[str] = Field(default=None, description="") + asset_anomalo_last_check_run_at: Optional[datetime] = Field(default=None, description="") + asset_anomalo_applied_check_types: Optional[Set[str]] = Field(default=None, description="") + asset_anomalo_failed_check_types: Optional[Set[str]] = Field(default=None, description="") asset_anomalo_source_url: Optional[str] = Field(default=None, description="") asset_soda_d_q_status: Optional[str] = Field(default=None, description="") asset_soda_check_count: Optional[int] = Field(default=None, description="") - asset_soda_last_sync_run_at: Optional[datetime] = Field( - default=None, description="" - ) - asset_soda_last_scan_at: Optional[datetime] = Field( - default=None, description="" - ) + asset_soda_last_sync_run_at: Optional[datetime] = Field(default=None, description="") + asset_soda_last_scan_at: Optional[datetime] = Field(default=None, description="") asset_soda_check_statuses: Optional[str] = Field(default=None, description="") asset_soda_source_url: Optional[str] = Field(default=None, description="") asset_icon: Optional[str] = Field(default=None, description="") @@ -3750,65 +2989,29 @@ class Attributes(Referenceable.Attributes): asset_policy_g_u_i_ds: Optional[Set[str]] = Field(default=None, description="") asset_policies_count: Optional[int] = Field(default=None, description="") domain_g_u_i_ds: Optional[Set[str]] = Field(default=None, description="") - non_compliant_asset_policy_g_u_i_ds: Optional[Set[str]] = Field( - default=None, description="" - ) + non_compliant_asset_policy_g_u_i_ds: Optional[Set[str]] = Field(default=None, description="") application_qualified_name: Optional[str] = Field(default=None, description="") - application_field_qualified_name: Optional[str] = Field( - default=None, description="" - ) + application_field_qualified_name: Optional[str] = Field(default=None, description="") schema_registry_subjects: Optional[List[SchemaRegistrySubject]] = Field( default=None, description="" ) # relationship - data_contract_latest_certified: Optional[DataContract] = Field( - default=None, description="" - ) # relationship - anomalo_checks: Optional[List[AnomaloCheck]] = Field( - default=None, description="" - ) # relationship - user_def_relationship_to: Optional[List[Referenceable]] = Field( - default=None, description="" - ) # relationship - output_port_data_products: Optional[List[DataProduct]] = Field( - default=None, description="" - ) # relationship - user_def_relationship_from: Optional[List[Referenceable]] = Field( - default=None, description="" - ) # relationship + data_contract_latest_certified: Optional[DataContract] = Field(default=None, description="") # relationship + anomalo_checks: Optional[List[AnomaloCheck]] = Field(default=None, description="") # relationship + user_def_relationship_to: Optional[List[Referenceable]] = Field(default=None, description="") # relationship + output_port_data_products: Optional[List[DataProduct]] = Field(default=None, description="") # relationship + user_def_relationship_from: Optional[List[Referenceable]] = Field(default=None, description="") # relationship readme: Optional[Readme] = Field(default=None, description="") # relationship - application_field: Optional[ApplicationField] = Field( - default=None, description="" - ) # relationship - data_contract_latest: Optional[DataContract] = Field( - default=None, description="" - ) # relationship - meanings: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - mc_monitors: Optional[List[MCMonitor]] = Field( - default=None, description="" - ) # relationship - application: Optional[Application] = Field( - default=None, description="" - ) # relationship - files: Optional[List[File]] = Field( - default=None, description="" - ) # relationship - mc_incidents: Optional[List[MCIncident]] = Field( - default=None, description="" - ) # relationship - links: Optional[List[Link]] = Field( - default=None, description="" - ) # relationship - metrics: Optional[List[Metric]] = Field( - default=None, description="" - ) # relationship - input_port_data_products: Optional[List[DataProduct]] = Field( - default=None, description="" - ) # relationship - soda_checks: Optional[List[SodaCheck]] = Field( - default=None, description="" - ) # relationship + application_field: Optional[ApplicationField] = Field(default=None, description="") # relationship + data_contract_latest: Optional[DataContract] = Field(default=None, description="") # relationship + meanings: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + mc_monitors: Optional[List[MCMonitor]] = Field(default=None, description="") # relationship + application: Optional[Application] = Field(default=None, description="") # relationship + files: Optional[List[File]] = Field(default=None, description="") # relationship + mc_incidents: Optional[List[MCIncident]] = Field(default=None, description="") # relationship + links: Optional[List[Link]] = Field(default=None, description="") # relationship + metrics: Optional[List[Metric]] = Field(default=None, description="") # relationship + input_port_data_products: Optional[List[DataProduct]] = Field(default=None, description="") # relationship + soda_checks: Optional[List[SodaCheck]] = Field(default=None, description="") # relationship def remove_description(self): self.description = None diff --git a/pyatlan/model/assets/core/atlas_glossary.py b/pyatlan/model/assets/core/atlas_glossary.py index be695be25..6e4218d83 100644 --- a/pyatlan/model/assets/core/atlas_glossary.py +++ b/pyatlan/model/assets/core/atlas_glossary.py @@ -29,31 +29,20 @@ def _set_qualified_name_fallback(cls, values): # unique attributes (in case of a related entity) # Otherwise, set the qualified name to the GUID # to avoid collisions when creating glossary object - attributes.qualified_name = ( - unique_attributes and unique_attributes.get("qualifiedName") - ) or guid + attributes.qualified_name = (unique_attributes and unique_attributes.get("qualifiedName")) or guid return values @classmethod @init_guid - def creator( - cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None - ) -> AtlasGlossary: + def creator(cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None) -> AtlasGlossary: validate_required_fields(["name"], [name]) - return AtlasGlossary( - attributes=AtlasGlossary.Attributes.create(name=name, icon=icon) - ) + return AtlasGlossary(attributes=AtlasGlossary.Attributes.create(name=name, icon=icon)) @classmethod @init_guid - def create( - cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None - ) -> AtlasGlossary: + def create(cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None) -> AtlasGlossary: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -72,15 +61,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SHORT_DESCRIPTION: ClassVar[TextField] = TextField( - "shortDescription", "shortDescription" - ) + SHORT_DESCRIPTION: ClassVar[TextField] = TextField("shortDescription", "shortDescription") """ Unused. A short definition of the glossary. See 'description' and 'userDescription' instead. """ - LONG_DESCRIPTION: ClassVar[TextField] = TextField( - "longDescription", "longDescription" - ) + LONG_DESCRIPTION: ClassVar[TextField] = TextField("longDescription", "longDescription") """ Unused. A longer description of the glossary. See 'readme' instead. """ @@ -92,9 +77,7 @@ def __setattr__(self, name, value): """ Unused. Inteded usage for the glossary. """ - ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( - "additionalAttributes", "additionalAttributes" - ) + ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("additionalAttributes", "additionalAttributes") """ Unused. Arbitrary set of additional attributes associated with this glossary. """ @@ -165,9 +148,7 @@ def usage(self, usage: Optional[str]): @property def additional_attributes(self) -> Optional[Dict[str, str]]: - return ( - None if self.attributes is None else self.attributes.additional_attributes - ) + return None if self.attributes is None else self.attributes.additional_attributes @additional_attributes.setter def additional_attributes(self, additional_attributes: Optional[Dict[str, str]]): @@ -210,27 +191,17 @@ class Attributes(Asset.Attributes): long_description: Optional[str] = Field(default=None, description="") language: Optional[str] = Field(default=None, description="") usage: Optional[str] = Field(default=None, description="") - additional_attributes: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + additional_attributes: Optional[Dict[str, str]] = Field(default=None, description="") glossary_type: Optional[AtlasGlossaryType] = Field(default=None, description="") - terms: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - categories: Optional[List[AtlasGlossaryCategory]] = Field( - default=None, description="" - ) # relationship + terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + categories: Optional[List[AtlasGlossaryCategory]] = Field(default=None, description="") # relationship @classmethod @init_guid - def create( - cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None - ) -> AtlasGlossary.Attributes: + def create(cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None) -> AtlasGlossary.Attributes: validate_required_fields(["name"], [name]) icon_str = icon.value if icon is not None else None - return AtlasGlossary.Attributes( - name=name, qualified_name=next_id(), asset_icon=icon_str - ) + return AtlasGlossary.Attributes(name=name, qualified_name=next_id(), asset_icon=icon_str) attributes: AtlasGlossary.Attributes = Field( default_factory=lambda: AtlasGlossary.Attributes(), diff --git a/pyatlan/model/assets/core/atlas_glossary_category.py b/pyatlan/model/assets/core/atlas_glossary_category.py index aff3ad3c6..225d8c0bc 100644 --- a/pyatlan/model/assets/core/atlas_glossary_category.py +++ b/pyatlan/model/assets/core/atlas_glossary_category.py @@ -37,9 +37,7 @@ def _set_qualified_name_fallback(cls, values): # unique attributes (in case of a related entity) # Otherwise, set the qualified name to the GUID # to avoid collisions when creating glossary object - attributes.qualified_name = ( - unique_attributes and unique_attributes.get("qualifiedName") - ) or guid + attributes.qualified_name = (unique_attributes and unique_attributes.get("qualifiedName")) or guid return values @classmethod @@ -68,10 +66,7 @@ def create( parent_category: Optional[AtlasGlossaryCategory] = None, ) -> AtlasGlossaryCategory: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -101,11 +96,7 @@ def updater( [name, qualified_name, glossary_guid], ) glossary = AtlasGlossary.ref_by_guid(glossary_guid) - return cls( - attributes=cls.Attributes( - qualified_name=qualified_name, name=name, anchor=glossary - ) - ) + return cls(attributes=cls.Attributes(qualified_name=qualified_name, name=name, anchor=glossary)) @classmethod def create_for_modification( @@ -115,23 +106,16 @@ def create_for_modification( glossary_guid: str = "", ) -> AtlasGlossaryCategory: warn( - ( - "This method is deprecated, please use 'updater' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.updater( - qualified_name=qualified_name, name=name, glossary_guid=glossary_guid - ) + return cls.updater(qualified_name=qualified_name, name=name, glossary_guid=glossary_guid) ANCHOR: ClassVar[KeywordField] = KeywordField("anchor", "__glossary") """Glossary in which the category is contained, searchable by the qualifiedName of the glossary.""" - PARENT_CATEGORY: ClassVar[KeywordField] = KeywordField( - "parentCategory", "__parentCategory" - ) + PARENT_CATEGORY: ClassVar[KeywordField] = KeywordField("parentCategory", "__parentCategory") """Parent category in which a subcategory is contained, searchable by the qualifiedName of the category.""" type_name: str = Field(default="AtlasGlossaryCategory", allow_mutation=False) @@ -147,21 +131,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SHORT_DESCRIPTION: ClassVar[TextField] = TextField( - "shortDescription", "shortDescription" - ) + SHORT_DESCRIPTION: ClassVar[TextField] = TextField("shortDescription", "shortDescription") """ Unused. Brief summary of the category. See 'description' and 'userDescription' instead. """ - LONG_DESCRIPTION: ClassVar[TextField] = TextField( - "longDescription", "longDescription" - ) + LONG_DESCRIPTION: ClassVar[TextField] = TextField("longDescription", "longDescription") """ Unused. Detailed description of the category. See 'readme' instead. """ - ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( - "additionalAttributes", "additionalAttributes" - ) + ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("additionalAttributes", "additionalAttributes") """ Unused. Arbitrary set of additional attributes associated with the category. """ @@ -212,9 +190,7 @@ def long_description(self, long_description: Optional[str]): @property def additional_attributes(self) -> Optional[Dict[str, str]]: - return ( - None if self.attributes is None else self.attributes.additional_attributes - ) + return None if self.attributes is None else self.attributes.additional_attributes @additional_attributes.setter def additional_attributes(self, additional_attributes: Optional[Dict[str, str]]): @@ -269,9 +245,7 @@ def children_categories(self) -> Optional[List[AtlasGlossaryCategory]]: return None if self.attributes is None else self.attributes.children_categories @children_categories.setter - def children_categories( - self, children_categories: Optional[List[AtlasGlossaryCategory]] - ): + def children_categories(self, children_categories: Optional[List[AtlasGlossaryCategory]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.children_categories = children_categories @@ -279,24 +253,12 @@ def children_categories( class Attributes(Asset.Attributes): short_description: Optional[str] = Field(default=None, description="") long_description: Optional[str] = Field(default=None, description="") - additional_attributes: Optional[Dict[str, str]] = Field( - default=None, description="" - ) - category_type: Optional[AtlasGlossaryCategoryType] = Field( - default=None, description="" - ) - terms: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - anchor: Optional[AtlasGlossary] = Field( - default=None, description="" - ) # relationship - parent_category: Optional[AtlasGlossaryCategory] = Field( - default=None, description="" - ) # relationship - children_categories: Optional[List[AtlasGlossaryCategory]] = Field( - default=None, description="" - ) # relationship + additional_attributes: Optional[Dict[str, str]] = Field(default=None, description="") + category_type: Optional[AtlasGlossaryCategoryType] = Field(default=None, description="") + terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + anchor: Optional[AtlasGlossary] = Field(default=None, description="") # relationship + parent_category: Optional[AtlasGlossaryCategory] = Field(default=None, description="") # relationship + children_categories: Optional[List[AtlasGlossaryCategory]] = Field(default=None, description="") # relationship @classmethod @init_guid diff --git a/pyatlan/model/assets/core/atlas_glossary_term.py b/pyatlan/model/assets/core/atlas_glossary_term.py index a6f2b347a..57c637575 100644 --- a/pyatlan/model/assets/core/atlas_glossary_term.py +++ b/pyatlan/model/assets/core/atlas_glossary_term.py @@ -34,9 +34,7 @@ def _set_qualified_name_fallback(cls, values): # unique attributes (in case of a related entity) # Otherwise, set the qualified name to the GUID # to avoid collisions when creating glossary object - attributes.qualified_name = ( - unique_attributes and unique_attributes.get("qualifiedName") - ) or guid + attributes.qualified_name = (unique_attributes and unique_attributes.get("qualifiedName")) or guid return values @classmethod @@ -73,10 +71,7 @@ def create( categories: Optional[List[AtlasGlossaryCategory]] = None, ) -> AtlasGlossaryTerm: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -111,11 +106,7 @@ def updater( ) glossary = AtlasGlossary() glossary.guid = glossary_guid - return cls( - attributes=cls.Attributes( - qualified_name=qualified_name, name=name, anchor=glossary - ) - ) + return cls(attributes=cls.Attributes(qualified_name=qualified_name, name=name, anchor=glossary)) @classmethod def create_for_modification( @@ -125,16 +116,11 @@ def create_for_modification( glossary_guid: str = "", ) -> AtlasGlossaryTerm: warn( - ( - "This method is deprecated, please use 'updater' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.updater( - qualified_name=qualified_name, name=name, glossary_guid=glossary_guid - ) + return cls.updater(qualified_name=qualified_name, name=name, glossary_guid=glossary_guid) ANCHOR: ClassVar[KeywordField] = KeywordField("anchor", "__glossary") """Glossary in which the term is contained, searchable by the qualifiedName of the glossary.""" @@ -155,15 +141,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SHORT_DESCRIPTION: ClassVar[TextField] = TextField( - "shortDescription", "shortDescription" - ) + SHORT_DESCRIPTION: ClassVar[TextField] = TextField("shortDescription", "shortDescription") """ Unused. Brief summary of the term. See 'description' and 'userDescription' instead. """ - LONG_DESCRIPTION: ClassVar[TextField] = TextField( - "longDescription", "longDescription" - ) + LONG_DESCRIPTION: ClassVar[TextField] = TextField("longDescription", "longDescription") """ Unused. Detailed definition of the term. See 'readme' instead. """ @@ -179,9 +161,7 @@ def __setattr__(self, name, value): """ Unused. Intended usage for the term. """ - ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( - "additionalAttributes", "additionalAttributes" - ) + ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("additionalAttributes", "additionalAttributes") """ Unused. Arbitrary set of additional attributes for the terrm. """ @@ -325,9 +305,7 @@ def usage(self, usage: Optional[str]): @property def additional_attributes(self) -> Optional[Dict[str, str]]: - return ( - None if self.attributes is None else self.attributes.additional_attributes - ) + return None if self.attributes is None else self.attributes.additional_attributes @additional_attributes.setter def additional_attributes(self, additional_attributes: Optional[Dict[str, str]]): @@ -511,58 +489,24 @@ class Attributes(Asset.Attributes): examples: Optional[Set[str]] = Field(default=None, description="") abbreviation: Optional[str] = Field(default=None, description="") usage: Optional[str] = Field(default=None, description="") - additional_attributes: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + additional_attributes: Optional[Dict[str, str]] = Field(default=None, description="") term_type: Optional[AtlasGlossaryTermType] = Field(default=None, description="") - valid_values_for: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - valid_values: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - see_also: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - is_a: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - antonyms: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - assigned_entities: Optional[List[Referenceable]] = Field( - default=None, description="" - ) # relationship - classifies: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - categories: Optional[List[AtlasGlossaryCategory]] = Field( - default=None, description="" - ) # relationship - preferred_to_terms: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - preferred_terms: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - translation_terms: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - synonyms: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - replaced_by: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - replacement_terms: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - translated_terms: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship - anchor: Optional[AtlasGlossary] = Field( - default=None, description="" - ) # relationship + valid_values_for: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + valid_values: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + see_also: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + is_a: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + antonyms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + assigned_entities: Optional[List[Referenceable]] = Field(default=None, description="") # relationship + classifies: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + categories: Optional[List[AtlasGlossaryCategory]] = Field(default=None, description="") # relationship + preferred_to_terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + preferred_terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + translation_terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + synonyms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + replaced_by: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + replacement_terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + translated_terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + anchor: Optional[AtlasGlossary] = Field(default=None, description="") # relationship @classmethod @init_guid diff --git a/pyatlan/model/assets/core/auth_policy.py b/pyatlan/model/assets/core/auth_policy.py index ad7753e74..729555eaf 100644 --- a/pyatlan/model/assets/core/auth_policy.py +++ b/pyatlan/model/assets/core/auth_policy.py @@ -58,10 +58,7 @@ def create_for_modification( """, ) -> SelfAsset: warn( - ( - "This method is deprecated, please use 'updater' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -84,21 +81,15 @@ def __setattr__(self, name, value): """ TBC """ - POLICY_SERVICE_NAME: ClassVar[KeywordField] = KeywordField( - "policyServiceName", "policyServiceName" - ) + POLICY_SERVICE_NAME: ClassVar[KeywordField] = KeywordField("policyServiceName", "policyServiceName") """ TBC """ - POLICY_CATEGORY: ClassVar[KeywordField] = KeywordField( - "policyCategory", "policyCategory" - ) + POLICY_CATEGORY: ClassVar[KeywordField] = KeywordField("policyCategory", "policyCategory") """ TBC """ - POLICY_SUB_CATEGORY: ClassVar[KeywordField] = KeywordField( - "policySubCategory", "policySubCategory" - ) + POLICY_SUB_CATEGORY: ClassVar[KeywordField] = KeywordField("policySubCategory", "policySubCategory") """ TBC """ @@ -114,45 +105,31 @@ def __setattr__(self, name, value): """ TBC """ - POLICY_ACTIONS: ClassVar[KeywordField] = KeywordField( - "policyActions", "policyActions" - ) + POLICY_ACTIONS: ClassVar[KeywordField] = KeywordField("policyActions", "policyActions") """ TBC """ - POLICY_RESOURCES: ClassVar[KeywordField] = KeywordField( - "policyResources", "policyResources" - ) + POLICY_RESOURCES: ClassVar[KeywordField] = KeywordField("policyResources", "policyResources") """ TBC """ - POLICY_RESOURCE_CATEGORY: ClassVar[KeywordField] = KeywordField( - "policyResourceCategory", "policyResourceCategory" - ) + POLICY_RESOURCE_CATEGORY: ClassVar[KeywordField] = KeywordField("policyResourceCategory", "policyResourceCategory") """ TBC """ - POLICY_PRIORITY: ClassVar[NumericField] = NumericField( - "policyPriority", "policyPriority" - ) + POLICY_PRIORITY: ClassVar[NumericField] = NumericField("policyPriority", "policyPriority") """ TBC """ - IS_POLICY_ENABLED: ClassVar[BooleanField] = BooleanField( - "isPolicyEnabled", "isPolicyEnabled" - ) + IS_POLICY_ENABLED: ClassVar[BooleanField] = BooleanField("isPolicyEnabled", "isPolicyEnabled") """ TBC """ - POLICY_MASK_TYPE: ClassVar[KeywordField] = KeywordField( - "policyMaskType", "policyMaskType" - ) + POLICY_MASK_TYPE: ClassVar[KeywordField] = KeywordField("policyMaskType", "policyMaskType") """ TBC """ - POLICY_VALIDITY_SCHEDULE: ClassVar[KeywordField] = KeywordField( - "policyValiditySchedule", "policyValiditySchedule" - ) + POLICY_VALIDITY_SCHEDULE: ClassVar[KeywordField] = KeywordField("policyValiditySchedule", "policyValiditySchedule") """ TBC """ @@ -162,15 +139,11 @@ def __setattr__(self, name, value): """ TBC """ - POLICY_DELEGATE_ADMIN: ClassVar[BooleanField] = BooleanField( - "policyDelegateAdmin", "policyDelegateAdmin" - ) + POLICY_DELEGATE_ADMIN: ClassVar[BooleanField] = BooleanField("policyDelegateAdmin", "policyDelegateAdmin") """ TBC """ - POLICY_CONDITIONS: ClassVar[KeywordField] = KeywordField( - "policyConditions", "policyConditions" - ) + POLICY_CONDITIONS: ClassVar[KeywordField] = KeywordField("policyConditions", "policyConditions") """ TBC """ @@ -293,11 +266,7 @@ def policy_resources(self, policy_resources: Optional[Set[str]]): @property def policy_resource_category(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.policy_resource_category - ) + return None if self.attributes is None else self.attributes.policy_resource_category @policy_resource_category.setter def policy_resource_category(self, policy_resource_category: Optional[str]): @@ -337,27 +306,17 @@ def policy_mask_type(self, policy_mask_type: Optional[str]): @property def policy_validity_schedule(self) -> Optional[List[AuthPolicyValiditySchedule]]: - return ( - None - if self.attributes is None - else self.attributes.policy_validity_schedule - ) + return None if self.attributes is None else self.attributes.policy_validity_schedule @policy_validity_schedule.setter - def policy_validity_schedule( - self, policy_validity_schedule: Optional[List[AuthPolicyValiditySchedule]] - ): + def policy_validity_schedule(self, policy_validity_schedule: Optional[List[AuthPolicyValiditySchedule]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.policy_validity_schedule = policy_validity_schedule @property def policy_resource_signature(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.policy_resource_signature - ) + return None if self.attributes is None else self.attributes.policy_resource_signature @policy_resource_signature.setter def policy_resource_signature(self, policy_resource_signature: Optional[str]): @@ -367,9 +326,7 @@ def policy_resource_signature(self, policy_resource_signature: Optional[str]): @property def policy_delegate_admin(self) -> Optional[bool]: - return ( - None if self.attributes is None else self.attributes.policy_delegate_admin - ) + return None if self.attributes is None else self.attributes.policy_delegate_admin @policy_delegate_admin.setter def policy_delegate_admin(self, policy_delegate_admin: Optional[bool]): @@ -411,24 +368,16 @@ class Attributes(Asset.Attributes): policy_priority: Optional[int] = Field(default=None, description="") is_policy_enabled: Optional[bool] = Field(default=None, description="") policy_mask_type: Optional[str] = Field(default=None, description="") - policy_validity_schedule: Optional[List[AuthPolicyValiditySchedule]] = Field( - default=None, description="" - ) + policy_validity_schedule: Optional[List[AuthPolicyValiditySchedule]] = Field(default=None, description="") policy_resource_signature: Optional[str] = Field(default=None, description="") policy_delegate_admin: Optional[bool] = Field(default=None, description="") - policy_conditions: Optional[List[AuthPolicyCondition]] = Field( - default=None, description="" - ) - access_control: Optional[AccessControl] = Field( - default=None, description="" - ) # relationship + policy_conditions: Optional[List[AuthPolicyCondition]] = Field(default=None, description="") + access_control: Optional[AccessControl] = Field(default=None, description="") # relationship @classmethod def __create(cls, name: str) -> AuthPolicy.Attributes: validate_required_fields(["name"], [name]) - return AuthPolicy.Attributes( - qualified_name=name, name=name, display_name="" - ) + return AuthPolicy.Attributes(qualified_name=name, name=name, display_name="") attributes: AuthPolicy.Attributes = Field( default_factory=lambda: AuthPolicy.Attributes(), diff --git a/pyatlan/model/assets/core/b_i_process.py b/pyatlan/model/assets/core/b_i_process.py index 328ce778e..437f9666f 100644 --- a/pyatlan/model/assets/core/b_i_process.py +++ b/pyatlan/model/assets/core/b_i_process.py @@ -64,12 +64,8 @@ def inputs(self, inputs: Optional[List[Catalog]]): self.attributes.inputs = inputs class Attributes(Process.Attributes): - outputs: Optional[List[Catalog]] = Field( - default=None, description="" - ) # relationship - inputs: Optional[List[Catalog]] = Field( - default=None, description="" - ) # relationship + outputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship + inputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship attributes: BIProcess.Attributes = Field( default_factory=lambda: BIProcess.Attributes(), diff --git a/pyatlan/model/assets/core/calculation_view.py b/pyatlan/model/assets/core/calculation_view.py index f79b31a38..3278380c9 100644 --- a/pyatlan/model/assets/core/calculation_view.py +++ b/pyatlan/model/assets/core/calculation_view.py @@ -90,11 +90,7 @@ def column_count(self, column_count: Optional[int]): @property def calculation_view_version_id(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_version_id - ) + return None if self.attributes is None else self.attributes.calculation_view_version_id @calculation_view_version_id.setter def calculation_view_version_id(self, calculation_view_version_id: Optional[int]): @@ -104,43 +100,27 @@ def calculation_view_version_id(self, calculation_view_version_id: Optional[int] @property def calculation_view_activated_by(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_activated_by - ) + return None if self.attributes is None else self.attributes.calculation_view_activated_by @calculation_view_activated_by.setter - def calculation_view_activated_by( - self, calculation_view_activated_by: Optional[str] - ): + def calculation_view_activated_by(self, calculation_view_activated_by: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.calculation_view_activated_by = calculation_view_activated_by @property def calculation_view_activated_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_activated_at - ) + return None if self.attributes is None else self.attributes.calculation_view_activated_at @calculation_view_activated_at.setter - def calculation_view_activated_at( - self, calculation_view_activated_at: Optional[datetime] - ): + def calculation_view_activated_at(self, calculation_view_activated_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.calculation_view_activated_at = calculation_view_activated_at @property def calculation_view_package_id(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_package_id - ) + return None if self.attributes is None else self.attributes.calculation_view_package_id @calculation_view_package_id.setter def calculation_view_package_id(self, calculation_view_package_id: Optional[str]): @@ -171,19 +151,11 @@ def atlan_schema(self, atlan_schema: Optional[Schema]): class Attributes(SQL.Attributes): column_count: Optional[int] = Field(default=None, description="") calculation_view_version_id: Optional[int] = Field(default=None, description="") - calculation_view_activated_by: Optional[str] = Field( - default=None, description="" - ) - calculation_view_activated_at: Optional[datetime] = Field( - default=None, description="" - ) + calculation_view_activated_by: Optional[str] = Field(default=None, description="") + calculation_view_activated_at: Optional[datetime] = Field(default=None, description="") calculation_view_package_id: Optional[str] = Field(default=None, description="") - columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship - atlan_schema: Optional[Schema] = Field( - default=None, description="" - ) # relationship + columns: Optional[List[Column]] = Field(default=None, description="") # relationship + atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship attributes: CalculationView.Attributes = Field( default_factory=lambda: CalculationView.Attributes(), diff --git a/pyatlan/model/assets/core/catalog.py b/pyatlan/model/assets/core/catalog.py index e15dfed84..6edbfd6b8 100644 --- a/pyatlan/model/assets/core/catalog.py +++ b/pyatlan/model/assets/core/catalog.py @@ -33,9 +33,7 @@ def __setattr__(self, name, value): """ TBC """ - INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( - "inputToAirflowTasks" - ) + INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("inputToAirflowTasks") """ TBC """ @@ -43,33 +41,23 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField( - "modelImplementedAttributes" - ) + MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelImplementedAttributes") """ TBC """ - OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( - "outputFromAirflowTasks" - ) + OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("outputFromAirflowTasks") """ TBC """ - OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField( - "outputFromSparkJobs" - ) + OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField("outputFromSparkJobs") """ TBC """ - MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField( - "modelImplementedEntities" - ) + MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField("modelImplementedEntities") """ TBC """ - OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField( - "outputFromProcesses" - ) + OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField("outputFromProcesses") """ TBC """ @@ -97,14 +85,10 @@ def input_to_spark_jobs(self, input_to_spark_jobs: Optional[List[SparkJob]]): @property def input_to_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return ( - None if self.attributes is None else self.attributes.input_to_airflow_tasks - ) + return None if self.attributes is None else self.attributes.input_to_airflow_tasks @input_to_airflow_tasks.setter - def input_to_airflow_tasks( - self, input_to_airflow_tasks: Optional[List[AirflowTask]] - ): + def input_to_airflow_tasks(self, input_to_airflow_tasks: Optional[List[AirflowTask]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.input_to_airflow_tasks = input_to_airflow_tasks @@ -121,41 +105,27 @@ def input_to_processes(self, input_to_processes: Optional[List[Process]]): @property def model_implemented_attributes(self) -> Optional[List[ModelAttribute]]: - return ( - None - if self.attributes is None - else self.attributes.model_implemented_attributes - ) + return None if self.attributes is None else self.attributes.model_implemented_attributes @model_implemented_attributes.setter - def model_implemented_attributes( - self, model_implemented_attributes: Optional[List[ModelAttribute]] - ): + def model_implemented_attributes(self, model_implemented_attributes: Optional[List[ModelAttribute]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_attributes = model_implemented_attributes @property def output_from_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return ( - None - if self.attributes is None - else self.attributes.output_from_airflow_tasks - ) + return None if self.attributes is None else self.attributes.output_from_airflow_tasks @output_from_airflow_tasks.setter - def output_from_airflow_tasks( - self, output_from_airflow_tasks: Optional[List[AirflowTask]] - ): + def output_from_airflow_tasks(self, output_from_airflow_tasks: Optional[List[AirflowTask]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.output_from_airflow_tasks = output_from_airflow_tasks @property def output_from_spark_jobs(self) -> Optional[List[SparkJob]]: - return ( - None if self.attributes is None else self.attributes.output_from_spark_jobs - ) + return None if self.attributes is None else self.attributes.output_from_spark_jobs @output_from_spark_jobs.setter def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob]]): @@ -165,25 +135,17 @@ def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob] @property def model_implemented_entities(self) -> Optional[List[ModelEntity]]: - return ( - None - if self.attributes is None - else self.attributes.model_implemented_entities - ) + return None if self.attributes is None else self.attributes.model_implemented_entities @model_implemented_entities.setter - def model_implemented_entities( - self, model_implemented_entities: Optional[List[ModelEntity]] - ): + def model_implemented_entities(self, model_implemented_entities: Optional[List[ModelEntity]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_entities = model_implemented_entities @property def output_from_processes(self) -> Optional[List[Process]]: - return ( - None if self.attributes is None else self.attributes.output_from_processes - ) + return None if self.attributes is None else self.attributes.output_from_processes @output_from_processes.setter def output_from_processes(self, output_from_processes: Optional[List[Process]]): @@ -192,30 +154,16 @@ def output_from_processes(self, output_from_processes: Optional[List[Process]]): self.attributes.output_from_processes = output_from_processes class Attributes(Asset.Attributes): - input_to_spark_jobs: Optional[List[SparkJob]] = Field( - default=None, description="" - ) # relationship - input_to_airflow_tasks: Optional[List[AirflowTask]] = Field( - default=None, description="" - ) # relationship - input_to_processes: Optional[List[Process]] = Field( - default=None, description="" - ) # relationship + input_to_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship + input_to_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship + input_to_processes: Optional[List[Process]] = Field(default=None, description="") # relationship model_implemented_attributes: Optional[List[ModelAttribute]] = Field( default=None, description="" ) # relationship - output_from_airflow_tasks: Optional[List[AirflowTask]] = Field( - default=None, description="" - ) # relationship - output_from_spark_jobs: Optional[List[SparkJob]] = Field( - default=None, description="" - ) # relationship - model_implemented_entities: Optional[List[ModelEntity]] = Field( - default=None, description="" - ) # relationship - output_from_processes: Optional[List[Process]] = Field( - default=None, description="" - ) # relationship + output_from_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship + output_from_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship + model_implemented_entities: Optional[List[ModelEntity]] = Field(default=None, description="") # relationship + output_from_processes: Optional[List[Process]] = Field(default=None, description="") # relationship attributes: Catalog.Attributes = Field( default_factory=lambda: Catalog.Attributes(), diff --git a/pyatlan/model/assets/core/column.py b/pyatlan/model/assets/core/column.py index 481e00eb2..39a1339a2 100644 --- a/pyatlan/model/assets/core/column.py +++ b/pyatlan/model/assets/core/column.py @@ -135,9 +135,7 @@ def creator( ) if table_qualified_name: warn( - ( - "`table_qualified_name` is deprecated, please use `parent_qualified_name` instead" - ), + ("`table_qualified_name` is deprecated, please use `parent_qualified_name` instead"), DeprecationWarning, stacklevel=2, ) @@ -160,14 +158,9 @@ def creator( @classmethod @init_guid - def create( - cls, *, name: str, parent_qualified_name: str, parent_type: type, order: int - ) -> Column: + def create(cls, *, name: str, parent_qualified_name: str, parent_type: type, order: int) -> Column: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -191,9 +184,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATA_TYPE: ClassVar[KeywordTextField] = KeywordTextField( - "dataType", "dataType", "dataType.text" - ) + DATA_TYPE: ClassVar[KeywordTextField] = KeywordTextField("dataType", "dataType", "dataType.text") """ Data type of values in this column. """ @@ -201,9 +192,7 @@ def __setattr__(self, name, value): """ Sub-data type of this column. """ - RAW_DATA_TYPE_DEFINITION: ClassVar[TextField] = TextField( - "rawDataTypeDefinition", "rawDataTypeDefinition" - ) + RAW_DATA_TYPE_DEFINITION: ClassVar[TextField] = TextField("rawDataTypeDefinition", "rawDataTypeDefinition") """ """ @@ -211,21 +200,15 @@ def __setattr__(self, name, value): """ Order (position) in which this column appears in the table (starting at 1). """ - NESTED_COLUMN_ORDER: ClassVar[KeywordField] = KeywordField( - "nestedColumnOrder", "nestedColumnOrder" - ) + NESTED_COLUMN_ORDER: ClassVar[KeywordField] = KeywordField("nestedColumnOrder", "nestedColumnOrder") """ Order (position) in which this column appears in the nested Column (nest level starts at 1). """ - NESTED_COLUMN_COUNT: ClassVar[NumericField] = NumericField( - "nestedColumnCount", "nestedColumnCount" - ) + NESTED_COLUMN_COUNT: ClassVar[NumericField] = NumericField("nestedColumnCount", "nestedColumnCount") """ Number of columns nested within this (STRUCT or NESTED) column. """ - COLUMN_HIERARCHY: ClassVar[KeywordField] = KeywordField( - "columnHierarchy", "columnHierarchy" - ) + COLUMN_HIERARCHY: ClassVar[KeywordField] = KeywordField("columnHierarchy", "columnHierarchy") """ List of top-level upstream nested columns. """ @@ -233,9 +216,7 @@ def __setattr__(self, name, value): """ Whether this column is a partition column (true) or not (false). """ - PARTITION_ORDER: ClassVar[NumericField] = NumericField( - "partitionOrder", "partitionOrder" - ) + PARTITION_ORDER: ClassVar[NumericField] = NumericField("partitionOrder", "partitionOrder") """ Order (position) of this partition column in the table. """ @@ -325,9 +306,7 @@ def __setattr__(self, name, value): """ Number of rows that contain distinct values. """ - COLUMN_HISTOGRAM: ClassVar[KeywordField] = KeywordField( - "columnHistogram", "columnHistogram" - ) + COLUMN_HISTOGRAM: ClassVar[KeywordField] = KeywordField("columnHistogram", "columnHistogram") """ List of values in a histogram that represents the contents of this column. """ @@ -369,15 +348,11 @@ def __setattr__(self, name, value): """ Number of rows in which a value in this column appears only once. """ - COLUMN_AVERAGE: ClassVar[NumericField] = NumericField( - "columnAverage", "columnAverage" - ) + COLUMN_AVERAGE: ClassVar[NumericField] = NumericField("columnAverage", "columnAverage") """ Average value in this column. """ - COLUMN_AVERAGE_LENGTH: ClassVar[NumericField] = NumericField( - "columnAverageLength", "columnAverageLength" - ) + COLUMN_AVERAGE_LENGTH: ClassVar[NumericField] = NumericField("columnAverageLength", "columnAverageLength") """ Average length of values in a string column. """ @@ -437,21 +412,15 @@ def __setattr__(self, name, value): """ Ratio indicating how unique data in this column is: 0 indicates that all values are the same, 100 indicates that all values in this column are unique. """ # noqa: E501 - COLUMN_VARIANCE: ClassVar[NumericField] = NumericField( - "columnVariance", "columnVariance" - ) + COLUMN_VARIANCE: ClassVar[NumericField] = NumericField("columnVariance", "columnVariance") """ Calculated variance of the values in a numeric column. """ - COLUMN_TOP_VALUES: ClassVar[KeywordField] = KeywordField( - "columnTopValues", "columnTopValues" - ) + COLUMN_TOP_VALUES: ClassVar[KeywordField] = KeywordField("columnTopValues", "columnTopValues") """ List of top values in this column. """ - COLUMN_DEPTH_LEVEL: ClassVar[NumericField] = NumericField( - "columnDepthLevel", "columnDepthLevel" - ) + COLUMN_DEPTH_LEVEL: ClassVar[NumericField] = NumericField("columnDepthLevel", "columnDepthLevel") """ Level of nesting of this column, used for STRUCT and NESTED columns. """ @@ -468,9 +437,7 @@ def __setattr__(self, name, value): Unique name of the cosmos/mongo collection in which this SQL asset (column) exists, or empty if it does not exist within a cosmos/mongo collection. """ # noqa: E501 - SNOWFLAKE_DYNAMIC_TABLE: ClassVar[RelationField] = RelationField( - "snowflakeDynamicTable" - ) + SNOWFLAKE_DYNAMIC_TABLE: ClassVar[RelationField] = RelationField("snowflakeDynamicTable") """ TBC """ @@ -482,9 +449,7 @@ def __setattr__(self, name, value): """ TBC """ - DATA_QUALITY_METRIC_DIMENSIONS: ClassVar[RelationField] = RelationField( - "dataQualityMetricDimensions" - ) + DATA_QUALITY_METRIC_DIMENSIONS: ClassVar[RelationField] = RelationField("dataQualityMetricDimensions") """ TBC """ @@ -496,9 +461,7 @@ def __setattr__(self, name, value): """ TBC """ - COLUMN_DBT_MODEL_COLUMNS: ClassVar[RelationField] = RelationField( - "columnDbtModelColumns" - ) + COLUMN_DBT_MODEL_COLUMNS: ClassVar[RelationField] = RelationField("columnDbtModelColumns") """ TBC """ @@ -526,9 +489,7 @@ def __setattr__(self, name, value): """ TBC """ - COSMOS_MONGO_DB_COLLECTION: ClassVar[RelationField] = RelationField( - "cosmosMongoDBCollection" - ) + COSMOS_MONGO_DB_COLLECTION: ClassVar[RelationField] = RelationField("cosmosMongoDBCollection") """ TBC """ @@ -641,11 +602,7 @@ def sub_data_type(self, sub_data_type: Optional[str]): @property def raw_data_type_definition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.raw_data_type_definition - ) + return None if self.attributes is None else self.attributes.raw_data_type_definition @raw_data_type_definition.setter def raw_data_type_definition(self, raw_data_type_definition: Optional[str]): @@ -865,11 +822,7 @@ def validations(self, validations: Optional[Dict[str, str]]): @property def parent_column_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.parent_column_qualified_name - ) + return None if self.attributes is None else self.attributes.parent_column_qualified_name @parent_column_qualified_name.setter def parent_column_qualified_name(self, parent_column_qualified_name: Optional[str]): @@ -889,11 +842,7 @@ def parent_column_name(self, parent_column_name: Optional[str]): @property def column_distinct_values_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.column_distinct_values_count - ) + return None if self.attributes is None else self.attributes.column_distinct_values_count @column_distinct_values_count.setter def column_distinct_values_count(self, column_distinct_values_count: Optional[int]): @@ -903,21 +852,13 @@ def column_distinct_values_count(self, column_distinct_values_count: Optional[in @property def column_distinct_values_count_long(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.column_distinct_values_count_long - ) + return None if self.attributes is None else self.attributes.column_distinct_values_count_long @column_distinct_values_count_long.setter - def column_distinct_values_count_long( - self, column_distinct_values_count_long: Optional[int] - ): + def column_distinct_values_count_long(self, column_distinct_values_count_long: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.column_distinct_values_count_long = ( - column_distinct_values_count_long - ) + self.attributes.column_distinct_values_count_long = column_distinct_values_count_long @property def column_histogram(self) -> Optional[Histogram]: @@ -981,11 +922,7 @@ def column_median(self, column_median: Optional[float]): @property def column_standard_deviation(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.column_standard_deviation - ) + return None if self.attributes is None else self.attributes.column_standard_deviation @column_standard_deviation.setter def column_standard_deviation(self, column_standard_deviation: Optional[float]): @@ -995,11 +932,7 @@ def column_standard_deviation(self, column_standard_deviation: Optional[float]): @property def column_unique_values_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.column_unique_values_count - ) + return None if self.attributes is None else self.attributes.column_unique_values_count @column_unique_values_count.setter def column_unique_values_count(self, column_unique_values_count: Optional[int]): @@ -1009,21 +942,13 @@ def column_unique_values_count(self, column_unique_values_count: Optional[int]): @property def column_unique_values_count_long(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.column_unique_values_count_long - ) + return None if self.attributes is None else self.attributes.column_unique_values_count_long @column_unique_values_count_long.setter - def column_unique_values_count_long( - self, column_unique_values_count_long: Optional[int] - ): + def column_unique_values_count_long(self, column_unique_values_count_long: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.column_unique_values_count_long = ( - column_unique_values_count_long - ) + self.attributes.column_unique_values_count_long = column_unique_values_count_long @property def column_average(self) -> Optional[float]: @@ -1037,9 +962,7 @@ def column_average(self, column_average: Optional[float]): @property def column_average_length(self) -> Optional[float]: - return ( - None if self.attributes is None else self.attributes.column_average_length - ) + return None if self.attributes is None else self.attributes.column_average_length @column_average_length.setter def column_average_length(self, column_average_length: Optional[float]): @@ -1049,45 +972,27 @@ def column_average_length(self, column_average_length: Optional[float]): @property def column_duplicate_values_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.column_duplicate_values_count - ) + return None if self.attributes is None else self.attributes.column_duplicate_values_count @column_duplicate_values_count.setter - def column_duplicate_values_count( - self, column_duplicate_values_count: Optional[int] - ): + def column_duplicate_values_count(self, column_duplicate_values_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.column_duplicate_values_count = column_duplicate_values_count @property def column_duplicate_values_count_long(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.column_duplicate_values_count_long - ) + return None if self.attributes is None else self.attributes.column_duplicate_values_count_long @column_duplicate_values_count_long.setter - def column_duplicate_values_count_long( - self, column_duplicate_values_count_long: Optional[int] - ): + def column_duplicate_values_count_long(self, column_duplicate_values_count_long: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.column_duplicate_values_count_long = ( - column_duplicate_values_count_long - ) + self.attributes.column_duplicate_values_count_long = column_duplicate_values_count_long @property def column_maximum_string_length(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.column_maximum_string_length - ) + return None if self.attributes is None else self.attributes.column_maximum_string_length @column_maximum_string_length.setter def column_maximum_string_length(self, column_maximum_string_length: Optional[int]): @@ -1107,11 +1012,7 @@ def column_maxs(self, column_maxs: Optional[Set[str]]): @property def column_minimum_string_length(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.column_minimum_string_length - ) + return None if self.attributes is None else self.attributes.column_minimum_string_length @column_minimum_string_length.setter def column_minimum_string_length(self, column_minimum_string_length: Optional[int]): @@ -1131,11 +1032,7 @@ def column_mins(self, column_mins: Optional[Set[str]]): @property def column_missing_values_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.column_missing_values_count - ) + return None if self.attributes is None else self.attributes.column_missing_values_count @column_missing_values_count.setter def column_missing_values_count(self, column_missing_values_count: Optional[int]): @@ -1145,52 +1042,30 @@ def column_missing_values_count(self, column_missing_values_count: Optional[int] @property def column_missing_values_count_long(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.column_missing_values_count_long - ) + return None if self.attributes is None else self.attributes.column_missing_values_count_long @column_missing_values_count_long.setter - def column_missing_values_count_long( - self, column_missing_values_count_long: Optional[int] - ): + def column_missing_values_count_long(self, column_missing_values_count_long: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.column_missing_values_count_long = ( - column_missing_values_count_long - ) + self.attributes.column_missing_values_count_long = column_missing_values_count_long @property def column_missing_values_percentage(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.column_missing_values_percentage - ) + return None if self.attributes is None else self.attributes.column_missing_values_percentage @column_missing_values_percentage.setter - def column_missing_values_percentage( - self, column_missing_values_percentage: Optional[float] - ): + def column_missing_values_percentage(self, column_missing_values_percentage: Optional[float]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.column_missing_values_percentage = ( - column_missing_values_percentage - ) + self.attributes.column_missing_values_percentage = column_missing_values_percentage @property def column_uniqueness_percentage(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.column_uniqueness_percentage - ) + return None if self.attributes is None else self.attributes.column_uniqueness_percentage @column_uniqueness_percentage.setter - def column_uniqueness_percentage( - self, column_uniqueness_percentage: Optional[float] - ): + def column_uniqueness_percentage(self, column_uniqueness_percentage: Optional[float]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.column_uniqueness_percentage = column_uniqueness_percentage @@ -1210,9 +1085,7 @@ def column_top_values(self) -> Optional[List[ColumnValueFrequencyMap]]: return None if self.attributes is None else self.attributes.column_top_values @column_top_values.setter - def column_top_values( - self, column_top_values: Optional[List[ColumnValueFrequencyMap]] - ): + def column_top_values(self, column_top_values: Optional[List[ColumnValueFrequencyMap]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.column_top_values = column_top_values @@ -1229,9 +1102,7 @@ def column_depth_level(self, column_depth_level: Optional[int]): @property def nosql_collection_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.nosql_collection_name - ) + return None if self.attributes is None else self.attributes.nosql_collection_name @nosql_collection_name.setter def nosql_collection_name(self, nosql_collection_name: Optional[str]): @@ -1241,32 +1112,20 @@ def nosql_collection_name(self, nosql_collection_name: Optional[str]): @property def nosql_collection_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.nosql_collection_qualified_name - ) + return None if self.attributes is None else self.attributes.nosql_collection_qualified_name @nosql_collection_qualified_name.setter - def nosql_collection_qualified_name( - self, nosql_collection_qualified_name: Optional[str] - ): + def nosql_collection_qualified_name(self, nosql_collection_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.nosql_collection_qualified_name = ( - nosql_collection_qualified_name - ) + self.attributes.nosql_collection_qualified_name = nosql_collection_qualified_name @property def snowflake_dynamic_table(self) -> Optional[SnowflakeDynamicTable]: - return ( - None if self.attributes is None else self.attributes.snowflake_dynamic_table - ) + return None if self.attributes is None else self.attributes.snowflake_dynamic_table @snowflake_dynamic_table.setter - def snowflake_dynamic_table( - self, snowflake_dynamic_table: Optional[SnowflakeDynamicTable] - ): + def snowflake_dynamic_table(self, snowflake_dynamic_table: Optional[SnowflakeDynamicTable]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.snowflake_dynamic_table = snowflake_dynamic_table @@ -1293,16 +1152,10 @@ def nested_columns(self, nested_columns: Optional[List[Column]]): @property def data_quality_metric_dimensions(self) -> Optional[List[Metric]]: - return ( - None - if self.attributes is None - else self.attributes.data_quality_metric_dimensions - ) + return None if self.attributes is None else self.attributes.data_quality_metric_dimensions @data_quality_metric_dimensions.setter - def data_quality_metric_dimensions( - self, data_quality_metric_dimensions: Optional[List[Metric]] - ): + def data_quality_metric_dimensions(self, data_quality_metric_dimensions: Optional[List[Metric]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_quality_metric_dimensions = data_quality_metric_dimensions @@ -1329,16 +1182,10 @@ def table(self, table: Optional[Table]): @property def column_dbt_model_columns(self) -> Optional[List[DbtModelColumn]]: - return ( - None - if self.attributes is None - else self.attributes.column_dbt_model_columns - ) + return None if self.attributes is None else self.attributes.column_dbt_model_columns @column_dbt_model_columns.setter - def column_dbt_model_columns( - self, column_dbt_model_columns: Optional[List[DbtModelColumn]] - ): + def column_dbt_model_columns(self, column_dbt_model_columns: Optional[List[DbtModelColumn]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.column_dbt_model_columns = column_dbt_model_columns @@ -1405,16 +1252,10 @@ def foreign_key_to(self, foreign_key_to: Optional[List[Column]]): @property def cosmos_mongo_d_b_collection(self) -> Optional[CosmosMongoDBCollection]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_collection - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_collection @cosmos_mongo_d_b_collection.setter - def cosmos_mongo_d_b_collection( - self, cosmos_mongo_d_b_collection: Optional[CosmosMongoDBCollection] - ): + def cosmos_mongo_d_b_collection(self, cosmos_mongo_d_b_collection: Optional[CosmosMongoDBCollection]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_collection = cosmos_mongo_d_b_collection @@ -1456,9 +1297,7 @@ class Attributes(SQL.Attributes): order: Optional[int] = Field(default=None, description="") nested_column_order: Optional[str] = Field(default=None, description="") nested_column_count: Optional[int] = Field(default=None, description="") - column_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) + column_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") is_partition: Optional[bool] = Field(default=None, description="") partition_order: Optional[int] = Field(default=None, description="") is_clustered: Optional[bool] = Field(default=None, description="") @@ -1476,16 +1315,10 @@ class Attributes(SQL.Attributes): numeric_scale: Optional[float] = Field(default=None, description="") max_length: Optional[int] = Field(default=None, description="") validations: Optional[Dict[str, str]] = Field(default=None, description="") - parent_column_qualified_name: Optional[str] = Field( - default=None, description="" - ) + parent_column_qualified_name: Optional[str] = Field(default=None, description="") parent_column_name: Optional[str] = Field(default=None, description="") - column_distinct_values_count: Optional[int] = Field( - default=None, description="" - ) - column_distinct_values_count_long: Optional[int] = Field( - default=None, description="" - ) + column_distinct_values_count: Optional[int] = Field(default=None, description="") + column_distinct_values_count_long: Optional[int] = Field(default=None, description="") column_histogram: Optional[Histogram] = Field(default=None, description="") column_max: Optional[float] = Field(default=None, description="") column_min: Optional[float] = Field(default=None, description="") @@ -1494,91 +1327,43 @@ class Attributes(SQL.Attributes): column_median: Optional[float] = Field(default=None, description="") column_standard_deviation: Optional[float] = Field(default=None, description="") column_unique_values_count: Optional[int] = Field(default=None, description="") - column_unique_values_count_long: Optional[int] = Field( - default=None, description="" - ) + column_unique_values_count_long: Optional[int] = Field(default=None, description="") column_average: Optional[float] = Field(default=None, description="") column_average_length: Optional[float] = Field(default=None, description="") - column_duplicate_values_count: Optional[int] = Field( - default=None, description="" - ) - column_duplicate_values_count_long: Optional[int] = Field( - default=None, description="" - ) - column_maximum_string_length: Optional[int] = Field( - default=None, description="" - ) + column_duplicate_values_count: Optional[int] = Field(default=None, description="") + column_duplicate_values_count_long: Optional[int] = Field(default=None, description="") + column_maximum_string_length: Optional[int] = Field(default=None, description="") column_maxs: Optional[Set[str]] = Field(default=None, description="") - column_minimum_string_length: Optional[int] = Field( - default=None, description="" - ) + column_minimum_string_length: Optional[int] = Field(default=None, description="") column_mins: Optional[Set[str]] = Field(default=None, description="") column_missing_values_count: Optional[int] = Field(default=None, description="") - column_missing_values_count_long: Optional[int] = Field( - default=None, description="" - ) - column_missing_values_percentage: Optional[float] = Field( - default=None, description="" - ) - column_uniqueness_percentage: Optional[float] = Field( - default=None, description="" - ) + column_missing_values_count_long: Optional[int] = Field(default=None, description="") + column_missing_values_percentage: Optional[float] = Field(default=None, description="") + column_uniqueness_percentage: Optional[float] = Field(default=None, description="") column_variance: Optional[float] = Field(default=None, description="") - column_top_values: Optional[List[ColumnValueFrequencyMap]] = Field( - default=None, description="" - ) + column_top_values: Optional[List[ColumnValueFrequencyMap]] = Field(default=None, description="") column_depth_level: Optional[int] = Field(default=None, description="") nosql_collection_name: Optional[str] = Field(default=None, description="") - nosql_collection_qualified_name: Optional[str] = Field( - default=None, description="" - ) - snowflake_dynamic_table: Optional[SnowflakeDynamicTable] = Field( - default=None, description="" - ) # relationship + nosql_collection_qualified_name: Optional[str] = Field(default=None, description="") + snowflake_dynamic_table: Optional[SnowflakeDynamicTable] = Field(default=None, description="") # relationship view: Optional[View] = Field(default=None, description="") # relationship - nested_columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship - data_quality_metric_dimensions: Optional[List[Metric]] = Field( - default=None, description="" - ) # relationship - dbt_model_columns: Optional[List[DbtModelColumn]] = Field( - default=None, description="" - ) # relationship + nested_columns: Optional[List[Column]] = Field(default=None, description="") # relationship + data_quality_metric_dimensions: Optional[List[Metric]] = Field(default=None, description="") # relationship + dbt_model_columns: Optional[List[DbtModelColumn]] = Field(default=None, description="") # relationship table: Optional[Table] = Field(default=None, description="") # relationship - column_dbt_model_columns: Optional[List[DbtModelColumn]] = Field( - default=None, description="" - ) # relationship - materialised_view: Optional[MaterialisedView] = Field( - default=None, description="" - ) # relationship - calculation_view: Optional[CalculationView] = Field( - default=None, description="" - ) # relationship - parent_column: Optional[Column] = Field( - default=None, description="" - ) # relationship - queries: Optional[List[Query]] = Field( - default=None, description="" - ) # relationship - metric_timestamps: Optional[List[Metric]] = Field( - default=None, description="" - ) # relationship - foreign_key_to: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship + column_dbt_model_columns: Optional[List[DbtModelColumn]] = Field(default=None, description="") # relationship + materialised_view: Optional[MaterialisedView] = Field(default=None, description="") # relationship + calculation_view: Optional[CalculationView] = Field(default=None, description="") # relationship + parent_column: Optional[Column] = Field(default=None, description="") # relationship + queries: Optional[List[Query]] = Field(default=None, description="") # relationship + metric_timestamps: Optional[List[Metric]] = Field(default=None, description="") # relationship + foreign_key_to: Optional[List[Column]] = Field(default=None, description="") # relationship cosmos_mongo_d_b_collection: Optional[CosmosMongoDBCollection] = Field( default=None, description="" ) # relationship - foreign_key_from: Optional[Column] = Field( - default=None, description="" - ) # relationship - dbt_metrics: Optional[List[DbtMetric]] = Field( - default=None, description="" - ) # relationship - table_partition: Optional[TablePartition] = Field( - default=None, description="" - ) # relationship + foreign_key_from: Optional[Column] = Field(default=None, description="") # relationship + dbt_metrics: Optional[List[DbtMetric]] = Field(default=None, description="") # relationship + table_partition: Optional[TablePartition] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -1623,9 +1408,7 @@ def create( [name, parent_qualified_name, parent_type, order], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( parent_qualified_name, "parent_qualified_name", 6 @@ -1639,13 +1422,8 @@ def create( database_name = database_name or fields[3] schema_name = schema_name or fields[4] parent_name = parent_name or fields[5] - database_qualified_name = ( - database_qualified_name - or f"{connection_qualified_name}/{database_name}" - ) - schema_qualified_name = ( - schema_qualified_name or f"{database_qualified_name}/{schema_name}" - ) + database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" + schema_qualified_name = schema_qualified_name or f"{database_qualified_name}/{schema_name}" column = Column.Attributes( name=name, @@ -1669,21 +1447,15 @@ def create( column.view_name = parent_name elif parent_type == MaterialisedView: column.view_qualified_name = parent_qualified_name - column.materialised_view = MaterialisedView.ref_by_qualified_name( - parent_qualified_name - ) + column.materialised_view = MaterialisedView.ref_by_qualified_name(parent_qualified_name) column.view_name = parent_name elif parent_type == TablePartition: column.table_qualified_name = parent_qualified_name - column.table_partition = TablePartition.ref_by_qualified_name( - parent_qualified_name - ) + column.table_partition = TablePartition.ref_by_qualified_name(parent_qualified_name) column.table_name = parent_name elif parent_type == SnowflakeDynamicTable: column.table_qualified_name = parent_qualified_name - column.snowflake_dynamic_table = ( - SnowflakeDynamicTable.ref_by_qualified_name(parent_qualified_name) - ) + column.snowflake_dynamic_table = SnowflakeDynamicTable.ref_by_qualified_name(parent_qualified_name) column.table_name = parent_name else: raise ValueError( diff --git a/pyatlan/model/assets/core/column_process.py b/pyatlan/model/assets/core/column_process.py index 520d9bbc1..6fafa41f8 100644 --- a/pyatlan/model/assets/core/column_process.py +++ b/pyatlan/model/assets/core/column_process.py @@ -52,10 +52,7 @@ def create( process_id: Optional[str] = None, ) -> ColumnProcess: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -131,12 +128,8 @@ def process(self, process: Optional[Process]): self.attributes.process = process class Attributes(Process.Attributes): - outputs: Optional[List[Catalog]] = Field( - default=None, description="" - ) # relationship - inputs: Optional[List[Catalog]] = Field( - default=None, description="" - ) # relationship + outputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship + inputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship process: Optional[Process] = Field(default=None, description="") # relationship @classmethod diff --git a/pyatlan/model/assets/core/cosmos_mongo_d_b_account.py b/pyatlan/model/assets/core/cosmos_mongo_d_b_account.py index 5b8f580ca..58da7882a 100644 --- a/pyatlan/model/assets/core/cosmos_mongo_d_b_account.py +++ b/pyatlan/model/assets/core/cosmos_mongo_d_b_account.py @@ -84,36 +84,28 @@ def __setattr__(self, name, value): """ The status of public network access for the Cosmos MongoDB account. """ - COSMOS_MONGO_DB_ACCOUNT_ENABLE_AUTOMATIC_FAILOVER: ClassVar[BooleanField] = ( - BooleanField( - "cosmosMongoDBAccountEnableAutomaticFailover", - "cosmosMongoDBAccountEnableAutomaticFailover", - ) + COSMOS_MONGO_DB_ACCOUNT_ENABLE_AUTOMATIC_FAILOVER: ClassVar[BooleanField] = BooleanField( + "cosmosMongoDBAccountEnableAutomaticFailover", + "cosmosMongoDBAccountEnableAutomaticFailover", ) """ Indicates whether automatic failover is enabled for the Cosmos MongoDB account. """ - COSMOS_MONGO_DB_ACCOUNT_ENABLE_MULTIPLE_WRITE_LOCATIONS: ClassVar[BooleanField] = ( - BooleanField( - "cosmosMongoDBAccountEnableMultipleWriteLocations", - "cosmosMongoDBAccountEnableMultipleWriteLocations", - ) + COSMOS_MONGO_DB_ACCOUNT_ENABLE_MULTIPLE_WRITE_LOCATIONS: ClassVar[BooleanField] = BooleanField( + "cosmosMongoDBAccountEnableMultipleWriteLocations", + "cosmosMongoDBAccountEnableMultipleWriteLocations", ) """ Indicates whether multiple write locations are enabled for the Cosmos MongoDB account. """ - COSMOS_MONGO_DB_ACCOUNT_ENABLE_PARTITION_KEY_MONITOR: ClassVar[BooleanField] = ( - BooleanField( - "cosmosMongoDBAccountEnablePartitionKeyMonitor", - "cosmosMongoDBAccountEnablePartitionKeyMonitor", - ) + COSMOS_MONGO_DB_ACCOUNT_ENABLE_PARTITION_KEY_MONITOR: ClassVar[BooleanField] = BooleanField( + "cosmosMongoDBAccountEnablePartitionKeyMonitor", + "cosmosMongoDBAccountEnablePartitionKeyMonitor", ) """ Indicates whether partition key monitoring is enabled for the Cosmos MongoDB account. """ - COSMOS_MONGO_DB_ACCOUNT_IS_VIRTUAL_NETWORK_FILTER_ENABLED: ClassVar[ - BooleanField - ] = BooleanField( + COSMOS_MONGO_DB_ACCOUNT_IS_VIRTUAL_NETWORK_FILTER_ENABLED: ClassVar[BooleanField] = BooleanField( "cosmosMongoDBAccountIsVirtualNetworkFilterEnabled", "cosmosMongoDBAccountIsVirtualNetworkFilterEnabled", ) @@ -145,9 +137,7 @@ def __setattr__(self, name, value): The write locations configured for the Cosmos MongoDB account. """ - COSMOS_MONGO_DB_DATABASES: ClassVar[RelationField] = RelationField( - "cosmosMongoDBDatabases" - ) + COSMOS_MONGO_DB_DATABASES: ClassVar[RelationField] = RelationField("cosmosMongoDBDatabases") """ TBC """ @@ -174,135 +164,77 @@ def __setattr__(self, name, value): @property def cosmos_mongo_d_b_account_instance_id(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_instance_id - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_instance_id @cosmos_mongo_d_b_account_instance_id.setter - def cosmos_mongo_d_b_account_instance_id( - self, cosmos_mongo_d_b_account_instance_id: Optional[str] - ): + def cosmos_mongo_d_b_account_instance_id(self, cosmos_mongo_d_b_account_instance_id: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_instance_id = ( - cosmos_mongo_d_b_account_instance_id - ) + self.attributes.cosmos_mongo_d_b_account_instance_id = cosmos_mongo_d_b_account_instance_id @property def cosmos_mongo_d_b_database_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_database_count - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_database_count @cosmos_mongo_d_b_database_count.setter - def cosmos_mongo_d_b_database_count( - self, cosmos_mongo_d_b_database_count: Optional[int] - ): + def cosmos_mongo_d_b_database_count(self, cosmos_mongo_d_b_database_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_database_count = ( - cosmos_mongo_d_b_database_count - ) + self.attributes.cosmos_mongo_d_b_database_count = cosmos_mongo_d_b_database_count @property def cosmos_mongo_d_b_account_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_type - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_type @cosmos_mongo_d_b_account_type.setter - def cosmos_mongo_d_b_account_type( - self, cosmos_mongo_d_b_account_type: Optional[str] - ): + def cosmos_mongo_d_b_account_type(self, cosmos_mongo_d_b_account_type: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_account_type = cosmos_mongo_d_b_account_type @property def cosmos_mongo_d_b_account_subscription_id(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_subscription_id - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_subscription_id @cosmos_mongo_d_b_account_subscription_id.setter - def cosmos_mongo_d_b_account_subscription_id( - self, cosmos_mongo_d_b_account_subscription_id: Optional[str] - ): + def cosmos_mongo_d_b_account_subscription_id(self, cosmos_mongo_d_b_account_subscription_id: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_subscription_id = ( - cosmos_mongo_d_b_account_subscription_id - ) + self.attributes.cosmos_mongo_d_b_account_subscription_id = cosmos_mongo_d_b_account_subscription_id @property def cosmos_mongo_d_b_account_resource_group(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_resource_group - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_resource_group @cosmos_mongo_d_b_account_resource_group.setter - def cosmos_mongo_d_b_account_resource_group( - self, cosmos_mongo_d_b_account_resource_group: Optional[str] - ): + def cosmos_mongo_d_b_account_resource_group(self, cosmos_mongo_d_b_account_resource_group: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_resource_group = ( - cosmos_mongo_d_b_account_resource_group - ) + self.attributes.cosmos_mongo_d_b_account_resource_group = cosmos_mongo_d_b_account_resource_group @property def cosmos_mongo_d_b_account_document_endpoint(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_document_endpoint - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_document_endpoint @cosmos_mongo_d_b_account_document_endpoint.setter - def cosmos_mongo_d_b_account_document_endpoint( - self, cosmos_mongo_d_b_account_document_endpoint: Optional[str] - ): + def cosmos_mongo_d_b_account_document_endpoint(self, cosmos_mongo_d_b_account_document_endpoint: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_document_endpoint = ( - cosmos_mongo_d_b_account_document_endpoint - ) + self.attributes.cosmos_mongo_d_b_account_document_endpoint = cosmos_mongo_d_b_account_document_endpoint @property def cosmos_mongo_d_b_account_mongo_endpoint(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_mongo_endpoint - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_mongo_endpoint @cosmos_mongo_d_b_account_mongo_endpoint.setter - def cosmos_mongo_d_b_account_mongo_endpoint( - self, cosmos_mongo_d_b_account_mongo_endpoint: Optional[str] - ): + def cosmos_mongo_d_b_account_mongo_endpoint(self, cosmos_mongo_d_b_account_mongo_endpoint: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_mongo_endpoint = ( - cosmos_mongo_d_b_account_mongo_endpoint - ) + self.attributes.cosmos_mongo_d_b_account_mongo_endpoint = cosmos_mongo_d_b_account_mongo_endpoint @property def cosmos_mongo_d_b_account_public_network_access(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_public_network_access - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_public_network_access @cosmos_mongo_d_b_account_public_network_access.setter def cosmos_mongo_d_b_account_public_network_access( @@ -310,17 +242,11 @@ def cosmos_mongo_d_b_account_public_network_access( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_public_network_access = ( - cosmos_mongo_d_b_account_public_network_access - ) + self.attributes.cosmos_mongo_d_b_account_public_network_access = cosmos_mongo_d_b_account_public_network_access @property def cosmos_mongo_d_b_account_enable_automatic_failover(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_enable_automatic_failover - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_enable_automatic_failover @cosmos_mongo_d_b_account_enable_automatic_failover.setter def cosmos_mongo_d_b_account_enable_automatic_failover( @@ -355,9 +281,7 @@ def cosmos_mongo_d_b_account_enable_multiple_write_locations( @property def cosmos_mongo_d_b_account_enable_partition_key_monitor(self) -> Optional[bool]: return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_enable_partition_key_monitor + None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_enable_partition_key_monitor ) @cosmos_mongo_d_b_account_enable_partition_key_monitor.setter @@ -392,141 +316,71 @@ def cosmos_mongo_d_b_account_is_virtual_network_filter_enabled( @property def cosmos_mongo_d_b_account_consistency_policy(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_consistency_policy - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_consistency_policy @cosmos_mongo_d_b_account_consistency_policy.setter - def cosmos_mongo_d_b_account_consistency_policy( - self, cosmos_mongo_d_b_account_consistency_policy: Optional[str] - ): + def cosmos_mongo_d_b_account_consistency_policy(self, cosmos_mongo_d_b_account_consistency_policy: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_consistency_policy = ( - cosmos_mongo_d_b_account_consistency_policy - ) + self.attributes.cosmos_mongo_d_b_account_consistency_policy = cosmos_mongo_d_b_account_consistency_policy @property def cosmos_mongo_d_b_account_locations(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_locations - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_locations @cosmos_mongo_d_b_account_locations.setter - def cosmos_mongo_d_b_account_locations( - self, cosmos_mongo_d_b_account_locations: Optional[Set[str]] - ): + def cosmos_mongo_d_b_account_locations(self, cosmos_mongo_d_b_account_locations: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_locations = ( - cosmos_mongo_d_b_account_locations - ) + self.attributes.cosmos_mongo_d_b_account_locations = cosmos_mongo_d_b_account_locations @property def cosmos_mongo_d_b_account_read_locations(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_read_locations - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_read_locations @cosmos_mongo_d_b_account_read_locations.setter - def cosmos_mongo_d_b_account_read_locations( - self, cosmos_mongo_d_b_account_read_locations: Optional[Set[str]] - ): + def cosmos_mongo_d_b_account_read_locations(self, cosmos_mongo_d_b_account_read_locations: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_read_locations = ( - cosmos_mongo_d_b_account_read_locations - ) + self.attributes.cosmos_mongo_d_b_account_read_locations = cosmos_mongo_d_b_account_read_locations @property def cosmos_mongo_d_b_account_write_locations(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_write_locations - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_write_locations @cosmos_mongo_d_b_account_write_locations.setter - def cosmos_mongo_d_b_account_write_locations( - self, cosmos_mongo_d_b_account_write_locations: Optional[Set[str]] - ): + def cosmos_mongo_d_b_account_write_locations(self, cosmos_mongo_d_b_account_write_locations: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_write_locations = ( - cosmos_mongo_d_b_account_write_locations - ) + self.attributes.cosmos_mongo_d_b_account_write_locations = cosmos_mongo_d_b_account_write_locations @property def cosmos_mongo_d_b_databases(self) -> Optional[List[CosmosMongoDBDatabase]]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_databases - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_databases @cosmos_mongo_d_b_databases.setter - def cosmos_mongo_d_b_databases( - self, cosmos_mongo_d_b_databases: Optional[List[CosmosMongoDBDatabase]] - ): + def cosmos_mongo_d_b_databases(self, cosmos_mongo_d_b_databases: Optional[List[CosmosMongoDBDatabase]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_databases = cosmos_mongo_d_b_databases class Attributes(CosmosMongoDB.Attributes): - cosmos_mongo_d_b_account_instance_id: Optional[str] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_database_count: Optional[int] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_type: Optional[str] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_subscription_id: Optional[str] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_resource_group: Optional[str] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_document_endpoint: Optional[str] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_mongo_endpoint: Optional[str] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_public_network_access: Optional[str] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_enable_automatic_failover: Optional[bool] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_enable_multiple_write_locations: Optional[bool] = ( - Field(default=None, description="") - ) - cosmos_mongo_d_b_account_enable_partition_key_monitor: Optional[bool] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_is_virtual_network_filter_enabled: Optional[bool] = ( - Field(default=None, description="") - ) - cosmos_mongo_d_b_account_consistency_policy: Optional[str] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_locations: Optional[Set[str]] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_read_locations: Optional[Set[str]] = Field( - default=None, description="" - ) - cosmos_mongo_d_b_account_write_locations: Optional[Set[str]] = Field( - default=None, description="" - ) + cosmos_mongo_d_b_account_instance_id: Optional[str] = Field(default=None, description="") + cosmos_mongo_d_b_database_count: Optional[int] = Field(default=None, description="") + cosmos_mongo_d_b_account_type: Optional[str] = Field(default=None, description="") + cosmos_mongo_d_b_account_subscription_id: Optional[str] = Field(default=None, description="") + cosmos_mongo_d_b_account_resource_group: Optional[str] = Field(default=None, description="") + cosmos_mongo_d_b_account_document_endpoint: Optional[str] = Field(default=None, description="") + cosmos_mongo_d_b_account_mongo_endpoint: Optional[str] = Field(default=None, description="") + cosmos_mongo_d_b_account_public_network_access: Optional[str] = Field(default=None, description="") + cosmos_mongo_d_b_account_enable_automatic_failover: Optional[bool] = Field(default=None, description="") + cosmos_mongo_d_b_account_enable_multiple_write_locations: Optional[bool] = Field(default=None, description="") + cosmos_mongo_d_b_account_enable_partition_key_monitor: Optional[bool] = Field(default=None, description="") + cosmos_mongo_d_b_account_is_virtual_network_filter_enabled: Optional[bool] = Field(default=None, description="") + cosmos_mongo_d_b_account_consistency_policy: Optional[str] = Field(default=None, description="") + cosmos_mongo_d_b_account_locations: Optional[Set[str]] = Field(default=None, description="") + cosmos_mongo_d_b_account_read_locations: Optional[Set[str]] = Field(default=None, description="") + cosmos_mongo_d_b_account_write_locations: Optional[Set[str]] = Field(default=None, description="") cosmos_mongo_d_b_databases: Optional[List[CosmosMongoDBDatabase]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/core/cosmos_mongo_d_b_collection.py b/pyatlan/model/assets/core/cosmos_mongo_d_b_collection.py index 142fb1c5a..d2a036e3f 100644 --- a/pyatlan/model/assets/core/cosmos_mongo_d_b_collection.py +++ b/pyatlan/model/assets/core/cosmos_mongo_d_b_collection.py @@ -38,19 +38,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - COSMOS_MONGO_DB_DATABASE_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( - KeywordTextField( - "cosmosMongoDBDatabaseQualifiedName", - "cosmosMongoDBDatabaseQualifiedName", - "cosmosMongoDBDatabaseQualifiedName.text", - ) + COSMOS_MONGO_DB_DATABASE_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "cosmosMongoDBDatabaseQualifiedName", + "cosmosMongoDBDatabaseQualifiedName", + "cosmosMongoDBDatabaseQualifiedName.text", ) """ Unique name of the database in which this collection exists. """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( - "noSQLSchemaDefinition", "noSQLSchemaDefinition" - ) + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") """ Represents attributes for describing the key schema for the table and indexes. """ @@ -148,51 +144,35 @@ def __setattr__(self, name, value): """ Whether this table is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( - "isQueryPreview", "isQueryPreview" - ) + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") """ Whether preview queries are allowed for this table (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( - "queryPreviewConfig", "queryPreviewConfig" - ) + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") """ Configuration for preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField( - "externalLocation", "externalLocation" - ) + EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") """ External location of this table, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( - "externalLocationRegion", "externalLocationRegion" - ) + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") """ Region of the external location of this table, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( - "externalLocationFormat", "externalLocationFormat" - ) + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") """ Format of the external location of this table, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( - "isPartitioned", "isPartitioned" - ) + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") """ Whether this table is partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( - "partitionStrategy", "partitionStrategy" - ) + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") """ Partition strategy for this table. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField( - "partitionCount", "partitionCount" - ) + PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") """ Number of partitions in this table. """ @@ -208,21 +188,15 @@ def __setattr__(self, name, value): """ Type of the table. """ - ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField( - "icebergCatalogName", "icebergCatalogName" - ) + ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField("icebergCatalogName", "icebergCatalogName") """ iceberg table catalog name (can be any user defined name) """ - ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField( - "icebergTableType", "icebergTableType" - ) + ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField("icebergTableType", "icebergTableType") """ iceberg table type (managed vs unmanaged) """ - ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField( - "icebergCatalogSource", "icebergCatalogSource" - ) + ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField("icebergCatalogSource", "icebergCatalogSource") """ iceberg table catalog type (glue, polaris, snowflake) """ @@ -250,9 +224,7 @@ def __setattr__(self, name, value): """ iceberg table base location inside the external volume. """ - TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField( - "tableRetentionTime", "tableRetentionTime" - ) + TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField("tableRetentionTime", "tableRetentionTime") """ Data retention time in days. """ @@ -260,69 +232,47 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( - "queryUserCount", "queryUserCount" - ) + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( - "queryUserMap", "queryUserMap" - ) + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( - "queryCountUpdatedAt", "queryCountUpdatedAt" - ) + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "databaseName", "databaseName.keyword", "databaseName" - ) + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "databaseQualifiedName", "databaseQualifiedName" - ) + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "schemaName", "schemaName.keyword", "schemaName" - ) + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "schemaQualifiedName", "schemaQualifiedName" - ) + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "tableName", "tableName.keyword", "tableName" - ) + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "tableQualifiedName", "tableQualifiedName" - ) + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "viewName", "viewName.keyword", "viewName" - ) + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "viewQualifiedName", "viewQualifiedName" - ) + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -342,9 +292,7 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( - "lastProfiledAt", "lastProfiledAt" - ) + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -377,9 +325,7 @@ def __setattr__(self, name, value): """ TBC """ - COSMOS_MONGO_DB_DATABASE: ClassVar[RelationField] = RelationField( - "cosmosMongoDBDatabase" - ) + COSMOS_MONGO_DB_DATABASE: ClassVar[RelationField] = RelationField("cosmosMongoDBDatabase") """ TBC """ @@ -476,29 +422,17 @@ def __setattr__(self, name, value): @property def cosmos_mongo_d_b_database_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_database_qualified_name - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_database_qualified_name @cosmos_mongo_d_b_database_qualified_name.setter - def cosmos_mongo_d_b_database_qualified_name( - self, cosmos_mongo_d_b_database_qualified_name: Optional[str] - ): + def cosmos_mongo_d_b_database_qualified_name(self, cosmos_mongo_d_b_database_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_database_qualified_name = ( - cosmos_mongo_d_b_database_qualified_name - ) + self.attributes.cosmos_mongo_d_b_database_qualified_name = cosmos_mongo_d_b_database_qualified_name @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.no_s_q_l_schema_definition - ) + return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -508,11 +442,7 @@ def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @property def mongo_d_b_collection_subtype(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_subtype - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_subtype @mongo_d_b_collection_subtype.setter def mongo_d_b_collection_subtype(self, mongo_d_b_collection_subtype: Optional[str]): @@ -522,197 +452,113 @@ def mongo_d_b_collection_subtype(self, mongo_d_b_collection_subtype: Optional[st @property def mongo_d_b_collection_is_capped(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_is_capped - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_is_capped @mongo_d_b_collection_is_capped.setter - def mongo_d_b_collection_is_capped( - self, mongo_d_b_collection_is_capped: Optional[bool] - ): + def mongo_d_b_collection_is_capped(self, mongo_d_b_collection_is_capped: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collection_is_capped = mongo_d_b_collection_is_capped @property def mongo_d_b_collection_time_field(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_time_field - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_time_field @mongo_d_b_collection_time_field.setter - def mongo_d_b_collection_time_field( - self, mongo_d_b_collection_time_field: Optional[str] - ): + def mongo_d_b_collection_time_field(self, mongo_d_b_collection_time_field: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_time_field = ( - mongo_d_b_collection_time_field - ) + self.attributes.mongo_d_b_collection_time_field = mongo_d_b_collection_time_field @property def mongo_d_b_collection_time_granularity(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_time_granularity - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_time_granularity @mongo_d_b_collection_time_granularity.setter - def mongo_d_b_collection_time_granularity( - self, mongo_d_b_collection_time_granularity: Optional[str] - ): + def mongo_d_b_collection_time_granularity(self, mongo_d_b_collection_time_granularity: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_time_granularity = ( - mongo_d_b_collection_time_granularity - ) + self.attributes.mongo_d_b_collection_time_granularity = mongo_d_b_collection_time_granularity @property def mongo_d_b_collection_expire_after_seconds(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_expire_after_seconds - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_expire_after_seconds @mongo_d_b_collection_expire_after_seconds.setter - def mongo_d_b_collection_expire_after_seconds( - self, mongo_d_b_collection_expire_after_seconds: Optional[int] - ): + def mongo_d_b_collection_expire_after_seconds(self, mongo_d_b_collection_expire_after_seconds: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_expire_after_seconds = ( - mongo_d_b_collection_expire_after_seconds - ) + self.attributes.mongo_d_b_collection_expire_after_seconds = mongo_d_b_collection_expire_after_seconds @property def mongo_d_b_collection_maximum_document_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_maximum_document_count - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_maximum_document_count @mongo_d_b_collection_maximum_document_count.setter - def mongo_d_b_collection_maximum_document_count( - self, mongo_d_b_collection_maximum_document_count: Optional[int] - ): + def mongo_d_b_collection_maximum_document_count(self, mongo_d_b_collection_maximum_document_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_maximum_document_count = ( - mongo_d_b_collection_maximum_document_count - ) + self.attributes.mongo_d_b_collection_maximum_document_count = mongo_d_b_collection_maximum_document_count @property def mongo_d_b_collection_max_size(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_max_size - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_max_size @mongo_d_b_collection_max_size.setter - def mongo_d_b_collection_max_size( - self, mongo_d_b_collection_max_size: Optional[int] - ): + def mongo_d_b_collection_max_size(self, mongo_d_b_collection_max_size: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collection_max_size = mongo_d_b_collection_max_size @property def mongo_d_b_collection_num_orphan_docs(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_num_orphan_docs - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_num_orphan_docs @mongo_d_b_collection_num_orphan_docs.setter - def mongo_d_b_collection_num_orphan_docs( - self, mongo_d_b_collection_num_orphan_docs: Optional[int] - ): + def mongo_d_b_collection_num_orphan_docs(self, mongo_d_b_collection_num_orphan_docs: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_num_orphan_docs = ( - mongo_d_b_collection_num_orphan_docs - ) + self.attributes.mongo_d_b_collection_num_orphan_docs = mongo_d_b_collection_num_orphan_docs @property def mongo_d_b_collection_num_indexes(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_num_indexes - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_num_indexes @mongo_d_b_collection_num_indexes.setter - def mongo_d_b_collection_num_indexes( - self, mongo_d_b_collection_num_indexes: Optional[int] - ): + def mongo_d_b_collection_num_indexes(self, mongo_d_b_collection_num_indexes: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_num_indexes = ( - mongo_d_b_collection_num_indexes - ) + self.attributes.mongo_d_b_collection_num_indexes = mongo_d_b_collection_num_indexes @property def mongo_d_b_collection_total_index_size(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_total_index_size - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_total_index_size @mongo_d_b_collection_total_index_size.setter - def mongo_d_b_collection_total_index_size( - self, mongo_d_b_collection_total_index_size: Optional[int] - ): + def mongo_d_b_collection_total_index_size(self, mongo_d_b_collection_total_index_size: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_total_index_size = ( - mongo_d_b_collection_total_index_size - ) + self.attributes.mongo_d_b_collection_total_index_size = mongo_d_b_collection_total_index_size @property def mongo_d_b_collection_average_object_size(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_average_object_size - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_average_object_size @mongo_d_b_collection_average_object_size.setter - def mongo_d_b_collection_average_object_size( - self, mongo_d_b_collection_average_object_size: Optional[int] - ): + def mongo_d_b_collection_average_object_size(self, mongo_d_b_collection_average_object_size: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_average_object_size = ( - mongo_d_b_collection_average_object_size - ) + self.attributes.mongo_d_b_collection_average_object_size = mongo_d_b_collection_average_object_size @property def mongo_d_b_collection_schema_definition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_schema_definition - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_schema_definition @mongo_d_b_collection_schema_definition.setter - def mongo_d_b_collection_schema_definition( - self, mongo_d_b_collection_schema_definition: Optional[str] - ): + def mongo_d_b_collection_schema_definition(self, mongo_d_b_collection_schema_definition: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_schema_definition = ( - mongo_d_b_collection_schema_definition - ) + self.attributes.mongo_d_b_collection_schema_definition = mongo_d_b_collection_schema_definition @property def column_count(self) -> Optional[int]: @@ -796,11 +642,7 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_region - ) + return None if self.attributes is None else self.attributes.external_location_region @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -810,11 +652,7 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_format - ) + return None if self.attributes is None else self.attributes.external_location_format @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -904,9 +742,7 @@ def iceberg_table_type(self, iceberg_table_type: Optional[str]): @property def iceberg_catalog_source(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.iceberg_catalog_source - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_source @iceberg_catalog_source.setter def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @@ -916,11 +752,7 @@ def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @property def iceberg_catalog_table_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_catalog_table_name - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_table_name @iceberg_catalog_table_name.setter def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @@ -930,29 +762,17 @@ def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @property def iceberg_catalog_table_namespace(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_catalog_table_namespace - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_table_namespace @iceberg_catalog_table_namespace.setter - def iceberg_catalog_table_namespace( - self, iceberg_catalog_table_namespace: Optional[str] - ): + def iceberg_catalog_table_namespace(self, iceberg_catalog_table_namespace: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.iceberg_catalog_table_namespace = ( - iceberg_catalog_table_namespace - ) + self.attributes.iceberg_catalog_table_namespace = iceberg_catalog_table_namespace @property def table_external_volume_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.table_external_volume_name - ) + return None if self.attributes is None else self.attributes.table_external_volume_name @table_external_volume_name.setter def table_external_volume_name(self, table_external_volume_name: Optional[str]): @@ -962,11 +782,7 @@ def table_external_volume_name(self, table_external_volume_name: Optional[str]): @property def iceberg_table_base_location(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_table_base_location - ) + return None if self.attributes is None else self.attributes.iceberg_table_base_location @iceberg_table_base_location.setter def iceberg_table_base_location(self, iceberg_table_base_location: Optional[str]): @@ -1016,9 +832,7 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.query_count_updated_at - ) + return None if self.attributes is None else self.attributes.query_count_updated_at @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -1038,9 +852,7 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.database_qualified_name - ) + return None if self.attributes is None else self.attributes.database_qualified_name @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -1060,9 +872,7 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.schema_qualified_name - ) + return None if self.attributes is None else self.attributes.schema_qualified_name @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -1112,9 +922,7 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.calculation_view_name - ) + return None if self.attributes is None else self.attributes.calculation_view_name @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -1124,21 +932,13 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_qualified_name - ) + return None if self.attributes is None else self.attributes.calculation_view_qualified_name @calculation_view_qualified_name.setter - def calculation_view_qualified_name( - self, calculation_view_qualified_name: Optional[str] - ): + def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = ( - calculation_view_qualified_name - ) + self.attributes.calculation_view_qualified_name = calculation_view_qualified_name @property def is_profiled(self) -> Optional[bool]: @@ -1232,16 +1032,10 @@ def partitions(self, partitions: Optional[List[TablePartition]]): @property def cosmos_mongo_d_b_database(self) -> Optional[CosmosMongoDBDatabase]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_database - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_database @cosmos_mongo_d_b_database.setter - def cosmos_mongo_d_b_database( - self, cosmos_mongo_d_b_database: Optional[CosmosMongoDBDatabase] - ): + def cosmos_mongo_d_b_database(self, cosmos_mongo_d_b_database: Optional[CosmosMongoDBDatabase]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_database = cosmos_mongo_d_b_database @@ -1297,55 +1091,27 @@ def dimensions(self, dimensions: Optional[List[Table]]): self.attributes.dimensions = dimensions class Attributes(CosmosMongoDB.Attributes): - cosmos_mongo_d_b_database_qualified_name: Optional[str] = Field( - default=None, description="" - ) + cosmos_mongo_d_b_database_qualified_name: Optional[str] = Field(default=None, description="") no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") - mongo_d_b_collection_subtype: Optional[str] = Field( - default=None, description="" - ) - mongo_d_b_collection_is_capped: Optional[bool] = Field( - default=None, description="" - ) - mongo_d_b_collection_time_field: Optional[str] = Field( - default=None, description="" - ) - mongo_d_b_collection_time_granularity: Optional[str] = Field( - default=None, description="" - ) - mongo_d_b_collection_expire_after_seconds: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_maximum_document_count: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_max_size: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_num_orphan_docs: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_num_indexes: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_total_index_size: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_average_object_size: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_schema_definition: Optional[str] = Field( - default=None, description="" - ) + mongo_d_b_collection_subtype: Optional[str] = Field(default=None, description="") + mongo_d_b_collection_is_capped: Optional[bool] = Field(default=None, description="") + mongo_d_b_collection_time_field: Optional[str] = Field(default=None, description="") + mongo_d_b_collection_time_granularity: Optional[str] = Field(default=None, description="") + mongo_d_b_collection_expire_after_seconds: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_maximum_document_count: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_max_size: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_num_orphan_docs: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_num_indexes: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_total_index_size: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_average_object_size: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_schema_definition: Optional[str] = Field(default=None, description="") column_count: Optional[int] = Field(default=None, description="") row_count: Optional[int] = Field(default=None, description="") size_bytes: Optional[int] = Field(default=None, description="") alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -1359,9 +1125,7 @@ class Attributes(CosmosMongoDB.Attributes): iceberg_table_type: Optional[str] = Field(default=None, description="") iceberg_catalog_source: Optional[str] = Field(default=None, description="") iceberg_catalog_table_name: Optional[str] = Field(default=None, description="") - iceberg_catalog_table_namespace: Optional[str] = Field( - default=None, description="" - ) + iceberg_catalog_table_namespace: Optional[str] = Field(default=None, description="") table_external_volume_name: Optional[str] = Field(default=None, description="") iceberg_table_base_location: Optional[str] = Field(default=None, description="") table_retention_time: Optional[int] = Field(default=None, description="") @@ -1378,50 +1142,22 @@ class Attributes(CosmosMongoDB.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field( - default=None, description="" - ) + calculation_view_qualified_name: Optional[str] = Field(default=None, description="") is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship - facts: Optional[List[Table]] = Field( - default=None, description="" - ) # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship - dbt_tests: Optional[List[DbtTest]] = Field( - default=None, description="" - ) # relationship - atlan_schema: Optional[Schema] = Field( - default=None, description="" - ) # relationship - partitions: Optional[List[TablePartition]] = Field( - default=None, description="" - ) # relationship - cosmos_mongo_d_b_database: Optional[CosmosMongoDBDatabase] = Field( - default=None, description="" - ) # relationship - queries: Optional[List[Query]] = Field( - default=None, description="" - ) # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship - mongo_d_b_database: Optional[MongoDBDatabase] = Field( - default=None, description="" - ) # relationship - dimensions: Optional[List[Table]] = Field( - default=None, description="" - ) # relationship + dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + columns: Optional[List[Column]] = Field(default=None, description="") # relationship + facts: Optional[List[Table]] = Field(default=None, description="") # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship + atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship + partitions: Optional[List[TablePartition]] = Field(default=None, description="") # relationship + cosmos_mongo_d_b_database: Optional[CosmosMongoDBDatabase] = Field(default=None, description="") # relationship + queries: Optional[List[Query]] = Field(default=None, description="") # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + mongo_d_b_database: Optional[MongoDBDatabase] = Field(default=None, description="") # relationship + dimensions: Optional[List[Table]] = Field(default=None, description="") # relationship attributes: CosmosMongoDBCollection.Attributes = Field( default_factory=lambda: CosmosMongoDBCollection.Attributes(), diff --git a/pyatlan/model/assets/core/cosmos_mongo_d_b_database.py b/pyatlan/model/assets/core/cosmos_mongo_d_b_database.py index b378ae861..77f59e4ff 100644 --- a/pyatlan/model/assets/core/cosmos_mongo_d_b_database.py +++ b/pyatlan/model/assets/core/cosmos_mongo_d_b_database.py @@ -37,19 +37,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - COSMOS_MONGO_DB_ACCOUNT_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( - KeywordTextField( - "cosmosMongoDBAccountQualifiedName", - "cosmosMongoDBAccountQualifiedName", - "cosmosMongoDBAccountQualifiedName.text", - ) + COSMOS_MONGO_DB_ACCOUNT_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "cosmosMongoDBAccountQualifiedName", + "cosmosMongoDBAccountQualifiedName", + "cosmosMongoDBAccountQualifiedName.text", ) """ Unique name of the account in which this database exists. """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( - "noSQLSchemaDefinition", "noSQLSchemaDefinition" - ) + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") """ Represents attributes for describing the key schema for the table and indexes. """ @@ -67,69 +63,47 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( - "queryUserCount", "queryUserCount" - ) + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( - "queryUserMap", "queryUserMap" - ) + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( - "queryCountUpdatedAt", "queryCountUpdatedAt" - ) + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "databaseName", "databaseName.keyword", "databaseName" - ) + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "databaseQualifiedName", "databaseQualifiedName" - ) + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "schemaName", "schemaName.keyword", "schemaName" - ) + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "schemaQualifiedName", "schemaQualifiedName" - ) + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "tableName", "tableName.keyword", "tableName" - ) + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "tableQualifiedName", "tableQualifiedName" - ) + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "viewName", "viewName.keyword", "viewName" - ) + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "viewQualifiedName", "viewQualifiedName" - ) + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -149,9 +123,7 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( - "lastProfiledAt", "lastProfiledAt" - ) + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -160,9 +132,7 @@ def __setattr__(self, name, value): """ TBC """ - COSMOS_MONGO_DB_ACCOUNT: ClassVar[RelationField] = RelationField( - "cosmosMongoDBAccount" - ) + COSMOS_MONGO_DB_ACCOUNT: ClassVar[RelationField] = RelationField("cosmosMongoDBAccount") """ TBC """ @@ -190,9 +160,7 @@ def __setattr__(self, name, value): """ TBC """ - COSMOS_MONGO_DB_COLLECTIONS: ClassVar[RelationField] = RelationField( - "cosmosMongoDBCollections" - ) + COSMOS_MONGO_DB_COLLECTIONS: ClassVar[RelationField] = RelationField("cosmosMongoDBCollections") """ TBC """ @@ -231,29 +199,17 @@ def __setattr__(self, name, value): @property def cosmos_mongo_d_b_account_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account_qualified_name - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_qualified_name @cosmos_mongo_d_b_account_qualified_name.setter - def cosmos_mongo_d_b_account_qualified_name( - self, cosmos_mongo_d_b_account_qualified_name: Optional[str] - ): + def cosmos_mongo_d_b_account_qualified_name(self, cosmos_mongo_d_b_account_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_qualified_name = ( - cosmos_mongo_d_b_account_qualified_name - ) + self.attributes.cosmos_mongo_d_b_account_qualified_name = cosmos_mongo_d_b_account_qualified_name @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.no_s_q_l_schema_definition - ) + return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -263,21 +219,13 @@ def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @property def mongo_d_b_database_collection_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_database_collection_count - ) + return None if self.attributes is None else self.attributes.mongo_d_b_database_collection_count @mongo_d_b_database_collection_count.setter - def mongo_d_b_database_collection_count( - self, mongo_d_b_database_collection_count: Optional[int] - ): + def mongo_d_b_database_collection_count(self, mongo_d_b_database_collection_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_database_collection_count = ( - mongo_d_b_database_collection_count - ) + self.attributes.mongo_d_b_database_collection_count = mongo_d_b_database_collection_count @property def schema_count(self) -> Optional[int]: @@ -321,9 +269,7 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.query_count_updated_at - ) + return None if self.attributes is None else self.attributes.query_count_updated_at @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -343,9 +289,7 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.database_qualified_name - ) + return None if self.attributes is None else self.attributes.database_qualified_name @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -365,9 +309,7 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.schema_qualified_name - ) + return None if self.attributes is None else self.attributes.schema_qualified_name @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -417,9 +359,7 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.calculation_view_name - ) + return None if self.attributes is None else self.attributes.calculation_view_name @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -429,21 +369,13 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_qualified_name - ) + return None if self.attributes is None else self.attributes.calculation_view_qualified_name @calculation_view_qualified_name.setter - def calculation_view_qualified_name( - self, calculation_view_qualified_name: Optional[str] - ): + def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = ( - calculation_view_qualified_name - ) + self.attributes.calculation_view_qualified_name = calculation_view_qualified_name @property def is_profiled(self) -> Optional[bool]: @@ -477,16 +409,10 @@ def dbt_sources(self, dbt_sources: Optional[List[DbtSource]]): @property def cosmos_mongo_d_b_account(self) -> Optional[CosmosMongoDBAccount]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_account - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account @cosmos_mongo_d_b_account.setter - def cosmos_mongo_d_b_account( - self, cosmos_mongo_d_b_account: Optional[CosmosMongoDBAccount] - ): + def cosmos_mongo_d_b_account(self, cosmos_mongo_d_b_account: Optional[CosmosMongoDBAccount]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_account = cosmos_mongo_d_b_account @@ -513,14 +439,10 @@ def dbt_tests(self, dbt_tests: Optional[List[DbtTest]]): @property def mongo_d_b_collections(self) -> Optional[List[MongoDBCollection]]: - return ( - None if self.attributes is None else self.attributes.mongo_d_b_collections - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collections @mongo_d_b_collections.setter - def mongo_d_b_collections( - self, mongo_d_b_collections: Optional[List[MongoDBCollection]] - ): + def mongo_d_b_collections(self, mongo_d_b_collections: Optional[List[MongoDBCollection]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collections = mongo_d_b_collections @@ -557,28 +479,18 @@ def schemas(self, schemas: Optional[List[Schema]]): @property def cosmos_mongo_d_b_collections(self) -> Optional[List[CosmosMongoDBCollection]]: - return ( - None - if self.attributes is None - else self.attributes.cosmos_mongo_d_b_collections - ) + return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_collections @cosmos_mongo_d_b_collections.setter - def cosmos_mongo_d_b_collections( - self, cosmos_mongo_d_b_collections: Optional[List[CosmosMongoDBCollection]] - ): + def cosmos_mongo_d_b_collections(self, cosmos_mongo_d_b_collections: Optional[List[CosmosMongoDBCollection]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_collections = cosmos_mongo_d_b_collections class Attributes(CosmosMongoDB.Attributes): - cosmos_mongo_d_b_account_qualified_name: Optional[str] = Field( - default=None, description="" - ) + cosmos_mongo_d_b_account_qualified_name: Optional[str] = Field(default=None, description="") no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") - mongo_d_b_database_collection_count: Optional[int] = Field( - default=None, description="" - ) + mongo_d_b_database_collection_count: Optional[int] = Field(default=None, description="") schema_count: Optional[int] = Field(default=None, description="") query_count: Optional[int] = Field(default=None, description="") query_user_count: Optional[int] = Field(default=None, description="") @@ -593,35 +505,17 @@ class Attributes(CosmosMongoDB.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field( - default=None, description="" - ) + calculation_view_qualified_name: Optional[str] = Field(default=None, description="") is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - cosmos_mongo_d_b_account: Optional[CosmosMongoDBAccount] = Field( - default=None, description="" - ) # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship - dbt_tests: Optional[List[DbtTest]] = Field( - default=None, description="" - ) # relationship - mongo_d_b_collections: Optional[List[MongoDBCollection]] = Field( - default=None, description="" - ) # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship - schemas: Optional[List[Schema]] = Field( - default=None, description="" - ) # relationship + dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + cosmos_mongo_d_b_account: Optional[CosmosMongoDBAccount] = Field(default=None, description="") # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship + mongo_d_b_collections: Optional[List[MongoDBCollection]] = Field(default=None, description="") # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + schemas: Optional[List[Schema]] = Field(default=None, description="") # relationship cosmos_mongo_d_b_collections: Optional[List[CosmosMongoDBCollection]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/core/data_contract.py b/pyatlan/model/assets/core/data_contract.py index b0281eabb..9b6b752be 100644 --- a/pyatlan/model/assets/core/data_contract.py +++ b/pyatlan/model/assets/core/data_contract.py @@ -31,9 +31,7 @@ def creator(cls, asset_qualified_name: str, contract_json: str) -> DataContract: @overload @classmethod - def creator( - cls, asset_qualified_name: str, contract_spec: Union[DataContractSpec, str] - ) -> DataContract: ... + def creator(cls, asset_qualified_name: str, contract_spec: Union[DataContractSpec, str]) -> DataContract: ... @classmethod @init_guid @@ -68,52 +66,36 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATA_CONTRACT_JSON: ClassVar[TextField] = TextField( - "dataContractJson", "dataContractJson" - ) + DATA_CONTRACT_JSON: ClassVar[TextField] = TextField("dataContractJson", "dataContractJson") """ (Deprecated) Replaced by dataContractSpec attribute. """ - DATA_CONTRACT_SPEC: ClassVar[TextField] = TextField( - "dataContractSpec", "dataContractSpec" - ) + DATA_CONTRACT_SPEC: ClassVar[TextField] = TextField("dataContractSpec", "dataContractSpec") """ Actual content of the contract in YAML string format. Any changes to this string should create a new instance (with new sequential version number). """ # noqa: E501 - DATA_CONTRACT_VERSION: ClassVar[NumericField] = NumericField( - "dataContractVersion", "dataContractVersion" - ) + DATA_CONTRACT_VERSION: ClassVar[NumericField] = NumericField("dataContractVersion", "dataContractVersion") """ Version of the contract. """ - DATA_CONTRACT_ASSET_GUID: ClassVar[KeywordField] = KeywordField( - "dataContractAssetGuid", "dataContractAssetGuid" - ) + DATA_CONTRACT_ASSET_GUID: ClassVar[KeywordField] = KeywordField("dataContractAssetGuid", "dataContractAssetGuid") """ Unique identifier of the asset associated with this data contract. """ - DATA_CONTRACT_ASSET_CERTIFIED: ClassVar[RelationField] = RelationField( - "dataContractAssetCertified" - ) + DATA_CONTRACT_ASSET_CERTIFIED: ClassVar[RelationField] = RelationField("dataContractAssetCertified") """ TBC """ - DATA_CONTRACT_NEXT_VERSION: ClassVar[RelationField] = RelationField( - "dataContractNextVersion" - ) + DATA_CONTRACT_NEXT_VERSION: ClassVar[RelationField] = RelationField("dataContractNextVersion") """ TBC """ - DATA_CONTRACT_ASSET_LATEST: ClassVar[RelationField] = RelationField( - "dataContractAssetLatest" - ) + DATA_CONTRACT_ASSET_LATEST: ClassVar[RelationField] = RelationField("dataContractAssetLatest") """ TBC """ - DATA_CONTRACT_PREVIOUS_VERSION: ClassVar[RelationField] = RelationField( - "dataContractPreviousVersion" - ) + DATA_CONTRACT_PREVIOUS_VERSION: ClassVar[RelationField] = RelationField("dataContractPreviousVersion") """ TBC """ @@ -151,9 +133,7 @@ def data_contract_spec(self, data_contract_spec: Optional[str]): @property def data_contract_version(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.data_contract_version - ) + return None if self.attributes is None else self.attributes.data_contract_version @data_contract_version.setter def data_contract_version(self, data_contract_version: Optional[int]): @@ -163,11 +143,7 @@ def data_contract_version(self, data_contract_version: Optional[int]): @property def data_contract_asset_guid(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.data_contract_asset_guid - ) + return None if self.attributes is None else self.attributes.data_contract_asset_guid @data_contract_asset_guid.setter def data_contract_asset_guid(self, data_contract_asset_guid: Optional[str]): @@ -177,43 +153,27 @@ def data_contract_asset_guid(self, data_contract_asset_guid: Optional[str]): @property def data_contract_asset_certified(self) -> Optional[Asset]: - return ( - None - if self.attributes is None - else self.attributes.data_contract_asset_certified - ) + return None if self.attributes is None else self.attributes.data_contract_asset_certified @data_contract_asset_certified.setter - def data_contract_asset_certified( - self, data_contract_asset_certified: Optional[Asset] - ): + def data_contract_asset_certified(self, data_contract_asset_certified: Optional[Asset]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_contract_asset_certified = data_contract_asset_certified @property def data_contract_next_version(self) -> Optional[DataContract]: - return ( - None - if self.attributes is None - else self.attributes.data_contract_next_version - ) + return None if self.attributes is None else self.attributes.data_contract_next_version @data_contract_next_version.setter - def data_contract_next_version( - self, data_contract_next_version: Optional[DataContract] - ): + def data_contract_next_version(self, data_contract_next_version: Optional[DataContract]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_contract_next_version = data_contract_next_version @property def data_contract_asset_latest(self) -> Optional[Asset]: - return ( - None - if self.attributes is None - else self.attributes.data_contract_asset_latest - ) + return None if self.attributes is None else self.attributes.data_contract_asset_latest @data_contract_asset_latest.setter def data_contract_asset_latest(self, data_contract_asset_latest: Optional[Asset]): @@ -223,16 +183,10 @@ def data_contract_asset_latest(self, data_contract_asset_latest: Optional[Asset] @property def data_contract_previous_version(self) -> Optional[DataContract]: - return ( - None - if self.attributes is None - else self.attributes.data_contract_previous_version - ) + return None if self.attributes is None else self.attributes.data_contract_previous_version @data_contract_previous_version.setter - def data_contract_previous_version( - self, data_contract_previous_version: Optional[DataContract] - ): + def data_contract_previous_version(self, data_contract_previous_version: Optional[DataContract]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_contract_previous_version = data_contract_previous_version @@ -242,18 +196,10 @@ class Attributes(Catalog.Attributes): data_contract_spec: Optional[str] = Field(default=None, description="") data_contract_version: Optional[int] = Field(default=None, description="") data_contract_asset_guid: Optional[str] = Field(default=None, description="") - data_contract_asset_certified: Optional[Asset] = Field( - default=None, description="" - ) # relationship - data_contract_next_version: Optional[DataContract] = Field( - default=None, description="" - ) # relationship - data_contract_asset_latest: Optional[Asset] = Field( - default=None, description="" - ) # relationship - data_contract_previous_version: Optional[DataContract] = Field( - default=None, description="" - ) # relationship + data_contract_asset_certified: Optional[Asset] = Field(default=None, description="") # relationship + data_contract_next_version: Optional[DataContract] = Field(default=None, description="") # relationship + data_contract_asset_latest: Optional[Asset] = Field(default=None, description="") # relationship + data_contract_previous_version: Optional[DataContract] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -272,13 +218,11 @@ def creator( ) if not (contract_json or contract_spec): raise ValueError( - "At least one of `contract_json` or `contract_spec` " - "must be provided to create a contract." + "At least one of `contract_json` or `contract_spec` must be provided to create a contract." ) if contract_json and contract_spec: raise ValueError( - "Both `contract_json` and `contract_spec` cannot be " - "provided simultaneously to create a contract." + "Both `contract_json` and `contract_spec` cannot be provided simultaneously to create a contract." ) last_slash_index = asset_qualified_name.rfind("/") default_dataset = asset_qualified_name[last_slash_index + 1 :] # noqa @@ -296,9 +240,7 @@ def creator( ) contract_spec = contract_spec.to_yaml() else: - is_dataset_found = search( - r"dataset:\s*([^\s#]+)", contract_spec or default_dataset - ) + is_dataset_found = search(r"dataset:\s*([^\s#]+)", contract_spec or default_dataset) dataset = None if is_dataset_found: dataset = is_dataset_found.group(1) diff --git a/pyatlan/model/assets/core/data_domain.py b/pyatlan/model/assets/core/data_domain.py index 5509fbe93..5f180dc07 100644 --- a/pyatlan/model/assets/core/data_domain.py +++ b/pyatlan/model/assets/core/data_domain.py @@ -43,10 +43,7 @@ def create( parent_domain_qualified_name: Optional[StrictStr] = None, ) -> DataDomain: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -80,10 +77,7 @@ def create_for_modification( name: str = "", ) -> SelfAsset: warn( - ( - "This method is deprecated, please use 'updater' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -170,18 +164,10 @@ def sub_domains(self, sub_domains: Optional[List[DataDomain]]): self.attributes.sub_domains = sub_domains class Attributes(DataMesh.Attributes): - stakeholders: Optional[List[Stakeholder]] = Field( - default=None, description="" - ) # relationship - parent_domain: Optional[DataDomain] = Field( - default=None, description="" - ) # relationship - data_products: Optional[List[DataProduct]] = Field( - default=None, description="" - ) # relationship - sub_domains: Optional[List[DataDomain]] = Field( - default=None, description="" - ) # relationship + stakeholders: Optional[List[Stakeholder]] = Field(default=None, description="") # relationship + parent_domain: Optional[DataDomain] = Field(default=None, description="") # relationship + data_products: Optional[List[DataProduct]] = Field(default=None, description="") # relationship + sub_domains: Optional[List[DataDomain]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -197,12 +183,8 @@ def create( # In case of sub-domain if parent_domain_qualified_name: - parent_domain = DataDomain.ref_by_qualified_name( - parent_domain_qualified_name - ) - super_domain_qualified_name = DataMesh.get_super_domain_qualified_name( - parent_domain_qualified_name - ) + parent_domain = DataDomain.ref_by_qualified_name(parent_domain_qualified_name) + super_domain_qualified_name = DataMesh.get_super_domain_qualified_name(parent_domain_qualified_name) return DataDomain.Attributes( name=name, diff --git a/pyatlan/model/assets/core/data_mesh.py b/pyatlan/model/assets/core/data_mesh.py index 487296d26..6b21f1c92 100644 --- a/pyatlan/model/assets/core/data_mesh.py +++ b/pyatlan/model/assets/core/data_mesh.py @@ -73,11 +73,7 @@ def __setattr__(self, name, value): @property def parent_domain_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.parent_domain_qualified_name - ) + return None if self.attributes is None else self.attributes.parent_domain_qualified_name @parent_domain_qualified_name.setter def parent_domain_qualified_name(self, parent_domain_qualified_name: Optional[str]): @@ -87,11 +83,7 @@ def parent_domain_qualified_name(self, parent_domain_qualified_name: Optional[st @property def super_domain_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.super_domain_qualified_name - ) + return None if self.attributes is None else self.attributes.super_domain_qualified_name @super_domain_qualified_name.setter def super_domain_qualified_name(self, super_domain_qualified_name: Optional[str]): @@ -100,9 +92,7 @@ def super_domain_qualified_name(self, super_domain_qualified_name: Optional[str] self.attributes.super_domain_qualified_name = super_domain_qualified_name class Attributes(Catalog.Attributes): - parent_domain_qualified_name: Optional[str] = Field( - default=None, description="" - ) + parent_domain_qualified_name: Optional[str] = Field(default=None, description="") super_domain_qualified_name: Optional[str] = Field(default=None, description="") attributes: DataMesh.Attributes = Field( diff --git a/pyatlan/model/assets/core/data_product.py b/pyatlan/model/assets/core/data_product.py index 7e7ae2e4e..104322c1f 100644 --- a/pyatlan/model/assets/core/data_product.py +++ b/pyatlan/model/assets/core/data_product.py @@ -59,10 +59,7 @@ def create( asset_selection: IndexSearchRequest, ) -> DataProduct: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -95,9 +92,7 @@ def updater( ) ) if asset_selection: - product.data_product_assets_d_s_l = ( - DataProductsAssetsDSL.get_asset_selection(asset_selection) - ) + product.data_product_assets_d_s_l = DataProductsAssetsDSL.get_asset_selection(asset_selection) return product @classmethod @@ -107,10 +102,7 @@ def create_for_modification( name: str = "", ) -> SelfAsset: warn( - ( - "This method is deprecated, please use 'updater' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -132,9 +124,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATA_PRODUCT_STATUS: ClassVar[KeywordField] = KeywordField( - "dataProductStatus", "dataProductStatus" - ) + DATA_PRODUCT_STATUS: ClassVar[KeywordField] = KeywordField("dataProductStatus", "dataProductStatus") """ Status of this data product. """ @@ -142,45 +132,31 @@ def __setattr__(self, name, value): """ Status of this data product. """ - DATA_PRODUCT_CRITICALITY: ClassVar[KeywordField] = KeywordField( - "dataProductCriticality", "dataProductCriticality" - ) + DATA_PRODUCT_CRITICALITY: ClassVar[KeywordField] = KeywordField("dataProductCriticality", "dataProductCriticality") """ Criticality of this data product. """ - DAAP_CRITICALITY: ClassVar[KeywordField] = KeywordField( - "daapCriticality", "daapCriticality" - ) + DAAP_CRITICALITY: ClassVar[KeywordField] = KeywordField("daapCriticality", "daapCriticality") """ Criticality of this data product. """ - DATA_PRODUCT_SENSITIVITY: ClassVar[KeywordField] = KeywordField( - "dataProductSensitivity", "dataProductSensitivity" - ) + DATA_PRODUCT_SENSITIVITY: ClassVar[KeywordField] = KeywordField("dataProductSensitivity", "dataProductSensitivity") """ Information sensitivity of this data product. """ - DAAP_SENSITIVITY: ClassVar[KeywordField] = KeywordField( - "daapSensitivity", "daapSensitivity" - ) + DAAP_SENSITIVITY: ClassVar[KeywordField] = KeywordField("daapSensitivity", "daapSensitivity") """ Information sensitivity of this data product. """ - DATA_PRODUCT_VISIBILITY: ClassVar[KeywordField] = KeywordField( - "dataProductVisibility", "dataProductVisibility" - ) + DATA_PRODUCT_VISIBILITY: ClassVar[KeywordField] = KeywordField("dataProductVisibility", "dataProductVisibility") """ Visibility of a data product. """ - DAAP_VISIBILITY: ClassVar[KeywordField] = KeywordField( - "daapVisibility", "daapVisibility" - ) + DAAP_VISIBILITY: ClassVar[KeywordField] = KeywordField("daapVisibility", "daapVisibility") """ Visibility of a data product. """ - DATA_PRODUCT_ASSETS_DSL: ClassVar[TextField] = TextField( - "dataProductAssetsDSL", "dataProductAssetsDSL" - ) + DATA_PRODUCT_ASSETS_DSL: ClassVar[TextField] = TextField("dataProductAssetsDSL", "dataProductAssetsDSL") """ Search DSL used to define which assets are part of this data product. """ @@ -190,9 +166,7 @@ def __setattr__(self, name, value): """ Playbook filter to define which assets are part of this data product. """ - DATA_PRODUCT_SCORE_VALUE: ClassVar[NumericField] = NumericField( - "dataProductScoreValue", "dataProductScoreValue" - ) + DATA_PRODUCT_SCORE_VALUE: ClassVar[NumericField] = NumericField("dataProductScoreValue", "dataProductScoreValue") """ Score of this data product. """ @@ -202,27 +176,19 @@ def __setattr__(self, name, value): """ Timestamp when the score of this data product was last updated. """ - DAAP_VISIBILITY_USERS: ClassVar[KeywordField] = KeywordField( - "daapVisibilityUsers", "daapVisibilityUsers" - ) + DAAP_VISIBILITY_USERS: ClassVar[KeywordField] = KeywordField("daapVisibilityUsers", "daapVisibilityUsers") """ list of users for product visibility control """ - DAAP_VISIBILITY_GROUPS: ClassVar[KeywordField] = KeywordField( - "daapVisibilityGroups", "daapVisibilityGroups" - ) + DAAP_VISIBILITY_GROUPS: ClassVar[KeywordField] = KeywordField("daapVisibilityGroups", "daapVisibilityGroups") """ list of groups for product visibility control """ - DAAP_OUTPUT_PORT_GUIDS: ClassVar[KeywordField] = KeywordField( - "daapOutputPortGuids", "daapOutputPortGuids" - ) + DAAP_OUTPUT_PORT_GUIDS: ClassVar[KeywordField] = KeywordField("daapOutputPortGuids", "daapOutputPortGuids") """ Output ports guids for this data product. """ - DAAP_INPUT_PORT_GUIDS: ClassVar[KeywordField] = KeywordField( - "daapInputPortGuids", "daapInputPortGuids" - ) + DAAP_INPUT_PORT_GUIDS: ClassVar[KeywordField] = KeywordField("daapInputPortGuids", "daapInputPortGuids") """ Input ports guids for this data product. """ @@ -284,16 +250,10 @@ def daap_status(self, daap_status: Optional[DataProductStatus]): @property def data_product_criticality(self) -> Optional[DataProductCriticality]: - return ( - None - if self.attributes is None - else self.attributes.data_product_criticality - ) + return None if self.attributes is None else self.attributes.data_product_criticality @data_product_criticality.setter - def data_product_criticality( - self, data_product_criticality: Optional[DataProductCriticality] - ): + def data_product_criticality(self, data_product_criticality: Optional[DataProductCriticality]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_product_criticality = data_product_criticality @@ -310,16 +270,10 @@ def daap_criticality(self, daap_criticality: Optional[DataProductCriticality]): @property def data_product_sensitivity(self) -> Optional[DataProductSensitivity]: - return ( - None - if self.attributes is None - else self.attributes.data_product_sensitivity - ) + return None if self.attributes is None else self.attributes.data_product_sensitivity @data_product_sensitivity.setter - def data_product_sensitivity( - self, data_product_sensitivity: Optional[DataProductSensitivity] - ): + def data_product_sensitivity(self, data_product_sensitivity: Optional[DataProductSensitivity]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_product_sensitivity = data_product_sensitivity @@ -336,14 +290,10 @@ def daap_sensitivity(self, daap_sensitivity: Optional[DataProductSensitivity]): @property def data_product_visibility(self) -> Optional[DataProductVisibility]: - return ( - None if self.attributes is None else self.attributes.data_product_visibility - ) + return None if self.attributes is None else self.attributes.data_product_visibility @data_product_visibility.setter - def data_product_visibility( - self, data_product_visibility: Optional[DataProductVisibility] - ): + def data_product_visibility(self, data_product_visibility: Optional[DataProductVisibility]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_product_visibility = data_product_visibility @@ -360,11 +310,7 @@ def daap_visibility(self, daap_visibility: Optional[DataProductVisibility]): @property def data_product_assets_d_s_l(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.data_product_assets_d_s_l - ) + return None if self.attributes is None else self.attributes.data_product_assets_d_s_l @data_product_assets_d_s_l.setter def data_product_assets_d_s_l(self, data_product_assets_d_s_l: Optional[str]): @@ -374,29 +320,17 @@ def data_product_assets_d_s_l(self, data_product_assets_d_s_l: Optional[str]): @property def data_product_assets_playbook_filter(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.data_product_assets_playbook_filter - ) + return None if self.attributes is None else self.attributes.data_product_assets_playbook_filter @data_product_assets_playbook_filter.setter - def data_product_assets_playbook_filter( - self, data_product_assets_playbook_filter: Optional[str] - ): + def data_product_assets_playbook_filter(self, data_product_assets_playbook_filter: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.data_product_assets_playbook_filter = ( - data_product_assets_playbook_filter - ) + self.attributes.data_product_assets_playbook_filter = data_product_assets_playbook_filter @property def data_product_score_value(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.data_product_score_value - ) + return None if self.attributes is None else self.attributes.data_product_score_value @data_product_score_value.setter def data_product_score_value(self, data_product_score_value: Optional[float]): @@ -406,25 +340,17 @@ def data_product_score_value(self, data_product_score_value: Optional[float]): @property def data_product_score_updated_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.data_product_score_updated_at - ) + return None if self.attributes is None else self.attributes.data_product_score_updated_at @data_product_score_updated_at.setter - def data_product_score_updated_at( - self, data_product_score_updated_at: Optional[datetime] - ): + def data_product_score_updated_at(self, data_product_score_updated_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_product_score_updated_at = data_product_score_updated_at @property def daap_visibility_users(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.daap_visibility_users - ) + return None if self.attributes is None else self.attributes.daap_visibility_users @daap_visibility_users.setter def daap_visibility_users(self, daap_visibility_users: Optional[Set[str]]): @@ -434,9 +360,7 @@ def daap_visibility_users(self, daap_visibility_users: Optional[Set[str]]): @property def daap_visibility_groups(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.daap_visibility_groups - ) + return None if self.attributes is None else self.attributes.daap_visibility_groups @daap_visibility_groups.setter def daap_visibility_groups(self, daap_visibility_groups: Optional[Set[str]]): @@ -446,9 +370,7 @@ def daap_visibility_groups(self, daap_visibility_groups: Optional[Set[str]]): @property def daap_output_port_guids(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.daap_output_port_guids - ) + return None if self.attributes is None else self.attributes.daap_output_port_guids @daap_output_port_guids.setter def daap_output_port_guids(self, daap_output_port_guids: Optional[Set[str]]): @@ -458,9 +380,7 @@ def daap_output_port_guids(self, daap_output_port_guids: Optional[Set[str]]): @property def daap_input_port_guids(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.daap_input_port_guids - ) + return None if self.attributes is None else self.attributes.daap_input_port_guids @daap_input_port_guids.setter def daap_input_port_guids(self, daap_input_port_guids: Optional[Set[str]]): @@ -499,49 +419,25 @@ def input_ports(self, input_ports: Optional[List[Asset]]): self.attributes.input_ports = input_ports class Attributes(DataMesh.Attributes): - data_product_status: Optional[DataProductStatus] = Field( - default=None, description="" - ) + data_product_status: Optional[DataProductStatus] = Field(default=None, description="") daap_status: Optional[DataProductStatus] = Field(default=None, description="") - data_product_criticality: Optional[DataProductCriticality] = Field( - default=None, description="" - ) - daap_criticality: Optional[DataProductCriticality] = Field( - default=None, description="" - ) - data_product_sensitivity: Optional[DataProductSensitivity] = Field( - default=None, description="" - ) - daap_sensitivity: Optional[DataProductSensitivity] = Field( - default=None, description="" - ) - data_product_visibility: Optional[DataProductVisibility] = Field( - default=None, description="" - ) - daap_visibility: Optional[DataProductVisibility] = Field( - default=None, description="" - ) + data_product_criticality: Optional[DataProductCriticality] = Field(default=None, description="") + daap_criticality: Optional[DataProductCriticality] = Field(default=None, description="") + data_product_sensitivity: Optional[DataProductSensitivity] = Field(default=None, description="") + daap_sensitivity: Optional[DataProductSensitivity] = Field(default=None, description="") + data_product_visibility: Optional[DataProductVisibility] = Field(default=None, description="") + daap_visibility: Optional[DataProductVisibility] = Field(default=None, description="") data_product_assets_d_s_l: Optional[str] = Field(default=None, description="") - data_product_assets_playbook_filter: Optional[str] = Field( - default=None, description="" - ) + data_product_assets_playbook_filter: Optional[str] = Field(default=None, description="") data_product_score_value: Optional[float] = Field(default=None, description="") - data_product_score_updated_at: Optional[datetime] = Field( - default=None, description="" - ) + data_product_score_updated_at: Optional[datetime] = Field(default=None, description="") daap_visibility_users: Optional[Set[str]] = Field(default=None, description="") daap_visibility_groups: Optional[Set[str]] = Field(default=None, description="") daap_output_port_guids: Optional[Set[str]] = Field(default=None, description="") daap_input_port_guids: Optional[Set[str]] = Field(default=None, description="") - output_ports: Optional[List[Asset]] = Field( - default=None, description="" - ) # relationship - data_domain: Optional[DataDomain] = Field( - default=None, description="" - ) # relationship - input_ports: Optional[List[Asset]] = Field( - default=None, description="" - ) # relationship + output_ports: Optional[List[Asset]] = Field(default=None, description="") # relationship + data_domain: Optional[DataDomain] = Field(default=None, description="") # relationship + input_ports: Optional[List[Asset]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -556,21 +452,15 @@ def create( ["name", "domain_qualified_name", "asset_selection"], [name, domain_qualified_name, asset_selection], ) - ASSETS_PLAYBOOK_FILTER = ( - '{"condition":"AND","isGroupLocked":false,"rules":[]}' - ) + ASSETS_PLAYBOOK_FILTER = '{"condition":"AND","isGroupLocked":false,"rules":[]}' return DataProduct.Attributes( name=name, - data_product_assets_d_s_l=DataProductsAssetsDSL.get_asset_selection( - asset_selection - ), + data_product_assets_d_s_l=DataProductsAssetsDSL.get_asset_selection(asset_selection), data_domain=DataDomain.ref_by_qualified_name(domain_qualified_name), qualified_name=f"{domain_qualified_name}/product/{name}", data_product_assets_playbook_filter=ASSETS_PLAYBOOK_FILTER, parent_domain_qualified_name=domain_qualified_name, - super_domain_qualified_name=DataMesh.get_super_domain_qualified_name( - domain_qualified_name - ), + super_domain_qualified_name=DataMesh.get_super_domain_qualified_name(domain_qualified_name), daap_status=DataProductStatus.ACTIVE, ) diff --git a/pyatlan/model/assets/core/database.py b/pyatlan/model/assets/core/database.py index 1850fea47..9f6e26171 100644 --- a/pyatlan/model/assets/core/database.py +++ b/pyatlan/model/assets/core/database.py @@ -22,16 +22,12 @@ class Database(SQL): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> Database: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) attributes = Database.Attributes( name=name, connection_qualified_name=connection_qualified_name, qualified_name=f"{connection_qualified_name}/{name}", - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) return cls(attributes=attributes) @@ -39,16 +35,11 @@ def creator(cls, *, name: str, connection_qualified_name: str) -> Database: @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> Database: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + return cls.creator(name=name, connection_qualified_name=connection_qualified_name) type_name: str = Field(default="Database", allow_mutation=False) @@ -100,25 +91,17 @@ def schemas(self, schemas: Optional[List[Schema]]): class Attributes(SQL.Attributes): schema_count: Optional[int] = Field(default=None, description="") - schemas: Optional[List[Schema]] = Field( - default=None, description="" - ) # relationship + schemas: Optional[List[Schema]] = Field(default=None, description="") # relationship @classmethod @init_guid - def create( - cls, name: str, connection_qualified_name: str - ) -> Database.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + def create(cls, name: str, connection_qualified_name: str) -> Database.Attributes: + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return Database.Attributes( name=name, connection_qualified_name=connection_qualified_name, qualified_name=f"{connection_qualified_name}/{name}", - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: Database.Attributes = Field( diff --git a/pyatlan/model/assets/core/databricks_unity_catalog_tag.py b/pyatlan/model/assets/core/databricks_unity_catalog_tag.py index bd9428f81..a0ac1a7c3 100644 --- a/pyatlan/model/assets/core/databricks_unity_catalog_tag.py +++ b/pyatlan/model/assets/core/databricks_unity_catalog_tag.py @@ -41,9 +41,7 @@ def __setattr__(self, name, value): """ Unique identifier of the tag in the source system. """ - TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( - "tagAttributes", "tagAttributes" - ) + TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("tagAttributes", "tagAttributes") """ Attributes associated with the tag in the source system. """ @@ -63,69 +61,47 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( - "queryUserCount", "queryUserCount" - ) + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( - "queryUserMap", "queryUserMap" - ) + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( - "queryCountUpdatedAt", "queryCountUpdatedAt" - ) + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "databaseName", "databaseName.keyword", "databaseName" - ) + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "databaseQualifiedName", "databaseQualifiedName" - ) + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "schemaName", "schemaName.keyword", "schemaName" - ) + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "schemaQualifiedName", "schemaQualifiedName" - ) + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "tableName", "tableName.keyword", "tableName" - ) + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "tableQualifiedName", "tableQualifiedName" - ) + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "viewName", "viewName.keyword", "viewName" - ) + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "viewQualifiedName", "viewQualifiedName" - ) + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -145,9 +121,7 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( - "lastProfiledAt", "lastProfiledAt" - ) + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -233,9 +207,7 @@ def tag_allowed_values(self, tag_allowed_values: Optional[Set[str]]): @property def mapped_atlan_tag_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.mapped_atlan_tag_name - ) + return None if self.attributes is None else self.attributes.mapped_atlan_tag_name @mapped_atlan_tag_name.setter def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): @@ -275,9 +247,7 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.query_count_updated_at - ) + return None if self.attributes is None else self.attributes.query_count_updated_at @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -297,9 +267,7 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.database_qualified_name - ) + return None if self.attributes is None else self.attributes.database_qualified_name @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -319,9 +287,7 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.schema_qualified_name - ) + return None if self.attributes is None else self.attributes.schema_qualified_name @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -371,9 +337,7 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.calculation_view_name - ) + return None if self.attributes is None else self.attributes.calculation_view_name @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -383,21 +347,13 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_qualified_name - ) + return None if self.attributes is None else self.attributes.calculation_view_qualified_name @calculation_view_qualified_name.setter - def calculation_view_qualified_name( - self, calculation_view_qualified_name: Optional[str] - ): + def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = ( - calculation_view_qualified_name - ) + self.attributes.calculation_view_qualified_name = calculation_view_qualified_name @property def is_profiled(self) -> Optional[bool]: @@ -471,9 +427,7 @@ def dbt_models(self, dbt_models: Optional[List[DbtModel]]): class Attributes(Tag.Attributes): tag_id: Optional[str] = Field(default=None, description="") - tag_attributes: Optional[List[SourceTagAttribute]] = Field( - default=None, description="" - ) + tag_attributes: Optional[List[SourceTagAttribute]] = Field(default=None, description="") tag_allowed_values: Optional[Set[str]] = Field(default=None, description="") mapped_atlan_tag_name: Optional[str] = Field(default=None, description="") query_count: Optional[int] = Field(default=None, description="") @@ -489,26 +443,14 @@ class Attributes(Tag.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field( - default=None, description="" - ) + calculation_view_qualified_name: Optional[str] = Field(default=None, description="") is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship - dbt_tests: Optional[List[DbtTest]] = Field( - default=None, description="" - ) # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship + dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship attributes: DatabricksUnityCatalogTag.Attributes = Field( default_factory=lambda: DatabricksUnityCatalogTag.Attributes(), diff --git a/pyatlan/model/assets/core/dbt.py b/pyatlan/model/assets/core/dbt.py index 4f2b02d63..f3e5ad539 100644 --- a/pyatlan/model/assets/core/dbt.py +++ b/pyatlan/model/assets/core/dbt.py @@ -36,9 +36,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField( - "dbtAlias", "dbtAlias.keyword", "dbtAlias" - ) + DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField("dbtAlias", "dbtAlias.keyword", "dbtAlias") """ """ @@ -46,9 +44,7 @@ def __setattr__(self, name, value): """ """ - DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField( - "dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId" - ) + DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField("dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId") """ """ @@ -70,21 +66,15 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "dbtJobName", "dbtJobName.keyword", "dbtJobName" - ) + DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField("dbtJobName", "dbtJobName.keyword", "dbtJobName") """ """ - DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField( - "dbtJobSchedule", "dbtJobSchedule" - ) + DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField("dbtJobSchedule", "dbtJobSchedule") """ """ - DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( - "dbtJobStatus", "dbtJobStatus" - ) + DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtJobStatus", "dbtJobStatus") """ """ @@ -96,15 +86,11 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( - "dbtJobLastRun", "dbtJobLastRun" - ) + DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("dbtJobLastRun", "dbtJobLastRun") """ """ - DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( - "dbtJobNextRun", "dbtJobNextRun" - ) + DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("dbtJobNextRun", "dbtJobNextRun") """ """ @@ -134,9 +120,7 @@ def __setattr__(self, name, value): """ """ - DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField( - "dbtConnectionContext", "dbtConnectionContext" - ) + DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField("dbtConnectionContext", "dbtConnectionContext") """ """ @@ -265,21 +249,13 @@ def dbt_job_status(self, dbt_job_status: Optional[str]): @property def dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_job_schedule_cron_humanized - ) + return None if self.attributes is None else self.attributes.dbt_job_schedule_cron_humanized @dbt_job_schedule_cron_humanized.setter - def dbt_job_schedule_cron_humanized( - self, dbt_job_schedule_cron_humanized: Optional[str] - ): + def dbt_job_schedule_cron_humanized(self, dbt_job_schedule_cron_humanized: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dbt_job_schedule_cron_humanized = ( - dbt_job_schedule_cron_humanized - ) + self.attributes.dbt_job_schedule_cron_humanized = dbt_job_schedule_cron_humanized @property def dbt_job_last_run(self) -> Optional[datetime]: @@ -303,11 +279,7 @@ def dbt_job_next_run(self, dbt_job_next_run: Optional[datetime]): @property def dbt_job_next_run_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_job_next_run_humanized - ) + return None if self.attributes is None else self.attributes.dbt_job_next_run_humanized @dbt_job_next_run_humanized.setter def dbt_job_next_run_humanized(self, dbt_job_next_run_humanized: Optional[str]): @@ -327,11 +299,7 @@ def dbt_environment_name(self, dbt_environment_name: Optional[str]): @property def dbt_environment_dbt_version(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_environment_dbt_version - ) + return None if self.attributes is None else self.attributes.dbt_environment_dbt_version @dbt_environment_dbt_version.setter def dbt_environment_dbt_version(self, dbt_environment_dbt_version: Optional[str]): @@ -351,9 +319,7 @@ def dbt_tags(self, dbt_tags: Optional[Set[str]]): @property def dbt_connection_context(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dbt_connection_context - ) + return None if self.attributes is None else self.attributes.dbt_connection_context @dbt_connection_context.setter def dbt_connection_context(self, dbt_connection_context: Optional[str]): @@ -363,11 +329,7 @@ def dbt_connection_context(self, dbt_connection_context: Optional[str]): @property def dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_semantic_layer_proxy_url - ) + return None if self.attributes is None else self.attributes.dbt_semantic_layer_proxy_url @dbt_semantic_layer_proxy_url.setter def dbt_semantic_layer_proxy_url(self, dbt_semantic_layer_proxy_url: Optional[str]): @@ -395,9 +357,7 @@ class Attributes(Catalog.Attributes): dbt_job_name: Optional[str] = Field(default=None, description="") dbt_job_schedule: Optional[str] = Field(default=None, description="") dbt_job_status: Optional[str] = Field(default=None, description="") - dbt_job_schedule_cron_humanized: Optional[str] = Field( - default=None, description="" - ) + dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") dbt_job_last_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") @@ -405,9 +365,7 @@ class Attributes(Catalog.Attributes): dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") dbt_tags: Optional[Set[str]] = Field(default=None, description="") dbt_connection_context: Optional[str] = Field(default=None, description="") - dbt_semantic_layer_proxy_url: Optional[str] = Field( - default=None, description="" - ) + dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") dbt_job_runs: Optional[List[DbtJobRun]] = Field(default=None, description="") attributes: Dbt.Attributes = Field( diff --git a/pyatlan/model/assets/core/dbt_metric.py b/pyatlan/model/assets/core/dbt_metric.py index 49a22b866..25399ac68 100644 --- a/pyatlan/model/assets/core/dbt_metric.py +++ b/pyatlan/model/assets/core/dbt_metric.py @@ -37,15 +37,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DBT_METRIC_FILTERS: ClassVar[KeywordField] = KeywordField( - "dbtMetricFilters", "dbtMetricFilters" - ) + DBT_METRIC_FILTERS: ClassVar[KeywordField] = KeywordField("dbtMetricFilters", "dbtMetricFilters") """ """ - DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField( - "dbtAlias", "dbtAlias.keyword", "dbtAlias" - ) + DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField("dbtAlias", "dbtAlias.keyword", "dbtAlias") """ """ @@ -53,9 +49,7 @@ def __setattr__(self, name, value): """ """ - DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField( - "dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId" - ) + DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField("dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId") """ """ @@ -77,21 +71,15 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "dbtJobName", "dbtJobName.keyword", "dbtJobName" - ) + DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField("dbtJobName", "dbtJobName.keyword", "dbtJobName") """ """ - DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField( - "dbtJobSchedule", "dbtJobSchedule" - ) + DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField("dbtJobSchedule", "dbtJobSchedule") """ """ - DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( - "dbtJobStatus", "dbtJobStatus" - ) + DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtJobStatus", "dbtJobStatus") """ """ @@ -103,15 +91,11 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( - "dbtJobLastRun", "dbtJobLastRun" - ) + DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("dbtJobLastRun", "dbtJobLastRun") """ """ - DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( - "dbtJobNextRun", "dbtJobNextRun" - ) + DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("dbtJobNextRun", "dbtJobNextRun") """ """ @@ -141,9 +125,7 @@ def __setattr__(self, name, value): """ """ - DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField( - "dbtConnectionContext", "dbtConnectionContext" - ) + DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField("dbtConnectionContext", "dbtConnectionContext") """ """ @@ -169,16 +151,12 @@ def __setattr__(self, name, value): """ Filters to be applied to the metric query. """ - METRIC_TIME_GRAINS: ClassVar[TextField] = TextField( - "metricTimeGrains", "metricTimeGrains" - ) + METRIC_TIME_GRAINS: ClassVar[TextField] = TextField("metricTimeGrains", "metricTimeGrains") """ List of time grains to be applied to the metric query. """ - METRIC_TIMESTAMP_COLUMN: ClassVar[RelationField] = RelationField( - "metricTimestampColumn" - ) + METRIC_TIMESTAMP_COLUMN: ClassVar[RelationField] = RelationField("metricTimestampColumn") """ TBC """ @@ -190,15 +168,11 @@ def __setattr__(self, name, value): """ TBC """ - METRIC_DIMENSION_COLUMNS: ClassVar[RelationField] = RelationField( - "metricDimensionColumns" - ) + METRIC_DIMENSION_COLUMNS: ClassVar[RelationField] = RelationField("metricDimensionColumns") """ TBC """ - DBT_METRIC_FILTER_COLUMNS: ClassVar[RelationField] = RelationField( - "dbtMetricFilterColumns" - ) + DBT_METRIC_FILTER_COLUMNS: ClassVar[RelationField] = RelationField("dbtMetricFilterColumns") """ TBC """ @@ -337,21 +311,13 @@ def dbt_job_status(self, dbt_job_status: Optional[str]): @property def dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_job_schedule_cron_humanized - ) + return None if self.attributes is None else self.attributes.dbt_job_schedule_cron_humanized @dbt_job_schedule_cron_humanized.setter - def dbt_job_schedule_cron_humanized( - self, dbt_job_schedule_cron_humanized: Optional[str] - ): + def dbt_job_schedule_cron_humanized(self, dbt_job_schedule_cron_humanized: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dbt_job_schedule_cron_humanized = ( - dbt_job_schedule_cron_humanized - ) + self.attributes.dbt_job_schedule_cron_humanized = dbt_job_schedule_cron_humanized @property def dbt_job_last_run(self) -> Optional[datetime]: @@ -375,11 +341,7 @@ def dbt_job_next_run(self, dbt_job_next_run: Optional[datetime]): @property def dbt_job_next_run_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_job_next_run_humanized - ) + return None if self.attributes is None else self.attributes.dbt_job_next_run_humanized @dbt_job_next_run_humanized.setter def dbt_job_next_run_humanized(self, dbt_job_next_run_humanized: Optional[str]): @@ -399,11 +361,7 @@ def dbt_environment_name(self, dbt_environment_name: Optional[str]): @property def dbt_environment_dbt_version(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_environment_dbt_version - ) + return None if self.attributes is None else self.attributes.dbt_environment_dbt_version @dbt_environment_dbt_version.setter def dbt_environment_dbt_version(self, dbt_environment_dbt_version: Optional[str]): @@ -423,9 +381,7 @@ def dbt_tags(self, dbt_tags: Optional[Set[str]]): @property def dbt_connection_context(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dbt_connection_context - ) + return None if self.attributes is None else self.attributes.dbt_connection_context @dbt_connection_context.setter def dbt_connection_context(self, dbt_connection_context: Optional[str]): @@ -435,11 +391,7 @@ def dbt_connection_context(self, dbt_connection_context: Optional[str]): @property def dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_semantic_layer_proxy_url - ) + return None if self.attributes is None else self.attributes.dbt_semantic_layer_proxy_url @dbt_semantic_layer_proxy_url.setter def dbt_semantic_layer_proxy_url(self, dbt_semantic_layer_proxy_url: Optional[str]): @@ -499,9 +451,7 @@ def metric_time_grains(self, metric_time_grains: Optional[Set[str]]): @property def metric_timestamp_column(self) -> Optional[Column]: - return ( - None if self.attributes is None else self.attributes.metric_timestamp_column - ) + return None if self.attributes is None else self.attributes.metric_timestamp_column @metric_timestamp_column.setter def metric_timestamp_column(self, metric_timestamp_column: Optional[Column]): @@ -531,40 +481,26 @@ def dbt_model(self, dbt_model: Optional[DbtModel]): @property def metric_dimension_columns(self) -> Optional[List[Column]]: - return ( - None - if self.attributes is None - else self.attributes.metric_dimension_columns - ) + return None if self.attributes is None else self.attributes.metric_dimension_columns @metric_dimension_columns.setter - def metric_dimension_columns( - self, metric_dimension_columns: Optional[List[Column]] - ): + def metric_dimension_columns(self, metric_dimension_columns: Optional[List[Column]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.metric_dimension_columns = metric_dimension_columns @property def dbt_metric_filter_columns(self) -> Optional[List[Column]]: - return ( - None - if self.attributes is None - else self.attributes.dbt_metric_filter_columns - ) + return None if self.attributes is None else self.attributes.dbt_metric_filter_columns @dbt_metric_filter_columns.setter - def dbt_metric_filter_columns( - self, dbt_metric_filter_columns: Optional[List[Column]] - ): + def dbt_metric_filter_columns(self, dbt_metric_filter_columns: Optional[List[Column]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_metric_filter_columns = dbt_metric_filter_columns class Attributes(Dbt.Attributes): - dbt_metric_filters: Optional[List[DbtMetricFilter]] = Field( - default=None, description="" - ) + dbt_metric_filters: Optional[List[DbtMetricFilter]] = Field(default=None, description="") dbt_alias: Optional[str] = Field(default=None, description="") dbt_meta: Optional[str] = Field(default=None, description="") dbt_unique_id: Optional[str] = Field(default=None, description="") @@ -574,9 +510,7 @@ class Attributes(Dbt.Attributes): dbt_job_name: Optional[str] = Field(default=None, description="") dbt_job_schedule: Optional[str] = Field(default=None, description="") dbt_job_status: Optional[str] = Field(default=None, description="") - dbt_job_schedule_cron_humanized: Optional[str] = Field( - default=None, description="" - ) + dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") dbt_job_last_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") @@ -584,29 +518,17 @@ class Attributes(Dbt.Attributes): dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") dbt_tags: Optional[Set[str]] = Field(default=None, description="") dbt_connection_context: Optional[str] = Field(default=None, description="") - dbt_semantic_layer_proxy_url: Optional[str] = Field( - default=None, description="" - ) + dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") dbt_job_runs: Optional[List[DbtJobRun]] = Field(default=None, description="") metric_type: Optional[str] = Field(default=None, description="") metric_s_q_l: Optional[str] = Field(default=None, description="") metric_filters: Optional[str] = Field(default=None, description="") metric_time_grains: Optional[Set[str]] = Field(default=None, description="") - metric_timestamp_column: Optional[Column] = Field( - default=None, description="" - ) # relationship - assets: Optional[List[Asset]] = Field( - default=None, description="" - ) # relationship - dbt_model: Optional[DbtModel] = Field( - default=None, description="" - ) # relationship - metric_dimension_columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship - dbt_metric_filter_columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship + metric_timestamp_column: Optional[Column] = Field(default=None, description="") # relationship + assets: Optional[List[Asset]] = Field(default=None, description="") # relationship + dbt_model: Optional[DbtModel] = Field(default=None, description="") # relationship + metric_dimension_columns: Optional[List[Column]] = Field(default=None, description="") # relationship + dbt_metric_filter_columns: Optional[List[Column]] = Field(default=None, description="") # relationship attributes: DbtMetric.Attributes = Field( default_factory=lambda: DbtMetric.Attributes(), diff --git a/pyatlan/model/assets/core/dbt_model.py b/pyatlan/model/assets/core/dbt_model.py index db0c50b03..5b7d6a619 100644 --- a/pyatlan/model/assets/core/dbt_model.py +++ b/pyatlan/model/assets/core/dbt_model.py @@ -47,9 +47,7 @@ def __setattr__(self, name, value): """ """ - DBT_COMPILED_SQL: ClassVar[TextField] = TextField( - "dbtCompiledSQL", "dbtCompiledSQL" - ) + DBT_COMPILED_SQL: ClassVar[TextField] = TextField("dbtCompiledSQL", "dbtCompiledSQL") """ """ @@ -57,9 +55,7 @@ def __setattr__(self, name, value): """ """ - DBT_MATERIALIZATION_TYPE: ClassVar[TextField] = TextField( - "dbtMaterializationType", "dbtMaterializationType" - ) + DBT_MATERIALIZATION_TYPE: ClassVar[TextField] = TextField("dbtMaterializationType", "dbtMaterializationType") """ """ @@ -87,9 +83,7 @@ def __setattr__(self, name, value): """ """ - DBT_MODEL_EXECUTION_TIME: ClassVar[NumericField] = NumericField( - "dbtModelExecutionTime", "dbtModelExecutionTime" - ) + DBT_MODEL_EXECUTION_TIME: ClassVar[NumericField] = NumericField("dbtModelExecutionTime", "dbtModelExecutionTime") """ """ @@ -200,11 +194,7 @@ def dbt_stats(self, dbt_stats: Optional[str]): @property def dbt_materialization_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_materialization_type - ) + return None if self.attributes is None else self.attributes.dbt_materialization_type @dbt_materialization_type.setter def dbt_materialization_type(self, dbt_materialization_type: Optional[str]): @@ -214,75 +204,47 @@ def dbt_materialization_type(self, dbt_materialization_type: Optional[str]): @property def dbt_model_compile_started_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.dbt_model_compile_started_at - ) + return None if self.attributes is None else self.attributes.dbt_model_compile_started_at @dbt_model_compile_started_at.setter - def dbt_model_compile_started_at( - self, dbt_model_compile_started_at: Optional[datetime] - ): + def dbt_model_compile_started_at(self, dbt_model_compile_started_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_compile_started_at = dbt_model_compile_started_at @property def dbt_model_compile_completed_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.dbt_model_compile_completed_at - ) + return None if self.attributes is None else self.attributes.dbt_model_compile_completed_at @dbt_model_compile_completed_at.setter - def dbt_model_compile_completed_at( - self, dbt_model_compile_completed_at: Optional[datetime] - ): + def dbt_model_compile_completed_at(self, dbt_model_compile_completed_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_compile_completed_at = dbt_model_compile_completed_at @property def dbt_model_execute_started_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.dbt_model_execute_started_at - ) + return None if self.attributes is None else self.attributes.dbt_model_execute_started_at @dbt_model_execute_started_at.setter - def dbt_model_execute_started_at( - self, dbt_model_execute_started_at: Optional[datetime] - ): + def dbt_model_execute_started_at(self, dbt_model_execute_started_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_execute_started_at = dbt_model_execute_started_at @property def dbt_model_execute_completed_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.dbt_model_execute_completed_at - ) + return None if self.attributes is None else self.attributes.dbt_model_execute_completed_at @dbt_model_execute_completed_at.setter - def dbt_model_execute_completed_at( - self, dbt_model_execute_completed_at: Optional[datetime] - ): + def dbt_model_execute_completed_at(self, dbt_model_execute_completed_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_execute_completed_at = dbt_model_execute_completed_at @property def dbt_model_execution_time(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.dbt_model_execution_time - ) + return None if self.attributes is None else self.attributes.dbt_model_execution_time @dbt_model_execution_time.setter def dbt_model_execution_time(self, dbt_model_execution_time: Optional[float]): @@ -292,27 +254,17 @@ def dbt_model_execution_time(self, dbt_model_execution_time: Optional[float]): @property def dbt_model_run_generated_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.dbt_model_run_generated_at - ) + return None if self.attributes is None else self.attributes.dbt_model_run_generated_at @dbt_model_run_generated_at.setter - def dbt_model_run_generated_at( - self, dbt_model_run_generated_at: Optional[datetime] - ): + def dbt_model_run_generated_at(self, dbt_model_run_generated_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_run_generated_at = dbt_model_run_generated_at @property def dbt_model_run_elapsed_time(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.dbt_model_run_elapsed_time - ) + return None if self.attributes is None else self.attributes.dbt_model_run_elapsed_time @dbt_model_run_elapsed_time.setter def dbt_model_run_elapsed_time(self, dbt_model_run_elapsed_time: Optional[float]): @@ -377,38 +329,18 @@ class Attributes(Dbt.Attributes): dbt_compiled_s_q_l: Optional[str] = Field(default=None, description="") dbt_stats: Optional[str] = Field(default=None, description="") dbt_materialization_type: Optional[str] = Field(default=None, description="") - dbt_model_compile_started_at: Optional[datetime] = Field( - default=None, description="" - ) - dbt_model_compile_completed_at: Optional[datetime] = Field( - default=None, description="" - ) - dbt_model_execute_started_at: Optional[datetime] = Field( - default=None, description="" - ) - dbt_model_execute_completed_at: Optional[datetime] = Field( - default=None, description="" - ) + dbt_model_compile_started_at: Optional[datetime] = Field(default=None, description="") + dbt_model_compile_completed_at: Optional[datetime] = Field(default=None, description="") + dbt_model_execute_started_at: Optional[datetime] = Field(default=None, description="") + dbt_model_execute_completed_at: Optional[datetime] = Field(default=None, description="") dbt_model_execution_time: Optional[float] = Field(default=None, description="") - dbt_model_run_generated_at: Optional[datetime] = Field( - default=None, description="" - ) - dbt_model_run_elapsed_time: Optional[float] = Field( - default=None, description="" - ) - dbt_tests: Optional[List[DbtTest]] = Field( - default=None, description="" - ) # relationship - dbt_model_columns: Optional[List[DbtModelColumn]] = Field( - default=None, description="" - ) # relationship + dbt_model_run_generated_at: Optional[datetime] = Field(default=None, description="") + dbt_model_run_elapsed_time: Optional[float] = Field(default=None, description="") + dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship + dbt_model_columns: Optional[List[DbtModelColumn]] = Field(default=None, description="") # relationship sql_asset: Optional[SQL] = Field(default=None, description="") # relationship - dbt_metrics: Optional[List[DbtMetric]] = Field( - default=None, description="" - ) # relationship - dbt_model_sql_assets: Optional[List[SQL]] = Field( - default=None, description="" - ) # relationship + dbt_metrics: Optional[List[DbtMetric]] = Field(default=None, description="") # relationship + dbt_model_sql_assets: Optional[List[SQL]] = Field(default=None, description="") # relationship attributes: DbtModel.Attributes = Field( default_factory=lambda: DbtModel.Attributes(), diff --git a/pyatlan/model/assets/core/dbt_model_column.py b/pyatlan/model/assets/core/dbt_model_column.py index 8383bc199..55dbd0948 100644 --- a/pyatlan/model/assets/core/dbt_model_column.py +++ b/pyatlan/model/assets/core/dbt_model_column.py @@ -46,9 +46,7 @@ def __setattr__(self, name, value): """ """ - DBT_MODEL_COLUMN_ORDER: ClassVar[NumericField] = NumericField( - "dbtModelColumnOrder", "dbtModelColumnOrder" - ) + DBT_MODEL_COLUMN_ORDER: ClassVar[NumericField] = NumericField("dbtModelColumnOrder", "dbtModelColumnOrder") """ """ @@ -65,9 +63,7 @@ def __setattr__(self, name, value): """ TBC """ - DBT_MODEL_COLUMN_SQL_COLUMNS: ClassVar[RelationField] = RelationField( - "dbtModelColumnSqlColumns" - ) + DBT_MODEL_COLUMN_SQL_COLUMNS: ClassVar[RelationField] = RelationField("dbtModelColumnSqlColumns") """ TBC """ @@ -84,11 +80,7 @@ def __setattr__(self, name, value): @property def dbt_model_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_model_qualified_name - ) + return None if self.attributes is None else self.attributes.dbt_model_qualified_name @dbt_model_qualified_name.setter def dbt_model_qualified_name(self, dbt_model_qualified_name: Optional[str]): @@ -98,11 +90,7 @@ def dbt_model_qualified_name(self, dbt_model_qualified_name: Optional[str]): @property def dbt_model_column_data_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_model_column_data_type - ) + return None if self.attributes is None else self.attributes.dbt_model_column_data_type @dbt_model_column_data_type.setter def dbt_model_column_data_type(self, dbt_model_column_data_type: Optional[str]): @@ -112,9 +100,7 @@ def dbt_model_column_data_type(self, dbt_model_column_data_type: Optional[str]): @property def dbt_model_column_order(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.dbt_model_column_order - ) + return None if self.attributes is None else self.attributes.dbt_model_column_order @dbt_model_column_order.setter def dbt_model_column_order(self, dbt_model_column_order: Optional[int]): @@ -154,16 +140,10 @@ def dbt_model(self, dbt_model: Optional[DbtModel]): @property def dbt_model_column_sql_columns(self) -> Optional[List[Column]]: - return ( - None - if self.attributes is None - else self.attributes.dbt_model_column_sql_columns - ) + return None if self.attributes is None else self.attributes.dbt_model_column_sql_columns @dbt_model_column_sql_columns.setter - def dbt_model_column_sql_columns( - self, dbt_model_column_sql_columns: Optional[List[Column]] - ): + def dbt_model_column_sql_columns(self, dbt_model_column_sql_columns: Optional[List[Column]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_column_sql_columns = dbt_model_column_sql_columns @@ -172,18 +152,10 @@ class Attributes(Dbt.Attributes): dbt_model_qualified_name: Optional[str] = Field(default=None, description="") dbt_model_column_data_type: Optional[str] = Field(default=None, description="") dbt_model_column_order: Optional[int] = Field(default=None, description="") - dbt_tests: Optional[List[DbtTest]] = Field( - default=None, description="" - ) # relationship - sql_column: Optional[Column] = Field( - default=None, description="" - ) # relationship - dbt_model: Optional[DbtModel] = Field( - default=None, description="" - ) # relationship - dbt_model_column_sql_columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship + dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship + sql_column: Optional[Column] = Field(default=None, description="") # relationship + dbt_model: Optional[DbtModel] = Field(default=None, description="") # relationship + dbt_model_column_sql_columns: Optional[List[Column]] = Field(default=None, description="") # relationship attributes: DbtModelColumn.Attributes = Field( default_factory=lambda: DbtModelColumn.Attributes(), diff --git a/pyatlan/model/assets/core/dbt_source.py b/pyatlan/model/assets/core/dbt_source.py index 09d01c3aa..024de19a6 100644 --- a/pyatlan/model/assets/core/dbt_source.py +++ b/pyatlan/model/assets/core/dbt_source.py @@ -33,9 +33,7 @@ def __setattr__(self, name, value): """ """ - DBT_FRESHNESS_CRITERIA: ClassVar[TextField] = TextField( - "dbtFreshnessCriteria", "dbtFreshnessCriteria" - ) + DBT_FRESHNESS_CRITERIA: ClassVar[TextField] = TextField("dbtFreshnessCriteria", "dbtFreshnessCriteria") """ """ @@ -73,9 +71,7 @@ def dbt_state(self, dbt_state: Optional[str]): @property def dbt_freshness_criteria(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dbt_freshness_criteria - ) + return None if self.attributes is None else self.attributes.dbt_freshness_criteria @dbt_freshness_criteria.setter def dbt_freshness_criteria(self, dbt_freshness_criteria: Optional[str]): @@ -116,12 +112,8 @@ def sql_asset(self, sql_asset: Optional[SQL]): class Attributes(Dbt.Attributes): dbt_state: Optional[str] = Field(default=None, description="") dbt_freshness_criteria: Optional[str] = Field(default=None, description="") - sql_assets: Optional[List[SQL]] = Field( - default=None, description="" - ) # relationship - dbt_tests: Optional[List[DbtTest]] = Field( - default=None, description="" - ) # relationship + sql_assets: Optional[List[SQL]] = Field(default=None, description="") # relationship + dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship sql_asset: Optional[SQL] = Field(default=None, description="") # relationship attributes: DbtSource.Attributes = Field( diff --git a/pyatlan/model/assets/core/dbt_test.py b/pyatlan/model/assets/core/dbt_test.py index fe3dee9b2..db81e2d15 100644 --- a/pyatlan/model/assets/core/dbt_test.py +++ b/pyatlan/model/assets/core/dbt_test.py @@ -29,15 +29,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DBT_TEST_STATUS: ClassVar[KeywordField] = KeywordField( - "dbtTestStatus", "dbtTestStatus" - ) + DBT_TEST_STATUS: ClassVar[KeywordField] = KeywordField("dbtTestStatus", "dbtTestStatus") """ Details of the results of the test. For errors, it reads "ERROR". """ - DBT_TEST_STATE: ClassVar[KeywordField] = KeywordField( - "dbtTestState", "dbtTestState" - ) + DBT_TEST_STATE: ClassVar[KeywordField] = KeywordField("dbtTestState", "dbtTestState") """ Test results. Can be one of, in order of severity, "error", "fail", "warn", "pass". """ @@ -45,33 +41,23 @@ def __setattr__(self, name, value): """ Error message in the case of state being "error". """ - DBT_TEST_RAW_SQL: ClassVar[TextField] = TextField( - "dbtTestRawSQL", "dbtTestRawSQL.text" - ) + DBT_TEST_RAW_SQL: ClassVar[TextField] = TextField("dbtTestRawSQL", "dbtTestRawSQL.text") """ Raw SQL of the test. """ - DBT_TEST_COMPILED_SQL: ClassVar[TextField] = TextField( - "dbtTestCompiledSQL", "dbtTestCompiledSQL" - ) + DBT_TEST_COMPILED_SQL: ClassVar[TextField] = TextField("dbtTestCompiledSQL", "dbtTestCompiledSQL") """ Compiled SQL of the test. """ - DBT_TEST_RAW_CODE: ClassVar[TextField] = TextField( - "dbtTestRawCode", "dbtTestRawCode.text" - ) + DBT_TEST_RAW_CODE: ClassVar[TextField] = TextField("dbtTestRawCode", "dbtTestRawCode.text") """ Raw code of the test (when the test is defined using Python). """ - DBT_TEST_COMPILED_CODE: ClassVar[TextField] = TextField( - "dbtTestCompiledCode", "dbtTestCompiledCode" - ) + DBT_TEST_COMPILED_CODE: ClassVar[TextField] = TextField("dbtTestCompiledCode", "dbtTestCompiledCode") """ Compiled code of the test (when the test is defined using Python). """ - DBT_TEST_LANGUAGE: ClassVar[TextField] = TextField( - "dbtTestLanguage", "dbtTestLanguage" - ) + DBT_TEST_LANGUAGE: ClassVar[TextField] = TextField("dbtTestLanguage", "dbtTestLanguage") """ Language in which the test is written, for example: SQL or Python. """ @@ -150,9 +136,7 @@ def dbt_test_raw_s_q_l(self, dbt_test_raw_s_q_l: Optional[str]): @property def dbt_test_compiled_s_q_l(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dbt_test_compiled_s_q_l - ) + return None if self.attributes is None else self.attributes.dbt_test_compiled_s_q_l @dbt_test_compiled_s_q_l.setter def dbt_test_compiled_s_q_l(self, dbt_test_compiled_s_q_l: Optional[str]): @@ -172,9 +156,7 @@ def dbt_test_raw_code(self, dbt_test_raw_code: Optional[str]): @property def dbt_test_compiled_code(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dbt_test_compiled_code - ) + return None if self.attributes is None else self.attributes.dbt_test_compiled_code @dbt_test_compiled_code.setter def dbt_test_compiled_code(self, dbt_test_compiled_code: Optional[str]): @@ -241,18 +223,10 @@ class Attributes(Dbt.Attributes): dbt_test_raw_code: Optional[str] = Field(default=None, description="") dbt_test_compiled_code: Optional[str] = Field(default=None, description="") dbt_test_language: Optional[str] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - sql_assets: Optional[List[SQL]] = Field( - default=None, description="" - ) # relationship - dbt_model_columns: Optional[List[DbtModelColumn]] = Field( - default=None, description="" - ) # relationship - dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship + dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + sql_assets: Optional[List[SQL]] = Field(default=None, description="") # relationship + dbt_model_columns: Optional[List[DbtModelColumn]] = Field(default=None, description="") # relationship + dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship attributes: DbtTest.Attributes = Field( default_factory=lambda: DbtTest.Attributes(), diff --git a/pyatlan/model/assets/core/dynamo_d_b_secondary_index.py b/pyatlan/model/assets/core/dynamo_d_b_secondary_index.py index bc577b1c8..2f3ceaf1e 100644 --- a/pyatlan/model/assets/core/dynamo_d_b_secondary_index.py +++ b/pyatlan/model/assets/core/dynamo_d_b_secondary_index.py @@ -67,51 +67,35 @@ def __setattr__(self, name, value): """ Whether this table is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( - "isQueryPreview", "isQueryPreview" - ) + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") """ Whether preview queries are allowed for this table (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( - "queryPreviewConfig", "queryPreviewConfig" - ) + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") """ Configuration for preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField( - "externalLocation", "externalLocation" - ) + EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") """ External location of this table, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( - "externalLocationRegion", "externalLocationRegion" - ) + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") """ Region of the external location of this table, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( - "externalLocationFormat", "externalLocationFormat" - ) + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") """ Format of the external location of this table, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( - "isPartitioned", "isPartitioned" - ) + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") """ Whether this table is partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( - "partitionStrategy", "partitionStrategy" - ) + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") """ Partition strategy for this table. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField( - "partitionCount", "partitionCount" - ) + PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") """ Number of partitions in this table. """ @@ -127,21 +111,15 @@ def __setattr__(self, name, value): """ Type of the table. """ - ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField( - "icebergCatalogName", "icebergCatalogName" - ) + ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField("icebergCatalogName", "icebergCatalogName") """ iceberg table catalog name (can be any user defined name) """ - ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField( - "icebergTableType", "icebergTableType" - ) + ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField("icebergTableType", "icebergTableType") """ iceberg table type (managed vs unmanaged) """ - ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField( - "icebergCatalogSource", "icebergCatalogSource" - ) + ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField("icebergCatalogSource", "icebergCatalogSource") """ iceberg table catalog type (glue, polaris, snowflake) """ @@ -169,9 +147,7 @@ def __setattr__(self, name, value): """ iceberg table base location inside the external volume. """ - TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField( - "tableRetentionTime", "tableRetentionTime" - ) + TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField("tableRetentionTime", "tableRetentionTime") """ Data retention time in days. """ @@ -179,69 +155,47 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( - "queryUserCount", "queryUserCount" - ) + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( - "queryUserMap", "queryUserMap" - ) + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( - "queryCountUpdatedAt", "queryCountUpdatedAt" - ) + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "databaseName", "databaseName.keyword", "databaseName" - ) + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "databaseQualifiedName", "databaseQualifiedName" - ) + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "schemaName", "schemaName.keyword", "schemaName" - ) + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "schemaQualifiedName", "schemaQualifiedName" - ) + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "tableName", "tableName.keyword", "tableName" - ) + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "tableQualifiedName", "tableQualifiedName" - ) + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "viewName", "viewName.keyword", "viewName" - ) + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "viewQualifiedName", "viewQualifiedName" - ) + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -261,27 +215,19 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( - "lastProfiledAt", "lastProfiledAt" - ) + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") """ Time (epoch) at which this asset was last profiled, in milliseconds. """ - DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField( - "dynamoDBStatus", "dynamoDBStatus" - ) + DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField("dynamoDBStatus", "dynamoDBStatus") """ Status of the DynamoDB Asset """ - DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField( - "dynamoDBPartitionKey", "dynamoDBPartitionKey" - ) + DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBPartitionKey", "dynamoDBPartitionKey") """ Specifies the partition key of the DynamoDB Table/Index """ - DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField( - "dynamoDBSortKey", "dynamoDBSortKey" - ) + DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBSortKey", "dynamoDBSortKey") """ Specifies the sort key of the DynamoDB Table/Index """ @@ -297,9 +243,7 @@ def __setattr__(self, name, value): """ The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( - "noSQLSchemaDefinition", "noSQLSchemaDefinition" - ) + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") """ Represents attributes for describing the key schema for the table and indexes. """ @@ -358,24 +302,16 @@ def __setattr__(self, name, value): def dynamo_d_b_secondary_index_projection_type( self, ) -> Optional[DynamoDBSecondaryIndexProjectionType]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_secondary_index_projection_type - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_secondary_index_projection_type @dynamo_d_b_secondary_index_projection_type.setter def dynamo_d_b_secondary_index_projection_type( self, - dynamo_d_b_secondary_index_projection_type: Optional[ - DynamoDBSecondaryIndexProjectionType - ], + dynamo_d_b_secondary_index_projection_type: Optional[DynamoDBSecondaryIndexProjectionType], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_secondary_index_projection_type = ( - dynamo_d_b_secondary_index_projection_type - ) + self.attributes.dynamo_d_b_secondary_index_projection_type = dynamo_d_b_secondary_index_projection_type @property def column_count(self) -> Optional[int]: @@ -459,11 +395,7 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_region - ) + return None if self.attributes is None else self.attributes.external_location_region @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -473,11 +405,7 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_format - ) + return None if self.attributes is None else self.attributes.external_location_format @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -567,9 +495,7 @@ def iceberg_table_type(self, iceberg_table_type: Optional[str]): @property def iceberg_catalog_source(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.iceberg_catalog_source - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_source @iceberg_catalog_source.setter def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @@ -579,11 +505,7 @@ def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @property def iceberg_catalog_table_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_catalog_table_name - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_table_name @iceberg_catalog_table_name.setter def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @@ -593,29 +515,17 @@ def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @property def iceberg_catalog_table_namespace(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_catalog_table_namespace - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_table_namespace @iceberg_catalog_table_namespace.setter - def iceberg_catalog_table_namespace( - self, iceberg_catalog_table_namespace: Optional[str] - ): + def iceberg_catalog_table_namespace(self, iceberg_catalog_table_namespace: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.iceberg_catalog_table_namespace = ( - iceberg_catalog_table_namespace - ) + self.attributes.iceberg_catalog_table_namespace = iceberg_catalog_table_namespace @property def table_external_volume_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.table_external_volume_name - ) + return None if self.attributes is None else self.attributes.table_external_volume_name @table_external_volume_name.setter def table_external_volume_name(self, table_external_volume_name: Optional[str]): @@ -625,11 +535,7 @@ def table_external_volume_name(self, table_external_volume_name: Optional[str]): @property def iceberg_table_base_location(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_table_base_location - ) + return None if self.attributes is None else self.attributes.iceberg_table_base_location @iceberg_table_base_location.setter def iceberg_table_base_location(self, iceberg_table_base_location: Optional[str]): @@ -679,9 +585,7 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.query_count_updated_at - ) + return None if self.attributes is None else self.attributes.query_count_updated_at @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -701,9 +605,7 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.database_qualified_name - ) + return None if self.attributes is None else self.attributes.database_qualified_name @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -723,9 +625,7 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.schema_qualified_name - ) + return None if self.attributes is None else self.attributes.schema_qualified_name @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -775,9 +675,7 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.calculation_view_name - ) + return None if self.attributes is None else self.attributes.calculation_view_name @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -787,21 +685,13 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_qualified_name - ) + return None if self.attributes is None else self.attributes.calculation_view_qualified_name @calculation_view_qualified_name.setter - def calculation_view_qualified_name( - self, calculation_view_qualified_name: Optional[str] - ): + def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = ( - calculation_view_qualified_name - ) + self.attributes.calculation_view_qualified_name = calculation_view_qualified_name @property def is_profiled(self) -> Optional[bool]: @@ -835,11 +725,7 @@ def dynamo_d_b_status(self, dynamo_d_b_status: Optional[DynamoDBStatus]): @property def dynamo_d_b_partition_key(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_partition_key - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_partition_key @dynamo_d_b_partition_key.setter def dynamo_d_b_partition_key(self, dynamo_d_b_partition_key: Optional[str]): @@ -859,45 +745,27 @@ def dynamo_d_b_sort_key(self, dynamo_d_b_sort_key: Optional[str]): @property def dynamo_d_b_read_capacity_units(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_read_capacity_units - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_read_capacity_units @dynamo_d_b_read_capacity_units.setter - def dynamo_d_b_read_capacity_units( - self, dynamo_d_b_read_capacity_units: Optional[int] - ): + def dynamo_d_b_read_capacity_units(self, dynamo_d_b_read_capacity_units: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dynamo_d_b_read_capacity_units = dynamo_d_b_read_capacity_units @property def dynamo_d_b_write_capacity_units(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_write_capacity_units - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_write_capacity_units @dynamo_d_b_write_capacity_units.setter - def dynamo_d_b_write_capacity_units( - self, dynamo_d_b_write_capacity_units: Optional[int] - ): + def dynamo_d_b_write_capacity_units(self, dynamo_d_b_write_capacity_units: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_write_capacity_units = ( - dynamo_d_b_write_capacity_units - ) + self.attributes.dynamo_d_b_write_capacity_units = dynamo_d_b_write_capacity_units @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.no_s_q_l_schema_definition - ) + return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -906,18 +774,16 @@ def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): self.attributes.no_s_q_l_schema_definition = no_s_q_l_schema_definition class Attributes(Table.Attributes): - dynamo_d_b_secondary_index_projection_type: Optional[ - DynamoDBSecondaryIndexProjectionType - ] = Field(default=None, description="") + dynamo_d_b_secondary_index_projection_type: Optional[DynamoDBSecondaryIndexProjectionType] = Field( + default=None, description="" + ) column_count: Optional[int] = Field(default=None, description="") row_count: Optional[int] = Field(default=None, description="") size_bytes: Optional[int] = Field(default=None, description="") alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -931,9 +797,7 @@ class Attributes(Table.Attributes): iceberg_table_type: Optional[str] = Field(default=None, description="") iceberg_catalog_source: Optional[str] = Field(default=None, description="") iceberg_catalog_table_name: Optional[str] = Field(default=None, description="") - iceberg_catalog_table_namespace: Optional[str] = Field( - default=None, description="" - ) + iceberg_catalog_table_namespace: Optional[str] = Field(default=None, description="") table_external_volume_name: Optional[str] = Field(default=None, description="") iceberg_table_base_location: Optional[str] = Field(default=None, description="") table_retention_time: Optional[int] = Field(default=None, description="") @@ -950,22 +814,14 @@ class Attributes(Table.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field( - default=None, description="" - ) + calculation_view_qualified_name: Optional[str] = Field(default=None, description="") is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dynamo_d_b_status: Optional[DynamoDBStatus] = Field( - default=None, description="" - ) + dynamo_d_b_status: Optional[DynamoDBStatus] = Field(default=None, description="") dynamo_d_b_partition_key: Optional[str] = Field(default=None, description="") dynamo_d_b_sort_key: Optional[str] = Field(default=None, description="") - dynamo_d_b_read_capacity_units: Optional[int] = Field( - default=None, description="" - ) - dynamo_d_b_write_capacity_units: Optional[int] = Field( - default=None, description="" - ) + dynamo_d_b_read_capacity_units: Optional[int] = Field(default=None, description="") + dynamo_d_b_write_capacity_units: Optional[int] = Field(default=None, description="") no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") attributes: DynamoDBSecondaryIndex.Attributes = Field( diff --git a/pyatlan/model/assets/core/file.py b/pyatlan/model/assets/core/file.py index 9860b7b23..ff5e15fb5 100644 --- a/pyatlan/model/assets/core/file.py +++ b/pyatlan/model/assets/core/file.py @@ -21,9 +21,7 @@ class File(Resource): @classmethod @init_guid - def creator( - cls, *, name: str, connection_qualified_name: str, file_type: FileType - ) -> File: + def creator(cls, *, name: str, connection_qualified_name: str, file_type: FileType) -> File: return File( attributes=File.Attributes.create( name=name, @@ -34,14 +32,9 @@ def creator( @classmethod @init_guid - def create( - cls, *, name: str, connection_qualified_name: str, file_type: FileType - ) -> File: + def create(cls, *, name: str, connection_qualified_name: str, file_type: FileType) -> File: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -117,15 +110,11 @@ def file_assets(self, file_assets: Optional[Asset]): class Attributes(Resource.Attributes): file_type: Optional[FileType] = Field(default=None, description="") file_path: Optional[str] = Field(default=None, description="") - file_assets: Optional[Asset] = Field( - default=None, description="" - ) # relationship + file_assets: Optional[Asset] = Field(default=None, description="") # relationship @classmethod @init_guid - def create( - cls, *, name: str, connection_qualified_name: str, file_type: FileType - ) -> File.Attributes: + def create(cls, *, name: str, connection_qualified_name: str, file_type: FileType) -> File.Attributes: validate_required_fields( ["name", "connection_qualified_name", "file_type"], [name, connection_qualified_name, file_type], @@ -134,9 +123,7 @@ def create( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), file_type=file_type, ) diff --git a/pyatlan/model/assets/core/fivetran.py b/pyatlan/model/assets/core/fivetran.py index f724a9817..ea1562f3f 100644 --- a/pyatlan/model/assets/core/fivetran.py +++ b/pyatlan/model/assets/core/fivetran.py @@ -30,15 +30,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - FIVETRAN_WORKFLOW_NAME: ClassVar[KeywordField] = KeywordField( - "fivetranWorkflowName", "fivetranWorkflowName" - ) + FIVETRAN_WORKFLOW_NAME: ClassVar[KeywordField] = KeywordField("fivetranWorkflowName", "fivetranWorkflowName") """ Name of the atlan fivetran workflow that updated this asset """ - FIVETRAN_LAST_SYNC_STATUS: ClassVar[KeywordField] = KeywordField( - "fivetranLastSyncStatus", "fivetranLastSyncStatus" - ) + FIVETRAN_LAST_SYNC_STATUS: ClassVar[KeywordField] = KeywordField("fivetranLastSyncStatus", "fivetranLastSyncStatus") """ Status of the latest sync on Fivetran. """ @@ -57,9 +53,7 @@ def __setattr__(self, name, value): @property def fivetran_workflow_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.fivetran_workflow_name - ) + return None if self.attributes is None else self.attributes.fivetran_workflow_name @fivetran_workflow_name.setter def fivetran_workflow_name(self, fivetran_workflow_name: Optional[str]): @@ -69,46 +63,28 @@ def fivetran_workflow_name(self, fivetran_workflow_name: Optional[str]): @property def fivetran_last_sync_status(self) -> Optional[FivetranConnectorStatus]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_last_sync_status - ) + return None if self.attributes is None else self.attributes.fivetran_last_sync_status @fivetran_last_sync_status.setter - def fivetran_last_sync_status( - self, fivetran_last_sync_status: Optional[FivetranConnectorStatus] - ): + def fivetran_last_sync_status(self, fivetran_last_sync_status: Optional[FivetranConnectorStatus]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.fivetran_last_sync_status = fivetran_last_sync_status @property def fivetran_last_sync_records_updated(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_last_sync_records_updated - ) + return None if self.attributes is None else self.attributes.fivetran_last_sync_records_updated @fivetran_last_sync_records_updated.setter - def fivetran_last_sync_records_updated( - self, fivetran_last_sync_records_updated: Optional[int] - ): + def fivetran_last_sync_records_updated(self, fivetran_last_sync_records_updated: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_last_sync_records_updated = ( - fivetran_last_sync_records_updated - ) + self.attributes.fivetran_last_sync_records_updated = fivetran_last_sync_records_updated class Attributes(Catalog.Attributes): fivetran_workflow_name: Optional[str] = Field(default=None, description="") - fivetran_last_sync_status: Optional[FivetranConnectorStatus] = Field( - default=None, description="" - ) - fivetran_last_sync_records_updated: Optional[int] = Field( - default=None, description="" - ) + fivetran_last_sync_status: Optional[FivetranConnectorStatus] = Field(default=None, description="") + fivetran_last_sync_records_updated: Optional[int] = Field(default=None, description="") attributes: Fivetran.Attributes = Field( default_factory=lambda: Fivetran.Attributes(), diff --git a/pyatlan/model/assets/core/fivetran_connector.py b/pyatlan/model/assets/core/fivetran_connector.py index 0565159d0..388c19df6 100644 --- a/pyatlan/model/assets/core/fivetran_connector.py +++ b/pyatlan/model/assets/core/fivetran_connector.py @@ -82,84 +82,64 @@ def __setattr__(self, name, value): """ Number of tables synced in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_EXTRACT_TIME_SECONDS: ClassVar[NumericField] = ( - NumericField( - "fivetranConnectorLastSyncExtractTimeSeconds", - "fivetranConnectorLastSyncExtractTimeSeconds", - ) + FIVETRAN_CONNECTOR_LAST_SYNC_EXTRACT_TIME_SECONDS: ClassVar[NumericField] = NumericField( + "fivetranConnectorLastSyncExtractTimeSeconds", + "fivetranConnectorLastSyncExtractTimeSeconds", ) """ Extract time in seconds in the latest sync on fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_EXTRACT_VOLUME_MEGABYTES: ClassVar[NumericField] = ( - NumericField( - "fivetranConnectorLastSyncExtractVolumeMegabytes", - "fivetranConnectorLastSyncExtractVolumeMegabytes", - ) + FIVETRAN_CONNECTOR_LAST_SYNC_EXTRACT_VOLUME_MEGABYTES: ClassVar[NumericField] = NumericField( + "fivetranConnectorLastSyncExtractVolumeMegabytes", + "fivetranConnectorLastSyncExtractVolumeMegabytes", ) """ Extracted data volume in metabytes in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_LOAD_TIME_SECONDS: ClassVar[NumericField] = ( - NumericField( - "fivetranConnectorLastSyncLoadTimeSeconds", - "fivetranConnectorLastSyncLoadTimeSeconds", - ) + FIVETRAN_CONNECTOR_LAST_SYNC_LOAD_TIME_SECONDS: ClassVar[NumericField] = NumericField( + "fivetranConnectorLastSyncLoadTimeSeconds", + "fivetranConnectorLastSyncLoadTimeSeconds", ) """ Load time in seconds in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_LOAD_VOLUME_MEGABYTES: ClassVar[NumericField] = ( - NumericField( - "fivetranConnectorLastSyncLoadVolumeMegabytes", - "fivetranConnectorLastSyncLoadVolumeMegabytes", - ) + FIVETRAN_CONNECTOR_LAST_SYNC_LOAD_VOLUME_MEGABYTES: ClassVar[NumericField] = NumericField( + "fivetranConnectorLastSyncLoadVolumeMegabytes", + "fivetranConnectorLastSyncLoadVolumeMegabytes", ) """ Loaded data volume in metabytes in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_PROCESS_TIME_SECONDS: ClassVar[NumericField] = ( - NumericField( - "fivetranConnectorLastSyncProcessTimeSeconds", - "fivetranConnectorLastSyncProcessTimeSeconds", - ) + FIVETRAN_CONNECTOR_LAST_SYNC_PROCESS_TIME_SECONDS: ClassVar[NumericField] = NumericField( + "fivetranConnectorLastSyncProcessTimeSeconds", + "fivetranConnectorLastSyncProcessTimeSeconds", ) """ Process time in seconds in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_PROCESS_VOLUME_MEGABYTES: ClassVar[NumericField] = ( - NumericField( - "fivetranConnectorLastSyncProcessVolumeMegabytes", - "fivetranConnectorLastSyncProcessVolumeMegabytes", - ) + FIVETRAN_CONNECTOR_LAST_SYNC_PROCESS_VOLUME_MEGABYTES: ClassVar[NumericField] = NumericField( + "fivetranConnectorLastSyncProcessVolumeMegabytes", + "fivetranConnectorLastSyncProcessVolumeMegabytes", ) """ Process volume in metabytes in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_TOTAL_TIME_SECONDS: ClassVar[NumericField] = ( - NumericField( - "fivetranConnectorLastSyncTotalTimeSeconds", - "fivetranConnectorLastSyncTotalTimeSeconds", - ) + FIVETRAN_CONNECTOR_LAST_SYNC_TOTAL_TIME_SECONDS: ClassVar[NumericField] = NumericField( + "fivetranConnectorLastSyncTotalTimeSeconds", + "fivetranConnectorLastSyncTotalTimeSeconds", ) """ Total sync time in seconds in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_NAME: ClassVar[KeywordField] = KeywordField( - "fivetranConnectorName", "fivetranConnectorName" - ) + FIVETRAN_CONNECTOR_NAME: ClassVar[KeywordField] = KeywordField("fivetranConnectorName", "fivetranConnectorName") """ Connector name added by the user on Fivetran """ - FIVETRAN_CONNECTOR_TYPE: ClassVar[KeywordField] = KeywordField( - "fivetranConnectorType", "fivetranConnectorType" - ) + FIVETRAN_CONNECTOR_TYPE: ClassVar[KeywordField] = KeywordField("fivetranConnectorType", "fivetranConnectorType") """ Type of connector on Fivetran. Eg: snowflake, google_analytics, notion etc. """ - FIVETRAN_CONNECTOR_URL: ClassVar[KeywordField] = KeywordField( - "fivetranConnectorURL", "fivetranConnectorURL" - ) + FIVETRAN_CONNECTOR_URL: ClassVar[KeywordField] = KeywordField("fivetranConnectorURL", "fivetranConnectorURL") """ URL to open the connector details on Fivetran """ @@ -233,54 +213,42 @@ def __setattr__(self, name, value): """ Total Monthly Active Rows used by the connector in the past month """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_FREE: ClassVar[ - NumericField - ] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_FREE: ClassVar[NumericField] = NumericField( "fivetranConnectorMonthlyActiveRowsChangePercentageFree", "fivetranConnectorMonthlyActiveRowsChangePercentageFree", ) """ Increase in the percentage of free MAR compared to the previous month """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_PAID: ClassVar[ - NumericField - ] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_PAID: ClassVar[NumericField] = NumericField( "fivetranConnectorMonthlyActiveRowsChangePercentagePaid", "fivetranConnectorMonthlyActiveRowsChangePercentagePaid", ) """ Increase in the percentage of paid MAR compared to the previous month """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_TOTAL: ClassVar[ - NumericField - ] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_TOTAL: ClassVar[NumericField] = NumericField( "fivetranConnectorMonthlyActiveRowsChangePercentageTotal", "fivetranConnectorMonthlyActiveRowsChangePercentageTotal", ) """ Increase in the percentage of total MAR compared to the previous month """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_FREE_PERCENTAGE_OF_ACCOUNT: ClassVar[ - NumericField - ] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_FREE_PERCENTAGE_OF_ACCOUNT: ClassVar[NumericField] = NumericField( "fivetranConnectorMonthlyActiveRowsFreePercentageOfAccount", "fivetranConnectorMonthlyActiveRowsFreePercentageOfAccount", ) """ Percentage of the account's total free MAR used by this connector """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_PAID_PERCENTAGE_OF_ACCOUNT: ClassVar[ - NumericField - ] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_PAID_PERCENTAGE_OF_ACCOUNT: ClassVar[NumericField] = NumericField( "fivetranConnectorMonthlyActiveRowsPaidPercentageOfAccount", "fivetranConnectorMonthlyActiveRowsPaidPercentageOfAccount", ) """ Percentage of the account's total paid MAR used by this connector """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_TOTAL_PERCENTAGE_OF_ACCOUNT: ClassVar[ - NumericField - ] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_TOTAL_PERCENTAGE_OF_ACCOUNT: ClassVar[NumericField] = NumericField( "fivetranConnectorMonthlyActiveRowsTotalPercentageOfAccount", "fivetranConnectorMonthlyActiveRowsTotalPercentageOfAccount", ) @@ -361,101 +329,57 @@ def __setattr__(self, name, value): @property def fivetran_connector_last_sync_id(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_id - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_id @fivetran_connector_last_sync_id.setter - def fivetran_connector_last_sync_id( - self, fivetran_connector_last_sync_id: Optional[str] - ): + def fivetran_connector_last_sync_id(self, fivetran_connector_last_sync_id: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_id = ( - fivetran_connector_last_sync_id - ) + self.attributes.fivetran_connector_last_sync_id = fivetran_connector_last_sync_id @property def fivetran_connector_last_sync_started_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_started_at - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_started_at @fivetran_connector_last_sync_started_at.setter - def fivetran_connector_last_sync_started_at( - self, fivetran_connector_last_sync_started_at: Optional[datetime] - ): + def fivetran_connector_last_sync_started_at(self, fivetran_connector_last_sync_started_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_started_at = ( - fivetran_connector_last_sync_started_at - ) + self.attributes.fivetran_connector_last_sync_started_at = fivetran_connector_last_sync_started_at @property def fivetran_connector_last_sync_finished_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_finished_at - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_finished_at @fivetran_connector_last_sync_finished_at.setter - def fivetran_connector_last_sync_finished_at( - self, fivetran_connector_last_sync_finished_at: Optional[datetime] - ): + def fivetran_connector_last_sync_finished_at(self, fivetran_connector_last_sync_finished_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_finished_at = ( - fivetran_connector_last_sync_finished_at - ) + self.attributes.fivetran_connector_last_sync_finished_at = fivetran_connector_last_sync_finished_at @property def fivetran_connector_last_sync_reason(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_reason - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_reason @fivetran_connector_last_sync_reason.setter - def fivetran_connector_last_sync_reason( - self, fivetran_connector_last_sync_reason: Optional[str] - ): + def fivetran_connector_last_sync_reason(self, fivetran_connector_last_sync_reason: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_reason = ( - fivetran_connector_last_sync_reason - ) + self.attributes.fivetran_connector_last_sync_reason = fivetran_connector_last_sync_reason @property def fivetran_connector_last_sync_task_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_task_type - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_task_type @fivetran_connector_last_sync_task_type.setter - def fivetran_connector_last_sync_task_type( - self, fivetran_connector_last_sync_task_type: Optional[str] - ): + def fivetran_connector_last_sync_task_type(self, fivetran_connector_last_sync_task_type: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_task_type = ( - fivetran_connector_last_sync_task_type - ) + self.attributes.fivetran_connector_last_sync_task_type = fivetran_connector_last_sync_task_type @property def fivetran_connector_last_sync_rescheduled_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_rescheduled_at - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_rescheduled_at @fivetran_connector_last_sync_rescheduled_at.setter def fivetran_connector_last_sync_rescheduled_at( @@ -463,35 +387,21 @@ def fivetran_connector_last_sync_rescheduled_at( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_rescheduled_at = ( - fivetran_connector_last_sync_rescheduled_at - ) + self.attributes.fivetran_connector_last_sync_rescheduled_at = fivetran_connector_last_sync_rescheduled_at @property def fivetran_connector_last_sync_tables_synced(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_tables_synced - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_tables_synced @fivetran_connector_last_sync_tables_synced.setter - def fivetran_connector_last_sync_tables_synced( - self, fivetran_connector_last_sync_tables_synced: Optional[int] - ): + def fivetran_connector_last_sync_tables_synced(self, fivetran_connector_last_sync_tables_synced: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_tables_synced = ( - fivetran_connector_last_sync_tables_synced - ) + self.attributes.fivetran_connector_last_sync_tables_synced = fivetran_connector_last_sync_tables_synced @property def fivetran_connector_last_sync_extract_time_seconds(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_extract_time_seconds - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_extract_time_seconds @fivetran_connector_last_sync_extract_time_seconds.setter def fivetran_connector_last_sync_extract_time_seconds( @@ -506,9 +416,7 @@ def fivetran_connector_last_sync_extract_time_seconds( @property def fivetran_connector_last_sync_extract_volume_megabytes(self) -> Optional[float]: return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_extract_volume_megabytes + None if self.attributes is None else self.attributes.fivetran_connector_last_sync_extract_volume_megabytes ) @fivetran_connector_last_sync_extract_volume_megabytes.setter @@ -523,11 +431,7 @@ def fivetran_connector_last_sync_extract_volume_megabytes( @property def fivetran_connector_last_sync_load_time_seconds(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_load_time_seconds - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_load_time_seconds @fivetran_connector_last_sync_load_time_seconds.setter def fivetran_connector_last_sync_load_time_seconds( @@ -535,17 +439,11 @@ def fivetran_connector_last_sync_load_time_seconds( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_load_time_seconds = ( - fivetran_connector_last_sync_load_time_seconds - ) + self.attributes.fivetran_connector_last_sync_load_time_seconds = fivetran_connector_last_sync_load_time_seconds @property def fivetran_connector_last_sync_load_volume_megabytes(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_load_volume_megabytes - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_load_volume_megabytes @fivetran_connector_last_sync_load_volume_megabytes.setter def fivetran_connector_last_sync_load_volume_megabytes( @@ -559,11 +457,7 @@ def fivetran_connector_last_sync_load_volume_megabytes( @property def fivetran_connector_last_sync_process_time_seconds(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_process_time_seconds - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_process_time_seconds @fivetran_connector_last_sync_process_time_seconds.setter def fivetran_connector_last_sync_process_time_seconds( @@ -578,9 +472,7 @@ def fivetran_connector_last_sync_process_time_seconds( @property def fivetran_connector_last_sync_process_volume_megabytes(self) -> Optional[float]: return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_process_volume_megabytes + None if self.attributes is None else self.attributes.fivetran_connector_last_sync_process_volume_megabytes ) @fivetran_connector_last_sync_process_volume_megabytes.setter @@ -595,11 +487,7 @@ def fivetran_connector_last_sync_process_volume_megabytes( @property def fivetran_connector_last_sync_total_time_seconds(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_last_sync_total_time_seconds - ) + return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_total_time_seconds @fivetran_connector_last_sync_total_time_seconds.setter def fivetran_connector_last_sync_total_time_seconds( @@ -613,9 +501,7 @@ def fivetran_connector_last_sync_total_time_seconds( @property def fivetran_connector_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.fivetran_connector_name - ) + return None if self.attributes is None else self.attributes.fivetran_connector_name @fivetran_connector_name.setter def fivetran_connector_name(self, fivetran_connector_name: Optional[str]): @@ -625,9 +511,7 @@ def fivetran_connector_name(self, fivetran_connector_name: Optional[str]): @property def fivetran_connector_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.fivetran_connector_type - ) + return None if self.attributes is None else self.attributes.fivetran_connector_type @fivetran_connector_type.setter def fivetran_connector_type(self, fivetran_connector_type: Optional[str]): @@ -637,9 +521,7 @@ def fivetran_connector_type(self, fivetran_connector_type: Optional[str]): @property def fivetran_connector_url(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.fivetran_connector_url - ) + return None if self.attributes is None else self.attributes.fivetran_connector_url @fivetran_connector_url.setter def fivetran_connector_url(self, fivetran_connector_url: Optional[str]): @@ -649,199 +531,113 @@ def fivetran_connector_url(self, fivetran_connector_url: Optional[str]): @property def fivetran_connector_destination_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_destination_name - ) + return None if self.attributes is None else self.attributes.fivetran_connector_destination_name @fivetran_connector_destination_name.setter - def fivetran_connector_destination_name( - self, fivetran_connector_destination_name: Optional[str] - ): + def fivetran_connector_destination_name(self, fivetran_connector_destination_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_destination_name = ( - fivetran_connector_destination_name - ) + self.attributes.fivetran_connector_destination_name = fivetran_connector_destination_name @property def fivetran_connector_destination_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_destination_type - ) + return None if self.attributes is None else self.attributes.fivetran_connector_destination_type @fivetran_connector_destination_type.setter - def fivetran_connector_destination_type( - self, fivetran_connector_destination_type: Optional[str] - ): + def fivetran_connector_destination_type(self, fivetran_connector_destination_type: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_destination_type = ( - fivetran_connector_destination_type - ) + self.attributes.fivetran_connector_destination_type = fivetran_connector_destination_type @property def fivetran_connector_destination_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_destination_url - ) + return None if self.attributes is None else self.attributes.fivetran_connector_destination_url @fivetran_connector_destination_url.setter - def fivetran_connector_destination_url( - self, fivetran_connector_destination_url: Optional[str] - ): + def fivetran_connector_destination_url(self, fivetran_connector_destination_url: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_destination_url = ( - fivetran_connector_destination_url - ) + self.attributes.fivetran_connector_destination_url = fivetran_connector_destination_url @property def fivetran_connector_sync_setup_on(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_sync_setup_on - ) + return None if self.attributes is None else self.attributes.fivetran_connector_sync_setup_on @fivetran_connector_sync_setup_on.setter - def fivetran_connector_sync_setup_on( - self, fivetran_connector_sync_setup_on: Optional[datetime] - ): + def fivetran_connector_sync_setup_on(self, fivetran_connector_sync_setup_on: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_sync_setup_on = ( - fivetran_connector_sync_setup_on - ) + self.attributes.fivetran_connector_sync_setup_on = fivetran_connector_sync_setup_on @property def fivetran_connector_sync_frequency(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_sync_frequency - ) + return None if self.attributes is None else self.attributes.fivetran_connector_sync_frequency @fivetran_connector_sync_frequency.setter - def fivetran_connector_sync_frequency( - self, fivetran_connector_sync_frequency: Optional[str] - ): + def fivetran_connector_sync_frequency(self, fivetran_connector_sync_frequency: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_sync_frequency = ( - fivetran_connector_sync_frequency - ) + self.attributes.fivetran_connector_sync_frequency = fivetran_connector_sync_frequency @property def fivetran_connector_sync_paused(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_sync_paused - ) + return None if self.attributes is None else self.attributes.fivetran_connector_sync_paused @fivetran_connector_sync_paused.setter - def fivetran_connector_sync_paused( - self, fivetran_connector_sync_paused: Optional[bool] - ): + def fivetran_connector_sync_paused(self, fivetran_connector_sync_paused: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.fivetran_connector_sync_paused = fivetran_connector_sync_paused @property def fivetran_connector_sync_setup_user_full_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_sync_setup_user_full_name - ) + return None if self.attributes is None else self.attributes.fivetran_connector_sync_setup_user_full_name @fivetran_connector_sync_setup_user_full_name.setter - def fivetran_connector_sync_setup_user_full_name( - self, fivetran_connector_sync_setup_user_full_name: Optional[str] - ): + def fivetran_connector_sync_setup_user_full_name(self, fivetran_connector_sync_setup_user_full_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_sync_setup_user_full_name = ( - fivetran_connector_sync_setup_user_full_name - ) + self.attributes.fivetran_connector_sync_setup_user_full_name = fivetran_connector_sync_setup_user_full_name @property def fivetran_connector_sync_setup_user_email(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_sync_setup_user_email - ) + return None if self.attributes is None else self.attributes.fivetran_connector_sync_setup_user_email @fivetran_connector_sync_setup_user_email.setter - def fivetran_connector_sync_setup_user_email( - self, fivetran_connector_sync_setup_user_email: Optional[str] - ): + def fivetran_connector_sync_setup_user_email(self, fivetran_connector_sync_setup_user_email: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_sync_setup_user_email = ( - fivetran_connector_sync_setup_user_email - ) + self.attributes.fivetran_connector_sync_setup_user_email = fivetran_connector_sync_setup_user_email @property def fivetran_connector_monthly_active_rows_free(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_monthly_active_rows_free - ) + return None if self.attributes is None else self.attributes.fivetran_connector_monthly_active_rows_free @fivetran_connector_monthly_active_rows_free.setter - def fivetran_connector_monthly_active_rows_free( - self, fivetran_connector_monthly_active_rows_free: Optional[int] - ): + def fivetran_connector_monthly_active_rows_free(self, fivetran_connector_monthly_active_rows_free: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_free = ( - fivetran_connector_monthly_active_rows_free - ) + self.attributes.fivetran_connector_monthly_active_rows_free = fivetran_connector_monthly_active_rows_free @property def fivetran_connector_monthly_active_rows_paid(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_monthly_active_rows_paid - ) + return None if self.attributes is None else self.attributes.fivetran_connector_monthly_active_rows_paid @fivetran_connector_monthly_active_rows_paid.setter - def fivetran_connector_monthly_active_rows_paid( - self, fivetran_connector_monthly_active_rows_paid: Optional[int] - ): + def fivetran_connector_monthly_active_rows_paid(self, fivetran_connector_monthly_active_rows_paid: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_paid = ( - fivetran_connector_monthly_active_rows_paid - ) + self.attributes.fivetran_connector_monthly_active_rows_paid = fivetran_connector_monthly_active_rows_paid @property def fivetran_connector_monthly_active_rows_total(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_monthly_active_rows_total - ) + return None if self.attributes is None else self.attributes.fivetran_connector_monthly_active_rows_total @fivetran_connector_monthly_active_rows_total.setter - def fivetran_connector_monthly_active_rows_total( - self, fivetran_connector_monthly_active_rows_total: Optional[int] - ): + def fivetran_connector_monthly_active_rows_total(self, fivetran_connector_monthly_active_rows_total: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_total = ( - fivetran_connector_monthly_active_rows_total - ) + self.attributes.fivetran_connector_monthly_active_rows_total = fivetran_connector_monthly_active_rows_total @property def fivetran_connector_monthly_active_rows_change_percentage_free( @@ -919,9 +715,7 @@ def fivetran_connector_monthly_active_rows_free_percentage_of_account( @fivetran_connector_monthly_active_rows_free_percentage_of_account.setter def fivetran_connector_monthly_active_rows_free_percentage_of_account( self, - fivetran_connector_monthly_active_rows_free_percentage_of_account: Optional[ - float - ], + fivetran_connector_monthly_active_rows_free_percentage_of_account: Optional[float], ): if self.attributes is None: self.attributes = self.Attributes() @@ -942,9 +736,7 @@ def fivetran_connector_monthly_active_rows_paid_percentage_of_account( @fivetran_connector_monthly_active_rows_paid_percentage_of_account.setter def fivetran_connector_monthly_active_rows_paid_percentage_of_account( self, - fivetran_connector_monthly_active_rows_paid_percentage_of_account: Optional[ - float - ], + fivetran_connector_monthly_active_rows_paid_percentage_of_account: Optional[float], ): if self.attributes is None: self.attributes = self.Attributes() @@ -965,9 +757,7 @@ def fivetran_connector_monthly_active_rows_total_percentage_of_account( @fivetran_connector_monthly_active_rows_total_percentage_of_account.setter def fivetran_connector_monthly_active_rows_total_percentage_of_account( self, - fivetran_connector_monthly_active_rows_total_percentage_of_account: Optional[ - float - ], + fivetran_connector_monthly_active_rows_total_percentage_of_account: Optional[float], ): if self.attributes is None: self.attributes = self.Attributes() @@ -977,73 +767,43 @@ def fivetran_connector_monthly_active_rows_total_percentage_of_account( @property def fivetran_connector_total_tables_synced(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_total_tables_synced - ) + return None if self.attributes is None else self.attributes.fivetran_connector_total_tables_synced @fivetran_connector_total_tables_synced.setter - def fivetran_connector_total_tables_synced( - self, fivetran_connector_total_tables_synced: Optional[int] - ): + def fivetran_connector_total_tables_synced(self, fivetran_connector_total_tables_synced: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_total_tables_synced = ( - fivetran_connector_total_tables_synced - ) + self.attributes.fivetran_connector_total_tables_synced = fivetran_connector_total_tables_synced @property def fivetran_connector_top_tables_by_m_a_r(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_top_tables_by_m_a_r - ) + return None if self.attributes is None else self.attributes.fivetran_connector_top_tables_by_m_a_r @fivetran_connector_top_tables_by_m_a_r.setter - def fivetran_connector_top_tables_by_m_a_r( - self, fivetran_connector_top_tables_by_m_a_r: Optional[str] - ): + def fivetran_connector_top_tables_by_m_a_r(self, fivetran_connector_top_tables_by_m_a_r: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_top_tables_by_m_a_r = ( - fivetran_connector_top_tables_by_m_a_r - ) + self.attributes.fivetran_connector_top_tables_by_m_a_r = fivetran_connector_top_tables_by_m_a_r @property def fivetran_connector_usage_cost(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_usage_cost - ) + return None if self.attributes is None else self.attributes.fivetran_connector_usage_cost @fivetran_connector_usage_cost.setter - def fivetran_connector_usage_cost( - self, fivetran_connector_usage_cost: Optional[float] - ): + def fivetran_connector_usage_cost(self, fivetran_connector_usage_cost: Optional[float]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.fivetran_connector_usage_cost = fivetran_connector_usage_cost @property def fivetran_connector_credits_used(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.fivetran_connector_credits_used - ) + return None if self.attributes is None else self.attributes.fivetran_connector_credits_used @fivetran_connector_credits_used.setter - def fivetran_connector_credits_used( - self, fivetran_connector_credits_used: Optional[float] - ): + def fivetran_connector_credits_used(self, fivetran_connector_credits_used: Optional[float]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_credits_used = ( - fivetran_connector_credits_used - ) + self.attributes.fivetran_connector_credits_used = fivetran_connector_credits_used @property def processes(self) -> Optional[List[Process]]: @@ -1056,117 +816,57 @@ def processes(self, processes: Optional[List[Process]]): self.attributes.processes = processes class Attributes(Fivetran.Attributes): - fivetran_connector_last_sync_id: Optional[str] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_started_at: Optional[datetime] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_finished_at: Optional[datetime] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_reason: Optional[str] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_task_type: Optional[str] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_rescheduled_at: Optional[datetime] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_tables_synced: Optional[int] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_extract_time_seconds: Optional[float] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_extract_volume_megabytes: Optional[float] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_load_time_seconds: Optional[float] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_load_volume_megabytes: Optional[float] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_process_time_seconds: Optional[float] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_process_volume_megabytes: Optional[float] = Field( - default=None, description="" - ) - fivetran_connector_last_sync_total_time_seconds: Optional[float] = Field( - default=None, description="" - ) + fivetran_connector_last_sync_id: Optional[str] = Field(default=None, description="") + fivetran_connector_last_sync_started_at: Optional[datetime] = Field(default=None, description="") + fivetran_connector_last_sync_finished_at: Optional[datetime] = Field(default=None, description="") + fivetran_connector_last_sync_reason: Optional[str] = Field(default=None, description="") + fivetran_connector_last_sync_task_type: Optional[str] = Field(default=None, description="") + fivetran_connector_last_sync_rescheduled_at: Optional[datetime] = Field(default=None, description="") + fivetran_connector_last_sync_tables_synced: Optional[int] = Field(default=None, description="") + fivetran_connector_last_sync_extract_time_seconds: Optional[float] = Field(default=None, description="") + fivetran_connector_last_sync_extract_volume_megabytes: Optional[float] = Field(default=None, description="") + fivetran_connector_last_sync_load_time_seconds: Optional[float] = Field(default=None, description="") + fivetran_connector_last_sync_load_volume_megabytes: Optional[float] = Field(default=None, description="") + fivetran_connector_last_sync_process_time_seconds: Optional[float] = Field(default=None, description="") + fivetran_connector_last_sync_process_volume_megabytes: Optional[float] = Field(default=None, description="") + fivetran_connector_last_sync_total_time_seconds: Optional[float] = Field(default=None, description="") fivetran_connector_name: Optional[str] = Field(default=None, description="") fivetran_connector_type: Optional[str] = Field(default=None, description="") fivetran_connector_url: Optional[str] = Field(default=None, description="") - fivetran_connector_destination_name: Optional[str] = Field( - default=None, description="" - ) - fivetran_connector_destination_type: Optional[str] = Field( - default=None, description="" - ) - fivetran_connector_destination_url: Optional[str] = Field( - default=None, description="" - ) - fivetran_connector_sync_setup_on: Optional[datetime] = Field( + fivetran_connector_destination_name: Optional[str] = Field(default=None, description="") + fivetran_connector_destination_type: Optional[str] = Field(default=None, description="") + fivetran_connector_destination_url: Optional[str] = Field(default=None, description="") + fivetran_connector_sync_setup_on: Optional[datetime] = Field(default=None, description="") + fivetran_connector_sync_frequency: Optional[str] = Field(default=None, description="") + fivetran_connector_sync_paused: Optional[bool] = Field(default=None, description="") + fivetran_connector_sync_setup_user_full_name: Optional[str] = Field(default=None, description="") + fivetran_connector_sync_setup_user_email: Optional[str] = Field(default=None, description="") + fivetran_connector_monthly_active_rows_free: Optional[int] = Field(default=None, description="") + fivetran_connector_monthly_active_rows_paid: Optional[int] = Field(default=None, description="") + fivetran_connector_monthly_active_rows_total: Optional[int] = Field(default=None, description="") + fivetran_connector_monthly_active_rows_change_percentage_free: Optional[float] = Field( default=None, description="" ) - fivetran_connector_sync_frequency: Optional[str] = Field( + fivetran_connector_monthly_active_rows_change_percentage_paid: Optional[float] = Field( default=None, description="" ) - fivetran_connector_sync_paused: Optional[bool] = Field( + fivetran_connector_monthly_active_rows_change_percentage_total: Optional[float] = Field( default=None, description="" ) - fivetran_connector_sync_setup_user_full_name: Optional[str] = Field( + fivetran_connector_monthly_active_rows_free_percentage_of_account: Optional[float] = Field( default=None, description="" ) - fivetran_connector_sync_setup_user_email: Optional[str] = Field( + fivetran_connector_monthly_active_rows_paid_percentage_of_account: Optional[float] = Field( default=None, description="" ) - fivetran_connector_monthly_active_rows_free: Optional[int] = Field( + fivetran_connector_monthly_active_rows_total_percentage_of_account: Optional[float] = Field( default=None, description="" ) - fivetran_connector_monthly_active_rows_paid: Optional[int] = Field( - default=None, description="" - ) - fivetran_connector_monthly_active_rows_total: Optional[int] = Field( - default=None, description="" - ) - fivetran_connector_monthly_active_rows_change_percentage_free: Optional[ - float - ] = Field(default=None, description="") - fivetran_connector_monthly_active_rows_change_percentage_paid: Optional[ - float - ] = Field(default=None, description="") - fivetran_connector_monthly_active_rows_change_percentage_total: Optional[ - float - ] = Field(default=None, description="") - fivetran_connector_monthly_active_rows_free_percentage_of_account: Optional[ - float - ] = Field(default=None, description="") - fivetran_connector_monthly_active_rows_paid_percentage_of_account: Optional[ - float - ] = Field(default=None, description="") - fivetran_connector_monthly_active_rows_total_percentage_of_account: Optional[ - float - ] = Field(default=None, description="") - fivetran_connector_total_tables_synced: Optional[int] = Field( - default=None, description="" - ) - fivetran_connector_top_tables_by_m_a_r: Optional[str] = Field( - default=None, description="" - ) - fivetran_connector_usage_cost: Optional[float] = Field( - default=None, description="" - ) - fivetran_connector_credits_used: Optional[float] = Field( - default=None, description="" - ) - processes: Optional[List[Process]] = Field( - default=None, description="" - ) # relationship + fivetran_connector_total_tables_synced: Optional[int] = Field(default=None, description="") + fivetran_connector_top_tables_by_m_a_r: Optional[str] = Field(default=None, description="") + fivetran_connector_usage_cost: Optional[float] = Field(default=None, description="") + fivetran_connector_credits_used: Optional[float] = Field(default=None, description="") + processes: Optional[List[Process]] = Field(default=None, description="") # relationship attributes: FivetranConnector.Attributes = Field( default_factory=lambda: FivetranConnector.Attributes(), diff --git a/pyatlan/model/assets/core/folder.py b/pyatlan/model/assets/core/folder.py index e06aa1471..f3204dbf9 100644 --- a/pyatlan/model/assets/core/folder.py +++ b/pyatlan/model/assets/core/folder.py @@ -94,9 +94,7 @@ def __setattr__(self, name, value): @property def parent_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.parent_qualified_name - ) + return None if self.attributes is None else self.attributes.parent_qualified_name @parent_qualified_name.setter def parent_qualified_name(self, parent_qualified_name: Optional[str]): @@ -106,11 +104,7 @@ def parent_qualified_name(self, parent_qualified_name: Optional[str]): @property def collection_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.collection_qualified_name - ) + return None if self.attributes is None else self.attributes.collection_qualified_name @collection_qualified_name.setter def collection_qualified_name(self, collection_qualified_name: Optional[str]): @@ -131,9 +125,7 @@ def parent(self, parent: Optional[Namespace]): class Attributes(Namespace.Attributes): parent_qualified_name: Optional[str] = Field(default=None, description="") collection_qualified_name: Optional[str] = Field(default=None, description="") - parent: Optional[Namespace] = Field( - default=None, description="" - ) # relationship + parent: Optional[Namespace] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -156,17 +148,13 @@ def creator( if not parent_folder_qualified_name: qualified_name = f"{collection_qualified_name}/{name}" parent_qn = collection_qualified_name - parent = Collection.ref_by_qualified_name( - collection_qualified_name or "" - ) + parent = Collection.ref_by_qualified_name(collection_qualified_name or "") else: tokens = parent_folder_qualified_name.split("/") if len(tokens) < 4: raise ValueError("Invalid collection_qualified_name") - collection_qualified_name = ( - f"{tokens[0]}/{tokens[1]}/{tokens[2]}/{tokens[3]}" - ) + collection_qualified_name = f"{tokens[0]}/{tokens[1]}/{tokens[2]}/{tokens[3]}" qualified_name = f"{parent_folder_qualified_name}/{name}" parent_qn = parent_folder_qualified_name parent = Folder.ref_by_qualified_name(parent_folder_qualified_name) # type: ignore[assignment] diff --git a/pyatlan/model/assets/core/function.py b/pyatlan/model/assets/core/function.py index 8a3f4d8be..9a0e2dc48 100644 --- a/pyatlan/model/assets/core/function.py +++ b/pyatlan/model/assets/core/function.py @@ -34,27 +34,19 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - FUNCTION_DEFINITION: ClassVar[TextField] = TextField( - "functionDefinition", "functionDefinition" - ) + FUNCTION_DEFINITION: ClassVar[TextField] = TextField("functionDefinition", "functionDefinition") """ Code or set of statements that determine the output of the function. """ - FUNCTION_RETURN_TYPE: ClassVar[KeywordField] = KeywordField( - "functionReturnType", "functionReturnType" - ) + FUNCTION_RETURN_TYPE: ClassVar[KeywordField] = KeywordField("functionReturnType", "functionReturnType") """ Data type of the value returned by the function. """ - FUNCTION_ARGUMENTS: ClassVar[KeywordField] = KeywordField( - "functionArguments", "functionArguments" - ) + FUNCTION_ARGUMENTS: ClassVar[KeywordField] = KeywordField("functionArguments", "functionArguments") """ Arguments that are passed in to the function. """ - FUNCTION_LANGUAGE: ClassVar[KeywordField] = KeywordField( - "functionLanguage", "functionLanguage" - ) + FUNCTION_LANGUAGE: ClassVar[KeywordField] = KeywordField("functionLanguage", "functionLanguage") """ Programming language in which the function is written. """ @@ -62,27 +54,19 @@ def __setattr__(self, name, value): """ Type of function. """ - FUNCTION_IS_EXTERNAL: ClassVar[BooleanField] = BooleanField( - "functionIsExternal", "functionIsExternal" - ) + FUNCTION_IS_EXTERNAL: ClassVar[BooleanField] = BooleanField("functionIsExternal", "functionIsExternal") """ Whether the function is stored or executed externally (true) or internally (false). """ - FUNCTION_IS_DMF: ClassVar[BooleanField] = BooleanField( - "functionIsDMF", "functionIsDMF" - ) + FUNCTION_IS_DMF: ClassVar[BooleanField] = BooleanField("functionIsDMF", "functionIsDMF") """ Whether the function is a data metric function. """ - FUNCTION_IS_SECURE: ClassVar[BooleanField] = BooleanField( - "functionIsSecure", "functionIsSecure" - ) + FUNCTION_IS_SECURE: ClassVar[BooleanField] = BooleanField("functionIsSecure", "functionIsSecure") """ Whether sensitive information of the function is omitted for unauthorized users (true) or not (false). """ - FUNCTION_IS_MEMOIZABLE: ClassVar[BooleanField] = BooleanField( - "functionIsMemoizable", "functionIsMemoizable" - ) + FUNCTION_IS_MEMOIZABLE: ClassVar[BooleanField] = BooleanField("functionIsMemoizable", "functionIsMemoizable") """ Whether the function must re-compute if there are no underlying changes in the values (false) or not (true). """ @@ -187,9 +171,7 @@ def function_is_secure(self, function_is_secure: Optional[bool]): @property def function_is_memoizable(self) -> Optional[bool]: - return ( - None if self.attributes is None else self.attributes.function_is_memoizable - ) + return None if self.attributes is None else self.attributes.function_is_memoizable @function_is_memoizable.setter def function_is_memoizable(self, function_is_memoizable: Optional[bool]): @@ -217,9 +199,7 @@ class Attributes(SQL.Attributes): function_is_d_m_f: Optional[bool] = Field(default=None, description="") function_is_secure: Optional[bool] = Field(default=None, description="") function_is_memoizable: Optional[bool] = Field(default=None, description="") - function_schema: Optional[Schema] = Field( - default=None, description="" - ) # relationship + function_schema: Optional[Schema] = Field(default=None, description="") # relationship attributes: Function.Attributes = Field( default_factory=lambda: Function.Attributes(), diff --git a/pyatlan/model/assets/core/link.py b/pyatlan/model/assets/core/link.py index 9d8308bae..b5bdeb691 100644 --- a/pyatlan/model/assets/core/link.py +++ b/pyatlan/model/assets/core/link.py @@ -22,25 +22,14 @@ class Link(Resource): @classmethod @init_guid - def creator( - cls, *, asset: Asset, name: str, link: str, idempotent: bool = False - ) -> Link: - return Link( - attributes=Link.Attributes.create( - asset=asset, name=name, link=link, idempotent=idempotent - ) - ) + def creator(cls, *, asset: Asset, name: str, link: str, idempotent: bool = False) -> Link: + return Link(attributes=Link.Attributes.create(asset=asset, name=name, link=link, idempotent=idempotent)) @classmethod @init_guid - def create( - cls, *, asset: Asset, name: str, link: str, idempotent: bool = False - ) -> Link: + def create(cls, *, asset: Asset, name: str, link: str, idempotent: bool = False) -> Link: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -116,9 +105,7 @@ class Attributes(Resource.Attributes): @classmethod @init_guid - def create( - cls, *, asset: Asset, name: str, link: str, idempotent: bool - ) -> Link.Attributes: + def create(cls, *, asset: Asset, name: str, link: str, idempotent: bool) -> Link.Attributes: validate_required_fields(["asset", "name", "link"], [asset, name, link]) qn = f"{asset.qualified_name}/{name}" if idempotent else str(uuid.uuid4()) return Link.Attributes( diff --git a/pyatlan/model/assets/core/m_c_incident.py b/pyatlan/model/assets/core/m_c_incident.py index 39d98f04b..f69b44368 100644 --- a/pyatlan/model/assets/core/m_c_incident.py +++ b/pyatlan/model/assets/core/m_c_incident.py @@ -29,45 +29,31 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MC_INCIDENT_ID: ClassVar[KeywordField] = KeywordField( - "mcIncidentId", "mcIncidentId" - ) + MC_INCIDENT_ID: ClassVar[KeywordField] = KeywordField("mcIncidentId", "mcIncidentId") """ Identifier of this incident, from Monte Carlo. """ - MC_INCIDENT_TYPE: ClassVar[KeywordField] = KeywordField( - "mcIncidentType", "mcIncidentType" - ) + MC_INCIDENT_TYPE: ClassVar[KeywordField] = KeywordField("mcIncidentType", "mcIncidentType") """ Type of this incident. """ - MC_INCIDENT_SUB_TYPES: ClassVar[KeywordField] = KeywordField( - "mcIncidentSubTypes", "mcIncidentSubTypes" - ) + MC_INCIDENT_SUB_TYPES: ClassVar[KeywordField] = KeywordField("mcIncidentSubTypes", "mcIncidentSubTypes") """ Subtypes of this incident. """ - MC_INCIDENT_SEVERITY: ClassVar[KeywordField] = KeywordField( - "mcIncidentSeverity", "mcIncidentSeverity" - ) + MC_INCIDENT_SEVERITY: ClassVar[KeywordField] = KeywordField("mcIncidentSeverity", "mcIncidentSeverity") """ Severity of this incident. """ - MC_INCIDENT_PRIORITY: ClassVar[KeywordField] = KeywordField( - "mcIncidentPriority", "mcIncidentPriority" - ) + MC_INCIDENT_PRIORITY: ClassVar[KeywordField] = KeywordField("mcIncidentPriority", "mcIncidentPriority") """ Priority of this incident inherited from monitor. """ - MC_INCIDENT_STATE: ClassVar[KeywordField] = KeywordField( - "mcIncidentState", "mcIncidentState" - ) + MC_INCIDENT_STATE: ClassVar[KeywordField] = KeywordField("mcIncidentState", "mcIncidentState") """ State of this incident. """ - MC_INCIDENT_WAREHOUSE: ClassVar[KeywordField] = KeywordField( - "mcIncidentWarehouse", "mcIncidentWarehouse" - ) + MC_INCIDENT_WAREHOUSE: ClassVar[KeywordField] = KeywordField("mcIncidentWarehouse", "mcIncidentWarehouse") """ Name of this incident's warehouse. """ @@ -115,9 +101,7 @@ def mc_incident_type(self, mc_incident_type: Optional[str]): @property def mc_incident_sub_types(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.mc_incident_sub_types - ) + return None if self.attributes is None else self.attributes.mc_incident_sub_types @mc_incident_sub_types.setter def mc_incident_sub_types(self, mc_incident_sub_types: Optional[Set[str]]): @@ -157,9 +141,7 @@ def mc_incident_state(self, mc_incident_state: Optional[str]): @property def mc_incident_warehouse(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.mc_incident_warehouse - ) + return None if self.attributes is None else self.attributes.mc_incident_warehouse @mc_incident_warehouse.setter def mc_incident_warehouse(self, mc_incident_warehouse: Optional[str]): @@ -195,12 +177,8 @@ class Attributes(MonteCarlo.Attributes): mc_incident_priority: Optional[str] = Field(default=None, description="") mc_incident_state: Optional[str] = Field(default=None, description="") mc_incident_warehouse: Optional[str] = Field(default=None, description="") - mc_monitor: Optional[MCMonitor] = Field( - default=None, description="" - ) # relationship - mc_incident_assets: Optional[List[Asset]] = Field( - default=None, description="" - ) # relationship + mc_monitor: Optional[MCMonitor] = Field(default=None, description="") # relationship + mc_incident_assets: Optional[List[Asset]] = Field(default=None, description="") # relationship attributes: MCIncident.Attributes = Field( default_factory=lambda: MCIncident.Attributes(), diff --git a/pyatlan/model/assets/core/m_c_monitor.py b/pyatlan/model/assets/core/m_c_monitor.py index d12bfe509..c3655ae47 100644 --- a/pyatlan/model/assets/core/m_c_monitor.py +++ b/pyatlan/model/assets/core/m_c_monitor.py @@ -42,27 +42,19 @@ def __setattr__(self, name, value): """ Unique identifier for this monitor, from Monte Carlo. """ - MC_MONITOR_STATUS: ClassVar[KeywordField] = KeywordField( - "mcMonitorStatus", "mcMonitorStatus" - ) + MC_MONITOR_STATUS: ClassVar[KeywordField] = KeywordField("mcMonitorStatus", "mcMonitorStatus") """ Status of this monitor. """ - MC_MONITOR_TYPE: ClassVar[KeywordField] = KeywordField( - "mcMonitorType", "mcMonitorType" - ) + MC_MONITOR_TYPE: ClassVar[KeywordField] = KeywordField("mcMonitorType", "mcMonitorType") """ Type of this monitor, for example: field health (stats) or dimension tracking (categories). """ - MC_MONITOR_WAREHOUSE: ClassVar[KeywordField] = KeywordField( - "mcMonitorWarehouse", "mcMonitorWarehouse" - ) + MC_MONITOR_WAREHOUSE: ClassVar[KeywordField] = KeywordField("mcMonitorWarehouse", "mcMonitorWarehouse") """ Name of the warehouse for this monitor. """ - MC_MONITOR_SCHEDULE_TYPE: ClassVar[KeywordField] = KeywordField( - "mcMonitorScheduleType", "mcMonitorScheduleType" - ) + MC_MONITOR_SCHEDULE_TYPE: ClassVar[KeywordField] = KeywordField("mcMonitorScheduleType", "mcMonitorScheduleType") """ Type of schedule for this monitor, for example: fixed or dynamic. """ @@ -72,15 +64,11 @@ def __setattr__(self, name, value): """ Namespace of this monitor. """ - MC_MONITOR_RULE_TYPE: ClassVar[KeywordField] = KeywordField( - "mcMonitorRuleType", "mcMonitorRuleType" - ) + MC_MONITOR_RULE_TYPE: ClassVar[KeywordField] = KeywordField("mcMonitorRuleType", "mcMonitorRuleType") """ Type of rule for this monitor. """ - MC_MONITOR_RULE_CUSTOM_SQL: ClassVar[TextField] = TextField( - "mcMonitorRuleCustomSql", "mcMonitorRuleCustomSql" - ) + MC_MONITOR_RULE_CUSTOM_SQL: ClassVar[TextField] = TextField("mcMonitorRuleCustomSql", "mcMonitorRuleCustomSql") """ SQL code for custom SQL rules. """ @@ -96,9 +84,7 @@ def __setattr__(self, name, value): """ Readable description of the schedule for the rule. """ - MC_MONITOR_ALERT_CONDITION: ClassVar[TextField] = TextField( - "mcMonitorAlertCondition", "mcMonitorAlertCondition" - ) + MC_MONITOR_ALERT_CONDITION: ClassVar[TextField] = TextField("mcMonitorAlertCondition", "mcMonitorAlertCondition") """ Condition on which the monitor produces an alert. """ @@ -126,33 +112,23 @@ def __setattr__(self, name, value): """ Whether the rule is currently snoozed (true) or not (false). """ - MC_MONITOR_BREACH_RATE: ClassVar[NumericField] = NumericField( - "mcMonitorBreachRate", "mcMonitorBreachRate" - ) + MC_MONITOR_BREACH_RATE: ClassVar[NumericField] = NumericField("mcMonitorBreachRate", "mcMonitorBreachRate") """ Rate at which this monitor is breached. """ - MC_MONITOR_INCIDENT_COUNT: ClassVar[NumericField] = NumericField( - "mcMonitorIncidentCount", "mcMonitorIncidentCount" - ) + MC_MONITOR_INCIDENT_COUNT: ClassVar[NumericField] = NumericField("mcMonitorIncidentCount", "mcMonitorIncidentCount") """ Number of incidents associated with this monitor. """ - MC_MONITOR_ALERT_COUNT: ClassVar[NumericField] = NumericField( - "mcMonitorAlertCount", "mcMonitorAlertCount" - ) + MC_MONITOR_ALERT_COUNT: ClassVar[NumericField] = NumericField("mcMonitorAlertCount", "mcMonitorAlertCount") """ Number of alerts associated with this monitor. """ - MC_MONITOR_PRIORITY: ClassVar[KeywordField] = KeywordField( - "mcMonitorPriority", "mcMonitorPriority" - ) + MC_MONITOR_PRIORITY: ClassVar[KeywordField] = KeywordField("mcMonitorPriority", "mcMonitorPriority") """ Priority of this monitor. """ - MC_MONITOR_IS_OOTB: ClassVar[BooleanField] = BooleanField( - "mcMonitorIsOotb", "mcMonitorIsOotb" - ) + MC_MONITOR_IS_OOTB: ClassVar[BooleanField] = BooleanField("mcMonitorIsOotb", "mcMonitorIsOotb") """ Whether the monitor is OOTB or not """ @@ -228,11 +204,7 @@ def mc_monitor_warehouse(self, mc_monitor_warehouse: Optional[str]): @property def mc_monitor_schedule_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mc_monitor_schedule_type - ) + return None if self.attributes is None else self.attributes.mc_monitor_schedule_type @mc_monitor_schedule_type.setter def mc_monitor_schedule_type(self, mc_monitor_schedule_type: Optional[str]): @@ -262,11 +234,7 @@ def mc_monitor_rule_type(self, mc_monitor_rule_type: Optional[str]): @property def mc_monitor_rule_custom_sql(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mc_monitor_rule_custom_sql - ) + return None if self.attributes is None else self.attributes.mc_monitor_rule_custom_sql @mc_monitor_rule_custom_sql.setter def mc_monitor_rule_custom_sql(self, mc_monitor_rule_custom_sql: Optional[str]): @@ -276,47 +244,27 @@ def mc_monitor_rule_custom_sql(self, mc_monitor_rule_custom_sql: Optional[str]): @property def mc_monitor_rule_schedule_config(self) -> Optional[MCRuleSchedule]: - return ( - None - if self.attributes is None - else self.attributes.mc_monitor_rule_schedule_config - ) + return None if self.attributes is None else self.attributes.mc_monitor_rule_schedule_config @mc_monitor_rule_schedule_config.setter - def mc_monitor_rule_schedule_config( - self, mc_monitor_rule_schedule_config: Optional[MCRuleSchedule] - ): + def mc_monitor_rule_schedule_config(self, mc_monitor_rule_schedule_config: Optional[MCRuleSchedule]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mc_monitor_rule_schedule_config = ( - mc_monitor_rule_schedule_config - ) + self.attributes.mc_monitor_rule_schedule_config = mc_monitor_rule_schedule_config @property def mc_monitor_rule_schedule_config_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mc_monitor_rule_schedule_config_humanized - ) + return None if self.attributes is None else self.attributes.mc_monitor_rule_schedule_config_humanized @mc_monitor_rule_schedule_config_humanized.setter - def mc_monitor_rule_schedule_config_humanized( - self, mc_monitor_rule_schedule_config_humanized: Optional[str] - ): + def mc_monitor_rule_schedule_config_humanized(self, mc_monitor_rule_schedule_config_humanized: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mc_monitor_rule_schedule_config_humanized = ( - mc_monitor_rule_schedule_config_humanized - ) + self.attributes.mc_monitor_rule_schedule_config_humanized = mc_monitor_rule_schedule_config_humanized @property def mc_monitor_alert_condition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mc_monitor_alert_condition - ) + return None if self.attributes is None else self.attributes.mc_monitor_alert_condition @mc_monitor_alert_condition.setter def mc_monitor_alert_condition(self, mc_monitor_alert_condition: Optional[str]): @@ -326,63 +274,37 @@ def mc_monitor_alert_condition(self, mc_monitor_alert_condition: Optional[str]): @property def mc_monitor_rule_next_execution_time(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.mc_monitor_rule_next_execution_time - ) + return None if self.attributes is None else self.attributes.mc_monitor_rule_next_execution_time @mc_monitor_rule_next_execution_time.setter - def mc_monitor_rule_next_execution_time( - self, mc_monitor_rule_next_execution_time: Optional[datetime] - ): + def mc_monitor_rule_next_execution_time(self, mc_monitor_rule_next_execution_time: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mc_monitor_rule_next_execution_time = ( - mc_monitor_rule_next_execution_time - ) + self.attributes.mc_monitor_rule_next_execution_time = mc_monitor_rule_next_execution_time @property def mc_monitor_rule_previous_execution_time(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.mc_monitor_rule_previous_execution_time - ) + return None if self.attributes is None else self.attributes.mc_monitor_rule_previous_execution_time @mc_monitor_rule_previous_execution_time.setter - def mc_monitor_rule_previous_execution_time( - self, mc_monitor_rule_previous_execution_time: Optional[datetime] - ): + def mc_monitor_rule_previous_execution_time(self, mc_monitor_rule_previous_execution_time: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mc_monitor_rule_previous_execution_time = ( - mc_monitor_rule_previous_execution_time - ) + self.attributes.mc_monitor_rule_previous_execution_time = mc_monitor_rule_previous_execution_time @property def mc_monitor_rule_comparisons(self) -> Optional[List[MCRuleComparison]]: - return ( - None - if self.attributes is None - else self.attributes.mc_monitor_rule_comparisons - ) + return None if self.attributes is None else self.attributes.mc_monitor_rule_comparisons @mc_monitor_rule_comparisons.setter - def mc_monitor_rule_comparisons( - self, mc_monitor_rule_comparisons: Optional[List[MCRuleComparison]] - ): + def mc_monitor_rule_comparisons(self, mc_monitor_rule_comparisons: Optional[List[MCRuleComparison]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mc_monitor_rule_comparisons = mc_monitor_rule_comparisons @property def mc_monitor_rule_is_snoozed(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.mc_monitor_rule_is_snoozed - ) + return None if self.attributes is None else self.attributes.mc_monitor_rule_is_snoozed @mc_monitor_rule_is_snoozed.setter def mc_monitor_rule_is_snoozed(self, mc_monitor_rule_is_snoozed: Optional[bool]): @@ -392,9 +314,7 @@ def mc_monitor_rule_is_snoozed(self, mc_monitor_rule_is_snoozed: Optional[bool]) @property def mc_monitor_breach_rate(self) -> Optional[float]: - return ( - None if self.attributes is None else self.attributes.mc_monitor_breach_rate - ) + return None if self.attributes is None else self.attributes.mc_monitor_breach_rate @mc_monitor_breach_rate.setter def mc_monitor_breach_rate(self, mc_monitor_breach_rate: Optional[float]): @@ -404,11 +324,7 @@ def mc_monitor_breach_rate(self, mc_monitor_breach_rate: Optional[float]): @property def mc_monitor_incident_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mc_monitor_incident_count - ) + return None if self.attributes is None else self.attributes.mc_monitor_incident_count @mc_monitor_incident_count.setter def mc_monitor_incident_count(self, mc_monitor_incident_count: Optional[int]): @@ -418,9 +334,7 @@ def mc_monitor_incident_count(self, mc_monitor_incident_count: Optional[int]): @property def mc_monitor_alert_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.mc_monitor_alert_count - ) + return None if self.attributes is None else self.attributes.mc_monitor_alert_count @mc_monitor_alert_count.setter def mc_monitor_alert_count(self, mc_monitor_alert_count: Optional[int]): @@ -467,31 +381,19 @@ class Attributes(MonteCarlo.Attributes): mc_monitor_namespace: Optional[str] = Field(default=None, description="") mc_monitor_rule_type: Optional[str] = Field(default=None, description="") mc_monitor_rule_custom_sql: Optional[str] = Field(default=None, description="") - mc_monitor_rule_schedule_config: Optional[MCRuleSchedule] = Field( - default=None, description="" - ) - mc_monitor_rule_schedule_config_humanized: Optional[str] = Field( - default=None, description="" - ) + mc_monitor_rule_schedule_config: Optional[MCRuleSchedule] = Field(default=None, description="") + mc_monitor_rule_schedule_config_humanized: Optional[str] = Field(default=None, description="") mc_monitor_alert_condition: Optional[str] = Field(default=None, description="") - mc_monitor_rule_next_execution_time: Optional[datetime] = Field( - default=None, description="" - ) - mc_monitor_rule_previous_execution_time: Optional[datetime] = Field( - default=None, description="" - ) - mc_monitor_rule_comparisons: Optional[List[MCRuleComparison]] = Field( - default=None, description="" - ) + mc_monitor_rule_next_execution_time: Optional[datetime] = Field(default=None, description="") + mc_monitor_rule_previous_execution_time: Optional[datetime] = Field(default=None, description="") + mc_monitor_rule_comparisons: Optional[List[MCRuleComparison]] = Field(default=None, description="") mc_monitor_rule_is_snoozed: Optional[bool] = Field(default=None, description="") mc_monitor_breach_rate: Optional[float] = Field(default=None, description="") mc_monitor_incident_count: Optional[int] = Field(default=None, description="") mc_monitor_alert_count: Optional[int] = Field(default=None, description="") mc_monitor_priority: Optional[str] = Field(default=None, description="") mc_monitor_is_ootb: Optional[bool] = Field(default=None, description="") - mc_monitor_assets: Optional[List[Asset]] = Field( - default=None, description="" - ) # relationship + mc_monitor_assets: Optional[List[Asset]] = Field(default=None, description="") # relationship attributes: MCMonitor.Attributes = Field( default_factory=lambda: MCMonitor.Attributes(), diff --git a/pyatlan/model/assets/core/materialised_view.py b/pyatlan/model/assets/core/materialised_view.py index 71137af98..042ff4fc1 100644 --- a/pyatlan/model/assets/core/materialised_view.py +++ b/pyatlan/model/assets/core/materialised_view.py @@ -60,9 +60,7 @@ def creator( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> MaterialisedView: - validate_required_fields( - ["name", "schema_qualified_name"], [name, schema_qualified_name] - ) + validate_required_fields(["name", "schema_qualified_name"], [name, schema_qualified_name]) attributes = MaterialisedView.Attributes.create( name=name, schema_qualified_name=schema_qualified_name, @@ -77,10 +75,7 @@ def creator( @init_guid def create(cls, *, name: str, schema_qualified_name: str) -> MaterialisedView: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -101,9 +96,7 @@ def __setattr__(self, name, value): """ Refresh mode for this materialized view. """ - REFRESH_METHOD: ClassVar[KeywordField] = KeywordField( - "refreshMethod", "refreshMethod" - ) + REFRESH_METHOD: ClassVar[KeywordField] = KeywordField("refreshMethod", "refreshMethod") """ Refresh method for this materialized view. """ @@ -111,9 +104,7 @@ def __setattr__(self, name, value): """ Staleness of this materialized view. """ - STALE_SINCE_DATE: ClassVar[NumericField] = NumericField( - "staleSinceDate", "staleSinceDate" - ) + STALE_SINCE_DATE: ClassVar[NumericField] = NumericField("staleSinceDate", "staleSinceDate") """ Time (epoch) from which this materialized view is stale, in milliseconds. """ @@ -129,15 +120,11 @@ def __setattr__(self, name, value): """ Size of this materialized view, in bytes. """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( - "isQueryPreview", "isQueryPreview" - ) + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") """ Whether it's possible to run a preview query on this materialized view (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( - "queryPreviewConfig", "queryPreviewConfig" - ) + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") """ Configuration for the query preview of this materialized view. """ @@ -329,18 +316,12 @@ class Attributes(SQL.Attributes): row_count: Optional[int] = Field(default=None, description="") size_bytes: Optional[int] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") definition: Optional[str] = Field(default=None, description="") - columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship - atlan_schema: Optional[Schema] = Field( - default=None, description="" - ) # relationship + columns: Optional[List[Column]] = Field(default=None, description="") # relationship + atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -354,13 +335,9 @@ def create( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> MaterialisedView.Attributes: - validate_required_fields( - ["name, schema_qualified_name"], [name, schema_qualified_name] - ) + validate_required_fields(["name, schema_qualified_name"], [name, schema_qualified_name]) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( schema_qualified_name, "schema_qualified_name", 5 @@ -371,10 +348,7 @@ def create( connection_qualified_name = connection_qualified_name or connection_qn database_name = database_name or fields[3] schema_name = schema_name or fields[4] - database_qualified_name = ( - database_qualified_name - or f"{connection_qualified_name}/{database_name}" - ) + database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" atlan_schema = Schema.ref_by_qualified_name(schema_qualified_name) return MaterialisedView.Attributes( diff --git a/pyatlan/model/assets/core/matillion.py b/pyatlan/model/assets/core/matillion.py index f9056b485..cc74ba4c0 100644 --- a/pyatlan/model/assets/core/matillion.py +++ b/pyatlan/model/assets/core/matillion.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MATILLION_VERSION: ClassVar[TextField] = TextField( - "matillionVersion", "matillionVersion" - ) + MATILLION_VERSION: ClassVar[TextField] = TextField("matillionVersion", "matillionVersion") """ Current point in time state of a project. """ diff --git a/pyatlan/model/assets/core/matillion_component.py b/pyatlan/model/assets/core/matillion_component.py index 51c69fcd7..dfe9fcdcc 100644 --- a/pyatlan/model/assets/core/matillion_component.py +++ b/pyatlan/model/assets/core/matillion_component.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MATILLION_COMPONENT_ID: ClassVar[KeywordField] = KeywordField( - "matillionComponentId", "matillionComponentId" - ) + MATILLION_COMPONENT_ID: ClassVar[KeywordField] = KeywordField("matillionComponentId", "matillionComponentId") """ Unique identifier of the component in Matillion. """ @@ -64,9 +62,7 @@ def __setattr__(self, name, value): """ Last five run statuses of the component within a job. """ - MATILLION_COMPONENT_SQLS: ClassVar[TextField] = TextField( - "matillionComponentSqls", "matillionComponentSqls" - ) + MATILLION_COMPONENT_SQLS: ClassVar[TextField] = TextField("matillionComponentSqls", "matillionComponentSqls") """ SQL queries used by the component. """ @@ -109,9 +105,7 @@ def __setattr__(self, name, value): @property def matillion_component_id(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.matillion_component_id - ) + return None if self.attributes is None else self.attributes.matillion_component_id @matillion_component_id.setter def matillion_component_id(self, matillion_component_id: Optional[str]): @@ -121,81 +115,47 @@ def matillion_component_id(self, matillion_component_id: Optional[str]): @property def matillion_component_implementation_id(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.matillion_component_implementation_id - ) + return None if self.attributes is None else self.attributes.matillion_component_implementation_id @matillion_component_implementation_id.setter - def matillion_component_implementation_id( - self, matillion_component_implementation_id: Optional[str] - ): + def matillion_component_implementation_id(self, matillion_component_implementation_id: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.matillion_component_implementation_id = ( - matillion_component_implementation_id - ) + self.attributes.matillion_component_implementation_id = matillion_component_implementation_id @property def matillion_component_linked_job(self) -> Optional[Dict[str, str]]: - return ( - None - if self.attributes is None - else self.attributes.matillion_component_linked_job - ) + return None if self.attributes is None else self.attributes.matillion_component_linked_job @matillion_component_linked_job.setter - def matillion_component_linked_job( - self, matillion_component_linked_job: Optional[Dict[str, str]] - ): + def matillion_component_linked_job(self, matillion_component_linked_job: Optional[Dict[str, str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.matillion_component_linked_job = matillion_component_linked_job @property def matillion_component_last_run_status(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.matillion_component_last_run_status - ) + return None if self.attributes is None else self.attributes.matillion_component_last_run_status @matillion_component_last_run_status.setter - def matillion_component_last_run_status( - self, matillion_component_last_run_status: Optional[str] - ): + def matillion_component_last_run_status(self, matillion_component_last_run_status: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.matillion_component_last_run_status = ( - matillion_component_last_run_status - ) + self.attributes.matillion_component_last_run_status = matillion_component_last_run_status @property def matillion_component_last_five_run_status(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.matillion_component_last_five_run_status - ) + return None if self.attributes is None else self.attributes.matillion_component_last_five_run_status @matillion_component_last_five_run_status.setter - def matillion_component_last_five_run_status( - self, matillion_component_last_five_run_status: Optional[str] - ): + def matillion_component_last_five_run_status(self, matillion_component_last_five_run_status: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.matillion_component_last_five_run_status = ( - matillion_component_last_five_run_status - ) + self.attributes.matillion_component_last_five_run_status = matillion_component_last_five_run_status @property def matillion_component_sqls(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.matillion_component_sqls - ) + return None if self.attributes is None else self.attributes.matillion_component_sqls @matillion_component_sqls.setter def matillion_component_sqls(self, matillion_component_sqls: Optional[Set[str]]): @@ -215,11 +175,7 @@ def matillion_job_name(self, matillion_job_name: Optional[str]): @property def matillion_job_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.matillion_job_qualified_name - ) + return None if self.attributes is None else self.attributes.matillion_job_qualified_name @matillion_job_qualified_name.setter def matillion_job_qualified_name(self, matillion_job_qualified_name: Optional[str]): @@ -249,31 +205,15 @@ def matillion_process(self, matillion_process: Optional[Process]): class Attributes(Matillion.Attributes): matillion_component_id: Optional[str] = Field(default=None, description="") - matillion_component_implementation_id: Optional[str] = Field( - default=None, description="" - ) - matillion_component_linked_job: Optional[Dict[str, str]] = Field( - default=None, description="" - ) - matillion_component_last_run_status: Optional[str] = Field( - default=None, description="" - ) - matillion_component_last_five_run_status: Optional[str] = Field( - default=None, description="" - ) - matillion_component_sqls: Optional[Set[str]] = Field( - default=None, description="" - ) + matillion_component_implementation_id: Optional[str] = Field(default=None, description="") + matillion_component_linked_job: Optional[Dict[str, str]] = Field(default=None, description="") + matillion_component_last_run_status: Optional[str] = Field(default=None, description="") + matillion_component_last_five_run_status: Optional[str] = Field(default=None, description="") + matillion_component_sqls: Optional[Set[str]] = Field(default=None, description="") matillion_job_name: Optional[str] = Field(default=None, description="") - matillion_job_qualified_name: Optional[str] = Field( - default=None, description="" - ) - matillion_job: Optional[MatillionJob] = Field( - default=None, description="" - ) # relationship - matillion_process: Optional[Process] = Field( - default=None, description="" - ) # relationship + matillion_job_qualified_name: Optional[str] = Field(default=None, description="") + matillion_job: Optional[MatillionJob] = Field(default=None, description="") # relationship + matillion_process: Optional[Process] = Field(default=None, description="") # relationship attributes: MatillionComponent.Attributes = Field( default_factory=lambda: MatillionComponent.Attributes(), diff --git a/pyatlan/model/assets/core/matillion_group.py b/pyatlan/model/assets/core/matillion_group.py index b778095c6..70db12d04 100644 --- a/pyatlan/model/assets/core/matillion_group.py +++ b/pyatlan/model/assets/core/matillion_group.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MATILLION_PROJECT_COUNT: ClassVar[NumericField] = NumericField( - "matillionProjectCount", "matillionProjectCount" - ) + MATILLION_PROJECT_COUNT: ClassVar[NumericField] = NumericField("matillionProjectCount", "matillionProjectCount") """ Number of projects within the group. """ @@ -48,9 +46,7 @@ def __setattr__(self, name, value): @property def matillion_project_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.matillion_project_count - ) + return None if self.attributes is None else self.attributes.matillion_project_count @matillion_project_count.setter def matillion_project_count(self, matillion_project_count: Optional[int]): @@ -70,9 +66,7 @@ def matillion_projects(self, matillion_projects: Optional[List[MatillionProject] class Attributes(Matillion.Attributes): matillion_project_count: Optional[int] = Field(default=None, description="") - matillion_projects: Optional[List[MatillionProject]] = Field( - default=None, description="" - ) # relationship + matillion_projects: Optional[List[MatillionProject]] = Field(default=None, description="") # relationship attributes: MatillionGroup.Attributes = Field( default_factory=lambda: MatillionGroup.Attributes(), diff --git a/pyatlan/model/assets/core/matillion_job.py b/pyatlan/model/assets/core/matillion_job.py index 53aca4d1d..aa4d90ba6 100644 --- a/pyatlan/model/assets/core/matillion_job.py +++ b/pyatlan/model/assets/core/matillion_job.py @@ -35,9 +35,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MATILLION_JOB_TYPE: ClassVar[KeywordField] = KeywordField( - "matillionJobType", "matillionJobType" - ) + MATILLION_JOB_TYPE: ClassVar[KeywordField] = KeywordField("matillionJobType", "matillionJobType") """ Type of the job, for example: orchestration or transformation. """ @@ -53,9 +51,7 @@ def __setattr__(self, name, value): """ Number of components within the job. """ - MATILLION_JOB_SCHEDULE: ClassVar[KeywordField] = KeywordField( - "matillionJobSchedule", "matillionJobSchedule" - ) + MATILLION_JOB_SCHEDULE: ClassVar[KeywordField] = KeywordField("matillionJobSchedule", "matillionJobSchedule") """ How the job is scheduled, for example: weekly or monthly. """ @@ -116,25 +112,17 @@ def matillion_job_path(self, matillion_job_path: Optional[str]): @property def matillion_job_component_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.matillion_job_component_count - ) + return None if self.attributes is None else self.attributes.matillion_job_component_count @matillion_job_component_count.setter - def matillion_job_component_count( - self, matillion_job_component_count: Optional[int] - ): + def matillion_job_component_count(self, matillion_job_component_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.matillion_job_component_count = matillion_job_component_count @property def matillion_job_schedule(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.matillion_job_schedule - ) + return None if self.attributes is None else self.attributes.matillion_job_schedule @matillion_job_schedule.setter def matillion_job_schedule(self, matillion_job_schedule: Optional[str]): @@ -144,9 +132,7 @@ def matillion_job_schedule(self, matillion_job_schedule: Optional[str]): @property def matillion_project_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.matillion_project_name - ) + return None if self.attributes is None else self.attributes.matillion_project_name @matillion_project_name.setter def matillion_project_name(self, matillion_project_name: Optional[str]): @@ -156,21 +142,13 @@ def matillion_project_name(self, matillion_project_name: Optional[str]): @property def matillion_project_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.matillion_project_qualified_name - ) + return None if self.attributes is None else self.attributes.matillion_project_qualified_name @matillion_project_qualified_name.setter - def matillion_project_qualified_name( - self, matillion_project_qualified_name: Optional[str] - ): + def matillion_project_qualified_name(self, matillion_project_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.matillion_project_qualified_name = ( - matillion_project_qualified_name - ) + self.attributes.matillion_project_qualified_name = matillion_project_qualified_name @property def matillion_project(self) -> Optional[MatillionProject]: @@ -187,32 +165,20 @@ def matillion_components(self) -> Optional[List[MatillionComponent]]: return None if self.attributes is None else self.attributes.matillion_components @matillion_components.setter - def matillion_components( - self, matillion_components: Optional[List[MatillionComponent]] - ): + def matillion_components(self, matillion_components: Optional[List[MatillionComponent]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.matillion_components = matillion_components class Attributes(Matillion.Attributes): - matillion_job_type: Optional[MatillionJobType] = Field( - default=None, description="" - ) + matillion_job_type: Optional[MatillionJobType] = Field(default=None, description="") matillion_job_path: Optional[str] = Field(default=None, description="") - matillion_job_component_count: Optional[int] = Field( - default=None, description="" - ) + matillion_job_component_count: Optional[int] = Field(default=None, description="") matillion_job_schedule: Optional[str] = Field(default=None, description="") matillion_project_name: Optional[str] = Field(default=None, description="") - matillion_project_qualified_name: Optional[str] = Field( - default=None, description="" - ) - matillion_project: Optional[MatillionProject] = Field( - default=None, description="" - ) # relationship - matillion_components: Optional[List[MatillionComponent]] = Field( - default=None, description="" - ) # relationship + matillion_project_qualified_name: Optional[str] = Field(default=None, description="") + matillion_project: Optional[MatillionProject] = Field(default=None, description="") # relationship + matillion_components: Optional[List[MatillionComponent]] = Field(default=None, description="") # relationship attributes: MatillionJob.Attributes = Field( default_factory=lambda: MatillionJob.Attributes(), diff --git a/pyatlan/model/assets/core/matillion_project.py b/pyatlan/model/assets/core/matillion_project.py index ca6d9e345..2d87f5f77 100644 --- a/pyatlan/model/assets/core/matillion_project.py +++ b/pyatlan/model/assets/core/matillion_project.py @@ -34,15 +34,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MATILLION_VERSIONS: ClassVar[TextField] = TextField( - "matillionVersions", "matillionVersions" - ) + MATILLION_VERSIONS: ClassVar[TextField] = TextField("matillionVersions", "matillionVersions") """ List of versions in the project. """ - MATILLION_ENVIRONMENTS: ClassVar[TextField] = TextField( - "matillionEnvironments", "matillionEnvironments" - ) + MATILLION_ENVIRONMENTS: ClassVar[TextField] = TextField("matillionEnvironments", "matillionEnvironments") """ List of environments in the project. """ @@ -98,9 +94,7 @@ def matillion_versions(self, matillion_versions: Optional[Set[str]]): @property def matillion_environments(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.matillion_environments - ) + return None if self.attributes is None else self.attributes.matillion_environments @matillion_environments.setter def matillion_environments(self, matillion_environments: Optional[Set[str]]): @@ -110,11 +104,7 @@ def matillion_environments(self, matillion_environments: Optional[Set[str]]): @property def matillion_project_job_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.matillion_project_job_count - ) + return None if self.attributes is None else self.attributes.matillion_project_job_count @matillion_project_job_count.setter def matillion_project_job_count(self, matillion_project_job_count: Optional[int]): @@ -134,16 +124,10 @@ def matillion_group_name(self, matillion_group_name: Optional[str]): @property def matillion_group_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.matillion_group_qualified_name - ) + return None if self.attributes is None else self.attributes.matillion_group_qualified_name @matillion_group_qualified_name.setter - def matillion_group_qualified_name( - self, matillion_group_qualified_name: Optional[str] - ): + def matillion_group_qualified_name(self, matillion_group_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.matillion_group_qualified_name = matillion_group_qualified_name @@ -173,15 +157,9 @@ class Attributes(Matillion.Attributes): matillion_environments: Optional[Set[str]] = Field(default=None, description="") matillion_project_job_count: Optional[int] = Field(default=None, description="") matillion_group_name: Optional[str] = Field(default=None, description="") - matillion_group_qualified_name: Optional[str] = Field( - default=None, description="" - ) - matillion_jobs: Optional[List[MatillionJob]] = Field( - default=None, description="" - ) # relationship - matillion_group: Optional[MatillionGroup] = Field( - default=None, description="" - ) # relationship + matillion_group_qualified_name: Optional[str] = Field(default=None, description="") + matillion_jobs: Optional[List[MatillionJob]] = Field(default=None, description="") # relationship + matillion_group: Optional[MatillionGroup] = Field(default=None, description="") # relationship attributes: MatillionProject.Attributes = Field( default_factory=lambda: MatillionProject.Attributes(), diff --git a/pyatlan/model/assets/core/metric.py b/pyatlan/model/assets/core/metric.py index 337c6f134..8a7d964f1 100644 --- a/pyatlan/model/assets/core/metric.py +++ b/pyatlan/model/assets/core/metric.py @@ -41,16 +41,12 @@ def __setattr__(self, name, value): """ Filters to be applied to the metric query. """ - METRIC_TIME_GRAINS: ClassVar[TextField] = TextField( - "metricTimeGrains", "metricTimeGrains" - ) + METRIC_TIME_GRAINS: ClassVar[TextField] = TextField("metricTimeGrains", "metricTimeGrains") """ List of time grains to be applied to the metric query. """ - METRIC_TIMESTAMP_COLUMN: ClassVar[RelationField] = RelationField( - "metricTimestampColumn" - ) + METRIC_TIMESTAMP_COLUMN: ClassVar[RelationField] = RelationField("metricTimestampColumn") """ TBC """ @@ -58,9 +54,7 @@ def __setattr__(self, name, value): """ TBC """ - METRIC_DIMENSION_COLUMNS: ClassVar[RelationField] = RelationField( - "metricDimensionColumns" - ) + METRIC_DIMENSION_COLUMNS: ClassVar[RelationField] = RelationField("metricDimensionColumns") """ TBC """ @@ -117,9 +111,7 @@ def metric_time_grains(self, metric_time_grains: Optional[Set[str]]): @property def metric_timestamp_column(self) -> Optional[Column]: - return ( - None if self.attributes is None else self.attributes.metric_timestamp_column - ) + return None if self.attributes is None else self.attributes.metric_timestamp_column @metric_timestamp_column.setter def metric_timestamp_column(self, metric_timestamp_column: Optional[Column]): @@ -139,16 +131,10 @@ def assets(self, assets: Optional[List[Asset]]): @property def metric_dimension_columns(self) -> Optional[List[Column]]: - return ( - None - if self.attributes is None - else self.attributes.metric_dimension_columns - ) + return None if self.attributes is None else self.attributes.metric_dimension_columns @metric_dimension_columns.setter - def metric_dimension_columns( - self, metric_dimension_columns: Optional[List[Column]] - ): + def metric_dimension_columns(self, metric_dimension_columns: Optional[List[Column]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.metric_dimension_columns = metric_dimension_columns @@ -158,15 +144,9 @@ class Attributes(DataQuality.Attributes): metric_s_q_l: Optional[str] = Field(default=None, description="") metric_filters: Optional[str] = Field(default=None, description="") metric_time_grains: Optional[Set[str]] = Field(default=None, description="") - metric_timestamp_column: Optional[Column] = Field( - default=None, description="" - ) # relationship - assets: Optional[List[Asset]] = Field( - default=None, description="" - ) # relationship - metric_dimension_columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship + metric_timestamp_column: Optional[Column] = Field(default=None, description="") # relationship + assets: Optional[List[Asset]] = Field(default=None, description="") # relationship + metric_dimension_columns: Optional[List[Column]] = Field(default=None, description="") # relationship attributes: Metric.Attributes = Field( default_factory=lambda: Metric.Attributes(), diff --git a/pyatlan/model/assets/core/model.py b/pyatlan/model/assets/core/model.py index 083c395ab..32c3ef54d 100644 --- a/pyatlan/model/assets/core/model.py +++ b/pyatlan/model/assets/core/model.py @@ -34,21 +34,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODEL_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "modelName", "modelName.keyword", "modelName" - ) + MODEL_NAME: ClassVar[KeywordTextField] = KeywordTextField("modelName", "modelName.keyword", "modelName") """ Simple name of the model in which this asset exists, or empty if it is itself a data model. """ - MODEL_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "modelQualifiedName", "modelQualifiedName" - ) + MODEL_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("modelQualifiedName", "modelQualifiedName") """ Unique name of the model in which this asset exists, or empty if it is itself a data model. """ - MODEL_DOMAIN: ClassVar[KeywordTextField] = KeywordTextField( - "modelDomain", "modelDomain.keyword", "modelDomain" - ) + MODEL_DOMAIN: ClassVar[KeywordTextField] = KeywordTextField("modelDomain", "modelDomain.keyword", "modelDomain") """ Model domain in which this asset exists. """ @@ -92,15 +86,11 @@ def __setattr__(self, name, value): """ Type of the model asset (conceptual, logical, physical). """ - MODEL_SYSTEM_DATE: ClassVar[NumericField] = NumericField( - "modelSystemDate", "modelSystemDate" - ) + MODEL_SYSTEM_DATE: ClassVar[NumericField] = NumericField("modelSystemDate", "modelSystemDate") """ System date for the asset. """ - MODEL_BUSINESS_DATE: ClassVar[NumericField] = NumericField( - "modelBusinessDate", "modelBusinessDate" - ) + MODEL_BUSINESS_DATE: ClassVar[NumericField] = NumericField("modelBusinessDate", "modelBusinessDate") """ Business date for the asset. """ @@ -186,29 +176,17 @@ def model_version_name(self, model_version_name: Optional[str]): @property def model_version_agnostic_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_version_agnostic_qualified_name - ) + return None if self.attributes is None else self.attributes.model_version_agnostic_qualified_name @model_version_agnostic_qualified_name.setter - def model_version_agnostic_qualified_name( - self, model_version_agnostic_qualified_name: Optional[str] - ): + def model_version_agnostic_qualified_name(self, model_version_agnostic_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_version_agnostic_qualified_name = ( - model_version_agnostic_qualified_name - ) + self.attributes.model_version_agnostic_qualified_name = model_version_agnostic_qualified_name @property def model_version_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_version_qualified_name - ) + return None if self.attributes is None else self.attributes.model_version_qualified_name @model_version_qualified_name.setter def model_version_qualified_name(self, model_version_qualified_name: Optional[str]): @@ -228,11 +206,7 @@ def model_entity_name(self, model_entity_name: Optional[str]): @property def model_entity_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_qualified_name - ) + return None if self.attributes is None else self.attributes.model_entity_qualified_name @model_entity_qualified_name.setter def model_entity_qualified_name(self, model_entity_qualified_name: Optional[str]): @@ -272,32 +246,20 @@ def model_business_date(self, model_business_date: Optional[datetime]): @property def model_expired_at_system_date(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.model_expired_at_system_date - ) + return None if self.attributes is None else self.attributes.model_expired_at_system_date @model_expired_at_system_date.setter - def model_expired_at_system_date( - self, model_expired_at_system_date: Optional[datetime] - ): + def model_expired_at_system_date(self, model_expired_at_system_date: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_expired_at_system_date = model_expired_at_system_date @property def model_expired_at_business_date(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.model_expired_at_business_date - ) + return None if self.attributes is None else self.attributes.model_expired_at_business_date @model_expired_at_business_date.setter - def model_expired_at_business_date( - self, model_expired_at_business_date: Optional[datetime] - ): + def model_expired_at_business_date(self, model_expired_at_business_date: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_expired_at_business_date = model_expired_at_business_date @@ -308,23 +270,15 @@ class Attributes(Catalog.Attributes): model_domain: Optional[str] = Field(default=None, description="") model_namespace: Optional[str] = Field(default=None, description="") model_version_name: Optional[str] = Field(default=None, description="") - model_version_agnostic_qualified_name: Optional[str] = Field( - default=None, description="" - ) - model_version_qualified_name: Optional[str] = Field( - default=None, description="" - ) + model_version_agnostic_qualified_name: Optional[str] = Field(default=None, description="") + model_version_qualified_name: Optional[str] = Field(default=None, description="") model_entity_name: Optional[str] = Field(default=None, description="") model_entity_qualified_name: Optional[str] = Field(default=None, description="") model_type: Optional[str] = Field(default=None, description="") model_system_date: Optional[datetime] = Field(default=None, description="") model_business_date: Optional[datetime] = Field(default=None, description="") - model_expired_at_system_date: Optional[datetime] = Field( - default=None, description="" - ) - model_expired_at_business_date: Optional[datetime] = Field( - default=None, description="" - ) + model_expired_at_system_date: Optional[datetime] = Field(default=None, description="") + model_expired_at_business_date: Optional[datetime] = Field(default=None, description="") attributes: Model.Attributes = Field( default_factory=lambda: Model.Attributes(), diff --git a/pyatlan/model/assets/core/model_attribute.py b/pyatlan/model/assets/core/model_attribute.py index e0dbc5f28..334426c8f 100644 --- a/pyatlan/model/assets/core/model_attribute.py +++ b/pyatlan/model/assets/core/model_attribute.py @@ -64,15 +64,11 @@ def __setattr__(self, name, value): """ Precision of the attribute. """ - MODEL_ATTRIBUTE_SCALE: ClassVar[NumericField] = NumericField( - "modelAttributeScale", "modelAttributeScale" - ) + MODEL_ATTRIBUTE_SCALE: ClassVar[NumericField] = NumericField("modelAttributeScale", "modelAttributeScale") """ Scale of the attribute. """ - MODEL_ATTRIBUTE_DATA_TYPE: ClassVar[KeywordField] = KeywordField( - "modelAttributeDataType", "modelAttributeDataType" - ) + MODEL_ATTRIBUTE_DATA_TYPE: ClassVar[KeywordField] = KeywordField("modelAttributeDataType", "modelAttributeDataType") """ Type of the attribute. """ @@ -83,21 +79,15 @@ def __setattr__(self, name, value): When true, this attribute has relationships with other attributes. """ - MODEL_ATTRIBUTE_IMPLEMENTED_BY_ASSETS: ClassVar[RelationField] = RelationField( - "modelAttributeImplementedByAssets" - ) + MODEL_ATTRIBUTE_IMPLEMENTED_BY_ASSETS: ClassVar[RelationField] = RelationField("modelAttributeImplementedByAssets") """ TBC """ - MODEL_ATTRIBUTE_RELATED_TO_ATTRIBUTES: ClassVar[RelationField] = RelationField( - "modelAttributeRelatedToAttributes" - ) + MODEL_ATTRIBUTE_RELATED_TO_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelAttributeRelatedToAttributes") """ TBC """ - MODEL_ATTRIBUTE_ENTITIES: ClassVar[RelationField] = RelationField( - "modelAttributeEntities" - ) + MODEL_ATTRIBUTE_ENTITIES: ClassVar[RelationField] = RelationField("modelAttributeEntities") """ TBC """ @@ -107,9 +97,7 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_ATTRIBUTE_MAPPED_TO_ATTRIBUTES: ClassVar[RelationField] = RelationField( - "modelAttributeMappedToAttributes" - ) + MODEL_ATTRIBUTE_MAPPED_TO_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelAttributeMappedToAttributes") """ TBC """ @@ -139,11 +127,7 @@ def __setattr__(self, name, value): @property def model_attribute_is_nullable(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_is_nullable - ) + return None if self.attributes is None else self.attributes.model_attribute_is_nullable @model_attribute_is_nullable.setter def model_attribute_is_nullable(self, model_attribute_is_nullable: Optional[bool]): @@ -153,11 +137,7 @@ def model_attribute_is_nullable(self, model_attribute_is_nullable: Optional[bool @property def model_attribute_is_primary(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_is_primary - ) + return None if self.attributes is None else self.attributes.model_attribute_is_primary @model_attribute_is_primary.setter def model_attribute_is_primary(self, model_attribute_is_primary: Optional[bool]): @@ -167,11 +147,7 @@ def model_attribute_is_primary(self, model_attribute_is_primary: Optional[bool]) @property def model_attribute_is_foreign(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_is_foreign - ) + return None if self.attributes is None else self.attributes.model_attribute_is_foreign @model_attribute_is_foreign.setter def model_attribute_is_foreign(self, model_attribute_is_foreign: Optional[bool]): @@ -181,11 +157,7 @@ def model_attribute_is_foreign(self, model_attribute_is_foreign: Optional[bool]) @property def model_attribute_is_derived(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_is_derived - ) + return None if self.attributes is None else self.attributes.model_attribute_is_derived @model_attribute_is_derived.setter def model_attribute_is_derived(self, model_attribute_is_derived: Optional[bool]): @@ -195,11 +167,7 @@ def model_attribute_is_derived(self, model_attribute_is_derived: Optional[bool]) @property def model_attribute_precision(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_precision - ) + return None if self.attributes is None else self.attributes.model_attribute_precision @model_attribute_precision.setter def model_attribute_precision(self, model_attribute_precision: Optional[int]): @@ -209,9 +177,7 @@ def model_attribute_precision(self, model_attribute_precision: Optional[int]): @property def model_attribute_scale(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.model_attribute_scale - ) + return None if self.attributes is None else self.attributes.model_attribute_scale @model_attribute_scale.setter def model_attribute_scale(self, model_attribute_scale: Optional[int]): @@ -221,11 +187,7 @@ def model_attribute_scale(self, model_attribute_scale: Optional[int]): @property def model_attribute_data_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_data_type - ) + return None if self.attributes is None else self.attributes.model_attribute_data_type @model_attribute_data_type.setter def model_attribute_data_type(self, model_attribute_data_type: Optional[str]): @@ -235,75 +197,45 @@ def model_attribute_data_type(self, model_attribute_data_type: Optional[str]): @property def model_attribute_has_relationships(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_has_relationships - ) + return None if self.attributes is None else self.attributes.model_attribute_has_relationships @model_attribute_has_relationships.setter - def model_attribute_has_relationships( - self, model_attribute_has_relationships: Optional[bool] - ): + def model_attribute_has_relationships(self, model_attribute_has_relationships: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_has_relationships = ( - model_attribute_has_relationships - ) + self.attributes.model_attribute_has_relationships = model_attribute_has_relationships @property def model_attribute_implemented_by_assets(self) -> Optional[List[Catalog]]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_implemented_by_assets - ) + return None if self.attributes is None else self.attributes.model_attribute_implemented_by_assets @model_attribute_implemented_by_assets.setter - def model_attribute_implemented_by_assets( - self, model_attribute_implemented_by_assets: Optional[List[Catalog]] - ): + def model_attribute_implemented_by_assets(self, model_attribute_implemented_by_assets: Optional[List[Catalog]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_implemented_by_assets = ( - model_attribute_implemented_by_assets - ) + self.attributes.model_attribute_implemented_by_assets = model_attribute_implemented_by_assets @property def model_attribute_related_to_attributes( self, ) -> Optional[List[ModelAttributeAssociation]]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_related_to_attributes - ) + return None if self.attributes is None else self.attributes.model_attribute_related_to_attributes @model_attribute_related_to_attributes.setter def model_attribute_related_to_attributes( self, - model_attribute_related_to_attributes: Optional[ - List[ModelAttributeAssociation] - ], + model_attribute_related_to_attributes: Optional[List[ModelAttributeAssociation]], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_related_to_attributes = ( - model_attribute_related_to_attributes - ) + self.attributes.model_attribute_related_to_attributes = model_attribute_related_to_attributes @property def model_attribute_entities(self) -> Optional[List[ModelEntity]]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_entities - ) + return None if self.attributes is None else self.attributes.model_attribute_entities @model_attribute_entities.setter - def model_attribute_entities( - self, model_attribute_entities: Optional[List[ModelEntity]] - ): + def model_attribute_entities(self, model_attribute_entities: Optional[List[ModelEntity]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_attribute_entities = model_attribute_entities @@ -312,32 +244,20 @@ def model_attribute_entities( def model_attribute_related_from_attributes( self, ) -> Optional[List[ModelAttributeAssociation]]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_related_from_attributes - ) + return None if self.attributes is None else self.attributes.model_attribute_related_from_attributes @model_attribute_related_from_attributes.setter def model_attribute_related_from_attributes( self, - model_attribute_related_from_attributes: Optional[ - List[ModelAttributeAssociation] - ], + model_attribute_related_from_attributes: Optional[List[ModelAttributeAssociation]], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_related_from_attributes = ( - model_attribute_related_from_attributes - ) + self.attributes.model_attribute_related_from_attributes = model_attribute_related_from_attributes @property def model_attribute_mapped_to_attributes(self) -> Optional[List[ModelAttribute]]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_mapped_to_attributes - ) + return None if self.attributes is None else self.attributes.model_attribute_mapped_to_attributes @model_attribute_mapped_to_attributes.setter def model_attribute_mapped_to_attributes( @@ -345,17 +265,11 @@ def model_attribute_mapped_to_attributes( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_mapped_to_attributes = ( - model_attribute_mapped_to_attributes - ) + self.attributes.model_attribute_mapped_to_attributes = model_attribute_mapped_to_attributes @property def model_attribute_mapped_from_attributes(self) -> Optional[List[ModelAttribute]]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_mapped_from_attributes - ) + return None if self.attributes is None else self.attributes.model_attribute_mapped_from_attributes @model_attribute_mapped_from_attributes.setter def model_attribute_mapped_from_attributes( @@ -363,37 +277,25 @@ def model_attribute_mapped_from_attributes( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_mapped_from_attributes = ( - model_attribute_mapped_from_attributes - ) + self.attributes.model_attribute_mapped_from_attributes = model_attribute_mapped_from_attributes class Attributes(Model.Attributes): - model_attribute_is_nullable: Optional[bool] = Field( - default=None, description="" - ) + model_attribute_is_nullable: Optional[bool] = Field(default=None, description="") model_attribute_is_primary: Optional[bool] = Field(default=None, description="") model_attribute_is_foreign: Optional[bool] = Field(default=None, description="") model_attribute_is_derived: Optional[bool] = Field(default=None, description="") model_attribute_precision: Optional[int] = Field(default=None, description="") model_attribute_scale: Optional[int] = Field(default=None, description="") model_attribute_data_type: Optional[str] = Field(default=None, description="") - model_attribute_has_relationships: Optional[bool] = Field( - default=None, description="" - ) + model_attribute_has_relationships: Optional[bool] = Field(default=None, description="") model_attribute_implemented_by_assets: Optional[List[Catalog]] = Field( default=None, description="" ) # relationship - model_attribute_related_to_attributes: Optional[ - List[ModelAttributeAssociation] - ] = Field( - default=None, description="" - ) # relationship - model_attribute_entities: Optional[List[ModelEntity]] = Field( + model_attribute_related_to_attributes: Optional[List[ModelAttributeAssociation]] = Field( default=None, description="" ) # relationship - model_attribute_related_from_attributes: Optional[ - List[ModelAttributeAssociation] - ] = Field( + model_attribute_entities: Optional[List[ModelEntity]] = Field(default=None, description="") # relationship + model_attribute_related_from_attributes: Optional[List[ModelAttributeAssociation]] = Field( default=None, description="" ) # relationship model_attribute_mapped_to_attributes: Optional[List[ModelAttribute]] = Field( diff --git a/pyatlan/model/assets/core/model_attribute_association.py b/pyatlan/model/assets/core/model_attribute_association.py index d2865c604..c616f7f4d 100644 --- a/pyatlan/model/assets/core/model_attribute_association.py +++ b/pyatlan/model/assets/core/model_attribute_association.py @@ -29,20 +29,16 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODEL_ATTRIBUTE_ASSOCIATION_TO_QUALIFIED_NAME: ClassVar[KeywordField] = ( - KeywordField( - "modelAttributeAssociationToQualifiedName", - "modelAttributeAssociationToQualifiedName", - ) + MODEL_ATTRIBUTE_ASSOCIATION_TO_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "modelAttributeAssociationToQualifiedName", + "modelAttributeAssociationToQualifiedName", ) """ Unique name of the association to which this attribute is related. """ - MODEL_ATTRIBUTE_ASSOCIATION_FROM_QUALIFIED_NAME: ClassVar[KeywordField] = ( - KeywordField( - "modelAttributeAssociationFromQualifiedName", - "modelAttributeAssociationFromQualifiedName", - ) + MODEL_ATTRIBUTE_ASSOCIATION_FROM_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "modelAttributeAssociationFromQualifiedName", + "modelAttributeAssociationFromQualifiedName", ) """ Unique name of the association from which this attribute is related. @@ -54,15 +50,11 @@ def __setattr__(self, name, value): Unique name of the entity association to which this attribute is related. """ - MODEL_ATTRIBUTE_ASSOCIATION_FROM: ClassVar[RelationField] = RelationField( - "modelAttributeAssociationFrom" - ) + MODEL_ATTRIBUTE_ASSOCIATION_FROM: ClassVar[RelationField] = RelationField("modelAttributeAssociationFrom") """ TBC """ - MODEL_ATTRIBUTE_ASSOCIATION_TO: ClassVar[RelationField] = RelationField( - "modelAttributeAssociationTo" - ) + MODEL_ATTRIBUTE_ASSOCIATION_TO: ClassVar[RelationField] = RelationField("modelAttributeAssociationTo") """ TBC """ @@ -77,11 +69,7 @@ def __setattr__(self, name, value): @property def model_attribute_association_to_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_association_to_qualified_name - ) + return None if self.attributes is None else self.attributes.model_attribute_association_to_qualified_name @model_attribute_association_to_qualified_name.setter def model_attribute_association_to_qualified_name( @@ -89,17 +77,11 @@ def model_attribute_association_to_qualified_name( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_association_to_qualified_name = ( - model_attribute_association_to_qualified_name - ) + self.attributes.model_attribute_association_to_qualified_name = model_attribute_association_to_qualified_name @property def model_attribute_association_from_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_association_from_qualified_name - ) + return None if self.attributes is None else self.attributes.model_attribute_association_from_qualified_name @model_attribute_association_from_qualified_name.setter def model_attribute_association_from_qualified_name( @@ -113,72 +95,40 @@ def model_attribute_association_from_qualified_name( @property def model_entity_association_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_qualified_name - ) + return None if self.attributes is None else self.attributes.model_entity_association_qualified_name @model_entity_association_qualified_name.setter - def model_entity_association_qualified_name( - self, model_entity_association_qualified_name: Optional[str] - ): + def model_entity_association_qualified_name(self, model_entity_association_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_qualified_name = ( - model_entity_association_qualified_name - ) + self.attributes.model_entity_association_qualified_name = model_entity_association_qualified_name @property def model_attribute_association_from(self) -> Optional[ModelAttribute]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_association_from - ) + return None if self.attributes is None else self.attributes.model_attribute_association_from @model_attribute_association_from.setter - def model_attribute_association_from( - self, model_attribute_association_from: Optional[ModelAttribute] - ): + def model_attribute_association_from(self, model_attribute_association_from: Optional[ModelAttribute]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_association_from = ( - model_attribute_association_from - ) + self.attributes.model_attribute_association_from = model_attribute_association_from @property def model_attribute_association_to(self) -> Optional[ModelAttribute]: - return ( - None - if self.attributes is None - else self.attributes.model_attribute_association_to - ) + return None if self.attributes is None else self.attributes.model_attribute_association_to @model_attribute_association_to.setter - def model_attribute_association_to( - self, model_attribute_association_to: Optional[ModelAttribute] - ): + def model_attribute_association_to(self, model_attribute_association_to: Optional[ModelAttribute]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_attribute_association_to = model_attribute_association_to class Attributes(Model.Attributes): - model_attribute_association_to_qualified_name: Optional[str] = Field( - default=None, description="" - ) - model_attribute_association_from_qualified_name: Optional[str] = Field( - default=None, description="" - ) - model_entity_association_qualified_name: Optional[str] = Field( - default=None, description="" - ) - model_attribute_association_from: Optional[ModelAttribute] = Field( - default=None, description="" - ) # relationship - model_attribute_association_to: Optional[ModelAttribute] = Field( - default=None, description="" - ) # relationship + model_attribute_association_to_qualified_name: Optional[str] = Field(default=None, description="") + model_attribute_association_from_qualified_name: Optional[str] = Field(default=None, description="") + model_entity_association_qualified_name: Optional[str] = Field(default=None, description="") + model_attribute_association_from: Optional[ModelAttribute] = Field(default=None, description="") # relationship + model_attribute_association_to: Optional[ModelAttribute] = Field(default=None, description="") # relationship attributes: ModelAttributeAssociation.Attributes = Field( default_factory=lambda: ModelAttributeAssociation.Attributes(), diff --git a/pyatlan/model/assets/core/model_data_model.py b/pyatlan/model/assets/core/model_data_model.py index 794a63ed2..bcbb30fec 100644 --- a/pyatlan/model/assets/core/model_data_model.py +++ b/pyatlan/model/assets/core/model_data_model.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODEL_VERSION_COUNT: ClassVar[NumericField] = NumericField( - "modelVersionCount", "modelVersionCount" - ) + MODEL_VERSION_COUNT: ClassVar[NumericField] = NumericField("modelVersionCount", "modelVersionCount") """ Number of versions of the data model. """ @@ -84,9 +82,7 @@ def model_versions(self, model_versions: Optional[List[ModelVersion]]): class Attributes(Model.Attributes): model_version_count: Optional[int] = Field(default=None, description="") model_tool: Optional[str] = Field(default=None, description="") - model_versions: Optional[List[ModelVersion]] = Field( - default=None, description="" - ) # relationship + model_versions: Optional[List[ModelVersion]] = Field(default=None, description="") # relationship attributes: ModelDataModel.Attributes = Field( default_factory=lambda: ModelDataModel.Attributes(), diff --git a/pyatlan/model/assets/core/model_entity.py b/pyatlan/model/assets/core/model_entity.py index 36bbdc7c5..e8fb33a1d 100644 --- a/pyatlan/model/assets/core/model_entity.py +++ b/pyatlan/model/assets/core/model_entity.py @@ -40,9 +40,7 @@ def __setattr__(self, name, value): """ Number of attributes in the entity. """ - MODEL_ENTITY_SUBJECT_AREA: ClassVar[KeywordField] = KeywordField( - "modelEntitySubjectArea", "modelEntitySubjectArea" - ) + MODEL_ENTITY_SUBJECT_AREA: ClassVar[KeywordField] = KeywordField("modelEntitySubjectArea", "modelEntitySubjectArea") """ Subject area of the entity. """ @@ -62,39 +60,27 @@ def __setattr__(self, name, value): Unique identifier for the general entity. """ - MODEL_ENTITY_RELATED_TO_ENTITIES: ClassVar[RelationField] = RelationField( - "modelEntityRelatedToEntities" - ) + MODEL_ENTITY_RELATED_TO_ENTITIES: ClassVar[RelationField] = RelationField("modelEntityRelatedToEntities") """ TBC """ - MODEL_ENTITY_GENERALIZATION_ENTITY: ClassVar[RelationField] = RelationField( - "modelEntityGeneralizationEntity" - ) + MODEL_ENTITY_GENERALIZATION_ENTITY: ClassVar[RelationField] = RelationField("modelEntityGeneralizationEntity") """ TBC """ - MODEL_ENTITY_IMPLEMENTED_BY_ASSETS: ClassVar[RelationField] = RelationField( - "modelEntityImplementedByAssets" - ) + MODEL_ENTITY_IMPLEMENTED_BY_ASSETS: ClassVar[RelationField] = RelationField("modelEntityImplementedByAssets") """ TBC """ - MODEL_ENTITY_ATTRIBUTES: ClassVar[RelationField] = RelationField( - "modelEntityAttributes" - ) + MODEL_ENTITY_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelEntityAttributes") """ TBC """ - MODEL_ENTITY_MAPPED_TO_ENTITIES: ClassVar[RelationField] = RelationField( - "modelEntityMappedToEntities" - ) + MODEL_ENTITY_MAPPED_TO_ENTITIES: ClassVar[RelationField] = RelationField("modelEntityMappedToEntities") """ TBC """ - MODEL_ENTITY_RELATED_FROM_ENTITIES: ClassVar[RelationField] = RelationField( - "modelEntityRelatedFromEntities" - ) + MODEL_ENTITY_RELATED_FROM_ENTITIES: ClassVar[RelationField] = RelationField("modelEntityRelatedFromEntities") """ TBC """ @@ -102,15 +88,11 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_ENTITY_MAPPED_FROM_ENTITIES: ClassVar[RelationField] = RelationField( - "modelEntityMappedFromEntities" - ) + MODEL_ENTITY_MAPPED_FROM_ENTITIES: ClassVar[RelationField] = RelationField("modelEntityMappedFromEntities") """ TBC """ - MODEL_ENTITY_SPECIALIZATION_ENTITIES: ClassVar[RelationField] = RelationField( - "modelEntitySpecializationEntities" - ) + MODEL_ENTITY_SPECIALIZATION_ENTITIES: ClassVar[RelationField] = RelationField("modelEntitySpecializationEntities") """ TBC """ @@ -133,11 +115,7 @@ def __setattr__(self, name, value): @property def model_entity_attribute_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_attribute_count - ) + return None if self.attributes is None else self.attributes.model_entity_attribute_count @model_entity_attribute_count.setter def model_entity_attribute_count(self, model_entity_attribute_count: Optional[int]): @@ -147,11 +125,7 @@ def model_entity_attribute_count(self, model_entity_attribute_count: Optional[in @property def model_entity_subject_area(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_subject_area - ) + return None if self.attributes is None else self.attributes.model_entity_subject_area @model_entity_subject_area.setter def model_entity_subject_area(self, model_entity_subject_area: Optional[str]): @@ -161,49 +135,29 @@ def model_entity_subject_area(self, model_entity_subject_area: Optional[str]): @property def model_entity_generalization_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_generalization_name - ) + return None if self.attributes is None else self.attributes.model_entity_generalization_name @model_entity_generalization_name.setter - def model_entity_generalization_name( - self, model_entity_generalization_name: Optional[str] - ): + def model_entity_generalization_name(self, model_entity_generalization_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_generalization_name = ( - model_entity_generalization_name - ) + self.attributes.model_entity_generalization_name = model_entity_generalization_name @property def model_entity_generalization_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_generalization_qualified_name - ) + return None if self.attributes is None else self.attributes.model_entity_generalization_qualified_name @model_entity_generalization_qualified_name.setter - def model_entity_generalization_qualified_name( - self, model_entity_generalization_qualified_name: Optional[str] - ): + def model_entity_generalization_qualified_name(self, model_entity_generalization_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_generalization_qualified_name = ( - model_entity_generalization_qualified_name - ) + self.attributes.model_entity_generalization_qualified_name = model_entity_generalization_qualified_name @property def model_entity_related_to_entities( self, ) -> Optional[List[ModelEntityAssociation]]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_related_to_entities - ) + return None if self.attributes is None else self.attributes.model_entity_related_to_entities @model_entity_related_to_entities.setter def model_entity_related_to_entities( @@ -211,87 +165,53 @@ def model_entity_related_to_entities( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_related_to_entities = ( - model_entity_related_to_entities - ) + self.attributes.model_entity_related_to_entities = model_entity_related_to_entities @property def model_entity_generalization_entity(self) -> Optional[ModelEntity]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_generalization_entity - ) + return None if self.attributes is None else self.attributes.model_entity_generalization_entity @model_entity_generalization_entity.setter - def model_entity_generalization_entity( - self, model_entity_generalization_entity: Optional[ModelEntity] - ): + def model_entity_generalization_entity(self, model_entity_generalization_entity: Optional[ModelEntity]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_generalization_entity = ( - model_entity_generalization_entity - ) + self.attributes.model_entity_generalization_entity = model_entity_generalization_entity @property def model_entity_implemented_by_assets(self) -> Optional[List[Catalog]]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_implemented_by_assets - ) + return None if self.attributes is None else self.attributes.model_entity_implemented_by_assets @model_entity_implemented_by_assets.setter - def model_entity_implemented_by_assets( - self, model_entity_implemented_by_assets: Optional[List[Catalog]] - ): + def model_entity_implemented_by_assets(self, model_entity_implemented_by_assets: Optional[List[Catalog]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_implemented_by_assets = ( - model_entity_implemented_by_assets - ) + self.attributes.model_entity_implemented_by_assets = model_entity_implemented_by_assets @property def model_entity_attributes(self) -> Optional[List[ModelAttribute]]: - return ( - None if self.attributes is None else self.attributes.model_entity_attributes - ) + return None if self.attributes is None else self.attributes.model_entity_attributes @model_entity_attributes.setter - def model_entity_attributes( - self, model_entity_attributes: Optional[List[ModelAttribute]] - ): + def model_entity_attributes(self, model_entity_attributes: Optional[List[ModelAttribute]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_entity_attributes = model_entity_attributes @property def model_entity_mapped_to_entities(self) -> Optional[List[ModelEntity]]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_mapped_to_entities - ) + return None if self.attributes is None else self.attributes.model_entity_mapped_to_entities @model_entity_mapped_to_entities.setter - def model_entity_mapped_to_entities( - self, model_entity_mapped_to_entities: Optional[List[ModelEntity]] - ): + def model_entity_mapped_to_entities(self, model_entity_mapped_to_entities: Optional[List[ModelEntity]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_mapped_to_entities = ( - model_entity_mapped_to_entities - ) + self.attributes.model_entity_mapped_to_entities = model_entity_mapped_to_entities @property def model_entity_related_from_entities( self, ) -> Optional[List[ModelEntityAssociation]]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_related_from_entities - ) + return None if self.attributes is None else self.attributes.model_entity_related_from_entities @model_entity_related_from_entities.setter def model_entity_related_from_entities( @@ -299,9 +219,7 @@ def model_entity_related_from_entities( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_related_from_entities = ( - model_entity_related_from_entities - ) + self.attributes.model_entity_related_from_entities = model_entity_related_from_entities @property def model_versions(self) -> Optional[List[ModelVersion]]: @@ -315,72 +233,44 @@ def model_versions(self, model_versions: Optional[List[ModelVersion]]): @property def model_entity_mapped_from_entities(self) -> Optional[List[ModelEntity]]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_mapped_from_entities - ) + return None if self.attributes is None else self.attributes.model_entity_mapped_from_entities @model_entity_mapped_from_entities.setter - def model_entity_mapped_from_entities( - self, model_entity_mapped_from_entities: Optional[List[ModelEntity]] - ): + def model_entity_mapped_from_entities(self, model_entity_mapped_from_entities: Optional[List[ModelEntity]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_mapped_from_entities = ( - model_entity_mapped_from_entities - ) + self.attributes.model_entity_mapped_from_entities = model_entity_mapped_from_entities @property def model_entity_specialization_entities(self) -> Optional[List[ModelEntity]]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_specialization_entities - ) + return None if self.attributes is None else self.attributes.model_entity_specialization_entities @model_entity_specialization_entities.setter - def model_entity_specialization_entities( - self, model_entity_specialization_entities: Optional[List[ModelEntity]] - ): + def model_entity_specialization_entities(self, model_entity_specialization_entities: Optional[List[ModelEntity]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_specialization_entities = ( - model_entity_specialization_entities - ) + self.attributes.model_entity_specialization_entities = model_entity_specialization_entities class Attributes(Model.Attributes): - model_entity_attribute_count: Optional[int] = Field( - default=None, description="" - ) + model_entity_attribute_count: Optional[int] = Field(default=None, description="") model_entity_subject_area: Optional[str] = Field(default=None, description="") - model_entity_generalization_name: Optional[str] = Field( - default=None, description="" - ) - model_entity_generalization_qualified_name: Optional[str] = Field( - default=None, description="" - ) - model_entity_related_to_entities: Optional[List[ModelEntityAssociation]] = ( - Field(default=None, description="") - ) # relationship - model_entity_generalization_entity: Optional[ModelEntity] = Field( + model_entity_generalization_name: Optional[str] = Field(default=None, description="") + model_entity_generalization_qualified_name: Optional[str] = Field(default=None, description="") + model_entity_related_to_entities: Optional[List[ModelEntityAssociation]] = Field( default=None, description="" ) # relationship + model_entity_generalization_entity: Optional[ModelEntity] = Field(default=None, description="") # relationship model_entity_implemented_by_assets: Optional[List[Catalog]] = Field( default=None, description="" ) # relationship - model_entity_attributes: Optional[List[ModelAttribute]] = Field( - default=None, description="" - ) # relationship + model_entity_attributes: Optional[List[ModelAttribute]] = Field(default=None, description="") # relationship model_entity_mapped_to_entities: Optional[List[ModelEntity]] = Field( default=None, description="" ) # relationship - model_entity_related_from_entities: Optional[List[ModelEntityAssociation]] = ( - Field(default=None, description="") - ) # relationship - model_versions: Optional[List[ModelVersion]] = Field( + model_entity_related_from_entities: Optional[List[ModelEntityAssociation]] = Field( default=None, description="" ) # relationship + model_versions: Optional[List[ModelVersion]] = Field(default=None, description="") # relationship model_entity_mapped_from_entities: Optional[List[ModelEntity]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/core/model_entity_association.py b/pyatlan/model/assets/core/model_entity_association.py index 1789255d9..27b4323e6 100644 --- a/pyatlan/model/assets/core/model_entity_association.py +++ b/pyatlan/model/assets/core/model_entity_association.py @@ -81,34 +81,26 @@ def __setattr__(self, name, value): """ Label when read from the association from which this entity is related. """ - MODEL_ENTITY_ASSOCIATION_FROM_MIN_CARDINALITY: ClassVar[NumericField] = ( - NumericField( - "modelEntityAssociationFromMinCardinality", - "modelEntityAssociationFromMinCardinality", - ) + MODEL_ENTITY_ASSOCIATION_FROM_MIN_CARDINALITY: ClassVar[NumericField] = NumericField( + "modelEntityAssociationFromMinCardinality", + "modelEntityAssociationFromMinCardinality", ) """ Minimum cardinality of the data entity from which the association exists. """ - MODEL_ENTITY_ASSOCIATION_FROM_MAX_CARDINALITY: ClassVar[NumericField] = ( - NumericField( - "modelEntityAssociationFromMaxCardinality", - "modelEntityAssociationFromMaxCardinality", - ) + MODEL_ENTITY_ASSOCIATION_FROM_MAX_CARDINALITY: ClassVar[NumericField] = NumericField( + "modelEntityAssociationFromMaxCardinality", + "modelEntityAssociationFromMaxCardinality", ) """ Maximum cardinality of the data entity from which the association exists. """ - MODEL_ENTITY_ASSOCIATION_TO: ClassVar[RelationField] = RelationField( - "modelEntityAssociationTo" - ) + MODEL_ENTITY_ASSOCIATION_TO: ClassVar[RelationField] = RelationField("modelEntityAssociationTo") """ TBC """ - MODEL_ENTITY_ASSOCIATION_FROM: ClassVar[RelationField] = RelationField( - "modelEntityAssociationFrom" - ) + MODEL_ENTITY_ASSOCIATION_FROM: ClassVar[RelationField] = RelationField("modelEntityAssociationFrom") """ TBC """ @@ -130,11 +122,7 @@ def __setattr__(self, name, value): @property def model_entity_association_cardinality(self) -> Optional[ModelCardinalityType]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_cardinality - ) + return None if self.attributes is None else self.attributes.model_entity_association_cardinality @model_entity_association_cardinality.setter def model_entity_association_cardinality( @@ -142,141 +130,81 @@ def model_entity_association_cardinality( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_cardinality = ( - model_entity_association_cardinality - ) + self.attributes.model_entity_association_cardinality = model_entity_association_cardinality @property def model_entity_association_label(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_label - ) + return None if self.attributes is None else self.attributes.model_entity_association_label @model_entity_association_label.setter - def model_entity_association_label( - self, model_entity_association_label: Optional[str] - ): + def model_entity_association_label(self, model_entity_association_label: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_entity_association_label = model_entity_association_label @property def model_entity_association_to_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_to_qualified_name - ) + return None if self.attributes is None else self.attributes.model_entity_association_to_qualified_name @model_entity_association_to_qualified_name.setter - def model_entity_association_to_qualified_name( - self, model_entity_association_to_qualified_name: Optional[str] - ): + def model_entity_association_to_qualified_name(self, model_entity_association_to_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_to_qualified_name = ( - model_entity_association_to_qualified_name - ) + self.attributes.model_entity_association_to_qualified_name = model_entity_association_to_qualified_name @property def model_entity_association_to_label(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_to_label - ) + return None if self.attributes is None else self.attributes.model_entity_association_to_label @model_entity_association_to_label.setter - def model_entity_association_to_label( - self, model_entity_association_to_label: Optional[str] - ): + def model_entity_association_to_label(self, model_entity_association_to_label: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_to_label = ( - model_entity_association_to_label - ) + self.attributes.model_entity_association_to_label = model_entity_association_to_label @property def model_entity_association_to_min_cardinality(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_to_min_cardinality - ) + return None if self.attributes is None else self.attributes.model_entity_association_to_min_cardinality @model_entity_association_to_min_cardinality.setter - def model_entity_association_to_min_cardinality( - self, model_entity_association_to_min_cardinality: Optional[int] - ): + def model_entity_association_to_min_cardinality(self, model_entity_association_to_min_cardinality: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_to_min_cardinality = ( - model_entity_association_to_min_cardinality - ) + self.attributes.model_entity_association_to_min_cardinality = model_entity_association_to_min_cardinality @property def model_entity_association_to_max_cardinality(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_to_max_cardinality - ) + return None if self.attributes is None else self.attributes.model_entity_association_to_max_cardinality @model_entity_association_to_max_cardinality.setter - def model_entity_association_to_max_cardinality( - self, model_entity_association_to_max_cardinality: Optional[int] - ): + def model_entity_association_to_max_cardinality(self, model_entity_association_to_max_cardinality: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_to_max_cardinality = ( - model_entity_association_to_max_cardinality - ) + self.attributes.model_entity_association_to_max_cardinality = model_entity_association_to_max_cardinality @property def model_entity_association_from_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_from_qualified_name - ) + return None if self.attributes is None else self.attributes.model_entity_association_from_qualified_name @model_entity_association_from_qualified_name.setter - def model_entity_association_from_qualified_name( - self, model_entity_association_from_qualified_name: Optional[str] - ): + def model_entity_association_from_qualified_name(self, model_entity_association_from_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_from_qualified_name = ( - model_entity_association_from_qualified_name - ) + self.attributes.model_entity_association_from_qualified_name = model_entity_association_from_qualified_name @property def model_entity_association_from_label(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_from_label - ) + return None if self.attributes is None else self.attributes.model_entity_association_from_label @model_entity_association_from_label.setter - def model_entity_association_from_label( - self, model_entity_association_from_label: Optional[str] - ): + def model_entity_association_from_label(self, model_entity_association_from_label: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_from_label = ( - model_entity_association_from_label - ) + self.attributes.model_entity_association_from_label = model_entity_association_from_label @property def model_entity_association_from_min_cardinality(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_from_min_cardinality - ) + return None if self.attributes is None else self.attributes.model_entity_association_from_min_cardinality @model_entity_association_from_min_cardinality.setter def model_entity_association_from_min_cardinality( @@ -284,17 +212,11 @@ def model_entity_association_from_min_cardinality( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_from_min_cardinality = ( - model_entity_association_from_min_cardinality - ) + self.attributes.model_entity_association_from_min_cardinality = model_entity_association_from_min_cardinality @property def model_entity_association_from_max_cardinality(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_from_max_cardinality - ) + return None if self.attributes is None else self.attributes.model_entity_association_from_max_cardinality @model_entity_association_from_max_cardinality.setter def model_entity_association_from_max_cardinality( @@ -302,79 +224,41 @@ def model_entity_association_from_max_cardinality( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_from_max_cardinality = ( - model_entity_association_from_max_cardinality - ) + self.attributes.model_entity_association_from_max_cardinality = model_entity_association_from_max_cardinality @property def model_entity_association_to(self) -> Optional[ModelEntity]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_to - ) + return None if self.attributes is None else self.attributes.model_entity_association_to @model_entity_association_to.setter - def model_entity_association_to( - self, model_entity_association_to: Optional[ModelEntity] - ): + def model_entity_association_to(self, model_entity_association_to: Optional[ModelEntity]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_entity_association_to = model_entity_association_to @property def model_entity_association_from(self) -> Optional[ModelEntity]: - return ( - None - if self.attributes is None - else self.attributes.model_entity_association_from - ) + return None if self.attributes is None else self.attributes.model_entity_association_from @model_entity_association_from.setter - def model_entity_association_from( - self, model_entity_association_from: Optional[ModelEntity] - ): + def model_entity_association_from(self, model_entity_association_from: Optional[ModelEntity]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_entity_association_from = model_entity_association_from class Attributes(Model.Attributes): - model_entity_association_cardinality: Optional[ModelCardinalityType] = Field( - default=None, description="" - ) - model_entity_association_label: Optional[str] = Field( - default=None, description="" - ) - model_entity_association_to_qualified_name: Optional[str] = Field( - default=None, description="" - ) - model_entity_association_to_label: Optional[str] = Field( - default=None, description="" - ) - model_entity_association_to_min_cardinality: Optional[int] = Field( - default=None, description="" - ) - model_entity_association_to_max_cardinality: Optional[int] = Field( - default=None, description="" - ) - model_entity_association_from_qualified_name: Optional[str] = Field( - default=None, description="" - ) - model_entity_association_from_label: Optional[str] = Field( - default=None, description="" - ) - model_entity_association_from_min_cardinality: Optional[int] = Field( - default=None, description="" - ) - model_entity_association_from_max_cardinality: Optional[int] = Field( - default=None, description="" - ) - model_entity_association_to: Optional[ModelEntity] = Field( - default=None, description="" - ) # relationship - model_entity_association_from: Optional[ModelEntity] = Field( - default=None, description="" - ) # relationship + model_entity_association_cardinality: Optional[ModelCardinalityType] = Field(default=None, description="") + model_entity_association_label: Optional[str] = Field(default=None, description="") + model_entity_association_to_qualified_name: Optional[str] = Field(default=None, description="") + model_entity_association_to_label: Optional[str] = Field(default=None, description="") + model_entity_association_to_min_cardinality: Optional[int] = Field(default=None, description="") + model_entity_association_to_max_cardinality: Optional[int] = Field(default=None, description="") + model_entity_association_from_qualified_name: Optional[str] = Field(default=None, description="") + model_entity_association_from_label: Optional[str] = Field(default=None, description="") + model_entity_association_from_min_cardinality: Optional[int] = Field(default=None, description="") + model_entity_association_from_max_cardinality: Optional[int] = Field(default=None, description="") + model_entity_association_to: Optional[ModelEntity] = Field(default=None, description="") # relationship + model_entity_association_from: Optional[ModelEntity] = Field(default=None, description="") # relationship attributes: ModelEntityAssociation.Attributes = Field( default_factory=lambda: ModelEntityAssociation.Attributes(), diff --git a/pyatlan/model/assets/core/model_version.py b/pyatlan/model/assets/core/model_version.py index bd0b220e8..1016c3465 100644 --- a/pyatlan/model/assets/core/model_version.py +++ b/pyatlan/model/assets/core/model_version.py @@ -40,9 +40,7 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_VERSION_ENTITIES: ClassVar[RelationField] = RelationField( - "modelVersionEntities" - ) + MODEL_VERSION_ENTITIES: ClassVar[RelationField] = RelationField("modelVersionEntities") """ TBC """ @@ -55,11 +53,7 @@ def __setattr__(self, name, value): @property def model_version_entity_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.model_version_entity_count - ) + return None if self.attributes is None else self.attributes.model_version_entity_count @model_version_entity_count.setter def model_version_entity_count(self, model_version_entity_count: Optional[int]): @@ -79,26 +73,18 @@ def model_data_model(self, model_data_model: Optional[ModelDataModel]): @property def model_version_entities(self) -> Optional[List[ModelEntity]]: - return ( - None if self.attributes is None else self.attributes.model_version_entities - ) + return None if self.attributes is None else self.attributes.model_version_entities @model_version_entities.setter - def model_version_entities( - self, model_version_entities: Optional[List[ModelEntity]] - ): + def model_version_entities(self, model_version_entities: Optional[List[ModelEntity]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_version_entities = model_version_entities class Attributes(Model.Attributes): model_version_entity_count: Optional[int] = Field(default=None, description="") - model_data_model: Optional[ModelDataModel] = Field( - default=None, description="" - ) # relationship - model_version_entities: Optional[List[ModelEntity]] = Field( - default=None, description="" - ) # relationship + model_data_model: Optional[ModelDataModel] = Field(default=None, description="") # relationship + model_version_entities: Optional[List[ModelEntity]] = Field(default=None, description="") # relationship attributes: ModelVersion.Attributes = Field( default_factory=lambda: ModelVersion.Attributes(), diff --git a/pyatlan/model/assets/core/mongo_d_b_collection.py b/pyatlan/model/assets/core/mongo_d_b_collection.py index 109567078..658d7867c 100644 --- a/pyatlan/model/assets/core/mongo_d_b_collection.py +++ b/pyatlan/model/assets/core/mongo_d_b_collection.py @@ -132,51 +132,35 @@ def __setattr__(self, name, value): """ Whether this table is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( - "isQueryPreview", "isQueryPreview" - ) + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") """ Whether preview queries are allowed for this table (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( - "queryPreviewConfig", "queryPreviewConfig" - ) + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") """ Configuration for preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField( - "externalLocation", "externalLocation" - ) + EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") """ External location of this table, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( - "externalLocationRegion", "externalLocationRegion" - ) + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") """ Region of the external location of this table, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( - "externalLocationFormat", "externalLocationFormat" - ) + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") """ Format of the external location of this table, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( - "isPartitioned", "isPartitioned" - ) + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") """ Whether this table is partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( - "partitionStrategy", "partitionStrategy" - ) + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") """ Partition strategy for this table. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField( - "partitionCount", "partitionCount" - ) + PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") """ Number of partitions in this table. """ @@ -192,21 +176,15 @@ def __setattr__(self, name, value): """ Type of the table. """ - ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField( - "icebergCatalogName", "icebergCatalogName" - ) + ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField("icebergCatalogName", "icebergCatalogName") """ iceberg table catalog name (can be any user defined name) """ - ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField( - "icebergTableType", "icebergTableType" - ) + ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField("icebergTableType", "icebergTableType") """ iceberg table type (managed vs unmanaged) """ - ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField( - "icebergCatalogSource", "icebergCatalogSource" - ) + ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField("icebergCatalogSource", "icebergCatalogSource") """ iceberg table catalog type (glue, polaris, snowflake) """ @@ -234,9 +212,7 @@ def __setattr__(self, name, value): """ iceberg table base location inside the external volume. """ - TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField( - "tableRetentionTime", "tableRetentionTime" - ) + TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField("tableRetentionTime", "tableRetentionTime") """ Data retention time in days. """ @@ -244,69 +220,47 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( - "queryUserCount", "queryUserCount" - ) + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( - "queryUserMap", "queryUserMap" - ) + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( - "queryCountUpdatedAt", "queryCountUpdatedAt" - ) + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "databaseName", "databaseName.keyword", "databaseName" - ) + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "databaseQualifiedName", "databaseQualifiedName" - ) + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "schemaName", "schemaName.keyword", "schemaName" - ) + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "schemaQualifiedName", "schemaQualifiedName" - ) + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "tableName", "tableName.keyword", "tableName" - ) + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "tableQualifiedName", "tableQualifiedName" - ) + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "viewName", "viewName.keyword", "viewName" - ) + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "viewQualifiedName", "viewQualifiedName" - ) + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -326,15 +280,11 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( - "lastProfiledAt", "lastProfiledAt" - ) + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") """ Time (epoch) at which this asset was last profiled, in milliseconds. """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( - "noSQLSchemaDefinition", "noSQLSchemaDefinition" - ) + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") """ Represents attributes for describing the key schema for the table and indexes. """ @@ -403,11 +353,7 @@ def __setattr__(self, name, value): @property def mongo_d_b_collection_subtype(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_subtype - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_subtype @mongo_d_b_collection_subtype.setter def mongo_d_b_collection_subtype(self, mongo_d_b_collection_subtype: Optional[str]): @@ -417,197 +363,113 @@ def mongo_d_b_collection_subtype(self, mongo_d_b_collection_subtype: Optional[st @property def mongo_d_b_collection_is_capped(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_is_capped - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_is_capped @mongo_d_b_collection_is_capped.setter - def mongo_d_b_collection_is_capped( - self, mongo_d_b_collection_is_capped: Optional[bool] - ): + def mongo_d_b_collection_is_capped(self, mongo_d_b_collection_is_capped: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collection_is_capped = mongo_d_b_collection_is_capped @property def mongo_d_b_collection_time_field(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_time_field - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_time_field @mongo_d_b_collection_time_field.setter - def mongo_d_b_collection_time_field( - self, mongo_d_b_collection_time_field: Optional[str] - ): + def mongo_d_b_collection_time_field(self, mongo_d_b_collection_time_field: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_time_field = ( - mongo_d_b_collection_time_field - ) + self.attributes.mongo_d_b_collection_time_field = mongo_d_b_collection_time_field @property def mongo_d_b_collection_time_granularity(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_time_granularity - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_time_granularity @mongo_d_b_collection_time_granularity.setter - def mongo_d_b_collection_time_granularity( - self, mongo_d_b_collection_time_granularity: Optional[str] - ): + def mongo_d_b_collection_time_granularity(self, mongo_d_b_collection_time_granularity: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_time_granularity = ( - mongo_d_b_collection_time_granularity - ) + self.attributes.mongo_d_b_collection_time_granularity = mongo_d_b_collection_time_granularity @property def mongo_d_b_collection_expire_after_seconds(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_expire_after_seconds - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_expire_after_seconds @mongo_d_b_collection_expire_after_seconds.setter - def mongo_d_b_collection_expire_after_seconds( - self, mongo_d_b_collection_expire_after_seconds: Optional[int] - ): + def mongo_d_b_collection_expire_after_seconds(self, mongo_d_b_collection_expire_after_seconds: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_expire_after_seconds = ( - mongo_d_b_collection_expire_after_seconds - ) + self.attributes.mongo_d_b_collection_expire_after_seconds = mongo_d_b_collection_expire_after_seconds @property def mongo_d_b_collection_maximum_document_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_maximum_document_count - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_maximum_document_count @mongo_d_b_collection_maximum_document_count.setter - def mongo_d_b_collection_maximum_document_count( - self, mongo_d_b_collection_maximum_document_count: Optional[int] - ): + def mongo_d_b_collection_maximum_document_count(self, mongo_d_b_collection_maximum_document_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_maximum_document_count = ( - mongo_d_b_collection_maximum_document_count - ) + self.attributes.mongo_d_b_collection_maximum_document_count = mongo_d_b_collection_maximum_document_count @property def mongo_d_b_collection_max_size(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_max_size - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_max_size @mongo_d_b_collection_max_size.setter - def mongo_d_b_collection_max_size( - self, mongo_d_b_collection_max_size: Optional[int] - ): + def mongo_d_b_collection_max_size(self, mongo_d_b_collection_max_size: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collection_max_size = mongo_d_b_collection_max_size @property def mongo_d_b_collection_num_orphan_docs(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_num_orphan_docs - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_num_orphan_docs @mongo_d_b_collection_num_orphan_docs.setter - def mongo_d_b_collection_num_orphan_docs( - self, mongo_d_b_collection_num_orphan_docs: Optional[int] - ): + def mongo_d_b_collection_num_orphan_docs(self, mongo_d_b_collection_num_orphan_docs: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_num_orphan_docs = ( - mongo_d_b_collection_num_orphan_docs - ) + self.attributes.mongo_d_b_collection_num_orphan_docs = mongo_d_b_collection_num_orphan_docs @property def mongo_d_b_collection_num_indexes(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_num_indexes - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_num_indexes @mongo_d_b_collection_num_indexes.setter - def mongo_d_b_collection_num_indexes( - self, mongo_d_b_collection_num_indexes: Optional[int] - ): + def mongo_d_b_collection_num_indexes(self, mongo_d_b_collection_num_indexes: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_num_indexes = ( - mongo_d_b_collection_num_indexes - ) + self.attributes.mongo_d_b_collection_num_indexes = mongo_d_b_collection_num_indexes @property def mongo_d_b_collection_total_index_size(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_total_index_size - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_total_index_size @mongo_d_b_collection_total_index_size.setter - def mongo_d_b_collection_total_index_size( - self, mongo_d_b_collection_total_index_size: Optional[int] - ): + def mongo_d_b_collection_total_index_size(self, mongo_d_b_collection_total_index_size: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_total_index_size = ( - mongo_d_b_collection_total_index_size - ) + self.attributes.mongo_d_b_collection_total_index_size = mongo_d_b_collection_total_index_size @property def mongo_d_b_collection_average_object_size(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_average_object_size - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_average_object_size @mongo_d_b_collection_average_object_size.setter - def mongo_d_b_collection_average_object_size( - self, mongo_d_b_collection_average_object_size: Optional[int] - ): + def mongo_d_b_collection_average_object_size(self, mongo_d_b_collection_average_object_size: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_average_object_size = ( - mongo_d_b_collection_average_object_size - ) + self.attributes.mongo_d_b_collection_average_object_size = mongo_d_b_collection_average_object_size @property def mongo_d_b_collection_schema_definition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_collection_schema_definition - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collection_schema_definition @mongo_d_b_collection_schema_definition.setter - def mongo_d_b_collection_schema_definition( - self, mongo_d_b_collection_schema_definition: Optional[str] - ): + def mongo_d_b_collection_schema_definition(self, mongo_d_b_collection_schema_definition: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_schema_definition = ( - mongo_d_b_collection_schema_definition - ) + self.attributes.mongo_d_b_collection_schema_definition = mongo_d_b_collection_schema_definition @property def column_count(self) -> Optional[int]: @@ -691,11 +553,7 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_region - ) + return None if self.attributes is None else self.attributes.external_location_region @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -705,11 +563,7 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_format - ) + return None if self.attributes is None else self.attributes.external_location_format @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -799,9 +653,7 @@ def iceberg_table_type(self, iceberg_table_type: Optional[str]): @property def iceberg_catalog_source(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.iceberg_catalog_source - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_source @iceberg_catalog_source.setter def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @@ -811,11 +663,7 @@ def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @property def iceberg_catalog_table_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_catalog_table_name - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_table_name @iceberg_catalog_table_name.setter def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @@ -825,29 +673,17 @@ def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @property def iceberg_catalog_table_namespace(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_catalog_table_namespace - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_table_namespace @iceberg_catalog_table_namespace.setter - def iceberg_catalog_table_namespace( - self, iceberg_catalog_table_namespace: Optional[str] - ): + def iceberg_catalog_table_namespace(self, iceberg_catalog_table_namespace: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.iceberg_catalog_table_namespace = ( - iceberg_catalog_table_namespace - ) + self.attributes.iceberg_catalog_table_namespace = iceberg_catalog_table_namespace @property def table_external_volume_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.table_external_volume_name - ) + return None if self.attributes is None else self.attributes.table_external_volume_name @table_external_volume_name.setter def table_external_volume_name(self, table_external_volume_name: Optional[str]): @@ -857,11 +693,7 @@ def table_external_volume_name(self, table_external_volume_name: Optional[str]): @property def iceberg_table_base_location(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_table_base_location - ) + return None if self.attributes is None else self.attributes.iceberg_table_base_location @iceberg_table_base_location.setter def iceberg_table_base_location(self, iceberg_table_base_location: Optional[str]): @@ -911,9 +743,7 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.query_count_updated_at - ) + return None if self.attributes is None else self.attributes.query_count_updated_at @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -933,9 +763,7 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.database_qualified_name - ) + return None if self.attributes is None else self.attributes.database_qualified_name @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -955,9 +783,7 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.schema_qualified_name - ) + return None if self.attributes is None else self.attributes.schema_qualified_name @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -1007,9 +833,7 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.calculation_view_name - ) + return None if self.attributes is None else self.attributes.calculation_view_name @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -1019,21 +843,13 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_qualified_name - ) + return None if self.attributes is None else self.attributes.calculation_view_qualified_name @calculation_view_qualified_name.setter - def calculation_view_qualified_name( - self, calculation_view_qualified_name: Optional[str] - ): + def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = ( - calculation_view_qualified_name - ) + self.attributes.calculation_view_qualified_name = calculation_view_qualified_name @property def is_profiled(self) -> Optional[bool]: @@ -1057,11 +873,7 @@ def last_profiled_at(self, last_profiled_at: Optional[datetime]): @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.no_s_q_l_schema_definition - ) + return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -1080,51 +892,25 @@ def mongo_d_b_database(self, mongo_d_b_database: Optional[MongoDBDatabase]): self.attributes.mongo_d_b_database = mongo_d_b_database class Attributes(Table.Attributes): - mongo_d_b_collection_subtype: Optional[str] = Field( - default=None, description="" - ) - mongo_d_b_collection_is_capped: Optional[bool] = Field( - default=None, description="" - ) - mongo_d_b_collection_time_field: Optional[str] = Field( - default=None, description="" - ) - mongo_d_b_collection_time_granularity: Optional[str] = Field( - default=None, description="" - ) - mongo_d_b_collection_expire_after_seconds: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_maximum_document_count: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_max_size: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_num_orphan_docs: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_num_indexes: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_total_index_size: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_average_object_size: Optional[int] = Field( - default=None, description="" - ) - mongo_d_b_collection_schema_definition: Optional[str] = Field( - default=None, description="" - ) + mongo_d_b_collection_subtype: Optional[str] = Field(default=None, description="") + mongo_d_b_collection_is_capped: Optional[bool] = Field(default=None, description="") + mongo_d_b_collection_time_field: Optional[str] = Field(default=None, description="") + mongo_d_b_collection_time_granularity: Optional[str] = Field(default=None, description="") + mongo_d_b_collection_expire_after_seconds: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_maximum_document_count: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_max_size: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_num_orphan_docs: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_num_indexes: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_total_index_size: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_average_object_size: Optional[int] = Field(default=None, description="") + mongo_d_b_collection_schema_definition: Optional[str] = Field(default=None, description="") column_count: Optional[int] = Field(default=None, description="") row_count: Optional[int] = Field(default=None, description="") size_bytes: Optional[int] = Field(default=None, description="") alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -1138,9 +924,7 @@ class Attributes(Table.Attributes): iceberg_table_type: Optional[str] = Field(default=None, description="") iceberg_catalog_source: Optional[str] = Field(default=None, description="") iceberg_catalog_table_name: Optional[str] = Field(default=None, description="") - iceberg_catalog_table_namespace: Optional[str] = Field( - default=None, description="" - ) + iceberg_catalog_table_namespace: Optional[str] = Field(default=None, description="") table_external_volume_name: Optional[str] = Field(default=None, description="") iceberg_table_base_location: Optional[str] = Field(default=None, description="") table_retention_time: Optional[int] = Field(default=None, description="") @@ -1157,15 +941,11 @@ class Attributes(Table.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field( - default=None, description="" - ) + calculation_view_qualified_name: Optional[str] = Field(default=None, description="") is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") - mongo_d_b_database: Optional[MongoDBDatabase] = Field( - default=None, description="" - ) # relationship + mongo_d_b_database: Optional[MongoDBDatabase] = Field(default=None, description="") # relationship attributes: MongoDBCollection.Attributes = Field( default_factory=lambda: MongoDBCollection.Attributes(), diff --git a/pyatlan/model/assets/core/mongo_d_b_database.py b/pyatlan/model/assets/core/mongo_d_b_database.py index 6a9af1da1..317312eb3 100644 --- a/pyatlan/model/assets/core/mongo_d_b_database.py +++ b/pyatlan/model/assets/core/mongo_d_b_database.py @@ -51,69 +51,47 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( - "queryUserCount", "queryUserCount" - ) + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( - "queryUserMap", "queryUserMap" - ) + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( - "queryCountUpdatedAt", "queryCountUpdatedAt" - ) + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "databaseName", "databaseName.keyword", "databaseName" - ) + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "databaseQualifiedName", "databaseQualifiedName" - ) + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "schemaName", "schemaName.keyword", "schemaName" - ) + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "schemaQualifiedName", "schemaQualifiedName" - ) + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "tableName", "tableName.keyword", "tableName" - ) + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "tableQualifiedName", "tableQualifiedName" - ) + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "viewName", "viewName.keyword", "viewName" - ) + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "viewQualifiedName", "viewQualifiedName" - ) + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -133,15 +111,11 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( - "lastProfiledAt", "lastProfiledAt" - ) + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") """ Time (epoch) at which this asset was last profiled, in milliseconds. """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( - "noSQLSchemaDefinition", "noSQLSchemaDefinition" - ) + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") """ Represents attributes for describing the key schema for the table and indexes. """ @@ -176,21 +150,13 @@ def __setattr__(self, name, value): @property def mongo_d_b_database_collection_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mongo_d_b_database_collection_count - ) + return None if self.attributes is None else self.attributes.mongo_d_b_database_collection_count @mongo_d_b_database_collection_count.setter - def mongo_d_b_database_collection_count( - self, mongo_d_b_database_collection_count: Optional[int] - ): + def mongo_d_b_database_collection_count(self, mongo_d_b_database_collection_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_database_collection_count = ( - mongo_d_b_database_collection_count - ) + self.attributes.mongo_d_b_database_collection_count = mongo_d_b_database_collection_count @property def schema_count(self) -> Optional[int]: @@ -234,9 +200,7 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.query_count_updated_at - ) + return None if self.attributes is None else self.attributes.query_count_updated_at @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -256,9 +220,7 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.database_qualified_name - ) + return None if self.attributes is None else self.attributes.database_qualified_name @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -278,9 +240,7 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.schema_qualified_name - ) + return None if self.attributes is None else self.attributes.schema_qualified_name @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -330,9 +290,7 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.calculation_view_name - ) + return None if self.attributes is None else self.attributes.calculation_view_name @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -342,21 +300,13 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_qualified_name - ) + return None if self.attributes is None else self.attributes.calculation_view_qualified_name @calculation_view_qualified_name.setter - def calculation_view_qualified_name( - self, calculation_view_qualified_name: Optional[str] - ): + def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = ( - calculation_view_qualified_name - ) + self.attributes.calculation_view_qualified_name = calculation_view_qualified_name @property def is_profiled(self) -> Optional[bool]: @@ -380,11 +330,7 @@ def last_profiled_at(self, last_profiled_at: Optional[datetime]): @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.no_s_q_l_schema_definition - ) + return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -394,22 +340,16 @@ def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @property def mongo_d_b_collections(self) -> Optional[List[MongoDBCollection]]: - return ( - None if self.attributes is None else self.attributes.mongo_d_b_collections - ) + return None if self.attributes is None else self.attributes.mongo_d_b_collections @mongo_d_b_collections.setter - def mongo_d_b_collections( - self, mongo_d_b_collections: Optional[List[MongoDBCollection]] - ): + def mongo_d_b_collections(self, mongo_d_b_collections: Optional[List[MongoDBCollection]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collections = mongo_d_b_collections class Attributes(Database.Attributes): - mongo_d_b_database_collection_count: Optional[int] = Field( - default=None, description="" - ) + mongo_d_b_database_collection_count: Optional[int] = Field(default=None, description="") schema_count: Optional[int] = Field(default=None, description="") query_count: Optional[int] = Field(default=None, description="") query_user_count: Optional[int] = Field(default=None, description="") @@ -424,15 +364,11 @@ class Attributes(Database.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field( - default=None, description="" - ) + calculation_view_qualified_name: Optional[str] = Field(default=None, description="") is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") - mongo_d_b_collections: Optional[List[MongoDBCollection]] = Field( - default=None, description="" - ) # relationship + mongo_d_b_collections: Optional[List[MongoDBCollection]] = Field(default=None, description="") # relationship attributes: MongoDBDatabase.Attributes = Field( default_factory=lambda: MongoDBDatabase.Attributes(), diff --git a/pyatlan/model/assets/core/monte_carlo.py b/pyatlan/model/assets/core/monte_carlo.py index 55438a0f6..56e561c1e 100644 --- a/pyatlan/model/assets/core/monte_carlo.py +++ b/pyatlan/model/assets/core/monte_carlo.py @@ -33,9 +33,7 @@ def __setattr__(self, name, value): """ List of labels for this Monte Carlo asset. """ - MC_ASSET_QUALIFIED_NAMES: ClassVar[KeywordField] = KeywordField( - "mcAssetQualifiedNames", "mcAssetQualifiedNames" - ) + MC_ASSET_QUALIFIED_NAMES: ClassVar[KeywordField] = KeywordField("mcAssetQualifiedNames", "mcAssetQualifiedNames") """ List of unique names of assets that are part of this Monte Carlo asset. """ @@ -57,11 +55,7 @@ def mc_labels(self, mc_labels: Optional[Set[str]]): @property def mc_asset_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.mc_asset_qualified_names - ) + return None if self.attributes is None else self.attributes.mc_asset_qualified_names @mc_asset_qualified_names.setter def mc_asset_qualified_names(self, mc_asset_qualified_names: Optional[Set[str]]): @@ -71,9 +65,7 @@ def mc_asset_qualified_names(self, mc_asset_qualified_names: Optional[Set[str]]) class Attributes(DataQuality.Attributes): mc_labels: Optional[Set[str]] = Field(default=None, description="") - mc_asset_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) + mc_asset_qualified_names: Optional[Set[str]] = Field(default=None, description="") attributes: MonteCarlo.Attributes = Field( default_factory=lambda: MonteCarlo.Attributes(), diff --git a/pyatlan/model/assets/core/namespace.py b/pyatlan/model/assets/core/namespace.py index 8d15f8a68..3bec05fa4 100644 --- a/pyatlan/model/assets/core/namespace.py +++ b/pyatlan/model/assets/core/namespace.py @@ -64,12 +64,8 @@ def children_queries(self, children_queries: Optional[List[Query]]): self.attributes.children_queries = children_queries class Attributes(Asset.Attributes): - children_folders: Optional[List[Folder]] = Field( - default=None, description="" - ) # relationship - children_queries: Optional[List[Query]] = Field( - default=None, description="" - ) # relationship + children_folders: Optional[List[Folder]] = Field(default=None, description="") # relationship + children_queries: Optional[List[Query]] = Field(default=None, description="") # relationship attributes: Namespace.Attributes = Field( default_factory=lambda: Namespace.Attributes(), diff --git a/pyatlan/model/assets/core/no_s_q_l.py b/pyatlan/model/assets/core/no_s_q_l.py index 5da903bd1..4513a2498 100644 --- a/pyatlan/model/assets/core/no_s_q_l.py +++ b/pyatlan/model/assets/core/no_s_q_l.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( - "noSQLSchemaDefinition", "noSQLSchemaDefinition" - ) + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") """ Represents attributes for describing the key schema for the table and indexes. """ @@ -42,11 +40,7 @@ def __setattr__(self, name, value): @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.no_s_q_l_schema_definition - ) + return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): diff --git a/pyatlan/model/assets/core/persona.py b/pyatlan/model/assets/core/persona.py index 7a2f02d97..f0f78105e 100644 --- a/pyatlan/model/assets/core/persona.py +++ b/pyatlan/model/assets/core/persona.py @@ -40,10 +40,7 @@ def creator(cls, *, name: str) -> Persona: @init_guid def create(cls, *, name: str) -> Persona: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -188,16 +185,11 @@ def create_for_modification( is_enabled: bool = True, ) -> Persona: warn( - ( - "This method is deprecated, please use 'updater' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.updater( - qualified_name=qualified_name, name=name, is_enabled=is_enabled - ) + return cls.updater(qualified_name=qualified_name, name=name, is_enabled=is_enabled) type_name: str = Field(default="Persona", allow_mutation=False) @@ -212,9 +204,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - PERSONA_GROUPS: ClassVar[KeywordField] = KeywordField( - "personaGroups", "personaGroups" - ) + PERSONA_GROUPS: ClassVar[KeywordField] = KeywordField("personaGroups", "personaGroups") """ TBC """ diff --git a/pyatlan/model/assets/core/power_b_i.py b/pyatlan/model/assets/core/power_b_i.py index 4f8ddaef8..551321cd5 100644 --- a/pyatlan/model/assets/core/power_b_i.py +++ b/pyatlan/model/assets/core/power_b_i.py @@ -35,9 +35,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - POWER_BI_IS_HIDDEN: ClassVar[BooleanField] = BooleanField( - "powerBIIsHidden", "powerBIIsHidden" - ) + POWER_BI_IS_HIDDEN: ClassVar[BooleanField] = BooleanField("powerBIIsHidden", "powerBIIsHidden") """ Whether this asset is hidden in Power BI (true) or not (false). """ @@ -49,15 +47,11 @@ def __setattr__(self, name, value): """ Unique name of the Power BI table in which this asset exists. """ - POWER_BI_FORMAT_STRING: ClassVar[TextField] = TextField( - "powerBIFormatString", "powerBIFormatString" - ) + POWER_BI_FORMAT_STRING: ClassVar[TextField] = TextField("powerBIFormatString", "powerBIFormatString") """ Format of this asset, as specified in the FORMAT_STRING of the MDX cell property. """ - POWER_BI_ENDORSEMENT: ClassVar[KeywordField] = KeywordField( - "powerBIEndorsement", "powerBIEndorsement" - ) + POWER_BI_ENDORSEMENT: ClassVar[KeywordField] = KeywordField("powerBIEndorsement", "powerBIEndorsement") """ Endorsement status of this asset, in Power BI. """ @@ -81,25 +75,17 @@ def power_b_i_is_hidden(self, power_b_i_is_hidden: Optional[bool]): @property def power_b_i_table_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_table_qualified_name - ) + return None if self.attributes is None else self.attributes.power_b_i_table_qualified_name @power_b_i_table_qualified_name.setter - def power_b_i_table_qualified_name( - self, power_b_i_table_qualified_name: Optional[str] - ): + def power_b_i_table_qualified_name(self, power_b_i_table_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_table_qualified_name = power_b_i_table_qualified_name @property def power_b_i_format_string(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.power_b_i_format_string - ) + return None if self.attributes is None else self.attributes.power_b_i_format_string @power_b_i_format_string.setter def power_b_i_format_string(self, power_b_i_format_string: Optional[str]): @@ -109,27 +95,19 @@ def power_b_i_format_string(self, power_b_i_format_string: Optional[str]): @property def power_b_i_endorsement(self) -> Optional[PowerbiEndorsement]: - return ( - None if self.attributes is None else self.attributes.power_b_i_endorsement - ) + return None if self.attributes is None else self.attributes.power_b_i_endorsement @power_b_i_endorsement.setter - def power_b_i_endorsement( - self, power_b_i_endorsement: Optional[PowerbiEndorsement] - ): + def power_b_i_endorsement(self, power_b_i_endorsement: Optional[PowerbiEndorsement]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_endorsement = power_b_i_endorsement class Attributes(BI.Attributes): power_b_i_is_hidden: Optional[bool] = Field(default=None, description="") - power_b_i_table_qualified_name: Optional[str] = Field( - default=None, description="" - ) + power_b_i_table_qualified_name: Optional[str] = Field(default=None, description="") power_b_i_format_string: Optional[str] = Field(default=None, description="") - power_b_i_endorsement: Optional[PowerbiEndorsement] = Field( - default=None, description="" - ) + power_b_i_endorsement: Optional[PowerbiEndorsement] = Field(default=None, description="") attributes: PowerBI.Attributes = Field( default_factory=lambda: PowerBI.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_column.py b/pyatlan/model/assets/core/power_b_i_column.py index 5d7c4b6f6..137456298 100644 --- a/pyatlan/model/assets/core/power_b_i_column.py +++ b/pyatlan/model/assets/core/power_b_i_column.py @@ -42,9 +42,7 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this column exists. """ - DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "datasetQualifiedName", "datasetQualifiedName" - ) + DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasetQualifiedName", "datasetQualifiedName") """ Unique name of the dataset in which this column exists. """ @@ -54,15 +52,11 @@ def __setattr__(self, name, value): """ Data category that describes the data in this column. """ - POWER_BI_COLUMN_DATA_TYPE: ClassVar[KeywordField] = KeywordField( - "powerBIColumnDataType", "powerBIColumnDataType" - ) + POWER_BI_COLUMN_DATA_TYPE: ClassVar[KeywordField] = KeywordField("powerBIColumnDataType", "powerBIColumnDataType") """ Data type of this column. """ - POWER_BI_SORT_BY_COLUMN: ClassVar[KeywordField] = KeywordField( - "powerBISortByColumn", "powerBISortByColumn" - ) + POWER_BI_SORT_BY_COLUMN: ClassVar[KeywordField] = KeywordField("powerBISortByColumn", "powerBISortByColumn") """ Name of a column in the same table to use to order this column. """ @@ -90,11 +84,7 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.workspace_qualified_name @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -104,9 +94,7 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def dataset_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dataset_qualified_name - ) + return None if self.attributes is None else self.attributes.dataset_qualified_name @dataset_qualified_name.setter def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @@ -116,27 +104,17 @@ def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @property def power_b_i_column_data_category(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_column_data_category - ) + return None if self.attributes is None else self.attributes.power_b_i_column_data_category @power_b_i_column_data_category.setter - def power_b_i_column_data_category( - self, power_b_i_column_data_category: Optional[str] - ): + def power_b_i_column_data_category(self, power_b_i_column_data_category: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_column_data_category = power_b_i_column_data_category @property def power_b_i_column_data_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_column_data_type - ) + return None if self.attributes is None else self.attributes.power_b_i_column_data_type @power_b_i_column_data_type.setter def power_b_i_column_data_type(self, power_b_i_column_data_type: Optional[str]): @@ -146,11 +124,7 @@ def power_b_i_column_data_type(self, power_b_i_column_data_type: Optional[str]): @property def power_b_i_sort_by_column(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_sort_by_column - ) + return None if self.attributes is None else self.attributes.power_b_i_sort_by_column @power_b_i_sort_by_column.setter def power_b_i_sort_by_column(self, power_b_i_sort_by_column: Optional[str]): @@ -160,16 +134,10 @@ def power_b_i_sort_by_column(self, power_b_i_sort_by_column: Optional[str]): @property def power_b_i_column_summarize_by(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_column_summarize_by - ) + return None if self.attributes is None else self.attributes.power_b_i_column_summarize_by @power_b_i_column_summarize_by.setter - def power_b_i_column_summarize_by( - self, power_b_i_column_summarize_by: Optional[str] - ): + def power_b_i_column_summarize_by(self, power_b_i_column_summarize_by: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_column_summarize_by = power_b_i_column_summarize_by @@ -187,17 +155,11 @@ def table(self, table: Optional[PowerBITable]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") dataset_qualified_name: Optional[str] = Field(default=None, description="") - power_b_i_column_data_category: Optional[str] = Field( - default=None, description="" - ) + power_b_i_column_data_category: Optional[str] = Field(default=None, description="") power_b_i_column_data_type: Optional[str] = Field(default=None, description="") power_b_i_sort_by_column: Optional[str] = Field(default=None, description="") - power_b_i_column_summarize_by: Optional[str] = Field( - default=None, description="" - ) - table: Optional[PowerBITable] = Field( - default=None, description="" - ) # relationship + power_b_i_column_summarize_by: Optional[str] = Field(default=None, description="") + table: Optional[PowerBITable] = Field(default=None, description="") # relationship attributes: PowerBIColumn.Attributes = Field( default_factory=lambda: PowerBIColumn.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_dashboard.py b/pyatlan/model/assets/core/power_b_i_dashboard.py index fccb372ff..60700bf9e 100644 --- a/pyatlan/model/assets/core/power_b_i_dashboard.py +++ b/pyatlan/model/assets/core/power_b_i_dashboard.py @@ -70,11 +70,7 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.workspace_qualified_name @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -126,12 +122,8 @@ class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") web_url: Optional[str] = Field(default=None, description="") tile_count: Optional[int] = Field(default=None, description="") - workspace: Optional[PowerBIWorkspace] = Field( - default=None, description="" - ) # relationship - tiles: Optional[List[PowerBITile]] = Field( - default=None, description="" - ) # relationship + workspace: Optional[PowerBIWorkspace] = Field(default=None, description="") # relationship + tiles: Optional[List[PowerBITile]] = Field(default=None, description="") # relationship attributes: PowerBIDashboard.Attributes = Field( default_factory=lambda: PowerBIDashboard.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_dataflow.py b/pyatlan/model/assets/core/power_b_i_dataflow.py index 782f49ae6..0afcb8e29 100644 --- a/pyatlan/model/assets/core/power_b_i_dataflow.py +++ b/pyatlan/model/assets/core/power_b_i_dataflow.py @@ -79,9 +79,7 @@ def __setattr__(self, name, value): """ TBC """ - POWER_BI_DATAFLOW_ENTITY_COLUMNS: ClassVar[RelationField] = RelationField( - "powerBIDataflowEntityColumns" - ) + POWER_BI_DATAFLOW_ENTITY_COLUMNS: ClassVar[RelationField] = RelationField("powerBIDataflowEntityColumns") """ TBC """ @@ -93,15 +91,11 @@ def __setattr__(self, name, value): """ TBC """ - POWER_BI_DATAFLOW_CHILDREN: ClassVar[RelationField] = RelationField( - "powerBIDataflowChildren" - ) + POWER_BI_DATAFLOW_CHILDREN: ClassVar[RelationField] = RelationField("powerBIDataflowChildren") """ TBC """ - POWER_BI_DATAFLOW_PARENTS: ClassVar[RelationField] = RelationField( - "powerBIDataflowParents" - ) + POWER_BI_DATAFLOW_PARENTS: ClassVar[RelationField] = RelationField("powerBIDataflowParents") """ TBC """ @@ -124,11 +118,7 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.workspace_qualified_name @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -148,11 +138,7 @@ def web_url(self, web_url: Optional[str]): @property def power_b_i_dataflow_refresh_schedule_frequency(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_dataflow_refresh_schedule_frequency - ) + return None if self.attributes is None else self.attributes.power_b_i_dataflow_refresh_schedule_frequency @power_b_i_dataflow_refresh_schedule_frequency.setter def power_b_i_dataflow_refresh_schedule_frequency( @@ -160,35 +146,21 @@ def power_b_i_dataflow_refresh_schedule_frequency( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_refresh_schedule_frequency = ( - power_b_i_dataflow_refresh_schedule_frequency - ) + self.attributes.power_b_i_dataflow_refresh_schedule_frequency = power_b_i_dataflow_refresh_schedule_frequency @property def power_b_i_dataflow_refresh_schedule_times(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_dataflow_refresh_schedule_times - ) + return None if self.attributes is None else self.attributes.power_b_i_dataflow_refresh_schedule_times @power_b_i_dataflow_refresh_schedule_times.setter - def power_b_i_dataflow_refresh_schedule_times( - self, power_b_i_dataflow_refresh_schedule_times: Optional[Set[str]] - ): + def power_b_i_dataflow_refresh_schedule_times(self, power_b_i_dataflow_refresh_schedule_times: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_refresh_schedule_times = ( - power_b_i_dataflow_refresh_schedule_times - ) + self.attributes.power_b_i_dataflow_refresh_schedule_times = power_b_i_dataflow_refresh_schedule_times @property def power_b_i_dataflow_refresh_schedule_time_zone(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_dataflow_refresh_schedule_time_zone - ) + return None if self.attributes is None else self.attributes.power_b_i_dataflow_refresh_schedule_time_zone @power_b_i_dataflow_refresh_schedule_time_zone.setter def power_b_i_dataflow_refresh_schedule_time_zone( @@ -196,9 +168,7 @@ def power_b_i_dataflow_refresh_schedule_time_zone( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_refresh_schedule_time_zone = ( - power_b_i_dataflow_refresh_schedule_time_zone - ) + self.attributes.power_b_i_dataflow_refresh_schedule_time_zone = power_b_i_dataflow_refresh_schedule_time_zone @property def workspace(self) -> Optional[PowerBIWorkspace]: @@ -234,11 +204,7 @@ def datasets(self, datasets: Optional[List[PowerBIDataset]]): def power_b_i_dataflow_entity_columns( self, ) -> Optional[List[PowerBIDataflowEntityColumn]]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_dataflow_entity_columns - ) + return None if self.attributes is None else self.attributes.power_b_i_dataflow_entity_columns @power_b_i_dataflow_entity_columns.setter def power_b_i_dataflow_entity_columns( @@ -247,9 +213,7 @@ def power_b_i_dataflow_entity_columns( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_entity_columns = ( - power_b_i_dataflow_entity_columns - ) + self.attributes.power_b_i_dataflow_entity_columns = power_b_i_dataflow_entity_columns @property def tables(self) -> Optional[List[PowerBITable]]: @@ -263,46 +227,30 @@ def tables(self, tables: Optional[List[PowerBITable]]): @property def power_b_i_datasources(self) -> Optional[List[PowerBIDatasource]]: - return ( - None if self.attributes is None else self.attributes.power_b_i_datasources - ) + return None if self.attributes is None else self.attributes.power_b_i_datasources @power_b_i_datasources.setter - def power_b_i_datasources( - self, power_b_i_datasources: Optional[List[PowerBIDatasource]] - ): + def power_b_i_datasources(self, power_b_i_datasources: Optional[List[PowerBIDatasource]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_datasources = power_b_i_datasources @property def power_b_i_dataflow_children(self) -> Optional[List[PowerBIDataflow]]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_dataflow_children - ) + return None if self.attributes is None else self.attributes.power_b_i_dataflow_children @power_b_i_dataflow_children.setter - def power_b_i_dataflow_children( - self, power_b_i_dataflow_children: Optional[List[PowerBIDataflow]] - ): + def power_b_i_dataflow_children(self, power_b_i_dataflow_children: Optional[List[PowerBIDataflow]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_dataflow_children = power_b_i_dataflow_children @property def power_b_i_dataflow_parents(self) -> Optional[List[PowerBIDataflow]]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_dataflow_parents - ) + return None if self.attributes is None else self.attributes.power_b_i_dataflow_parents @power_b_i_dataflow_parents.setter - def power_b_i_dataflow_parents( - self, power_b_i_dataflow_parents: Optional[List[PowerBIDataflow]] - ): + def power_b_i_dataflow_parents(self, power_b_i_dataflow_parents: Optional[List[PowerBIDataflow]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_dataflow_parents = power_b_i_dataflow_parents @@ -310,35 +258,17 @@ def power_b_i_dataflow_parents( class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") web_url: Optional[str] = Field(default=None, description="") - power_b_i_dataflow_refresh_schedule_frequency: Optional[str] = Field( - default=None, description="" - ) - power_b_i_dataflow_refresh_schedule_times: Optional[Set[str]] = Field( - default=None, description="" - ) - power_b_i_dataflow_refresh_schedule_time_zone: Optional[str] = Field( - default=None, description="" - ) - workspace: Optional[PowerBIWorkspace] = Field( - default=None, description="" - ) # relationship - power_b_i_processes: Optional[List[Process]] = Field( - default=None, description="" - ) # relationship - datasets: Optional[List[PowerBIDataset]] = Field( - default=None, description="" - ) # relationship - power_b_i_dataflow_entity_columns: Optional[ - List[PowerBIDataflowEntityColumn] - ] = Field( - default=None, description="" - ) # relationship - tables: Optional[List[PowerBITable]] = Field( - default=None, description="" - ) # relationship - power_b_i_datasources: Optional[List[PowerBIDatasource]] = Field( + power_b_i_dataflow_refresh_schedule_frequency: Optional[str] = Field(default=None, description="") + power_b_i_dataflow_refresh_schedule_times: Optional[Set[str]] = Field(default=None, description="") + power_b_i_dataflow_refresh_schedule_time_zone: Optional[str] = Field(default=None, description="") + workspace: Optional[PowerBIWorkspace] = Field(default=None, description="") # relationship + power_b_i_processes: Optional[List[Process]] = Field(default=None, description="") # relationship + datasets: Optional[List[PowerBIDataset]] = Field(default=None, description="") # relationship + power_b_i_dataflow_entity_columns: Optional[List[PowerBIDataflowEntityColumn]] = Field( default=None, description="" ) # relationship + tables: Optional[List[PowerBITable]] = Field(default=None, description="") # relationship + power_b_i_datasources: Optional[List[PowerBIDatasource]] = Field(default=None, description="") # relationship power_b_i_dataflow_children: Optional[List[PowerBIDataflow]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/core/power_b_i_dataflow_entity_column.py b/pyatlan/model/assets/core/power_b_i_dataflow_entity_column.py index d734366c9..b3a706726 100644 --- a/pyatlan/model/assets/core/power_b_i_dataflow_entity_column.py +++ b/pyatlan/model/assets/core/power_b_i_dataflow_entity_column.py @@ -69,73 +69,43 @@ def __setattr__(self, name, value): @property def power_b_i_dataflow_entity_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_dataflow_entity_name - ) + return None if self.attributes is None else self.attributes.power_b_i_dataflow_entity_name @power_b_i_dataflow_entity_name.setter - def power_b_i_dataflow_entity_name( - self, power_b_i_dataflow_entity_name: Optional[str] - ): + def power_b_i_dataflow_entity_name(self, power_b_i_dataflow_entity_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_dataflow_entity_name = power_b_i_dataflow_entity_name @property def power_b_i_workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.power_b_i_workspace_qualified_name @power_b_i_workspace_qualified_name.setter - def power_b_i_workspace_qualified_name( - self, power_b_i_workspace_qualified_name: Optional[str] - ): + def power_b_i_workspace_qualified_name(self, power_b_i_workspace_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_workspace_qualified_name = ( - power_b_i_workspace_qualified_name - ) + self.attributes.power_b_i_workspace_qualified_name = power_b_i_workspace_qualified_name @property def power_b_i_dataflow_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_dataflow_qualified_name - ) + return None if self.attributes is None else self.attributes.power_b_i_dataflow_qualified_name @power_b_i_dataflow_qualified_name.setter - def power_b_i_dataflow_qualified_name( - self, power_b_i_dataflow_qualified_name: Optional[str] - ): + def power_b_i_dataflow_qualified_name(self, power_b_i_dataflow_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_qualified_name = ( - power_b_i_dataflow_qualified_name - ) + self.attributes.power_b_i_dataflow_qualified_name = power_b_i_dataflow_qualified_name @property def power_b_i_dataflow_entity_column_data_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_dataflow_entity_column_data_type - ) + return None if self.attributes is None else self.attributes.power_b_i_dataflow_entity_column_data_type @power_b_i_dataflow_entity_column_data_type.setter - def power_b_i_dataflow_entity_column_data_type( - self, power_b_i_dataflow_entity_column_data_type: Optional[str] - ): + def power_b_i_dataflow_entity_column_data_type(self, power_b_i_dataflow_entity_column_data_type: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_entity_column_data_type = ( - power_b_i_dataflow_entity_column_data_type - ) + self.attributes.power_b_i_dataflow_entity_column_data_type = power_b_i_dataflow_entity_column_data_type @property def power_b_i_dataflow(self) -> Optional[PowerBIDataflow]: @@ -148,21 +118,11 @@ def power_b_i_dataflow(self, power_b_i_dataflow: Optional[PowerBIDataflow]): self.attributes.power_b_i_dataflow = power_b_i_dataflow class Attributes(PowerBI.Attributes): - power_b_i_dataflow_entity_name: Optional[str] = Field( - default=None, description="" - ) - power_b_i_workspace_qualified_name: Optional[str] = Field( - default=None, description="" - ) - power_b_i_dataflow_qualified_name: Optional[str] = Field( - default=None, description="" - ) - power_b_i_dataflow_entity_column_data_type: Optional[str] = Field( - default=None, description="" - ) - power_b_i_dataflow: Optional[PowerBIDataflow] = Field( - default=None, description="" - ) # relationship + power_b_i_dataflow_entity_name: Optional[str] = Field(default=None, description="") + power_b_i_workspace_qualified_name: Optional[str] = Field(default=None, description="") + power_b_i_dataflow_qualified_name: Optional[str] = Field(default=None, description="") + power_b_i_dataflow_entity_column_data_type: Optional[str] = Field(default=None, description="") + power_b_i_dataflow: Optional[PowerBIDataflow] = Field(default=None, description="") # relationship attributes: PowerBIDataflowEntityColumn.Attributes = Field( default_factory=lambda: PowerBIDataflowEntityColumn.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_dataset.py b/pyatlan/model/assets/core/power_b_i_dataset.py index bcd0cf026..dbc2aad10 100644 --- a/pyatlan/model/assets/core/power_b_i_dataset.py +++ b/pyatlan/model/assets/core/power_b_i_dataset.py @@ -80,11 +80,7 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.workspace_qualified_name @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -165,24 +161,12 @@ def datasources(self, datasources: Optional[List[PowerBIDatasource]]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") web_url: Optional[str] = Field(default=None, description="") - reports: Optional[List[PowerBIReport]] = Field( - default=None, description="" - ) # relationship - workspace: Optional[PowerBIWorkspace] = Field( - default=None, description="" - ) # relationship - tiles: Optional[List[PowerBITile]] = Field( - default=None, description="" - ) # relationship - tables: Optional[List[PowerBITable]] = Field( - default=None, description="" - ) # relationship - dataflows: Optional[List[PowerBIDataflow]] = Field( - default=None, description="" - ) # relationship - datasources: Optional[List[PowerBIDatasource]] = Field( - default=None, description="" - ) # relationship + reports: Optional[List[PowerBIReport]] = Field(default=None, description="") # relationship + workspace: Optional[PowerBIWorkspace] = Field(default=None, description="") # relationship + tiles: Optional[List[PowerBITile]] = Field(default=None, description="") # relationship + tables: Optional[List[PowerBITable]] = Field(default=None, description="") # relationship + dataflows: Optional[List[PowerBIDataflow]] = Field(default=None, description="") # relationship + datasources: Optional[List[PowerBIDatasource]] = Field(default=None, description="") # relationship attributes: PowerBIDataset.Attributes = Field( default_factory=lambda: PowerBIDataset.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_datasource.py b/pyatlan/model/assets/core/power_b_i_datasource.py index 8accfcca2..474d03ca7 100644 --- a/pyatlan/model/assets/core/power_b_i_datasource.py +++ b/pyatlan/model/assets/core/power_b_i_datasource.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - CONNECTION_DETAILS: ClassVar[KeywordField] = KeywordField( - "connectionDetails", "connectionDetails" - ) + CONNECTION_DETAILS: ClassVar[KeywordField] = KeywordField("connectionDetails", "connectionDetails") """ Connection details of the datasource. """ @@ -82,15 +80,9 @@ def datasets(self, datasets: Optional[List[PowerBIDataset]]): self.attributes.datasets = datasets class Attributes(PowerBI.Attributes): - connection_details: Optional[Dict[str, str]] = Field( - default=None, description="" - ) - power_b_i_dataflows: Optional[List[PowerBIDataflow]] = Field( - default=None, description="" - ) # relationship - datasets: Optional[List[PowerBIDataset]] = Field( - default=None, description="" - ) # relationship + connection_details: Optional[Dict[str, str]] = Field(default=None, description="") + power_b_i_dataflows: Optional[List[PowerBIDataflow]] = Field(default=None, description="") # relationship + datasets: Optional[List[PowerBIDataset]] = Field(default=None, description="") # relationship attributes: PowerBIDatasource.Attributes = Field( default_factory=lambda: PowerBIDatasource.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_measure.py b/pyatlan/model/assets/core/power_b_i_measure.py index 3b3a7f0df..b48a45b06 100644 --- a/pyatlan/model/assets/core/power_b_i_measure.py +++ b/pyatlan/model/assets/core/power_b_i_measure.py @@ -42,15 +42,11 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this measure exists. """ - DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "datasetQualifiedName", "datasetQualifiedName" - ) + DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasetQualifiedName", "datasetQualifiedName") """ Unique name of the dataset in which this measure exists. """ - POWER_BI_MEASURE_EXPRESSION: ClassVar[TextField] = TextField( - "powerBIMeasureExpression", "powerBIMeasureExpression" - ) + POWER_BI_MEASURE_EXPRESSION: ClassVar[TextField] = TextField("powerBIMeasureExpression", "powerBIMeasureExpression") """ DAX expression for this measure. """ @@ -76,11 +72,7 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.workspace_qualified_name @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -90,9 +82,7 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def dataset_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dataset_qualified_name - ) + return None if self.attributes is None else self.attributes.dataset_qualified_name @dataset_qualified_name.setter def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @@ -102,11 +92,7 @@ def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @property def power_b_i_measure_expression(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_measure_expression - ) + return None if self.attributes is None else self.attributes.power_b_i_measure_expression @power_b_i_measure_expression.setter def power_b_i_measure_expression(self, power_b_i_measure_expression: Optional[str]): @@ -116,16 +102,10 @@ def power_b_i_measure_expression(self, power_b_i_measure_expression: Optional[st @property def power_b_i_is_external_measure(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_is_external_measure - ) + return None if self.attributes is None else self.attributes.power_b_i_is_external_measure @power_b_i_is_external_measure.setter - def power_b_i_is_external_measure( - self, power_b_i_is_external_measure: Optional[bool] - ): + def power_b_i_is_external_measure(self, power_b_i_is_external_measure: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_is_external_measure = power_b_i_is_external_measure @@ -143,15 +123,9 @@ def table(self, table: Optional[PowerBITable]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") dataset_qualified_name: Optional[str] = Field(default=None, description="") - power_b_i_measure_expression: Optional[str] = Field( - default=None, description="" - ) - power_b_i_is_external_measure: Optional[bool] = Field( - default=None, description="" - ) - table: Optional[PowerBITable] = Field( - default=None, description="" - ) # relationship + power_b_i_measure_expression: Optional[str] = Field(default=None, description="") + power_b_i_is_external_measure: Optional[bool] = Field(default=None, description="") + table: Optional[PowerBITable] = Field(default=None, description="") # relationship attributes: PowerBIMeasure.Attributes = Field( default_factory=lambda: PowerBIMeasure.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_page.py b/pyatlan/model/assets/core/power_b_i_page.py index 75cc670ae..88db91f31 100644 --- a/pyatlan/model/assets/core/power_b_i_page.py +++ b/pyatlan/model/assets/core/power_b_i_page.py @@ -37,9 +37,7 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this page exists. """ - REPORT_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "reportQualifiedName", "reportQualifiedName" - ) + REPORT_QUALIFIED_NAME: ClassVar[TextField] = TextField("reportQualifiedName", "reportQualifiedName") """ Unique name of the report in which this page exists. """ @@ -57,11 +55,7 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.workspace_qualified_name @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -71,9 +65,7 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def report_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.report_qualified_name - ) + return None if self.attributes is None else self.attributes.report_qualified_name @report_qualified_name.setter def report_qualified_name(self, report_qualified_name: Optional[str]): @@ -94,9 +86,7 @@ def report(self, report: Optional[PowerBIReport]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") report_qualified_name: Optional[str] = Field(default=None, description="") - report: Optional[PowerBIReport] = Field( - default=None, description="" - ) # relationship + report: Optional[PowerBIReport] = Field(default=None, description="") # relationship attributes: PowerBIPage.Attributes = Field( default_factory=lambda: PowerBIPage.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_report.py b/pyatlan/model/assets/core/power_b_i_report.py index d8ddc70a3..3ef606932 100644 --- a/pyatlan/model/assets/core/power_b_i_report.py +++ b/pyatlan/model/assets/core/power_b_i_report.py @@ -42,9 +42,7 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this report exists. """ - DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "datasetQualifiedName", "datasetQualifiedName" - ) + DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasetQualifiedName", "datasetQualifiedName") """ Unique name of the dataset used to build this report. """ @@ -87,11 +85,7 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.workspace_qualified_name @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -101,9 +95,7 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def dataset_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dataset_qualified_name - ) + return None if self.attributes is None else self.attributes.dataset_qualified_name @dataset_qualified_name.setter def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @@ -176,18 +168,10 @@ class Attributes(PowerBI.Attributes): dataset_qualified_name: Optional[str] = Field(default=None, description="") web_url: Optional[str] = Field(default=None, description="") page_count: Optional[int] = Field(default=None, description="") - workspace: Optional[PowerBIWorkspace] = Field( - default=None, description="" - ) # relationship - tiles: Optional[List[PowerBITile]] = Field( - default=None, description="" - ) # relationship - pages: Optional[List[PowerBIPage]] = Field( - default=None, description="" - ) # relationship - dataset: Optional[PowerBIDataset] = Field( - default=None, description="" - ) # relationship + workspace: Optional[PowerBIWorkspace] = Field(default=None, description="") # relationship + tiles: Optional[List[PowerBITile]] = Field(default=None, description="") # relationship + pages: Optional[List[PowerBIPage]] = Field(default=None, description="") # relationship + dataset: Optional[PowerBIDataset] = Field(default=None, description="") # relationship attributes: PowerBIReport.Attributes = Field( default_factory=lambda: PowerBIReport.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_table.py b/pyatlan/model/assets/core/power_b_i_table.py index 69520437d..a6ab63477 100644 --- a/pyatlan/model/assets/core/power_b_i_table.py +++ b/pyatlan/model/assets/core/power_b_i_table.py @@ -42,9 +42,7 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this table exists. """ - DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "datasetQualifiedName", "datasetQualifiedName" - ) + DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasetQualifiedName", "datasetQualifiedName") """ Unique name of the dataset in which this table exists. """ @@ -107,11 +105,7 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.workspace_qualified_name @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -121,9 +115,7 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def dataset_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dataset_qualified_name - ) + return None if self.attributes is None else self.attributes.dataset_qualified_name @dataset_qualified_name.setter def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @@ -133,11 +125,7 @@ def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @property def dataflow_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.dataflow_qualified_names - ) + return None if self.attributes is None else self.attributes.dataflow_qualified_names @dataflow_qualified_names.setter def dataflow_qualified_names(self, dataflow_qualified_names: Optional[Set[str]]): @@ -147,29 +135,17 @@ def dataflow_qualified_names(self, dataflow_qualified_names: Optional[Set[str]]) @property def power_b_i_table_source_expressions(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_table_source_expressions - ) + return None if self.attributes is None else self.attributes.power_b_i_table_source_expressions @power_b_i_table_source_expressions.setter - def power_b_i_table_source_expressions( - self, power_b_i_table_source_expressions: Optional[Set[str]] - ): + def power_b_i_table_source_expressions(self, power_b_i_table_source_expressions: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_table_source_expressions = ( - power_b_i_table_source_expressions - ) + self.attributes.power_b_i_table_source_expressions = power_b_i_table_source_expressions @property def power_b_i_table_column_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_table_column_count - ) + return None if self.attributes is None else self.attributes.power_b_i_table_column_count @power_b_i_table_column_count.setter def power_b_i_table_column_count(self, power_b_i_table_column_count: Optional[int]): @@ -179,16 +155,10 @@ def power_b_i_table_column_count(self, power_b_i_table_column_count: Optional[in @property def power_b_i_table_measure_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.power_b_i_table_measure_count - ) + return None if self.attributes is None else self.attributes.power_b_i_table_measure_count @power_b_i_table_measure_count.setter - def power_b_i_table_measure_count( - self, power_b_i_table_measure_count: Optional[int] - ): + def power_b_i_table_measure_count(self, power_b_i_table_measure_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_table_measure_count = power_b_i_table_measure_count @@ -236,30 +206,14 @@ def dataset(self, dataset: Optional[PowerBIDataset]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") dataset_qualified_name: Optional[str] = Field(default=None, description="") - dataflow_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) - power_b_i_table_source_expressions: Optional[Set[str]] = Field( - default=None, description="" - ) - power_b_i_table_column_count: Optional[int] = Field( - default=None, description="" - ) - power_b_i_table_measure_count: Optional[int] = Field( - default=None, description="" - ) - columns: Optional[List[PowerBIColumn]] = Field( - default=None, description="" - ) # relationship - measures: Optional[List[PowerBIMeasure]] = Field( - default=None, description="" - ) # relationship - dataflows: Optional[List[PowerBIDataflow]] = Field( - default=None, description="" - ) # relationship - dataset: Optional[PowerBIDataset] = Field( - default=None, description="" - ) # relationship + dataflow_qualified_names: Optional[Set[str]] = Field(default=None, description="") + power_b_i_table_source_expressions: Optional[Set[str]] = Field(default=None, description="") + power_b_i_table_column_count: Optional[int] = Field(default=None, description="") + power_b_i_table_measure_count: Optional[int] = Field(default=None, description="") + columns: Optional[List[PowerBIColumn]] = Field(default=None, description="") # relationship + measures: Optional[List[PowerBIMeasure]] = Field(default=None, description="") # relationship + dataflows: Optional[List[PowerBIDataflow]] = Field(default=None, description="") # relationship + dataset: Optional[PowerBIDataset] = Field(default=None, description="") # relationship attributes: PowerBITable.Attributes = Field( default_factory=lambda: PowerBITable.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_tile.py b/pyatlan/model/assets/core/power_b_i_tile.py index d31fdeb00..be686b541 100644 --- a/pyatlan/model/assets/core/power_b_i_tile.py +++ b/pyatlan/model/assets/core/power_b_i_tile.py @@ -37,9 +37,7 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this tile exists. """ - DASHBOARD_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "dashboardQualifiedName", "dashboardQualifiedName" - ) + DASHBOARD_QUALIFIED_NAME: ClassVar[TextField] = TextField("dashboardQualifiedName", "dashboardQualifiedName") """ Unique name of the dashboard in which this tile is pinned. """ @@ -67,11 +65,7 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.workspace_qualified_name @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -81,11 +75,7 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def dashboard_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dashboard_qualified_name - ) + return None if self.attributes is None else self.attributes.dashboard_qualified_name @dashboard_qualified_name.setter def dashboard_qualified_name(self, dashboard_qualified_name: Optional[str]): @@ -126,15 +116,9 @@ def dataset(self, dataset: Optional[PowerBIDataset]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") dashboard_qualified_name: Optional[str] = Field(default=None, description="") - dashboard: Optional[PowerBIDashboard] = Field( - default=None, description="" - ) # relationship - report: Optional[PowerBIReport] = Field( - default=None, description="" - ) # relationship - dataset: Optional[PowerBIDataset] = Field( - default=None, description="" - ) # relationship + dashboard: Optional[PowerBIDashboard] = Field(default=None, description="") # relationship + report: Optional[PowerBIReport] = Field(default=None, description="") # relationship + dataset: Optional[PowerBIDataset] = Field(default=None, description="") # relationship attributes: PowerBITile.Attributes = Field( default_factory=lambda: PowerBITile.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_workspace.py b/pyatlan/model/assets/core/power_b_i_workspace.py index 47966cb64..436986446 100644 --- a/pyatlan/model/assets/core/power_b_i_workspace.py +++ b/pyatlan/model/assets/core/power_b_i_workspace.py @@ -37,9 +37,7 @@ def __setattr__(self, name, value): """ Number of reports in this workspace. """ - DASHBOARD_COUNT: ClassVar[NumericField] = NumericField( - "dashboardCount", "dashboardCount" - ) + DASHBOARD_COUNT: ClassVar[NumericField] = NumericField("dashboardCount", "dashboardCount") """ Number of dashboards in this workspace. """ @@ -47,9 +45,7 @@ def __setattr__(self, name, value): """ Number of datasets in this workspace. """ - DATAFLOW_COUNT: ClassVar[NumericField] = NumericField( - "dataflowCount", "dataflowCount" - ) + DATAFLOW_COUNT: ClassVar[NumericField] = NumericField("dataflowCount", "dataflowCount") """ Number of dataflows in this workspace. """ @@ -179,18 +175,10 @@ class Attributes(PowerBI.Attributes): dashboard_count: Optional[int] = Field(default=None, description="") dataset_count: Optional[int] = Field(default=None, description="") dataflow_count: Optional[int] = Field(default=None, description="") - reports: Optional[List[PowerBIReport]] = Field( - default=None, description="" - ) # relationship - datasets: Optional[List[PowerBIDataset]] = Field( - default=None, description="" - ) # relationship - dashboards: Optional[List[PowerBIDashboard]] = Field( - default=None, description="" - ) # relationship - dataflows: Optional[List[PowerBIDataflow]] = Field( - default=None, description="" - ) # relationship + reports: Optional[List[PowerBIReport]] = Field(default=None, description="") # relationship + datasets: Optional[List[PowerBIDataset]] = Field(default=None, description="") # relationship + dashboards: Optional[List[PowerBIDashboard]] = Field(default=None, description="") # relationship + dataflows: Optional[List[PowerBIDataflow]] = Field(default=None, description="") # relationship attributes: PowerBIWorkspace.Attributes = Field( default_factory=lambda: PowerBIWorkspace.Attributes(), diff --git a/pyatlan/model/assets/core/procedure.py b/pyatlan/model/assets/core/procedure.py index 52e9f238f..2e07718b4 100644 --- a/pyatlan/model/assets/core/procedure.py +++ b/pyatlan/model/assets/core/procedure.py @@ -73,9 +73,7 @@ def updater(cls, *, name: str, qualified_name: str, definition: str) -> Procedur ["name", "qualified_name", "definition"], [name, qualified_name, definition], ) - procedure = Procedure( - attributes=Procedure.Attributes(qualified_name=qualified_name, name=name) - ) + procedure = Procedure(attributes=Procedure.Attributes(qualified_name=qualified_name, name=name)) procedure.definition = definition return procedure @@ -136,9 +134,7 @@ def atlan_schema(self, atlan_schema: Optional[Schema]): class Attributes(SQL.Attributes): definition: Optional[str] = Field(default=None, description="") - atlan_schema: Optional[Schema] = Field( - default=None, description="" - ) # relationship + atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -159,9 +155,7 @@ def create( ) assert schema_qualified_name # noqa: S101 if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( schema_qualified_name, "schema_qualified_name", 5 @@ -172,10 +166,7 @@ def create( connection_qualified_name = connection_qualified_name or connection_qn database_name = database_name or fields[3] schema_name = schema_name or fields[4] - database_qualified_name = ( - database_qualified_name - or f"{connection_qualified_name}/{database_name}" - ) + database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" return Procedure.Attributes( name=name, diff --git a/pyatlan/model/assets/core/process.py b/pyatlan/model/assets/core/process.py index f271c13b1..4143f9146 100644 --- a/pyatlan/model/assets/core/process.py +++ b/pyatlan/model/assets/core/process.py @@ -54,10 +54,7 @@ def create( parent: Optional[Process] = None, ) -> Process: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -95,9 +92,7 @@ def __setattr__(self, name, value): """ Parsed AST of the code or SQL statements that describe the logic of this process. """ - ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField( - "additionalEtlContext", "additionalEtlContext" - ) + ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField("additionalEtlContext", "additionalEtlContext") """ Additional Context of the ETL pipeline/notebook which creates the process. """ @@ -199,9 +194,7 @@ def ast(self, ast: Optional[str]): @property def additional_etl_context(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.additional_etl_context - ) + return None if self.attributes is None else self.attributes.additional_etl_context @additional_etl_context.setter def additional_etl_context(self, additional_etl_context: Optional[str]): @@ -286,27 +279,13 @@ class Attributes(Asset.Attributes): sql: Optional[str] = Field(default=None, description="") ast: Optional[str] = Field(default=None, description="") additional_etl_context: Optional[str] = Field(default=None, description="") - adf_activity: Optional[AdfActivity] = Field( - default=None, description="" - ) # relationship - spark_jobs: Optional[List[SparkJob]] = Field( - default=None, description="" - ) # relationship - matillion_component: Optional[MatillionComponent] = Field( - default=None, description="" - ) # relationship - airflow_tasks: Optional[List[AirflowTask]] = Field( - default=None, description="" - ) # relationship - fivetran_connector: Optional[FivetranConnector] = Field( - default=None, description="" - ) # relationship - power_b_i_dataflow: Optional[PowerBIDataflow] = Field( - default=None, description="" - ) # relationship - column_processes: Optional[List[ColumnProcess]] = Field( - default=None, description="" - ) # relationship + adf_activity: Optional[AdfActivity] = Field(default=None, description="") # relationship + spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship + matillion_component: Optional[MatillionComponent] = Field(default=None, description="") # relationship + airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship + fivetran_connector: Optional[FivetranConnector] = Field(default=None, description="") # relationship + power_b_i_dataflow: Optional[PowerBIDataflow] = Field(default=None, description="") # relationship + column_processes: Optional[List[ColumnProcess]] = Field(default=None, description="") # relationship @staticmethod def generate_qualified_name( diff --git a/pyatlan/model/assets/core/query.py b/pyatlan/model/assets/core/query.py index 1f4bd5201..c54681a06 100644 --- a/pyatlan/model/assets/core/query.py +++ b/pyatlan/model/assets/core/query.py @@ -82,9 +82,7 @@ def updater( else: parent = Folder.ref_by_qualified_name(parent_qualified_name) # type: ignore[assignment] - query = Query( - attributes=Query.Attributes(qualified_name=qualified_name, name=name) - ) + query = Query(attributes=Query.Attributes(qualified_name=qualified_name, name=name)) query.parent = parent query.collection_qualified_name = collection_qualified_name query.parent_qualified_name = parent_qualified_name @@ -111,9 +109,7 @@ def with_raw_query(self, schema_qualified_name: str, query: str): self.default_schema_qualified_name = schema_qualified_name self.is_visual_query = False self.raw_query_text = query - self.variables_schema_base64 = b64encode( - _DEFAULT_VARIABLE_SCHEMA.encode("utf-8") - ).decode("utf-8") + self.variables_schema_base64 = b64encode(_DEFAULT_VARIABLE_SCHEMA.encode("utf-8")).decode("utf-8") type_name: str = Field(default="Query", allow_mutation=False) @@ -156,9 +152,7 @@ def __setattr__(self, name, value): """ Unique name of the default database to use for this query. """ - VARIABLES_SCHEMA_BASE64: ClassVar[TextField] = TextField( - "variablesSchemaBase64", "variablesSchemaBase64" - ) + VARIABLES_SCHEMA_BASE64: ClassVar[TextField] = TextField("variablesSchemaBase64", "variablesSchemaBase64") """ Base64-encoded string of the variables to use in this query. """ @@ -166,9 +160,7 @@ def __setattr__(self, name, value): """ Whether this query is private (true) or shared (false). """ - IS_SQL_SNIPPET: ClassVar[BooleanField] = BooleanField( - "isSqlSnippet", "isSqlSnippet" - ) + IS_SQL_SNIPPET: ClassVar[BooleanField] = BooleanField("isSqlSnippet", "isSqlSnippet") """ Whether this query is a SQL snippet (true) or not (false). """ @@ -186,9 +178,7 @@ def __setattr__(self, name, value): """ Unique name of the collection in which this query exists. """ - IS_VISUAL_QUERY: ClassVar[BooleanField] = BooleanField( - "isVisualQuery", "isVisualQuery" - ) + IS_VISUAL_QUERY: ClassVar[BooleanField] = BooleanField("isVisualQuery", "isVisualQuery") """ Whether this query is a visual query (true) or not (false). """ @@ -267,43 +257,27 @@ def raw_query_text(self, raw_query_text: Optional[str]): @property def default_schema_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.default_schema_qualified_name - ) + return None if self.attributes is None else self.attributes.default_schema_qualified_name @default_schema_qualified_name.setter - def default_schema_qualified_name( - self, default_schema_qualified_name: Optional[str] - ): + def default_schema_qualified_name(self, default_schema_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.default_schema_qualified_name = default_schema_qualified_name @property def default_database_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.default_database_qualified_name - ) + return None if self.attributes is None else self.attributes.default_database_qualified_name @default_database_qualified_name.setter - def default_database_qualified_name( - self, default_database_qualified_name: Optional[str] - ): + def default_database_qualified_name(self, default_database_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.default_database_qualified_name = ( - default_database_qualified_name - ) + self.attributes.default_database_qualified_name = default_database_qualified_name @property def variables_schema_base64(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.variables_schema_base64 - ) + return None if self.attributes is None else self.attributes.variables_schema_base64 @variables_schema_base64.setter def variables_schema_base64(self, variables_schema_base64: Optional[str]): @@ -333,9 +307,7 @@ def is_sql_snippet(self, is_sql_snippet: Optional[bool]): @property def parent_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.parent_qualified_name - ) + return None if self.attributes is None else self.attributes.parent_qualified_name @parent_qualified_name.setter def parent_qualified_name(self, parent_qualified_name: Optional[str]): @@ -345,11 +317,7 @@ def parent_qualified_name(self, parent_qualified_name: Optional[str]): @property def collection_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.collection_qualified_name - ) + return None if self.attributes is None else self.attributes.collection_qualified_name @collection_qualified_name.setter def collection_qualified_name(self, collection_qualified_name: Optional[str]): @@ -369,11 +337,7 @@ def is_visual_query(self, is_visual_query: Optional[bool]): @property def visual_builder_schema_base64(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.visual_builder_schema_base64 - ) + return None if self.attributes is None else self.attributes.visual_builder_schema_base64 @visual_builder_schema_base64.setter def visual_builder_schema_base64(self, visual_builder_schema_base64: Optional[str]): @@ -425,33 +389,19 @@ class Attributes(SQL.Attributes): raw_query: Optional[str] = Field(default=None, description="") long_raw_query: Optional[str] = Field(default=None, description="") raw_query_text: Optional[str] = Field(default=None, description="") - default_schema_qualified_name: Optional[str] = Field( - default=None, description="" - ) - default_database_qualified_name: Optional[str] = Field( - default=None, description="" - ) + default_schema_qualified_name: Optional[str] = Field(default=None, description="") + default_database_qualified_name: Optional[str] = Field(default=None, description="") variables_schema_base64: Optional[str] = Field(default=None, description="") is_private: Optional[bool] = Field(default=None, description="") is_sql_snippet: Optional[bool] = Field(default=None, description="") parent_qualified_name: Optional[str] = Field(default=None, description="") collection_qualified_name: Optional[str] = Field(default=None, description="") is_visual_query: Optional[bool] = Field(default=None, description="") - visual_builder_schema_base64: Optional[str] = Field( - default=None, description="" - ) - parent: Optional[Namespace] = Field( - default=None, description="" - ) # relationship - columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship - tables: Optional[List[Table]] = Field( - default=None, description="" - ) # relationship - views: Optional[List[View]] = Field( - default=None, description="" - ) # relationship + visual_builder_schema_base64: Optional[str] = Field(default=None, description="") + parent: Optional[Namespace] = Field(default=None, description="") # relationship + columns: Optional[List[Column]] = Field(default=None, description="") # relationship + tables: Optional[List[Table]] = Field(default=None, description="") # relationship + views: Optional[List[View]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -474,17 +424,13 @@ def creator( if not parent_folder_qualified_name: qualified_name = f"{collection_qualified_name}/{name}" parent_qn = collection_qualified_name - parent = Collection.ref_by_qualified_name( - collection_qualified_name or "" - ) + parent = Collection.ref_by_qualified_name(collection_qualified_name or "") else: tokens = parent_folder_qualified_name.split("/") if len(tokens) < 4: raise ValueError("Invalid collection_qualified_name") - collection_qualified_name = ( - f"{tokens[0]}/{tokens[1]}/{tokens[2]}/{tokens[3]}" - ) + collection_qualified_name = f"{tokens[0]}/{tokens[1]}/{tokens[2]}/{tokens[3]}" qualified_name = f"{parent_folder_qualified_name}/{name}" parent_qn = parent_folder_qualified_name parent = Folder.ref_by_qualified_name(parent_folder_qualified_name) # type: ignore[assignment] diff --git a/pyatlan/model/assets/core/readme.py b/pyatlan/model/assets/core/readme.py index bf0778bb4..71bd8fcaf 100644 --- a/pyatlan/model/assets/core/readme.py +++ b/pyatlan/model/assets/core/readme.py @@ -21,25 +21,14 @@ class Readme(Resource): @classmethod @init_guid - def creator( - cls, *, asset: Asset, content: str, asset_name: Optional[str] = None - ) -> Readme: - return Readme( - attributes=Readme.Attributes.create( - asset=asset, content=content, asset_name=asset_name - ) - ) + def creator(cls, *, asset: Asset, content: str, asset_name: Optional[str] = None) -> Readme: + return Readme(attributes=Readme.Attributes.create(asset=asset, content=content, asset_name=asset_name)) @classmethod @init_guid - def create( - cls, *, asset: Asset, content: str, asset_name: Optional[str] = None - ) -> Readme: + def create(cls, *, asset: Asset, content: str, asset_name: Optional[str] = None) -> Readme: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -54,9 +43,7 @@ def description(self) -> Optional[str]: def description(self, description: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.description = ( - quote(description) if description is not None else description - ) + self.attributes.description = quote(description) if description is not None else description type_name: str = Field(default="Readme", allow_mutation=False) @@ -106,26 +93,18 @@ def asset(self, asset: Optional[Asset]): self.attributes.asset = asset class Attributes(Resource.Attributes): - see_also: Optional[List[Readme]] = Field( - default=None, description="" - ) # relationship + see_also: Optional[List[Readme]] = Field(default=None, description="") # relationship asset: Optional[Asset] = Field(default=None, description="") # relationship @classmethod @init_guid - def create( - cls, *, asset: Asset, content: str, asset_name: Optional[str] = None - ) -> Readme.Attributes: + def create(cls, *, asset: Asset, content: str, asset_name: Optional[str] = None) -> Readme.Attributes: validate_required_fields(["asset", "content"], [asset, content]) if not asset.name or len(asset.name) < 1: if not asset_name: - raise ValueError( - "asset_name is required when name is not available from asset" - ) + raise ValueError("asset_name is required when name is not available from asset") elif asset_name: - raise ValueError( - "asset_name can not be given when name is available from asset" - ) + raise ValueError("asset_name can not be given when name is available from asset") else: asset_name = asset.name if not asset.guid: diff --git a/pyatlan/model/assets/core/referenceable.py b/pyatlan/model/assets/core/referenceable.py index 33fa2f03f..5d20f6ca2 100644 --- a/pyatlan/model/assets/core/referenceable.py +++ b/pyatlan/model/assets/core/referenceable.py @@ -30,9 +30,7 @@ class Referenceable(AtlanObject): def __init__(__pydantic_self__, **data: Any) -> None: super().__init__(**data) __pydantic_self__.__fields_set__.update(["attributes", "type_name"]) - __pydantic_self__._metadata_proxy = CustomMetadataProxy( - __pydantic_self__.business_attributes - ) + __pydantic_self__._metadata_proxy = CustomMetadataProxy(__pydantic_self__.business_attributes) @root_validator(pre=True) def parse_custom_attributes(cls, values): @@ -90,10 +88,7 @@ def atlan_tag_names(self) -> List[str]: from pyatlan.model.constants import DELETED_ if self.classification_names: - return [ - AtlanTagCache.get_name_for_id(tag_id) or DELETED_ - for tag_id in self.classification_names - ] + return [AtlanTagCache.get_name_for_id(tag_id) or DELETED_ for tag_id in self.classification_names] return [] def __setattr__(self, name, value): @@ -120,32 +115,20 @@ def qualified_name(self, qualified_name: Optional[str]): @property def user_def_relationship_to(self) -> Optional[List[Referenceable]]: - return ( - None - if self.attributes is None - else self.attributes.user_def_relationship_to - ) + return None if self.attributes is None else self.attributes.user_def_relationship_to @user_def_relationship_to.setter - def user_def_relationship_to( - self, user_def_relationship_to: Optional[List[Referenceable]] - ): + def user_def_relationship_to(self, user_def_relationship_to: Optional[List[Referenceable]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.user_def_relationship_to = user_def_relationship_to @property def user_def_relationship_from(self) -> Optional[List[Referenceable]]: - return ( - None - if self.attributes is None - else self.attributes.user_def_relationship_from - ) + return None if self.attributes is None else self.attributes.user_def_relationship_from @user_def_relationship_from.setter - def user_def_relationship_from( - self, user_def_relationship_from: Optional[List[Referenceable]] - ): + def user_def_relationship_from(self, user_def_relationship_from: Optional[List[Referenceable]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.user_def_relationship_from = user_def_relationship_from @@ -162,15 +145,9 @@ def assigned_terms(self, assigned_terms: Optional[List[AtlasGlossaryTerm]]): class Attributes(AtlanObject): qualified_name: Optional[str] = Field(default="", description="") - user_def_relationship_to: Optional[List[Referenceable]] = Field( - default=None, description="" - ) # relationship - user_def_relationship_from: Optional[List[Referenceable]] = Field( - default=None, description="" - ) # relationship - meanings: Optional[List[AtlasGlossaryTerm]] = Field( - default=None, description="" - ) # relationship + user_def_relationship_to: Optional[List[Referenceable]] = Field(default=None, description="") # relationship + user_def_relationship_from: Optional[List[Referenceable]] = Field(default=None, description="") # relationship + meanings: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship def validate_required(self): pass @@ -183,19 +160,13 @@ def validate_required(self): GUID: ClassVar[KeywordField] = InternalKeywordField("guid", "__guid", "__guid") """Globally unique identifier (GUID) of any object in Atlan.""" - CREATED_BY: ClassVar[KeywordField] = InternalKeywordField( - "createdBy", "__createdBy", "__createdBy" - ) + CREATED_BY: ClassVar[KeywordField] = InternalKeywordField("createdBy", "__createdBy", "__createdBy") """Atlan user who created this asset.""" - UPDATED_BY: ClassVar[KeywordField] = InternalKeywordField( - "updatedBy", "__modifiedBy", "__modifiedBy" - ) + UPDATED_BY: ClassVar[KeywordField] = InternalKeywordField("updatedBy", "__modifiedBy", "__modifiedBy") """Atlan user who last updated the asset.""" - STATUS: ClassVar[KeywordField] = InternalKeywordField( - "status", "__state", "__state" - ) + STATUS: ClassVar[KeywordField] = InternalKeywordField("status", "__state", "__state") """Asset status in Atlan (active vs deleted).""" ATLAN_TAGS: ClassVar[KeywordTextField] = InternalKeywordTextField( @@ -226,9 +197,7 @@ def validate_required(self): ) """All super types of an asset.""" - CREATE_TIME: ClassVar[NumericField] = InternalNumericField( - "createTime", "__timestamp", "__timestamp" - ) + CREATE_TIME: ClassVar[NumericField] = InternalNumericField("createTime", "__timestamp", "__timestamp") """Time (in milliseconds) when the asset was created.""" UPDATE_TIME: ClassVar[NumericField] = InternalNumericField( @@ -241,9 +210,7 @@ def validate_required(self): ) """Unique fully-qualified name of the asset in Atlan.""" - CUSTOM_ATTRIBUTES: ClassVar[TextField] = TextField( - "__customAttributes", "__customAttributes" - ) + CUSTOM_ATTRIBUTES: ClassVar[TextField] = TextField("__customAttributes", "__customAttributes") """ Any source-provided custom information. NOTE: This is NOT the same as custom metadata (user-managed), @@ -285,9 +252,7 @@ def validate_required(self): example="917ffec9-fa84-4c59-8e6c-c7b114d04be3", ) is_incomplete: Optional[bool] = Field(default=True, description="", example=True) - labels: Optional[List[str]] = Field( - default=None, description="Arbitrary textual labels for the asset." - ) + labels: Optional[List[str]] = Field(default=None, description="Arbitrary textual labels for the asset.") relationship_attributes: Optional[Dict[str, Any]] = Field( default=None, description="Map of relationships for the entity. The specific keys of this map will vary by type, " @@ -306,9 +271,7 @@ def validate_required(self): description="Time (epoch) at which this object was last assets_updated, in milliseconds.", example=1649172284333, ) - version: Optional[int] = Field( - default=None, description="Version of this object.", example=2 - ) + version: Optional[int] = Field(default=None, description="Version of this object.", example=2) atlan_tags: Optional[List[AtlanTag]] = Field( default=None, description="Atlan tags", diff --git a/pyatlan/model/assets/core/resource.py b/pyatlan/model/assets/core/resource.py index 00f6be3ab..c8f77ef42 100644 --- a/pyatlan/model/assets/core/resource.py +++ b/pyatlan/model/assets/core/resource.py @@ -41,9 +41,7 @@ def __setattr__(self, name, value): """ Reference to the resource. """ - RESOURCE_METADATA: ClassVar[KeywordField] = KeywordField( - "resourceMetadata", "resourceMetadata" - ) + RESOURCE_METADATA: ClassVar[KeywordField] = KeywordField("resourceMetadata", "resourceMetadata") """ Metadata of the resource. """ @@ -99,9 +97,7 @@ class Attributes(Catalog.Attributes): link: Optional[str] = Field(default=None, description="") is_global: Optional[bool] = Field(default=None, description="") reference: Optional[str] = Field(default=None, description="") - resource_metadata: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + resource_metadata: Optional[Dict[str, str]] = Field(default=None, description="") attributes: Resource.Attributes = Field( default_factory=lambda: Resource.Attributes(), diff --git a/pyatlan/model/assets/core/s_q_l.py b/pyatlan/model/assets/core/s_q_l.py index 52c349640..e4e1150b6 100644 --- a/pyatlan/model/assets/core/s_q_l.py +++ b/pyatlan/model/assets/core/s_q_l.py @@ -40,69 +40,47 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( - "queryUserCount", "queryUserCount" - ) + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( - "queryUserMap", "queryUserMap" - ) + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( - "queryCountUpdatedAt", "queryCountUpdatedAt" - ) + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "databaseName", "databaseName.keyword", "databaseName" - ) + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "databaseQualifiedName", "databaseQualifiedName" - ) + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "schemaName", "schemaName.keyword", "schemaName" - ) + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "schemaQualifiedName", "schemaQualifiedName" - ) + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "tableName", "tableName.keyword", "tableName" - ) + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "tableQualifiedName", "tableQualifiedName" - ) + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "viewName", "viewName.keyword", "viewName" - ) + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "viewQualifiedName", "viewQualifiedName" - ) + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -122,9 +100,7 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( - "lastProfiledAt", "lastProfiledAt" - ) + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -206,9 +182,7 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.query_count_updated_at - ) + return None if self.attributes is None else self.attributes.query_count_updated_at @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -228,9 +202,7 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.database_qualified_name - ) + return None if self.attributes is None else self.attributes.database_qualified_name @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -250,9 +222,7 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.schema_qualified_name - ) + return None if self.attributes is None else self.attributes.schema_qualified_name @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -302,9 +272,7 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.calculation_view_name - ) + return None if self.attributes is None else self.attributes.calculation_view_name @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -314,21 +282,13 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_qualified_name - ) + return None if self.attributes is None else self.attributes.calculation_view_qualified_name @calculation_view_qualified_name.setter - def calculation_view_qualified_name( - self, calculation_view_qualified_name: Optional[str] - ): + def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = ( - calculation_view_qualified_name - ) + self.attributes.calculation_view_qualified_name = calculation_view_qualified_name @property def is_profiled(self) -> Optional[bool]: @@ -414,26 +374,14 @@ class Attributes(Catalog.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field( - default=None, description="" - ) + calculation_view_qualified_name: Optional[str] = Field(default=None, description="") is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship - dbt_tests: Optional[List[DbtTest]] = Field( - default=None, description="" - ) # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship + dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship attributes: SQL.Attributes = Field( default_factory=lambda: SQL.Attributes(), diff --git a/pyatlan/model/assets/core/schema.py b/pyatlan/model/assets/core/schema.py index 1516dcb95..a3e8be496 100644 --- a/pyatlan/model/assets/core/schema.py +++ b/pyatlan/model/assets/core/schema.py @@ -49,9 +49,7 @@ def creator( database_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> Schema: - validate_required_fields( - ["name", "database_qualified_name"], [name, database_qualified_name] - ) + validate_required_fields(["name", "database_qualified_name"], [name, database_qualified_name]) attributes = Schema.Attributes.create( name=name, database_qualified_name=database_qualified_name, @@ -64,10 +62,7 @@ def creator( @init_guid def create(cls, *, name: str, database_qualified_name: str) -> Schema: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -132,9 +127,7 @@ def __setattr__(self, name, value): """ TBC """ - SNOWFLAKE_DYNAMIC_TABLES: ClassVar[RelationField] = RelationField( - "snowflakeDynamicTables" - ) + SNOWFLAKE_DYNAMIC_TABLES: ClassVar[RelationField] = RelationField("snowflakeDynamicTables") """ TBC """ @@ -190,11 +183,7 @@ def views_count(self, views_count: Optional[int]): @property def linked_schema_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.linked_schema_qualified_name - ) + return None if self.attributes is None else self.attributes.linked_schema_qualified_name @linked_schema_qualified_name.setter def linked_schema_qualified_name(self, linked_schema_qualified_name: Optional[str]): @@ -274,16 +263,10 @@ def materialised_views(self, materialised_views: Optional[List[MaterialisedView] @property def snowflake_dynamic_tables(self) -> Optional[List[SnowflakeDynamicTable]]: - return ( - None - if self.attributes is None - else self.attributes.snowflake_dynamic_tables - ) + return None if self.attributes is None else self.attributes.snowflake_dynamic_tables @snowflake_dynamic_tables.setter - def snowflake_dynamic_tables( - self, snowflake_dynamic_tables: Optional[List[SnowflakeDynamicTable]] - ): + def snowflake_dynamic_tables(self, snowflake_dynamic_tables: Optional[List[SnowflakeDynamicTable]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.snowflake_dynamic_tables = snowflake_dynamic_tables @@ -321,42 +304,20 @@ def calculation_views(self, calculation_views: Optional[List[CalculationView]]): class Attributes(SQL.Attributes): table_count: Optional[int] = Field(default=None, description="") views_count: Optional[int] = Field(default=None, description="") - linked_schema_qualified_name: Optional[str] = Field( - default=None, description="" - ) - snowflake_tags: Optional[List[SnowflakeTag]] = Field( - default=None, description="" - ) # relationship - functions: Optional[List[Function]] = Field( - default=None, description="" - ) # relationship - tables: Optional[List[Table]] = Field( - default=None, description="" - ) # relationship - database: Optional[Database] = Field( - default=None, description="" - ) # relationship - procedures: Optional[List[Procedure]] = Field( - default=None, description="" - ) # relationship - views: Optional[List[View]] = Field( - default=None, description="" - ) # relationship - materialised_views: Optional[List[MaterialisedView]] = Field( - default=None, description="" - ) # relationship + linked_schema_qualified_name: Optional[str] = Field(default=None, description="") + snowflake_tags: Optional[List[SnowflakeTag]] = Field(default=None, description="") # relationship + functions: Optional[List[Function]] = Field(default=None, description="") # relationship + tables: Optional[List[Table]] = Field(default=None, description="") # relationship + database: Optional[Database] = Field(default=None, description="") # relationship + procedures: Optional[List[Procedure]] = Field(default=None, description="") # relationship + views: Optional[List[View]] = Field(default=None, description="") # relationship + materialised_views: Optional[List[MaterialisedView]] = Field(default=None, description="") # relationship snowflake_dynamic_tables: Optional[List[SnowflakeDynamicTable]] = Field( default=None, description="" ) # relationship - snowflake_pipes: Optional[List[SnowflakePipe]] = Field( - default=None, description="" - ) # relationship - snowflake_streams: Optional[List[SnowflakeStream]] = Field( - default=None, description="" - ) # relationship - calculation_views: Optional[List[CalculationView]] = Field( - default=None, description="" - ) # relationship + snowflake_pipes: Optional[List[SnowflakePipe]] = Field(default=None, description="") # relationship + snowflake_streams: Optional[List[SnowflakeStream]] = Field(default=None, description="") # relationship + calculation_views: Optional[List[CalculationView]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -368,13 +329,9 @@ def create( database_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> Schema.Attributes: - validate_required_fields( - ["name, database_qualified_name"], [name, database_qualified_name] - ) + validate_required_fields(["name, database_qualified_name"], [name, database_qualified_name]) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( database_qualified_name, "database_qualified_name", 4 diff --git a/pyatlan/model/assets/core/schema_registry.py b/pyatlan/model/assets/core/schema_registry.py index bbb485d15..0968814f3 100644 --- a/pyatlan/model/assets/core/schema_registry.py +++ b/pyatlan/model/assets/core/schema_registry.py @@ -36,9 +36,7 @@ def __setattr__(self, name, value): """ Type of language or specification used to define the schema, for example: JSON, Protobuf, etc. """ - SCHEMA_REGISTRY_SCHEMA_ID: ClassVar[KeywordField] = KeywordField( - "schemaRegistrySchemaId", "schemaRegistrySchemaId" - ) + SCHEMA_REGISTRY_SCHEMA_ID: ClassVar[KeywordField] = KeywordField("schemaRegistrySchemaId", "schemaRegistrySchemaId") """ Unique identifier for schema definition set by the schema registry. """ @@ -50,27 +48,17 @@ def __setattr__(self, name, value): @property def schema_registry_schema_type(self) -> Optional[SchemaRegistrySchemaType]: - return ( - None - if self.attributes is None - else self.attributes.schema_registry_schema_type - ) + return None if self.attributes is None else self.attributes.schema_registry_schema_type @schema_registry_schema_type.setter - def schema_registry_schema_type( - self, schema_registry_schema_type: Optional[SchemaRegistrySchemaType] - ): + def schema_registry_schema_type(self, schema_registry_schema_type: Optional[SchemaRegistrySchemaType]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.schema_registry_schema_type = schema_registry_schema_type @property def schema_registry_schema_id(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.schema_registry_schema_id - ) + return None if self.attributes is None else self.attributes.schema_registry_schema_id @schema_registry_schema_id.setter def schema_registry_schema_id(self, schema_registry_schema_id: Optional[str]): @@ -79,9 +67,7 @@ def schema_registry_schema_id(self, schema_registry_schema_id: Optional[str]): self.attributes.schema_registry_schema_id = schema_registry_schema_id class Attributes(Catalog.Attributes): - schema_registry_schema_type: Optional[SchemaRegistrySchemaType] = Field( - default=None, description="" - ) + schema_registry_schema_type: Optional[SchemaRegistrySchemaType] = Field(default=None, description="") schema_registry_schema_id: Optional[str] = Field(default=None, description="") attributes: SchemaRegistry.Attributes = Field( diff --git a/pyatlan/model/assets/core/schema_registry_subject.py b/pyatlan/model/assets/core/schema_registry_subject.py index 71d9e563d..8998f7492 100644 --- a/pyatlan/model/assets/core/schema_registry_subject.py +++ b/pyatlan/model/assets/core/schema_registry_subject.py @@ -54,11 +54,9 @@ def __setattr__(self, name, value): """ Compatibility of the schema across versions. """ - SCHEMA_REGISTRY_SUBJECT_LATEST_SCHEMA_VERSION: ClassVar[KeywordField] = ( - KeywordField( - "schemaRegistrySubjectLatestSchemaVersion", - "schemaRegistrySubjectLatestSchemaVersion", - ) + SCHEMA_REGISTRY_SUBJECT_LATEST_SCHEMA_VERSION: ClassVar[KeywordField] = KeywordField( + "schemaRegistrySubjectLatestSchemaVersion", + "schemaRegistrySubjectLatestSchemaVersion", ) """ Latest schema version of the subject. @@ -70,11 +68,9 @@ def __setattr__(self, name, value): """ Definition of the latest schema in the subject. """ - SCHEMA_REGISTRY_SUBJECT_GOVERNING_ASSET_QUALIFIED_NAMES: ClassVar[KeywordField] = ( - KeywordField( - "schemaRegistrySubjectGoverningAssetQualifiedNames", - "schemaRegistrySubjectGoverningAssetQualifiedNames", - ) + SCHEMA_REGISTRY_SUBJECT_GOVERNING_ASSET_QUALIFIED_NAMES: ClassVar[KeywordField] = KeywordField( + "schemaRegistrySubjectGoverningAssetQualifiedNames", + "schemaRegistrySubjectGoverningAssetQualifiedNames", ) """ List of asset qualified names that this subject is governing/validating. @@ -97,70 +93,42 @@ def __setattr__(self, name, value): @property def schema_registry_subject_base_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.schema_registry_subject_base_name - ) + return None if self.attributes is None else self.attributes.schema_registry_subject_base_name @schema_registry_subject_base_name.setter - def schema_registry_subject_base_name( - self, schema_registry_subject_base_name: Optional[str] - ): + def schema_registry_subject_base_name(self, schema_registry_subject_base_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.schema_registry_subject_base_name = ( - schema_registry_subject_base_name - ) + self.attributes.schema_registry_subject_base_name = schema_registry_subject_base_name @property def schema_registry_subject_is_key_schema(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.schema_registry_subject_is_key_schema - ) + return None if self.attributes is None else self.attributes.schema_registry_subject_is_key_schema @schema_registry_subject_is_key_schema.setter - def schema_registry_subject_is_key_schema( - self, schema_registry_subject_is_key_schema: Optional[bool] - ): + def schema_registry_subject_is_key_schema(self, schema_registry_subject_is_key_schema: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.schema_registry_subject_is_key_schema = ( - schema_registry_subject_is_key_schema - ) + self.attributes.schema_registry_subject_is_key_schema = schema_registry_subject_is_key_schema @property def schema_registry_subject_schema_compatibility( self, ) -> Optional[SchemaRegistrySchemaCompatibility]: - return ( - None - if self.attributes is None - else self.attributes.schema_registry_subject_schema_compatibility - ) + return None if self.attributes is None else self.attributes.schema_registry_subject_schema_compatibility @schema_registry_subject_schema_compatibility.setter def schema_registry_subject_schema_compatibility( self, - schema_registry_subject_schema_compatibility: Optional[ - SchemaRegistrySchemaCompatibility - ], + schema_registry_subject_schema_compatibility: Optional[SchemaRegistrySchemaCompatibility], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.schema_registry_subject_schema_compatibility = ( - schema_registry_subject_schema_compatibility - ) + self.attributes.schema_registry_subject_schema_compatibility = schema_registry_subject_schema_compatibility @property def schema_registry_subject_latest_schema_version(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.schema_registry_subject_latest_schema_version - ) + return None if self.attributes is None else self.attributes.schema_registry_subject_latest_schema_version @schema_registry_subject_latest_schema_version.setter def schema_registry_subject_latest_schema_version( @@ -168,17 +136,11 @@ def schema_registry_subject_latest_schema_version( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.schema_registry_subject_latest_schema_version = ( - schema_registry_subject_latest_schema_version - ) + self.attributes.schema_registry_subject_latest_schema_version = schema_registry_subject_latest_schema_version @property def schema_registry_subject_latest_schema_definition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.schema_registry_subject_latest_schema_definition - ) + return None if self.attributes is None else self.attributes.schema_registry_subject_latest_schema_definition @schema_registry_subject_latest_schema_definition.setter def schema_registry_subject_latest_schema_definition( @@ -195,9 +157,7 @@ def schema_registry_subject_governing_asset_qualified_names( self, ) -> Optional[Set[str]]: return ( - None - if self.attributes is None - else self.attributes.schema_registry_subject_governing_asset_qualified_names + None if self.attributes is None else self.attributes.schema_registry_subject_governing_asset_qualified_names ) @schema_registry_subject_governing_asset_qualified_names.setter @@ -222,27 +182,17 @@ def assets(self, assets: Optional[List[Asset]]): self.attributes.assets = assets class Attributes(SchemaRegistry.Attributes): - schema_registry_subject_base_name: Optional[str] = Field( + schema_registry_subject_base_name: Optional[str] = Field(default=None, description="") + schema_registry_subject_is_key_schema: Optional[bool] = Field(default=None, description="") + schema_registry_subject_schema_compatibility: Optional[SchemaRegistrySchemaCompatibility] = Field( default=None, description="" ) - schema_registry_subject_is_key_schema: Optional[bool] = Field( + schema_registry_subject_latest_schema_version: Optional[str] = Field(default=None, description="") + schema_registry_subject_latest_schema_definition: Optional[str] = Field(default=None, description="") + schema_registry_subject_governing_asset_qualified_names: Optional[Set[str]] = Field( default=None, description="" ) - schema_registry_subject_schema_compatibility: Optional[ - SchemaRegistrySchemaCompatibility - ] = Field(default=None, description="") - schema_registry_subject_latest_schema_version: Optional[str] = Field( - default=None, description="" - ) - schema_registry_subject_latest_schema_definition: Optional[str] = Field( - default=None, description="" - ) - schema_registry_subject_governing_asset_qualified_names: Optional[Set[str]] = ( - Field(default=None, description="") - ) - assets: Optional[List[Asset]] = Field( - default=None, description="" - ) # relationship + assets: Optional[List[Asset]] = Field(default=None, description="") # relationship attributes: SchemaRegistrySubject.Attributes = Field( default_factory=lambda: SchemaRegistrySubject.Attributes(), diff --git a/pyatlan/model/assets/core/snowflake_pipe.py b/pyatlan/model/assets/core/snowflake_pipe.py index 3fffa9a45..1e764fb1c 100644 --- a/pyatlan/model/assets/core/snowflake_pipe.py +++ b/pyatlan/model/assets/core/snowflake_pipe.py @@ -44,12 +44,10 @@ def __setattr__(self, name, value): """ Whether auto-ingest is enabled for this pipe (true) or not (false). """ - SNOWFLAKE_PIPE_NOTIFICATION_CHANNEL_NAME: ClassVar[KeywordTextField] = ( - KeywordTextField( - "snowflakePipeNotificationChannelName", - "snowflakePipeNotificationChannelName", - "snowflakePipeNotificationChannelName.text", - ) + SNOWFLAKE_PIPE_NOTIFICATION_CHANNEL_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "snowflakePipeNotificationChannelName", + "snowflakePipeNotificationChannelName", + "snowflakePipeNotificationChannelName.text", ) """ Name of the notification channel for this pipe. @@ -79,39 +77,23 @@ def definition(self, definition: Optional[str]): @property def snowflake_pipe_is_auto_ingest_enabled(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.snowflake_pipe_is_auto_ingest_enabled - ) + return None if self.attributes is None else self.attributes.snowflake_pipe_is_auto_ingest_enabled @snowflake_pipe_is_auto_ingest_enabled.setter - def snowflake_pipe_is_auto_ingest_enabled( - self, snowflake_pipe_is_auto_ingest_enabled: Optional[bool] - ): + def snowflake_pipe_is_auto_ingest_enabled(self, snowflake_pipe_is_auto_ingest_enabled: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.snowflake_pipe_is_auto_ingest_enabled = ( - snowflake_pipe_is_auto_ingest_enabled - ) + self.attributes.snowflake_pipe_is_auto_ingest_enabled = snowflake_pipe_is_auto_ingest_enabled @property def snowflake_pipe_notification_channel_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.snowflake_pipe_notification_channel_name - ) + return None if self.attributes is None else self.attributes.snowflake_pipe_notification_channel_name @snowflake_pipe_notification_channel_name.setter - def snowflake_pipe_notification_channel_name( - self, snowflake_pipe_notification_channel_name: Optional[str] - ): + def snowflake_pipe_notification_channel_name(self, snowflake_pipe_notification_channel_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.snowflake_pipe_notification_channel_name = ( - snowflake_pipe_notification_channel_name - ) + self.attributes.snowflake_pipe_notification_channel_name = snowflake_pipe_notification_channel_name @property def atlan_schema(self) -> Optional[Schema]: @@ -125,15 +107,9 @@ def atlan_schema(self, atlan_schema: Optional[Schema]): class Attributes(SQL.Attributes): definition: Optional[str] = Field(default=None, description="") - snowflake_pipe_is_auto_ingest_enabled: Optional[bool] = Field( - default=None, description="" - ) - snowflake_pipe_notification_channel_name: Optional[str] = Field( - default=None, description="" - ) - atlan_schema: Optional[Schema] = Field( - default=None, description="" - ) # relationship + snowflake_pipe_is_auto_ingest_enabled: Optional[bool] = Field(default=None, description="") + snowflake_pipe_notification_channel_name: Optional[str] = Field(default=None, description="") + atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship attributes: SnowflakePipe.Attributes = Field( default_factory=lambda: SnowflakePipe.Attributes(), diff --git a/pyatlan/model/assets/core/snowflake_stream.py b/pyatlan/model/assets/core/snowflake_stream.py index 081dc4241..05d0560e3 100644 --- a/pyatlan/model/assets/core/snowflake_stream.py +++ b/pyatlan/model/assets/core/snowflake_stream.py @@ -35,9 +35,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SNOWFLAKE_STREAM_TYPE: ClassVar[KeywordField] = KeywordField( - "snowflakeStreamType", "snowflakeStreamType" - ) + SNOWFLAKE_STREAM_TYPE: ClassVar[KeywordField] = KeywordField("snowflakeStreamType", "snowflakeStreamType") """ Type of this stream, for example: standard, append-only, insert-only, etc. """ @@ -47,15 +45,11 @@ def __setattr__(self, name, value): """ Type of the source of this stream. """ - SNOWFLAKE_STREAM_MODE: ClassVar[KeywordField] = KeywordField( - "snowflakeStreamMode", "snowflakeStreamMode" - ) + SNOWFLAKE_STREAM_MODE: ClassVar[KeywordField] = KeywordField("snowflakeStreamMode", "snowflakeStreamMode") """ Mode of this stream. """ - SNOWFLAKE_STREAM_IS_STALE: ClassVar[BooleanField] = BooleanField( - "snowflakeStreamIsStale", "snowflakeStreamIsStale" - ) + SNOWFLAKE_STREAM_IS_STALE: ClassVar[BooleanField] = BooleanField("snowflakeStreamIsStale", "snowflakeStreamIsStale") """ Whether this stream is stale (true) or not (false). """ @@ -82,9 +76,7 @@ def __setattr__(self, name, value): @property def snowflake_stream_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.snowflake_stream_type - ) + return None if self.attributes is None else self.attributes.snowflake_stream_type @snowflake_stream_type.setter def snowflake_stream_type(self, snowflake_stream_type: Optional[str]): @@ -94,11 +86,7 @@ def snowflake_stream_type(self, snowflake_stream_type: Optional[str]): @property def snowflake_stream_source_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.snowflake_stream_source_type - ) + return None if self.attributes is None else self.attributes.snowflake_stream_source_type @snowflake_stream_source_type.setter def snowflake_stream_source_type(self, snowflake_stream_source_type: Optional[str]): @@ -108,9 +96,7 @@ def snowflake_stream_source_type(self, snowflake_stream_source_type: Optional[st @property def snowflake_stream_mode(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.snowflake_stream_mode - ) + return None if self.attributes is None else self.attributes.snowflake_stream_mode @snowflake_stream_mode.setter def snowflake_stream_mode(self, snowflake_stream_mode: Optional[str]): @@ -120,11 +106,7 @@ def snowflake_stream_mode(self, snowflake_stream_mode: Optional[str]): @property def snowflake_stream_is_stale(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.snowflake_stream_is_stale - ) + return None if self.attributes is None else self.attributes.snowflake_stream_is_stale @snowflake_stream_is_stale.setter def snowflake_stream_is_stale(self, snowflake_stream_is_stale: Optional[bool]): @@ -134,16 +116,10 @@ def snowflake_stream_is_stale(self, snowflake_stream_is_stale: Optional[bool]): @property def snowflake_stream_stale_after(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.snowflake_stream_stale_after - ) + return None if self.attributes is None else self.attributes.snowflake_stream_stale_after @snowflake_stream_stale_after.setter - def snowflake_stream_stale_after( - self, snowflake_stream_stale_after: Optional[datetime] - ): + def snowflake_stream_stale_after(self, snowflake_stream_stale_after: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.snowflake_stream_stale_after = snowflake_stream_stale_after @@ -160,17 +136,11 @@ def atlan_schema(self, atlan_schema: Optional[Schema]): class Attributes(SQL.Attributes): snowflake_stream_type: Optional[str] = Field(default=None, description="") - snowflake_stream_source_type: Optional[str] = Field( - default=None, description="" - ) + snowflake_stream_source_type: Optional[str] = Field(default=None, description="") snowflake_stream_mode: Optional[str] = Field(default=None, description="") snowflake_stream_is_stale: Optional[bool] = Field(default=None, description="") - snowflake_stream_stale_after: Optional[datetime] = Field( - default=None, description="" - ) - atlan_schema: Optional[Schema] = Field( - default=None, description="" - ) # relationship + snowflake_stream_stale_after: Optional[datetime] = Field(default=None, description="") + atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship attributes: SnowflakeStream.Attributes = Field( default_factory=lambda: SnowflakeStream.Attributes(), diff --git a/pyatlan/model/assets/core/snowflake_tag.py b/pyatlan/model/assets/core/snowflake_tag.py index e04428a26..c200e2fbc 100644 --- a/pyatlan/model/assets/core/snowflake_tag.py +++ b/pyatlan/model/assets/core/snowflake_tag.py @@ -41,9 +41,7 @@ def __setattr__(self, name, value): """ Unique identifier of the tag in the source system. """ - TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( - "tagAttributes", "tagAttributes" - ) + TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("tagAttributes", "tagAttributes") """ Attributes associated with the tag in the source system. """ @@ -63,69 +61,47 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( - "queryUserCount", "queryUserCount" - ) + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( - "queryUserMap", "queryUserMap" - ) + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( - "queryCountUpdatedAt", "queryCountUpdatedAt" - ) + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "databaseName", "databaseName.keyword", "databaseName" - ) + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "databaseQualifiedName", "databaseQualifiedName" - ) + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "schemaName", "schemaName.keyword", "schemaName" - ) + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "schemaQualifiedName", "schemaQualifiedName" - ) + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "tableName", "tableName.keyword", "tableName" - ) + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "tableQualifiedName", "tableQualifiedName" - ) + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "viewName", "viewName.keyword", "viewName" - ) + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "viewQualifiedName", "viewQualifiedName" - ) + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -145,9 +121,7 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( - "lastProfiledAt", "lastProfiledAt" - ) + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -238,9 +212,7 @@ def tag_allowed_values(self, tag_allowed_values: Optional[Set[str]]): @property def mapped_atlan_tag_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.mapped_atlan_tag_name - ) + return None if self.attributes is None else self.attributes.mapped_atlan_tag_name @mapped_atlan_tag_name.setter def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): @@ -280,9 +252,7 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.query_count_updated_at - ) + return None if self.attributes is None else self.attributes.query_count_updated_at @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -302,9 +272,7 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.database_qualified_name - ) + return None if self.attributes is None else self.attributes.database_qualified_name @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -324,9 +292,7 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.schema_qualified_name - ) + return None if self.attributes is None else self.attributes.schema_qualified_name @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -376,9 +342,7 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.calculation_view_name - ) + return None if self.attributes is None else self.attributes.calculation_view_name @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -388,21 +352,13 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_qualified_name - ) + return None if self.attributes is None else self.attributes.calculation_view_qualified_name @calculation_view_qualified_name.setter - def calculation_view_qualified_name( - self, calculation_view_qualified_name: Optional[str] - ): + def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = ( - calculation_view_qualified_name - ) + self.attributes.calculation_view_qualified_name = calculation_view_qualified_name @property def is_profiled(self) -> Optional[bool]: @@ -486,9 +442,7 @@ def dbt_models(self, dbt_models: Optional[List[DbtModel]]): class Attributes(Tag.Attributes): tag_id: Optional[str] = Field(default=None, description="") - tag_attributes: Optional[List[SourceTagAttribute]] = Field( - default=None, description="" - ) + tag_attributes: Optional[List[SourceTagAttribute]] = Field(default=None, description="") tag_allowed_values: Optional[Set[str]] = Field(default=None, description="") mapped_atlan_tag_name: Optional[str] = Field(default=None, description="") query_count: Optional[int] = Field(default=None, description="") @@ -504,29 +458,15 @@ class Attributes(Tag.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field( - default=None, description="" - ) + calculation_view_qualified_name: Optional[str] = Field(default=None, description="") is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship - dbt_tests: Optional[List[DbtTest]] = Field( - default=None, description="" - ) # relationship - atlan_schema: Optional[Schema] = Field( - default=None, description="" - ) # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field( - default=None, description="" - ) # relationship - dbt_models: Optional[List[DbtModel]] = Field( - default=None, description="" - ) # relationship + dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship + atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship + dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship attributes: SnowflakeTag.Attributes = Field( default_factory=lambda: SnowflakeTag.Attributes(), diff --git a/pyatlan/model/assets/core/soda_check.py b/pyatlan/model/assets/core/soda_check.py index d71097ef4..7beea1f95 100644 --- a/pyatlan/model/assets/core/soda_check.py +++ b/pyatlan/model/assets/core/soda_check.py @@ -45,21 +45,15 @@ def __setattr__(self, name, value): """ Status of the check in Soda. """ - SODA_CHECK_DEFINITION: ClassVar[TextField] = TextField( - "sodaCheckDefinition", "sodaCheckDefinition" - ) + SODA_CHECK_DEFINITION: ClassVar[TextField] = TextField("sodaCheckDefinition", "sodaCheckDefinition") """ Definition of the check in Soda. """ - SODA_CHECK_LAST_SCAN_AT: ClassVar[NumericField] = NumericField( - "sodaCheckLastScanAt", "sodaCheckLastScanAt" - ) + SODA_CHECK_LAST_SCAN_AT: ClassVar[NumericField] = NumericField("sodaCheckLastScanAt", "sodaCheckLastScanAt") """ """ - SODA_CHECK_INCIDENT_COUNT: ClassVar[NumericField] = NumericField( - "sodaCheckIncidentCount", "sodaCheckIncidentCount" - ) + SODA_CHECK_INCIDENT_COUNT: ClassVar[NumericField] = NumericField("sodaCheckIncidentCount", "sodaCheckIncidentCount") """ """ @@ -95,11 +89,7 @@ def soda_check_id(self, soda_check_id: Optional[str]): @property def soda_check_evaluation_status(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.soda_check_evaluation_status - ) + return None if self.attributes is None else self.attributes.soda_check_evaluation_status @soda_check_evaluation_status.setter def soda_check_evaluation_status(self, soda_check_evaluation_status: Optional[str]): @@ -109,9 +99,7 @@ def soda_check_evaluation_status(self, soda_check_evaluation_status: Optional[st @property def soda_check_definition(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.soda_check_definition - ) + return None if self.attributes is None else self.attributes.soda_check_definition @soda_check_definition.setter def soda_check_definition(self, soda_check_definition: Optional[str]): @@ -121,9 +109,7 @@ def soda_check_definition(self, soda_check_definition: Optional[str]): @property def soda_check_last_scan_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.soda_check_last_scan_at - ) + return None if self.attributes is None else self.attributes.soda_check_last_scan_at @soda_check_last_scan_at.setter def soda_check_last_scan_at(self, soda_check_last_scan_at: Optional[datetime]): @@ -133,11 +119,7 @@ def soda_check_last_scan_at(self, soda_check_last_scan_at: Optional[datetime]): @property def soda_check_incident_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.soda_check_incident_count - ) + return None if self.attributes is None else self.attributes.soda_check_incident_count @soda_check_incident_count.setter def soda_check_incident_count(self, soda_check_incident_count: Optional[int]): @@ -167,20 +149,12 @@ def soda_check_assets(self, soda_check_assets: Optional[List[Asset]]): class Attributes(Soda.Attributes): soda_check_id: Optional[str] = Field(default=None, description="") - soda_check_evaluation_status: Optional[str] = Field( - default=None, description="" - ) + soda_check_evaluation_status: Optional[str] = Field(default=None, description="") soda_check_definition: Optional[str] = Field(default=None, description="") - soda_check_last_scan_at: Optional[datetime] = Field( - default=None, description="" - ) + soda_check_last_scan_at: Optional[datetime] = Field(default=None, description="") soda_check_incident_count: Optional[int] = Field(default=None, description="") - soda_check_columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship - soda_check_assets: Optional[List[Asset]] = Field( - default=None, description="" - ) # relationship + soda_check_columns: Optional[List[Column]] = Field(default=None, description="") # relationship + soda_check_assets: Optional[List[Asset]] = Field(default=None, description="") # relationship attributes: SodaCheck.Attributes = Field( default_factory=lambda: SodaCheck.Attributes(), diff --git a/pyatlan/model/assets/core/spark.py b/pyatlan/model/assets/core/spark.py index 86841c96b..145e70fc5 100644 --- a/pyatlan/model/assets/core/spark.py +++ b/pyatlan/model/assets/core/spark.py @@ -31,9 +31,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SPARK_RUN_VERSION: ClassVar[KeywordField] = KeywordField( - "sparkRunVersion", "sparkRunVersion" - ) + SPARK_RUN_VERSION: ClassVar[KeywordField] = KeywordField("sparkRunVersion", "sparkRunVersion") """ Spark Version for the Spark Job run eg. 3.4.1 """ @@ -43,15 +41,11 @@ def __setattr__(self, name, value): """ OpenLineage Version of the Spark Job run eg. 1.1.0 """ - SPARK_RUN_START_TIME: ClassVar[NumericField] = NumericField( - "sparkRunStartTime", "sparkRunStartTime" - ) + SPARK_RUN_START_TIME: ClassVar[NumericField] = NumericField("sparkRunStartTime", "sparkRunStartTime") """ Start time of the Spark Job eg. 1695673598218 """ - SPARK_RUN_END_TIME: ClassVar[NumericField] = NumericField( - "sparkRunEndTime", "sparkRunEndTime" - ) + SPARK_RUN_END_TIME: ClassVar[NumericField] = NumericField("sparkRunEndTime", "sparkRunEndTime") """ End time of the Spark Job eg. 1695673598218 """ @@ -82,16 +76,10 @@ def spark_run_version(self, spark_run_version: Optional[str]): @property def spark_run_open_lineage_version(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.spark_run_open_lineage_version - ) + return None if self.attributes is None else self.attributes.spark_run_open_lineage_version @spark_run_open_lineage_version.setter - def spark_run_open_lineage_version( - self, spark_run_open_lineage_version: Optional[str] - ): + def spark_run_open_lineage_version(self, spark_run_open_lineage_version: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.spark_run_open_lineage_version = spark_run_open_lineage_version @@ -118,30 +106,20 @@ def spark_run_end_time(self, spark_run_end_time: Optional[datetime]): @property def spark_run_open_lineage_state(self) -> Optional[OpenLineageRunState]: - return ( - None - if self.attributes is None - else self.attributes.spark_run_open_lineage_state - ) + return None if self.attributes is None else self.attributes.spark_run_open_lineage_state @spark_run_open_lineage_state.setter - def spark_run_open_lineage_state( - self, spark_run_open_lineage_state: Optional[OpenLineageRunState] - ): + def spark_run_open_lineage_state(self, spark_run_open_lineage_state: Optional[OpenLineageRunState]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.spark_run_open_lineage_state = spark_run_open_lineage_state class Attributes(Catalog.Attributes): spark_run_version: Optional[str] = Field(default=None, description="") - spark_run_open_lineage_version: Optional[str] = Field( - default=None, description="" - ) + spark_run_open_lineage_version: Optional[str] = Field(default=None, description="") spark_run_start_time: Optional[datetime] = Field(default=None, description="") spark_run_end_time: Optional[datetime] = Field(default=None, description="") - spark_run_open_lineage_state: Optional[OpenLineageRunState] = Field( - default=None, description="" - ) + spark_run_open_lineage_state: Optional[OpenLineageRunState] = Field(default=None, description="") attributes: Spark.Attributes = Field( default_factory=lambda: Spark.Attributes(), diff --git a/pyatlan/model/assets/core/spark_job.py b/pyatlan/model/assets/core/spark_job.py index 27a92593b..4ec7c5527 100644 --- a/pyatlan/model/assets/core/spark_job.py +++ b/pyatlan/model/assets/core/spark_job.py @@ -118,12 +118,8 @@ def process(self, process: Optional[Process]): class Attributes(Spark.Attributes): spark_app_name: Optional[str] = Field(default=None, description="") spark_master: Optional[str] = Field(default=None, description="") - outputs: Optional[List[Catalog]] = Field( - default=None, description="" - ) # relationship - inputs: Optional[List[Catalog]] = Field( - default=None, description="" - ) # relationship + outputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship + inputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship process: Optional[Process] = Field(default=None, description="") # relationship attributes: SparkJob.Attributes = Field( diff --git a/pyatlan/model/assets/core/stakeholder.py b/pyatlan/model/assets/core/stakeholder.py index 768b8342b..3d23f9ab2 100644 --- a/pyatlan/model/assets/core/stakeholder.py +++ b/pyatlan/model/assets/core/stakeholder.py @@ -35,9 +35,7 @@ def __setattr__(self, name, value): """ TBC """ - STAKEHOLDER_TITLE_GUID: ClassVar[KeywordField] = KeywordField( - "stakeholderTitleGuid", "stakeholderTitleGuid" - ) + STAKEHOLDER_TITLE_GUID: ClassVar[KeywordField] = KeywordField("stakeholderTitleGuid", "stakeholderTitleGuid") """ TBC """ @@ -46,9 +44,7 @@ def __setattr__(self, name, value): """ TBC """ - STAKEHOLDER_DATA_DOMAIN: ClassVar[RelationField] = RelationField( - "stakeholderDataDomain" - ) + STAKEHOLDER_DATA_DOMAIN: ClassVar[RelationField] = RelationField("stakeholderDataDomain") """ TBC """ @@ -62,27 +58,17 @@ def __setattr__(self, name, value): @property def stakeholder_domain_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.stakeholder_domain_qualified_name - ) + return None if self.attributes is None else self.attributes.stakeholder_domain_qualified_name @stakeholder_domain_qualified_name.setter - def stakeholder_domain_qualified_name( - self, stakeholder_domain_qualified_name: Optional[str] - ): + def stakeholder_domain_qualified_name(self, stakeholder_domain_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.stakeholder_domain_qualified_name = ( - stakeholder_domain_qualified_name - ) + self.attributes.stakeholder_domain_qualified_name = stakeholder_domain_qualified_name @property def stakeholder_title_guid(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.stakeholder_title_guid - ) + return None if self.attributes is None else self.attributes.stakeholder_title_guid @stakeholder_title_guid.setter def stakeholder_title_guid(self, stakeholder_title_guid: Optional[str]): @@ -102,9 +88,7 @@ def stakeholder_title(self, stakeholder_title: Optional[StakeholderTitle]): @property def stakeholder_data_domain(self) -> Optional[DataDomain]: - return ( - None if self.attributes is None else self.attributes.stakeholder_data_domain - ) + return None if self.attributes is None else self.attributes.stakeholder_data_domain @stakeholder_data_domain.setter def stakeholder_data_domain(self, stakeholder_data_domain: Optional[DataDomain]): @@ -113,16 +97,10 @@ def stakeholder_data_domain(self, stakeholder_data_domain: Optional[DataDomain]) self.attributes.stakeholder_data_domain = stakeholder_data_domain class Attributes(Persona.Attributes): - stakeholder_domain_qualified_name: Optional[str] = Field( - default=None, description="" - ) + stakeholder_domain_qualified_name: Optional[str] = Field(default=None, description="") stakeholder_title_guid: Optional[str] = Field(default=None, description="") - stakeholder_title: Optional[StakeholderTitle] = Field( - default=None, description="" - ) # relationship - stakeholder_data_domain: Optional[DataDomain] = Field( - default=None, description="" - ) # relationship + stakeholder_title: Optional[StakeholderTitle] = Field(default=None, description="") # relationship + stakeholder_data_domain: Optional[DataDomain] = Field(default=None, description="") # relationship attributes: Stakeholder.Attributes = Field( default_factory=lambda: Stakeholder.Attributes(), diff --git a/pyatlan/model/assets/core/stakeholder_title.py b/pyatlan/model/assets/core/stakeholder_title.py index d22bf45c9..b2511bea5 100644 --- a/pyatlan/model/assets/core/stakeholder_title.py +++ b/pyatlan/model/assets/core/stakeholder_title.py @@ -48,21 +48,13 @@ def __setattr__(self, name, value): @property def stakeholder_title_domain_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.stakeholder_title_domain_qualified_names - ) + return None if self.attributes is None else self.attributes.stakeholder_title_domain_qualified_names @stakeholder_title_domain_qualified_names.setter - def stakeholder_title_domain_qualified_names( - self, stakeholder_title_domain_qualified_names: Optional[Set[str]] - ): + def stakeholder_title_domain_qualified_names(self, stakeholder_title_domain_qualified_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.stakeholder_title_domain_qualified_names = ( - stakeholder_title_domain_qualified_names - ) + self.attributes.stakeholder_title_domain_qualified_names = stakeholder_title_domain_qualified_names @property def stakeholders(self) -> Optional[List[Stakeholder]]: @@ -75,12 +67,8 @@ def stakeholders(self, stakeholders: Optional[List[Stakeholder]]): self.attributes.stakeholders = stakeholders class Attributes(Asset.Attributes): - stakeholder_title_domain_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) - stakeholders: Optional[List[Stakeholder]] = Field( - default=None, description="" - ) # relationship + stakeholder_title_domain_qualified_names: Optional[Set[str]] = Field(default=None, description="") + stakeholders: Optional[List[Stakeholder]] = Field(default=None, description="") # relationship attributes: StakeholderTitle.Attributes = Field( default_factory=lambda: StakeholderTitle.Attributes(), diff --git a/pyatlan/model/assets/core/table.py b/pyatlan/model/assets/core/table.py index 7f3513e25..3367b031d 100644 --- a/pyatlan/model/assets/core/table.py +++ b/pyatlan/model/assets/core/table.py @@ -59,9 +59,7 @@ def creator( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> Table: - validate_required_fields( - ["name", "schema_qualified_name"], [name, schema_qualified_name] - ) + validate_required_fields(["name", "schema_qualified_name"], [name, schema_qualified_name]) attributes = Table.Attributes.create( name=name, schema_qualified_name=schema_qualified_name, @@ -76,10 +74,7 @@ def creator( @init_guid def create(cls, *, name: str, schema_qualified_name: str) -> Table: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -119,51 +114,35 @@ def __setattr__(self, name, value): """ Whether this table is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( - "isQueryPreview", "isQueryPreview" - ) + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") """ Whether preview queries are allowed for this table (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( - "queryPreviewConfig", "queryPreviewConfig" - ) + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") """ Configuration for preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField( - "externalLocation", "externalLocation" - ) + EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") """ External location of this table, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( - "externalLocationRegion", "externalLocationRegion" - ) + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") """ Region of the external location of this table, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( - "externalLocationFormat", "externalLocationFormat" - ) + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") """ Format of the external location of this table, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( - "isPartitioned", "isPartitioned" - ) + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") """ Whether this table is partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( - "partitionStrategy", "partitionStrategy" - ) + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") """ Partition strategy for this table. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField( - "partitionCount", "partitionCount" - ) + PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") """ Number of partitions in this table. """ @@ -179,21 +158,15 @@ def __setattr__(self, name, value): """ Type of the table. """ - ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField( - "icebergCatalogName", "icebergCatalogName" - ) + ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField("icebergCatalogName", "icebergCatalogName") """ iceberg table catalog name (can be any user defined name) """ - ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField( - "icebergTableType", "icebergTableType" - ) + ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField("icebergTableType", "icebergTableType") """ iceberg table type (managed vs unmanaged) """ - ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField( - "icebergCatalogSource", "icebergCatalogSource" - ) + ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField("icebergCatalogSource", "icebergCatalogSource") """ iceberg table catalog type (glue, polaris, snowflake) """ @@ -221,9 +194,7 @@ def __setattr__(self, name, value): """ iceberg table base location inside the external volume. """ - TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField( - "tableRetentionTime", "tableRetentionTime" - ) + TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField("tableRetentionTime", "tableRetentionTime") """ Data retention time in days. """ @@ -368,11 +339,7 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_region - ) + return None if self.attributes is None else self.attributes.external_location_region @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -382,11 +349,7 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_format - ) + return None if self.attributes is None else self.attributes.external_location_format @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -476,9 +439,7 @@ def iceberg_table_type(self, iceberg_table_type: Optional[str]): @property def iceberg_catalog_source(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.iceberg_catalog_source - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_source @iceberg_catalog_source.setter def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @@ -488,11 +449,7 @@ def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @property def iceberg_catalog_table_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_catalog_table_name - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_table_name @iceberg_catalog_table_name.setter def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @@ -502,29 +459,17 @@ def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @property def iceberg_catalog_table_namespace(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_catalog_table_namespace - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_table_namespace @iceberg_catalog_table_namespace.setter - def iceberg_catalog_table_namespace( - self, iceberg_catalog_table_namespace: Optional[str] - ): + def iceberg_catalog_table_namespace(self, iceberg_catalog_table_namespace: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.iceberg_catalog_table_namespace = ( - iceberg_catalog_table_namespace - ) + self.attributes.iceberg_catalog_table_namespace = iceberg_catalog_table_namespace @property def table_external_volume_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.table_external_volume_name - ) + return None if self.attributes is None else self.attributes.table_external_volume_name @table_external_volume_name.setter def table_external_volume_name(self, table_external_volume_name: Optional[str]): @@ -534,11 +479,7 @@ def table_external_volume_name(self, table_external_volume_name: Optional[str]): @property def iceberg_table_base_location(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_table_base_location - ) + return None if self.attributes is None else self.attributes.iceberg_table_base_location @iceberg_table_base_location.setter def iceberg_table_base_location(self, iceberg_table_base_location: Optional[str]): @@ -623,9 +564,7 @@ class Attributes(SQL.Attributes): alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -639,30 +578,16 @@ class Attributes(SQL.Attributes): iceberg_table_type: Optional[str] = Field(default=None, description="") iceberg_catalog_source: Optional[str] = Field(default=None, description="") iceberg_catalog_table_name: Optional[str] = Field(default=None, description="") - iceberg_catalog_table_namespace: Optional[str] = Field( - default=None, description="" - ) + iceberg_catalog_table_namespace: Optional[str] = Field(default=None, description="") table_external_volume_name: Optional[str] = Field(default=None, description="") iceberg_table_base_location: Optional[str] = Field(default=None, description="") table_retention_time: Optional[int] = Field(default=None, description="") - columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship - facts: Optional[List[Table]] = Field( - default=None, description="" - ) # relationship - atlan_schema: Optional[Schema] = Field( - default=None, description="" - ) # relationship - partitions: Optional[List[TablePartition]] = Field( - default=None, description="" - ) # relationship - queries: Optional[List[Query]] = Field( - default=None, description="" - ) # relationship - dimensions: Optional[List[Table]] = Field( - default=None, description="" - ) # relationship + columns: Optional[List[Column]] = Field(default=None, description="") # relationship + facts: Optional[List[Table]] = Field(default=None, description="") # relationship + atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship + partitions: Optional[List[TablePartition]] = Field(default=None, description="") # relationship + queries: Optional[List[Query]] = Field(default=None, description="") # relationship + dimensions: Optional[List[Table]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -676,13 +601,9 @@ def create( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> Table.Attributes: - validate_required_fields( - ["name, schema_qualified_name"], [name, schema_qualified_name] - ) + validate_required_fields(["name, schema_qualified_name"], [name, schema_qualified_name]) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( schema_qualified_name, "schema_qualified_name", 5 @@ -693,10 +614,7 @@ def create( connection_qualified_name = connection_qualified_name or connection_qn database_name = database_name or fields[3] schema_name = schema_name or fields[4] - database_qualified_name = ( - database_qualified_name - or f"{connection_qualified_name}/{database_name}" - ) + database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" return Table.Attributes( name=name, diff --git a/pyatlan/model/assets/core/table_partition.py b/pyatlan/model/assets/core/table_partition.py index f975f97b5..374a51fa6 100644 --- a/pyatlan/model/assets/core/table_partition.py +++ b/pyatlan/model/assets/core/table_partition.py @@ -144,51 +144,35 @@ def __setattr__(self, name, value): """ Whether this partition is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( - "isQueryPreview", "isQueryPreview" - ) + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") """ Whether preview queries for this partition are allowed (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( - "queryPreviewConfig", "queryPreviewConfig" - ) + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") """ Configuration for the preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField( - "externalLocation", "externalLocation" - ) + EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") """ External location of this partition, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( - "externalLocationRegion", "externalLocationRegion" - ) + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") """ Region of the external location of this partition, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( - "externalLocationFormat", "externalLocationFormat" - ) + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") """ Format of the external location of this partition, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( - "isPartitioned", "isPartitioned" - ) + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") """ Whether this partition is further partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( - "partitionStrategy", "partitionStrategy" - ) + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") """ Partition strategy of this partition. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField( - "partitionCount", "partitionCount" - ) + PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") """ Number of sub-partitions of this partition. """ @@ -205,15 +189,11 @@ def __setattr__(self, name, value): """ TBC """ - CHILD_TABLE_PARTITIONS: ClassVar[RelationField] = RelationField( - "childTablePartitions" - ) + CHILD_TABLE_PARTITIONS: ClassVar[RelationField] = RelationField("childTablePartitions") """ TBC """ - PARENT_TABLE_PARTITION: ClassVar[RelationField] = RelationField( - "parentTablePartition" - ) + PARENT_TABLE_PARTITION: ClassVar[RelationField] = RelationField("parentTablePartition") """ TBC """ @@ -332,11 +312,7 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_region - ) + return None if self.attributes is None else self.attributes.external_location_region @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -346,11 +322,7 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_format - ) + return None if self.attributes is None else self.attributes.external_location_format @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -420,23 +392,17 @@ def parent_table(self, parent_table: Optional[Table]): @property def child_table_partitions(self) -> Optional[List[TablePartition]]: - return ( - None if self.attributes is None else self.attributes.child_table_partitions - ) + return None if self.attributes is None else self.attributes.child_table_partitions @child_table_partitions.setter - def child_table_partitions( - self, child_table_partitions: Optional[List[TablePartition]] - ): + def child_table_partitions(self, child_table_partitions: Optional[List[TablePartition]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.child_table_partitions = child_table_partitions @property def parent_table_partition(self) -> Optional[TablePartition]: - return ( - None if self.attributes is None else self.attributes.parent_table_partition - ) + return None if self.attributes is None else self.attributes.parent_table_partition @parent_table_partition.setter def parent_table_partition(self, parent_table_partition: Optional[TablePartition]): @@ -452,9 +418,7 @@ class Attributes(SQL.Attributes): alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -462,18 +426,10 @@ class Attributes(SQL.Attributes): partition_strategy: Optional[str] = Field(default=None, description="") partition_count: Optional[int] = Field(default=None, description="") partition_list: Optional[str] = Field(default=None, description="") - columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship - parent_table: Optional[Table] = Field( - default=None, description="" - ) # relationship - child_table_partitions: Optional[List[TablePartition]] = Field( - default=None, description="" - ) # relationship - parent_table_partition: Optional[TablePartition] = Field( - default=None, description="" - ) # relationship + columns: Optional[List[Column]] = Field(default=None, description="") # relationship + parent_table: Optional[Table] = Field(default=None, description="") # relationship + child_table_partitions: Optional[List[TablePartition]] = Field(default=None, description="") # relationship + parent_table_partition: Optional[TablePartition] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -508,9 +464,7 @@ def creator( ) assert table_qualified_name # noqa: S101 if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( table_qualified_name, "table_qualified_name", 6 @@ -522,13 +476,8 @@ def creator( database_name = database_name or fields[3] schema_name = schema_name or fields[4] table_name = table_name or fields[5] - database_qualified_name = ( - database_qualified_name - or f"{connection_qualified_name}/{database_name}" - ) - schema_qualified_name = ( - schema_qualified_name or f"{database_qualified_name}/{schema_name}" - ) + database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" + schema_qualified_name = schema_qualified_name or f"{database_qualified_name}/{schema_name}" qualified_name = f"{schema_qualified_name}/{name}" diff --git a/pyatlan/model/assets/core/tag.py b/pyatlan/model/assets/core/tag.py index 9b7919062..9ce2545ab 100644 --- a/pyatlan/model/assets/core/tag.py +++ b/pyatlan/model/assets/core/tag.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): """ Unique identifier of the tag in the source system. """ - TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( - "tagAttributes", "tagAttributes" - ) + TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("tagAttributes", "tagAttributes") """ Attributes associated with the tag in the source system. """ @@ -92,9 +90,7 @@ def tag_allowed_values(self, tag_allowed_values: Optional[Set[str]]): @property def mapped_atlan_tag_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.mapped_atlan_tag_name - ) + return None if self.attributes is None else self.attributes.mapped_atlan_tag_name @mapped_atlan_tag_name.setter def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): @@ -104,9 +100,7 @@ def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): class Attributes(Catalog.Attributes): tag_id: Optional[str] = Field(default=None, description="") - tag_attributes: Optional[List[SourceTagAttribute]] = Field( - default=None, description="" - ) + tag_attributes: Optional[List[SourceTagAttribute]] = Field(default=None, description="") tag_allowed_values: Optional[Set[str]] = Field(default=None, description="") mapped_atlan_tag_name: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/core/view.py b/pyatlan/model/assets/core/view.py index 165cdd267..8b841a5d9 100644 --- a/pyatlan/model/assets/core/view.py +++ b/pyatlan/model/assets/core/view.py @@ -59,9 +59,7 @@ def creator( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> View: - validate_required_fields( - ["name", "schema_qualified_name"], [name, schema_qualified_name] - ) + validate_required_fields(["name", "schema_qualified_name"], [name, schema_qualified_name]) attributes = View.Attributes.create( name=name, schema_qualified_name=schema_qualified_name, @@ -76,10 +74,7 @@ def creator( @init_guid def create(cls, *, name: str, schema_qualified_name: str) -> View: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -111,15 +106,11 @@ def __setattr__(self, name, value): """ Size of this view, in bytes. """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( - "isQueryPreview", "isQueryPreview" - ) + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") """ Whether preview queries are allowed on this view (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( - "queryPreviewConfig", "queryPreviewConfig" - ) + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") """ Configuration for preview queries on this view. """ @@ -278,21 +269,13 @@ class Attributes(SQL.Attributes): row_count: Optional[int] = Field(default=None, description="") size_bytes: Optional[int] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") definition: Optional[str] = Field(default=None, description="") - columns: Optional[List[Column]] = Field( - default=None, description="" - ) # relationship - atlan_schema: Optional[Schema] = Field( - default=None, description="" - ) # relationship - queries: Optional[List[Query]] = Field( - default=None, description="" - ) # relationship + columns: Optional[List[Column]] = Field(default=None, description="") # relationship + atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship + queries: Optional[List[Query]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -306,13 +289,9 @@ def create( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> View.Attributes: - validate_required_fields( - ["name, schema_qualified_name"], [name, schema_qualified_name] - ) + validate_required_fields(["name, schema_qualified_name"], [name, schema_qualified_name]) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( schema_qualified_name, "schema_qualified_name", 5 @@ -323,10 +302,7 @@ def create( connection_qualified_name = connection_qualified_name or connection_qn database_name = database_name or fields[3] schema_name = schema_name or fields[4] - database_qualified_name = ( - database_qualified_name - or f"{connection_qualified_name}/{database_name}" - ) + database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" atlan_schema = Schema.ref_by_qualified_name(schema_qualified_name) return View.Attributes( diff --git a/pyatlan/model/assets/cube.py b/pyatlan/model/assets/cube.py index b7de24623..e39994712 100644 --- a/pyatlan/model/assets/cube.py +++ b/pyatlan/model/assets/cube.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - CUBE_DIMENSION_COUNT: ClassVar[NumericField] = NumericField( - "cubeDimensionCount", "cubeDimensionCount" - ) + CUBE_DIMENSION_COUNT: ClassVar[NumericField] = NumericField("cubeDimensionCount", "cubeDimensionCount") """ Number of dimensions in the cube. """ @@ -68,9 +66,7 @@ def cube_dimensions(self, cube_dimensions: Optional[List[CubeDimension]]): class Attributes(MultiDimensionalDataset.Attributes): cube_dimension_count: Optional[int] = Field(default=None, description="") - cube_dimensions: Optional[List[CubeDimension]] = Field( - default=None, description="" - ) # relationship + cube_dimensions: Optional[List[CubeDimension]] = Field(default=None, description="") # relationship attributes: Cube.Attributes = Field( default_factory=lambda: Cube.Attributes(), diff --git a/pyatlan/model/assets/cube_dimension.py b/pyatlan/model/assets/cube_dimension.py index 9375b1d03..65786a9e7 100644 --- a/pyatlan/model/assets/cube_dimension.py +++ b/pyatlan/model/assets/cube_dimension.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - CUBE_HIERARCHY_COUNT: ClassVar[NumericField] = NumericField( - "cubeHierarchyCount", "cubeHierarchyCount" - ) + CUBE_HIERARCHY_COUNT: ClassVar[NumericField] = NumericField("cubeHierarchyCount", "cubeHierarchyCount") """ Number of hierarchies in the cube dimension. """ @@ -83,9 +81,7 @@ def cube(self, cube: Optional[Cube]): class Attributes(MultiDimensionalDataset.Attributes): cube_hierarchy_count: Optional[int] = Field(default=None, description="") - cube_hierarchies: Optional[List[CubeHierarchy]] = Field( - default=None, description="" - ) # relationship + cube_hierarchies: Optional[List[CubeHierarchy]] = Field(default=None, description="") # relationship cube: Optional[Cube] = Field(default=None, description="") # relationship attributes: CubeDimension.Attributes = Field( diff --git a/pyatlan/model/assets/cube_field.py b/pyatlan/model/assets/cube_field.py index f8667d215..6e0cf0d1d 100644 --- a/pyatlan/model/assets/cube_field.py +++ b/pyatlan/model/assets/cube_field.py @@ -46,15 +46,11 @@ def __setattr__(self, name, value): """ Unique name of the parent field in which this field is nested. """ - CUBE_FIELD_LEVEL: ClassVar[NumericField] = NumericField( - "cubeFieldLevel", "cubeFieldLevel" - ) + CUBE_FIELD_LEVEL: ClassVar[NumericField] = NumericField("cubeFieldLevel", "cubeFieldLevel") """ Level of the field in the cube hierarchy. """ - CUBE_FIELD_GENERATION: ClassVar[NumericField] = NumericField( - "cubeFieldGeneration", "cubeFieldGeneration" - ) + CUBE_FIELD_GENERATION: ClassVar[NumericField] = NumericField("cubeFieldGeneration", "cubeFieldGeneration") """ Generation of the field in the cube hierarchy. """ @@ -66,9 +62,7 @@ def __setattr__(self, name, value): """ Expression used to calculate this measure. """ - CUBE_SUB_FIELD_COUNT: ClassVar[NumericField] = NumericField( - "cubeSubFieldCount", "cubeSubFieldCount" - ) + CUBE_SUB_FIELD_COUNT: ClassVar[NumericField] = NumericField("cubeSubFieldCount", "cubeSubFieldCount") """ Number of sub-fields that are direct children of this field. """ @@ -100,9 +94,7 @@ def __setattr__(self, name, value): @property def cube_parent_field_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.cube_parent_field_name - ) + return None if self.attributes is None else self.attributes.cube_parent_field_name @cube_parent_field_name.setter def cube_parent_field_name(self, cube_parent_field_name: Optional[str]): @@ -112,21 +104,13 @@ def cube_parent_field_name(self, cube_parent_field_name: Optional[str]): @property def cube_parent_field_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cube_parent_field_qualified_name - ) + return None if self.attributes is None else self.attributes.cube_parent_field_qualified_name @cube_parent_field_qualified_name.setter - def cube_parent_field_qualified_name( - self, cube_parent_field_qualified_name: Optional[str] - ): + def cube_parent_field_qualified_name(self, cube_parent_field_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cube_parent_field_qualified_name = ( - cube_parent_field_qualified_name - ) + self.attributes.cube_parent_field_qualified_name = cube_parent_field_qualified_name @property def cube_field_level(self) -> Optional[int]: @@ -140,9 +124,7 @@ def cube_field_level(self, cube_field_level: Optional[int]): @property def cube_field_generation(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.cube_field_generation - ) + return None if self.attributes is None else self.attributes.cube_field_generation @cube_field_generation.setter def cube_field_generation(self, cube_field_generation: Optional[int]): @@ -152,16 +134,10 @@ def cube_field_generation(self, cube_field_generation: Optional[int]): @property def cube_field_measure_expression(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cube_field_measure_expression - ) + return None if self.attributes is None else self.attributes.cube_field_measure_expression @cube_field_measure_expression.setter - def cube_field_measure_expression( - self, cube_field_measure_expression: Optional[str] - ): + def cube_field_measure_expression(self, cube_field_measure_expression: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cube_field_measure_expression = cube_field_measure_expression @@ -208,24 +184,14 @@ def cube_nested_fields(self, cube_nested_fields: Optional[List[CubeField]]): class Attributes(MultiDimensionalDataset.Attributes): cube_parent_field_name: Optional[str] = Field(default=None, description="") - cube_parent_field_qualified_name: Optional[str] = Field( - default=None, description="" - ) + cube_parent_field_qualified_name: Optional[str] = Field(default=None, description="") cube_field_level: Optional[int] = Field(default=None, description="") cube_field_generation: Optional[int] = Field(default=None, description="") - cube_field_measure_expression: Optional[str] = Field( - default=None, description="" - ) + cube_field_measure_expression: Optional[str] = Field(default=None, description="") cube_sub_field_count: Optional[int] = Field(default=None, description="") - cube_parent_field: Optional[CubeField] = Field( - default=None, description="" - ) # relationship - cube_hierarchy: Optional[CubeHierarchy] = Field( - default=None, description="" - ) # relationship - cube_nested_fields: Optional[List[CubeField]] = Field( - default=None, description="" - ) # relationship + cube_parent_field: Optional[CubeField] = Field(default=None, description="") # relationship + cube_hierarchy: Optional[CubeHierarchy] = Field(default=None, description="") # relationship + cube_nested_fields: Optional[List[CubeField]] = Field(default=None, description="") # relationship attributes: CubeField.Attributes = Field( default_factory=lambda: CubeField.Attributes(), diff --git a/pyatlan/model/assets/cube_hierarchy.py b/pyatlan/model/assets/cube_hierarchy.py index eac7ce209..cd36cb4a2 100644 --- a/pyatlan/model/assets/cube_hierarchy.py +++ b/pyatlan/model/assets/cube_hierarchy.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - CUBE_FIELD_COUNT: ClassVar[NumericField] = NumericField( - "cubeFieldCount", "cubeFieldCount" - ) + CUBE_FIELD_COUNT: ClassVar[NumericField] = NumericField("cubeFieldCount", "cubeFieldCount") """ Number of total fields in the cube hierarchy. """ @@ -83,12 +81,8 @@ def cube_dimension(self, cube_dimension: Optional[CubeDimension]): class Attributes(MultiDimensionalDataset.Attributes): cube_field_count: Optional[int] = Field(default=None, description="") - cube_fields: Optional[List[CubeField]] = Field( - default=None, description="" - ) # relationship - cube_dimension: Optional[CubeDimension] = Field( - default=None, description="" - ) # relationship + cube_fields: Optional[List[CubeField]] = Field(default=None, description="") # relationship + cube_dimension: Optional[CubeDimension] = Field(default=None, description="") # relationship attributes: CubeHierarchy.Attributes = Field( default_factory=lambda: CubeHierarchy.Attributes(), diff --git a/pyatlan/model/assets/custom_entity.py b/pyatlan/model/assets/custom_entity.py index 98ed2e7fd..d469564fb 100644 --- a/pyatlan/model/assets/custom_entity.py +++ b/pyatlan/model/assets/custom_entity.py @@ -21,12 +21,8 @@ class CustomEntity(Custom): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> CustomEntity: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) - attributes = CustomEntity.Attributes.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + attributes = CustomEntity.Attributes.creator(name=name, connection_qualified_name=connection_qualified_name) return cls(attributes=attributes) type_name: str = Field(default="CustomEntity", allow_mutation=False) @@ -46,21 +42,15 @@ def __setattr__(self, name, value): """ TBC """ - CUSTOM_CHILD_ENTITIES: ClassVar[RelationField] = RelationField( - "customChildEntities" - ) + CUSTOM_CHILD_ENTITIES: ClassVar[RelationField] = RelationField("customChildEntities") """ TBC """ - CUSTOM_RELATED_TO_ENTITIES: ClassVar[RelationField] = RelationField( - "customRelatedToEntities" - ) + CUSTOM_RELATED_TO_ENTITIES: ClassVar[RelationField] = RelationField("customRelatedToEntities") """ TBC """ - CUSTOM_RELATED_FROM_ENTITIES: ClassVar[RelationField] = RelationField( - "customRelatedFromEntities" - ) + CUSTOM_RELATED_FROM_ENTITIES: ClassVar[RelationField] = RelationField("customRelatedFromEntities") """ TBC """ @@ -84,79 +74,49 @@ def custom_parent_entity(self, custom_parent_entity: Optional[CustomEntity]): @property def custom_child_entities(self) -> Optional[List[CustomEntity]]: - return ( - None if self.attributes is None else self.attributes.custom_child_entities - ) + return None if self.attributes is None else self.attributes.custom_child_entities @custom_child_entities.setter - def custom_child_entities( - self, custom_child_entities: Optional[List[CustomEntity]] - ): + def custom_child_entities(self, custom_child_entities: Optional[List[CustomEntity]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.custom_child_entities = custom_child_entities @property def custom_related_to_entities(self) -> Optional[List[CustomEntity]]: - return ( - None - if self.attributes is None - else self.attributes.custom_related_to_entities - ) + return None if self.attributes is None else self.attributes.custom_related_to_entities @custom_related_to_entities.setter - def custom_related_to_entities( - self, custom_related_to_entities: Optional[List[CustomEntity]] - ): + def custom_related_to_entities(self, custom_related_to_entities: Optional[List[CustomEntity]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.custom_related_to_entities = custom_related_to_entities @property def custom_related_from_entities(self) -> Optional[List[CustomEntity]]: - return ( - None - if self.attributes is None - else self.attributes.custom_related_from_entities - ) + return None if self.attributes is None else self.attributes.custom_related_from_entities @custom_related_from_entities.setter - def custom_related_from_entities( - self, custom_related_from_entities: Optional[List[CustomEntity]] - ): + def custom_related_from_entities(self, custom_related_from_entities: Optional[List[CustomEntity]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.custom_related_from_entities = custom_related_from_entities class Attributes(Custom.Attributes): - custom_parent_entity: Optional[CustomEntity] = Field( - default=None, description="" - ) # relationship - custom_child_entities: Optional[List[CustomEntity]] = Field( - default=None, description="" - ) # relationship - custom_related_to_entities: Optional[List[CustomEntity]] = Field( - default=None, description="" - ) # relationship - custom_related_from_entities: Optional[List[CustomEntity]] = Field( - default=None, description="" - ) # relationship + custom_parent_entity: Optional[CustomEntity] = Field(default=None, description="") # relationship + custom_child_entities: Optional[List[CustomEntity]] = Field(default=None, description="") # relationship + custom_related_to_entities: Optional[List[CustomEntity]] = Field(default=None, description="") # relationship + custom_related_from_entities: Optional[List[CustomEntity]] = Field(default=None, description="") # relationship @classmethod @init_guid - def creator( - cls, *, name: str, connection_qualified_name: str - ) -> CustomEntity.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + def creator(cls, *, name: str, connection_qualified_name: str) -> CustomEntity.Attributes: + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return CustomEntity.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: CustomEntity.Attributes = Field( diff --git a/pyatlan/model/assets/data_studio.py b/pyatlan/model/assets/data_studio.py index 225217b17..9eba56474 100644 --- a/pyatlan/model/assets/data_studio.py +++ b/pyatlan/model/assets/data_studio.py @@ -35,9 +35,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField( - "googleService", "googleService" - ) + GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField("googleService", "googleService") """ Service in Google in which the asset exists. """ @@ -53,21 +51,15 @@ def __setattr__(self, name, value): """ ID of the project in which the asset exists. """ - GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField( - "googleProjectNumber", "googleProjectNumber" - ) + GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField("googleProjectNumber", "googleProjectNumber") """ Number of the project in which the asset exists. """ - GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField( - "googleLocation", "googleLocation" - ) + GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField("googleLocation", "googleLocation") """ Location of this asset in Google. """ - GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField( - "googleLocationType", "googleLocationType" - ) + GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField("googleLocationType", "googleLocationType") """ Type of location of this asset in Google. """ @@ -84,9 +76,7 @@ def __setattr__(self, name, value): """ TBC """ - INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( - "inputToAirflowTasks" - ) + INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("inputToAirflowTasks") """ TBC """ @@ -94,33 +84,23 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField( - "modelImplementedAttributes" - ) + MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelImplementedAttributes") """ TBC """ - OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( - "outputFromAirflowTasks" - ) + OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("outputFromAirflowTasks") """ TBC """ - OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField( - "outputFromSparkJobs" - ) + OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField("outputFromSparkJobs") """ TBC """ - MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField( - "modelImplementedEntities" - ) + MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField("modelImplementedEntities") """ TBC """ - OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField( - "outputFromProcesses" - ) + OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField("outputFromProcesses") """ TBC """ @@ -176,9 +156,7 @@ def google_project_id(self, google_project_id: Optional[str]): @property def google_project_number(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.google_project_number - ) + return None if self.attributes is None else self.attributes.google_project_number @google_project_number.setter def google_project_number(self, google_project_number: Optional[int]): @@ -238,14 +216,10 @@ def input_to_spark_jobs(self, input_to_spark_jobs: Optional[List[SparkJob]]): @property def input_to_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return ( - None if self.attributes is None else self.attributes.input_to_airflow_tasks - ) + return None if self.attributes is None else self.attributes.input_to_airflow_tasks @input_to_airflow_tasks.setter - def input_to_airflow_tasks( - self, input_to_airflow_tasks: Optional[List[AirflowTask]] - ): + def input_to_airflow_tasks(self, input_to_airflow_tasks: Optional[List[AirflowTask]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.input_to_airflow_tasks = input_to_airflow_tasks @@ -262,41 +236,27 @@ def input_to_processes(self, input_to_processes: Optional[List[Process]]): @property def model_implemented_attributes(self) -> Optional[List[ModelAttribute]]: - return ( - None - if self.attributes is None - else self.attributes.model_implemented_attributes - ) + return None if self.attributes is None else self.attributes.model_implemented_attributes @model_implemented_attributes.setter - def model_implemented_attributes( - self, model_implemented_attributes: Optional[List[ModelAttribute]] - ): + def model_implemented_attributes(self, model_implemented_attributes: Optional[List[ModelAttribute]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_attributes = model_implemented_attributes @property def output_from_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return ( - None - if self.attributes is None - else self.attributes.output_from_airflow_tasks - ) + return None if self.attributes is None else self.attributes.output_from_airflow_tasks @output_from_airflow_tasks.setter - def output_from_airflow_tasks( - self, output_from_airflow_tasks: Optional[List[AirflowTask]] - ): + def output_from_airflow_tasks(self, output_from_airflow_tasks: Optional[List[AirflowTask]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.output_from_airflow_tasks = output_from_airflow_tasks @property def output_from_spark_jobs(self) -> Optional[List[SparkJob]]: - return ( - None if self.attributes is None else self.attributes.output_from_spark_jobs - ) + return None if self.attributes is None else self.attributes.output_from_spark_jobs @output_from_spark_jobs.setter def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob]]): @@ -306,25 +266,17 @@ def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob] @property def model_implemented_entities(self) -> Optional[List[ModelEntity]]: - return ( - None - if self.attributes is None - else self.attributes.model_implemented_entities - ) + return None if self.attributes is None else self.attributes.model_implemented_entities @model_implemented_entities.setter - def model_implemented_entities( - self, model_implemented_entities: Optional[List[ModelEntity]] - ): + def model_implemented_entities(self, model_implemented_entities: Optional[List[ModelEntity]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_entities = model_implemented_entities @property def output_from_processes(self) -> Optional[List[Process]]: - return ( - None if self.attributes is None else self.attributes.output_from_processes - ) + return None if self.attributes is None else self.attributes.output_from_processes @output_from_processes.setter def output_from_processes(self, output_from_processes: Optional[List[Process]]): @@ -341,30 +293,16 @@ class Attributes(Google.Attributes): google_location_type: Optional[str] = Field(default=None, description="") google_labels: Optional[List[GoogleLabel]] = Field(default=None, description="") google_tags: Optional[List[GoogleTag]] = Field(default=None, description="") - input_to_spark_jobs: Optional[List[SparkJob]] = Field( - default=None, description="" - ) # relationship - input_to_airflow_tasks: Optional[List[AirflowTask]] = Field( - default=None, description="" - ) # relationship - input_to_processes: Optional[List[Process]] = Field( - default=None, description="" - ) # relationship + input_to_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship + input_to_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship + input_to_processes: Optional[List[Process]] = Field(default=None, description="") # relationship model_implemented_attributes: Optional[List[ModelAttribute]] = Field( default=None, description="" ) # relationship - output_from_airflow_tasks: Optional[List[AirflowTask]] = Field( - default=None, description="" - ) # relationship - output_from_spark_jobs: Optional[List[SparkJob]] = Field( - default=None, description="" - ) # relationship - model_implemented_entities: Optional[List[ModelEntity]] = Field( - default=None, description="" - ) # relationship - output_from_processes: Optional[List[Process]] = Field( - default=None, description="" - ) # relationship + output_from_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship + output_from_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship + model_implemented_entities: Optional[List[ModelEntity]] = Field(default=None, description="") # relationship + output_from_processes: Optional[List[Process]] = Field(default=None, description="") # relationship attributes: DataStudio.Attributes = Field( default_factory=lambda: DataStudio.Attributes(), diff --git a/pyatlan/model/assets/data_studio_asset.py b/pyatlan/model/assets/data_studio_asset.py index de4c806c4..dbf6602ec 100644 --- a/pyatlan/model/assets/data_studio_asset.py +++ b/pyatlan/model/assets/data_studio_asset.py @@ -62,10 +62,7 @@ def create( gdsid: Optional[str] = None, ) -> DataStudioAsset: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -89,26 +86,20 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATA_STUDIO_ASSET_TYPE: ClassVar[KeywordField] = KeywordField( - "dataStudioAssetType", "dataStudioAssetType" - ) + DATA_STUDIO_ASSET_TYPE: ClassVar[KeywordField] = KeywordField("dataStudioAssetType", "dataStudioAssetType") """ Type of the Google Data Studio asset, for example: REPORT or DATA_SOURCE. """ - DATA_STUDIO_ASSET_TITLE: ClassVar[KeywordTextStemmedField] = ( - KeywordTextStemmedField( - "dataStudioAssetTitle", - "dataStudioAssetTitle.keyword", - "dataStudioAssetTitle", - "dataStudioAssetTitle.stemmed", - ) + DATA_STUDIO_ASSET_TITLE: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( + "dataStudioAssetTitle", + "dataStudioAssetTitle.keyword", + "dataStudioAssetTitle", + "dataStudioAssetTitle.stemmed", ) """ Title of the Google Data Studio asset. """ - DATA_STUDIO_ASSET_OWNER: ClassVar[KeywordField] = KeywordField( - "dataStudioAssetOwner", "dataStudioAssetOwner" - ) + DATA_STUDIO_ASSET_OWNER: ClassVar[KeywordField] = KeywordField("dataStudioAssetOwner", "dataStudioAssetOwner") """ Owner of the asset, from Google Data Studio. """ @@ -118,9 +109,7 @@ def __setattr__(self, name, value): """ Whether the Google Data Studio asset has been trashed (true) or not (false). """ - GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField( - "googleService", "googleService" - ) + GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField("googleService", "googleService") """ Service in Google in which the asset exists. """ @@ -136,21 +125,15 @@ def __setattr__(self, name, value): """ ID of the project in which the asset exists. """ - GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField( - "googleProjectNumber", "googleProjectNumber" - ) + GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField("googleProjectNumber", "googleProjectNumber") """ Number of the project in which the asset exists. """ - GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField( - "googleLocation", "googleLocation" - ) + GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField("googleLocation", "googleLocation") """ Location of this asset in Google. """ - GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField( - "googleLocationType", "googleLocationType" - ) + GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField("googleLocationType", "googleLocationType") """ Type of location of this asset in Google. """ @@ -180,23 +163,17 @@ def __setattr__(self, name, value): @property def data_studio_asset_type(self) -> Optional[GoogleDatastudioAssetType]: - return ( - None if self.attributes is None else self.attributes.data_studio_asset_type - ) + return None if self.attributes is None else self.attributes.data_studio_asset_type @data_studio_asset_type.setter - def data_studio_asset_type( - self, data_studio_asset_type: Optional[GoogleDatastudioAssetType] - ): + def data_studio_asset_type(self, data_studio_asset_type: Optional[GoogleDatastudioAssetType]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_studio_asset_type = data_studio_asset_type @property def data_studio_asset_title(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.data_studio_asset_title - ) + return None if self.attributes is None else self.attributes.data_studio_asset_title @data_studio_asset_title.setter def data_studio_asset_title(self, data_studio_asset_title: Optional[str]): @@ -206,9 +183,7 @@ def data_studio_asset_title(self, data_studio_asset_title: Optional[str]): @property def data_studio_asset_owner(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.data_studio_asset_owner - ) + return None if self.attributes is None else self.attributes.data_studio_asset_owner @data_studio_asset_owner.setter def data_studio_asset_owner(self, data_studio_asset_owner: Optional[str]): @@ -218,16 +193,10 @@ def data_studio_asset_owner(self, data_studio_asset_owner: Optional[str]): @property def is_trashed_data_studio_asset(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.is_trashed_data_studio_asset - ) + return None if self.attributes is None else self.attributes.is_trashed_data_studio_asset @is_trashed_data_studio_asset.setter - def is_trashed_data_studio_asset( - self, is_trashed_data_studio_asset: Optional[bool] - ): + def is_trashed_data_studio_asset(self, is_trashed_data_studio_asset: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.is_trashed_data_studio_asset = is_trashed_data_studio_asset @@ -264,9 +233,7 @@ def google_project_id(self, google_project_id: Optional[str]): @property def google_project_number(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.google_project_number - ) + return None if self.attributes is None else self.attributes.google_project_number @google_project_number.setter def google_project_number(self, google_project_number: Optional[int]): @@ -315,14 +282,10 @@ def google_tags(self, google_tags: Optional[List[GoogleTag]]): self.attributes.google_tags = google_tags class Attributes(DataStudio.Attributes): - data_studio_asset_type: Optional[GoogleDatastudioAssetType] = Field( - default=None, description="" - ) + data_studio_asset_type: Optional[GoogleDatastudioAssetType] = Field(default=None, description="") data_studio_asset_title: Optional[str] = Field(default=None, description="") data_studio_asset_owner: Optional[str] = Field(default=None, description="") - is_trashed_data_studio_asset: Optional[bool] = Field( - default=None, description="" - ) + is_trashed_data_studio_asset: Optional[bool] = Field(default=None, description="") google_service: Optional[str] = Field(default=None, description="") google_project_name: Optional[str] = Field(default=None, description="") google_project_id: Optional[str] = Field(default=None, description="") @@ -350,9 +313,7 @@ def create( name=name, qualified_name=f"{connection_qualified_name}/{gdsid}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), data_studio_asset_type=data_studio_asset_type, ) diff --git a/pyatlan/model/assets/dataverse.py b/pyatlan/model/assets/dataverse.py index 165651951..0bf569a71 100644 --- a/pyatlan/model/assets/dataverse.py +++ b/pyatlan/model/assets/dataverse.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATAVERSE_IS_CUSTOM: ClassVar[BooleanField] = BooleanField( - "dataverseIsCustom", "dataverseIsCustom" - ) + DATAVERSE_IS_CUSTOM: ClassVar[BooleanField] = BooleanField("dataverseIsCustom", "dataverseIsCustom") """ Indicator if DataverseEntity is custom built. """ @@ -66,11 +64,7 @@ def dataverse_is_custom(self, dataverse_is_custom: Optional[bool]): @property def dataverse_is_customizable(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.dataverse_is_customizable - ) + return None if self.attributes is None else self.attributes.dataverse_is_customizable @dataverse_is_customizable.setter def dataverse_is_customizable(self, dataverse_is_customizable: Optional[bool]): @@ -80,11 +74,7 @@ def dataverse_is_customizable(self, dataverse_is_customizable: Optional[bool]): @property def dataverse_is_audit_enabled(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.dataverse_is_audit_enabled - ) + return None if self.attributes is None else self.attributes.dataverse_is_audit_enabled @dataverse_is_audit_enabled.setter def dataverse_is_audit_enabled(self, dataverse_is_audit_enabled: Optional[bool]): diff --git a/pyatlan/model/assets/dataverse_attribute.py b/pyatlan/model/assets/dataverse_attribute.py index 6b7332dcc..7e8526aff 100644 --- a/pyatlan/model/assets/dataverse_attribute.py +++ b/pyatlan/model/assets/dataverse_attribute.py @@ -82,9 +82,7 @@ def __setattr__(self, name, value): """ Schema Name of the DataverseAttribute. """ - DATAVERSE_ATTRIBUTE_TYPE: ClassVar[KeywordField] = KeywordField( - "dataverseAttributeType", "dataverseAttributeType" - ) + DATAVERSE_ATTRIBUTE_TYPE: ClassVar[KeywordField] = KeywordField("dataverseAttributeType", "dataverseAttributeType") """ Type of the DataverseAttribute. """ @@ -117,47 +115,27 @@ def __setattr__(self, name, value): @property def dataverse_entity_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dataverse_entity_qualified_name - ) + return None if self.attributes is None else self.attributes.dataverse_entity_qualified_name @dataverse_entity_qualified_name.setter - def dataverse_entity_qualified_name( - self, dataverse_entity_qualified_name: Optional[str] - ): + def dataverse_entity_qualified_name(self, dataverse_entity_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dataverse_entity_qualified_name = ( - dataverse_entity_qualified_name - ) + self.attributes.dataverse_entity_qualified_name = dataverse_entity_qualified_name @property def dataverse_attribute_schema_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dataverse_attribute_schema_name - ) + return None if self.attributes is None else self.attributes.dataverse_attribute_schema_name @dataverse_attribute_schema_name.setter - def dataverse_attribute_schema_name( - self, dataverse_attribute_schema_name: Optional[str] - ): + def dataverse_attribute_schema_name(self, dataverse_attribute_schema_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dataverse_attribute_schema_name = ( - dataverse_attribute_schema_name - ) + self.attributes.dataverse_attribute_schema_name = dataverse_attribute_schema_name @property def dataverse_attribute_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dataverse_attribute_type - ) + return None if self.attributes is None else self.attributes.dataverse_attribute_type @dataverse_attribute_type.setter def dataverse_attribute_type(self, dataverse_attribute_type: Optional[str]): @@ -167,39 +145,23 @@ def dataverse_attribute_type(self, dataverse_attribute_type: Optional[str]): @property def dataverse_attribute_is_primary_id(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.dataverse_attribute_is_primary_id - ) + return None if self.attributes is None else self.attributes.dataverse_attribute_is_primary_id @dataverse_attribute_is_primary_id.setter - def dataverse_attribute_is_primary_id( - self, dataverse_attribute_is_primary_id: Optional[bool] - ): + def dataverse_attribute_is_primary_id(self, dataverse_attribute_is_primary_id: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dataverse_attribute_is_primary_id = ( - dataverse_attribute_is_primary_id - ) + self.attributes.dataverse_attribute_is_primary_id = dataverse_attribute_is_primary_id @property def dataverse_attribute_is_searchable(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.dataverse_attribute_is_searchable - ) + return None if self.attributes is None else self.attributes.dataverse_attribute_is_searchable @dataverse_attribute_is_searchable.setter - def dataverse_attribute_is_searchable( - self, dataverse_attribute_is_searchable: Optional[bool] - ): + def dataverse_attribute_is_searchable(self, dataverse_attribute_is_searchable: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dataverse_attribute_is_searchable = ( - dataverse_attribute_is_searchable - ) + self.attributes.dataverse_attribute_is_searchable = dataverse_attribute_is_searchable @property def dataverse_entity(self) -> Optional[DataverseEntity]: @@ -212,22 +174,12 @@ def dataverse_entity(self, dataverse_entity: Optional[DataverseEntity]): self.attributes.dataverse_entity = dataverse_entity class Attributes(Dataverse.Attributes): - dataverse_entity_qualified_name: Optional[str] = Field( - default=None, description="" - ) - dataverse_attribute_schema_name: Optional[str] = Field( - default=None, description="" - ) + dataverse_entity_qualified_name: Optional[str] = Field(default=None, description="") + dataverse_attribute_schema_name: Optional[str] = Field(default=None, description="") dataverse_attribute_type: Optional[str] = Field(default=None, description="") - dataverse_attribute_is_primary_id: Optional[bool] = Field( - default=None, description="" - ) - dataverse_attribute_is_searchable: Optional[bool] = Field( - default=None, description="" - ) - dataverse_entity: Optional[DataverseEntity] = Field( - default=None, description="" - ) # relationship + dataverse_attribute_is_primary_id: Optional[bool] = Field(default=None, description="") + dataverse_attribute_is_searchable: Optional[bool] = Field(default=None, description="") + dataverse_entity: Optional[DataverseEntity] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -243,9 +195,7 @@ def creator( [name, dataverse_entity_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( dataverse_entity_qualified_name, @@ -259,9 +209,7 @@ def creator( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{dataverse_entity_qualified_name}/{name}", connector_name=connector_name, - dataverse_entity=DataverseEntity.ref_by_qualified_name( - dataverse_entity_qualified_name - ), + dataverse_entity=DataverseEntity.ref_by_qualified_name(dataverse_entity_qualified_name), ) attributes: DataverseAttribute.Attributes = Field( diff --git a/pyatlan/model/assets/dataverse_entity.py b/pyatlan/model/assets/dataverse_entity.py index 3bde074ab..68efd7af4 100644 --- a/pyatlan/model/assets/dataverse_entity.py +++ b/pyatlan/model/assets/dataverse_entity.py @@ -70,11 +70,7 @@ def __setattr__(self, name, value): @property def dataverse_entity_schema_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dataverse_entity_schema_name - ) + return None if self.attributes is None else self.attributes.dataverse_entity_schema_name @dataverse_entity_schema_name.setter def dataverse_entity_schema_name(self, dataverse_entity_schema_name: Optional[str]): @@ -84,11 +80,7 @@ def dataverse_entity_schema_name(self, dataverse_entity_schema_name: Optional[st @property def dataverse_entity_table_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dataverse_entity_table_type - ) + return None if self.attributes is None else self.attributes.dataverse_entity_table_type @dataverse_entity_table_type.setter def dataverse_entity_table_type(self, dataverse_entity_table_type: Optional[str]): @@ -101,27 +93,19 @@ def dataverse_attributes(self) -> Optional[List[DataverseAttribute]]: return None if self.attributes is None else self.attributes.dataverse_attributes @dataverse_attributes.setter - def dataverse_attributes( - self, dataverse_attributes: Optional[List[DataverseAttribute]] - ): + def dataverse_attributes(self, dataverse_attributes: Optional[List[DataverseAttribute]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dataverse_attributes = dataverse_attributes class Attributes(Dataverse.Attributes): - dataverse_entity_schema_name: Optional[str] = Field( - default=None, description="" - ) + dataverse_entity_schema_name: Optional[str] = Field(default=None, description="") dataverse_entity_table_type: Optional[str] = Field(default=None, description="") - dataverse_attributes: Optional[List[DataverseAttribute]] = Field( - default=None, description="" - ) # relationship + dataverse_attributes: Optional[List[DataverseAttribute]] = Field(default=None, description="") # relationship @classmethod @init_guid - def creator( - cls, *, name: str, connection_qualified_name: str - ) -> DataverseEntity.Attributes: + def creator(cls, *, name: str, connection_qualified_name: str) -> DataverseEntity.Attributes: validate_required_fields( ["name", "connection_qualified_name"], [name, connection_qualified_name], @@ -130,9 +114,7 @@ def creator( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: DataverseEntity.Attributes = Field( diff --git a/pyatlan/model/assets/dbt_column_process.py b/pyatlan/model/assets/dbt_column_process.py index 3686fb408..c644e8621 100644 --- a/pyatlan/model/assets/dbt_column_process.py +++ b/pyatlan/model/assets/dbt_column_process.py @@ -43,9 +43,7 @@ def __setattr__(self, name, value): """ """ - DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField( - "dbtAlias", "dbtAlias.keyword", "dbtAlias" - ) + DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField("dbtAlias", "dbtAlias.keyword", "dbtAlias") """ """ @@ -53,9 +51,7 @@ def __setattr__(self, name, value): """ """ - DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField( - "dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId" - ) + DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField("dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId") """ """ @@ -77,21 +73,15 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "dbtJobName", "dbtJobName.keyword", "dbtJobName" - ) + DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField("dbtJobName", "dbtJobName.keyword", "dbtJobName") """ """ - DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField( - "dbtJobSchedule", "dbtJobSchedule" - ) + DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField("dbtJobSchedule", "dbtJobSchedule") """ """ - DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( - "dbtJobStatus", "dbtJobStatus" - ) + DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtJobStatus", "dbtJobStatus") """ """ @@ -103,15 +93,11 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( - "dbtJobLastRun", "dbtJobLastRun" - ) + DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("dbtJobLastRun", "dbtJobLastRun") """ """ - DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( - "dbtJobNextRun", "dbtJobNextRun" - ) + DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("dbtJobNextRun", "dbtJobNextRun") """ """ @@ -141,9 +127,7 @@ def __setattr__(self, name, value): """ """ - DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField( - "dbtConnectionContext", "dbtConnectionContext" - ) + DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField("dbtConnectionContext", "dbtConnectionContext") """ """ @@ -169,9 +153,7 @@ def __setattr__(self, name, value): """ Parsed AST of the code or SQL statements that describe the logic of this process. """ - ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField( - "additionalEtlContext", "additionalEtlContext" - ) + ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField("additionalEtlContext", "additionalEtlContext") """ Additional Context of the ETL pipeline/notebook which creates the process. """ @@ -248,16 +230,10 @@ def __setattr__(self, name, value): @property def dbt_column_process_job_status(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_column_process_job_status - ) + return None if self.attributes is None else self.attributes.dbt_column_process_job_status @dbt_column_process_job_status.setter - def dbt_column_process_job_status( - self, dbt_column_process_job_status: Optional[str] - ): + def dbt_column_process_job_status(self, dbt_column_process_job_status: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_column_process_job_status = dbt_column_process_job_status @@ -354,21 +330,13 @@ def dbt_job_status(self, dbt_job_status: Optional[str]): @property def dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_job_schedule_cron_humanized - ) + return None if self.attributes is None else self.attributes.dbt_job_schedule_cron_humanized @dbt_job_schedule_cron_humanized.setter - def dbt_job_schedule_cron_humanized( - self, dbt_job_schedule_cron_humanized: Optional[str] - ): + def dbt_job_schedule_cron_humanized(self, dbt_job_schedule_cron_humanized: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dbt_job_schedule_cron_humanized = ( - dbt_job_schedule_cron_humanized - ) + self.attributes.dbt_job_schedule_cron_humanized = dbt_job_schedule_cron_humanized @property def dbt_job_last_run(self) -> Optional[datetime]: @@ -392,11 +360,7 @@ def dbt_job_next_run(self, dbt_job_next_run: Optional[datetime]): @property def dbt_job_next_run_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_job_next_run_humanized - ) + return None if self.attributes is None else self.attributes.dbt_job_next_run_humanized @dbt_job_next_run_humanized.setter def dbt_job_next_run_humanized(self, dbt_job_next_run_humanized: Optional[str]): @@ -416,11 +380,7 @@ def dbt_environment_name(self, dbt_environment_name: Optional[str]): @property def dbt_environment_dbt_version(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_environment_dbt_version - ) + return None if self.attributes is None else self.attributes.dbt_environment_dbt_version @dbt_environment_dbt_version.setter def dbt_environment_dbt_version(self, dbt_environment_dbt_version: Optional[str]): @@ -440,9 +400,7 @@ def dbt_tags(self, dbt_tags: Optional[Set[str]]): @property def dbt_connection_context(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dbt_connection_context - ) + return None if self.attributes is None else self.attributes.dbt_connection_context @dbt_connection_context.setter def dbt_connection_context(self, dbt_connection_context: Optional[str]): @@ -452,11 +410,7 @@ def dbt_connection_context(self, dbt_connection_context: Optional[str]): @property def dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_semantic_layer_proxy_url - ) + return None if self.attributes is None else self.attributes.dbt_semantic_layer_proxy_url @dbt_semantic_layer_proxy_url.setter def dbt_semantic_layer_proxy_url(self, dbt_semantic_layer_proxy_url: Optional[str]): @@ -526,9 +480,7 @@ def ast(self, ast: Optional[str]): @property def additional_etl_context(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.additional_etl_context - ) + return None if self.attributes is None else self.attributes.additional_etl_context @additional_etl_context.setter def additional_etl_context(self, additional_etl_context: Optional[str]): @@ -617,9 +569,7 @@ def column_processes(self, column_processes: Optional[List[ColumnProcess]]): self.attributes.column_processes = column_processes class Attributes(Dbt.Attributes): - dbt_column_process_job_status: Optional[str] = Field( - default=None, description="" - ) + dbt_column_process_job_status: Optional[str] = Field(default=None, description="") dbt_alias: Optional[str] = Field(default=None, description="") dbt_meta: Optional[str] = Field(default=None, description="") dbt_unique_id: Optional[str] = Field(default=None, description="") @@ -629,9 +579,7 @@ class Attributes(Dbt.Attributes): dbt_job_name: Optional[str] = Field(default=None, description="") dbt_job_schedule: Optional[str] = Field(default=None, description="") dbt_job_status: Optional[str] = Field(default=None, description="") - dbt_job_schedule_cron_humanized: Optional[str] = Field( - default=None, description="" - ) + dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") dbt_job_last_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") @@ -639,9 +587,7 @@ class Attributes(Dbt.Attributes): dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") dbt_tags: Optional[Set[str]] = Field(default=None, description="") dbt_connection_context: Optional[str] = Field(default=None, description="") - dbt_semantic_layer_proxy_url: Optional[str] = Field( - default=None, description="" - ) + dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") dbt_job_runs: Optional[List[DbtJobRun]] = Field(default=None, description="") inputs: Optional[List[Catalog]] = Field(default=None, description="") outputs: Optional[List[Catalog]] = Field(default=None, description="") @@ -649,28 +595,14 @@ class Attributes(Dbt.Attributes): sql: Optional[str] = Field(default=None, description="") ast: Optional[str] = Field(default=None, description="") additional_etl_context: Optional[str] = Field(default=None, description="") - adf_activity: Optional[AdfActivity] = Field( - default=None, description="" - ) # relationship - spark_jobs: Optional[List[SparkJob]] = Field( - default=None, description="" - ) # relationship - matillion_component: Optional[MatillionComponent] = Field( - default=None, description="" - ) # relationship + adf_activity: Optional[AdfActivity] = Field(default=None, description="") # relationship + spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship + matillion_component: Optional[MatillionComponent] = Field(default=None, description="") # relationship process: Optional[Process] = Field(default=None, description="") # relationship - airflow_tasks: Optional[List[AirflowTask]] = Field( - default=None, description="" - ) # relationship - fivetran_connector: Optional[FivetranConnector] = Field( - default=None, description="" - ) # relationship - power_b_i_dataflow: Optional[PowerBIDataflow] = Field( - default=None, description="" - ) # relationship - column_processes: Optional[List[ColumnProcess]] = Field( - default=None, description="" - ) # relationship + airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship + fivetran_connector: Optional[FivetranConnector] = Field(default=None, description="") # relationship + power_b_i_dataflow: Optional[PowerBIDataflow] = Field(default=None, description="") # relationship + column_processes: Optional[List[ColumnProcess]] = Field(default=None, description="") # relationship attributes: DbtColumnProcess.Attributes = Field( default_factory=lambda: DbtColumnProcess.Attributes(), diff --git a/pyatlan/model/assets/dbt_process.py b/pyatlan/model/assets/dbt_process.py index d8f293acc..4f3ad6973 100644 --- a/pyatlan/model/assets/dbt_process.py +++ b/pyatlan/model/assets/dbt_process.py @@ -37,15 +37,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DBT_PROCESS_JOB_STATUS: ClassVar[KeywordField] = KeywordField( - "dbtProcessJobStatus", "dbtProcessJobStatus" - ) + DBT_PROCESS_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtProcessJobStatus", "dbtProcessJobStatus") """ """ - DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField( - "dbtAlias", "dbtAlias.keyword", "dbtAlias" - ) + DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField("dbtAlias", "dbtAlias.keyword", "dbtAlias") """ """ @@ -53,9 +49,7 @@ def __setattr__(self, name, value): """ """ - DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField( - "dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId" - ) + DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField("dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId") """ """ @@ -77,21 +71,15 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "dbtJobName", "dbtJobName.keyword", "dbtJobName" - ) + DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField("dbtJobName", "dbtJobName.keyword", "dbtJobName") """ """ - DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField( - "dbtJobSchedule", "dbtJobSchedule" - ) + DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField("dbtJobSchedule", "dbtJobSchedule") """ """ - DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( - "dbtJobStatus", "dbtJobStatus" - ) + DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtJobStatus", "dbtJobStatus") """ """ @@ -103,15 +91,11 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( - "dbtJobLastRun", "dbtJobLastRun" - ) + DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("dbtJobLastRun", "dbtJobLastRun") """ """ - DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( - "dbtJobNextRun", "dbtJobNextRun" - ) + DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("dbtJobNextRun", "dbtJobNextRun") """ """ @@ -141,9 +125,7 @@ def __setattr__(self, name, value): """ """ - DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField( - "dbtConnectionContext", "dbtConnectionContext" - ) + DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField("dbtConnectionContext", "dbtConnectionContext") """ """ @@ -169,9 +151,7 @@ def __setattr__(self, name, value): """ Parsed AST of the code or SQL statements that describe the logic of this process. """ - ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField( - "additionalEtlContext", "additionalEtlContext" - ) + ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField("additionalEtlContext", "additionalEtlContext") """ Additional Context of the ETL pipeline/notebook which creates the process. """ @@ -243,9 +223,7 @@ def __setattr__(self, name, value): @property def dbt_process_job_status(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dbt_process_job_status - ) + return None if self.attributes is None else self.attributes.dbt_process_job_status @dbt_process_job_status.setter def dbt_process_job_status(self, dbt_process_job_status: Optional[str]): @@ -345,21 +323,13 @@ def dbt_job_status(self, dbt_job_status: Optional[str]): @property def dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_job_schedule_cron_humanized - ) + return None if self.attributes is None else self.attributes.dbt_job_schedule_cron_humanized @dbt_job_schedule_cron_humanized.setter - def dbt_job_schedule_cron_humanized( - self, dbt_job_schedule_cron_humanized: Optional[str] - ): + def dbt_job_schedule_cron_humanized(self, dbt_job_schedule_cron_humanized: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dbt_job_schedule_cron_humanized = ( - dbt_job_schedule_cron_humanized - ) + self.attributes.dbt_job_schedule_cron_humanized = dbt_job_schedule_cron_humanized @property def dbt_job_last_run(self) -> Optional[datetime]: @@ -383,11 +353,7 @@ def dbt_job_next_run(self, dbt_job_next_run: Optional[datetime]): @property def dbt_job_next_run_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_job_next_run_humanized - ) + return None if self.attributes is None else self.attributes.dbt_job_next_run_humanized @dbt_job_next_run_humanized.setter def dbt_job_next_run_humanized(self, dbt_job_next_run_humanized: Optional[str]): @@ -407,11 +373,7 @@ def dbt_environment_name(self, dbt_environment_name: Optional[str]): @property def dbt_environment_dbt_version(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_environment_dbt_version - ) + return None if self.attributes is None else self.attributes.dbt_environment_dbt_version @dbt_environment_dbt_version.setter def dbt_environment_dbt_version(self, dbt_environment_dbt_version: Optional[str]): @@ -431,9 +393,7 @@ def dbt_tags(self, dbt_tags: Optional[Set[str]]): @property def dbt_connection_context(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dbt_connection_context - ) + return None if self.attributes is None else self.attributes.dbt_connection_context @dbt_connection_context.setter def dbt_connection_context(self, dbt_connection_context: Optional[str]): @@ -443,11 +403,7 @@ def dbt_connection_context(self, dbt_connection_context: Optional[str]): @property def dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_semantic_layer_proxy_url - ) + return None if self.attributes is None else self.attributes.dbt_semantic_layer_proxy_url @dbt_semantic_layer_proxy_url.setter def dbt_semantic_layer_proxy_url(self, dbt_semantic_layer_proxy_url: Optional[str]): @@ -517,9 +473,7 @@ def ast(self, ast: Optional[str]): @property def additional_etl_context(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.additional_etl_context - ) + return None if self.attributes is None else self.attributes.additional_etl_context @additional_etl_context.setter def additional_etl_context(self, additional_etl_context: Optional[str]): @@ -608,9 +562,7 @@ class Attributes(Dbt.Attributes): dbt_job_name: Optional[str] = Field(default=None, description="") dbt_job_schedule: Optional[str] = Field(default=None, description="") dbt_job_status: Optional[str] = Field(default=None, description="") - dbt_job_schedule_cron_humanized: Optional[str] = Field( - default=None, description="" - ) + dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") dbt_job_last_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") @@ -618,9 +570,7 @@ class Attributes(Dbt.Attributes): dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") dbt_tags: Optional[Set[str]] = Field(default=None, description="") dbt_connection_context: Optional[str] = Field(default=None, description="") - dbt_semantic_layer_proxy_url: Optional[str] = Field( - default=None, description="" - ) + dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") dbt_job_runs: Optional[List[DbtJobRun]] = Field(default=None, description="") inputs: Optional[List[Catalog]] = Field(default=None, description="") outputs: Optional[List[Catalog]] = Field(default=None, description="") @@ -628,27 +578,13 @@ class Attributes(Dbt.Attributes): sql: Optional[str] = Field(default=None, description="") ast: Optional[str] = Field(default=None, description="") additional_etl_context: Optional[str] = Field(default=None, description="") - adf_activity: Optional[AdfActivity] = Field( - default=None, description="" - ) # relationship - spark_jobs: Optional[List[SparkJob]] = Field( - default=None, description="" - ) # relationship - matillion_component: Optional[MatillionComponent] = Field( - default=None, description="" - ) # relationship - airflow_tasks: Optional[List[AirflowTask]] = Field( - default=None, description="" - ) # relationship - fivetran_connector: Optional[FivetranConnector] = Field( - default=None, description="" - ) # relationship - power_b_i_dataflow: Optional[PowerBIDataflow] = Field( - default=None, description="" - ) # relationship - column_processes: Optional[List[ColumnProcess]] = Field( - default=None, description="" - ) # relationship + adf_activity: Optional[AdfActivity] = Field(default=None, description="") # relationship + spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship + matillion_component: Optional[MatillionComponent] = Field(default=None, description="") # relationship + airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship + fivetran_connector: Optional[FivetranConnector] = Field(default=None, description="") # relationship + power_b_i_dataflow: Optional[PowerBIDataflow] = Field(default=None, description="") # relationship + column_processes: Optional[List[ColumnProcess]] = Field(default=None, description="") # relationship attributes: DbtProcess.Attributes = Field( default_factory=lambda: DbtProcess.Attributes(), diff --git a/pyatlan/model/assets/dbt_tag.py b/pyatlan/model/assets/dbt_tag.py index 22b02d83d..bbe0a77ea 100644 --- a/pyatlan/model/assets/dbt_tag.py +++ b/pyatlan/model/assets/dbt_tag.py @@ -36,9 +36,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField( - "dbtAlias", "dbtAlias.keyword", "dbtAlias" - ) + DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField("dbtAlias", "dbtAlias.keyword", "dbtAlias") """ """ @@ -46,9 +44,7 @@ def __setattr__(self, name, value): """ """ - DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField( - "dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId" - ) + DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField("dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId") """ """ @@ -70,21 +66,15 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "dbtJobName", "dbtJobName.keyword", "dbtJobName" - ) + DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField("dbtJobName", "dbtJobName.keyword", "dbtJobName") """ """ - DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField( - "dbtJobSchedule", "dbtJobSchedule" - ) + DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField("dbtJobSchedule", "dbtJobSchedule") """ """ - DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( - "dbtJobStatus", "dbtJobStatus" - ) + DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtJobStatus", "dbtJobStatus") """ """ @@ -96,15 +86,11 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( - "dbtJobLastRun", "dbtJobLastRun" - ) + DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("dbtJobLastRun", "dbtJobLastRun") """ """ - DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( - "dbtJobNextRun", "dbtJobNextRun" - ) + DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("dbtJobNextRun", "dbtJobNextRun") """ """ @@ -134,9 +120,7 @@ def __setattr__(self, name, value): """ """ - DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField( - "dbtConnectionContext", "dbtConnectionContext" - ) + DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField("dbtConnectionContext", "dbtConnectionContext") """ """ @@ -154,9 +138,7 @@ def __setattr__(self, name, value): """ Unique identifier of the tag in the source system. """ - TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( - "tagAttributes", "tagAttributes" - ) + TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("tagAttributes", "tagAttributes") """ Attributes associated with the tag in the source system. """ @@ -291,21 +273,13 @@ def dbt_job_status(self, dbt_job_status: Optional[str]): @property def dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_job_schedule_cron_humanized - ) + return None if self.attributes is None else self.attributes.dbt_job_schedule_cron_humanized @dbt_job_schedule_cron_humanized.setter - def dbt_job_schedule_cron_humanized( - self, dbt_job_schedule_cron_humanized: Optional[str] - ): + def dbt_job_schedule_cron_humanized(self, dbt_job_schedule_cron_humanized: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dbt_job_schedule_cron_humanized = ( - dbt_job_schedule_cron_humanized - ) + self.attributes.dbt_job_schedule_cron_humanized = dbt_job_schedule_cron_humanized @property def dbt_job_last_run(self) -> Optional[datetime]: @@ -329,11 +303,7 @@ def dbt_job_next_run(self, dbt_job_next_run: Optional[datetime]): @property def dbt_job_next_run_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_job_next_run_humanized - ) + return None if self.attributes is None else self.attributes.dbt_job_next_run_humanized @dbt_job_next_run_humanized.setter def dbt_job_next_run_humanized(self, dbt_job_next_run_humanized: Optional[str]): @@ -353,11 +323,7 @@ def dbt_environment_name(self, dbt_environment_name: Optional[str]): @property def dbt_environment_dbt_version(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_environment_dbt_version - ) + return None if self.attributes is None else self.attributes.dbt_environment_dbt_version @dbt_environment_dbt_version.setter def dbt_environment_dbt_version(self, dbt_environment_dbt_version: Optional[str]): @@ -377,9 +343,7 @@ def dbt_tags(self, dbt_tags: Optional[Set[str]]): @property def dbt_connection_context(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.dbt_connection_context - ) + return None if self.attributes is None else self.attributes.dbt_connection_context @dbt_connection_context.setter def dbt_connection_context(self, dbt_connection_context: Optional[str]): @@ -389,11 +353,7 @@ def dbt_connection_context(self, dbt_connection_context: Optional[str]): @property def dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dbt_semantic_layer_proxy_url - ) + return None if self.attributes is None else self.attributes.dbt_semantic_layer_proxy_url @dbt_semantic_layer_proxy_url.setter def dbt_semantic_layer_proxy_url(self, dbt_semantic_layer_proxy_url: Optional[str]): @@ -443,9 +403,7 @@ def tag_allowed_values(self, tag_allowed_values: Optional[Set[str]]): @property def mapped_atlan_tag_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.mapped_atlan_tag_name - ) + return None if self.attributes is None else self.attributes.mapped_atlan_tag_name @mapped_atlan_tag_name.setter def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): @@ -463,9 +421,7 @@ class Attributes(Dbt.Attributes): dbt_job_name: Optional[str] = Field(default=None, description="") dbt_job_schedule: Optional[str] = Field(default=None, description="") dbt_job_status: Optional[str] = Field(default=None, description="") - dbt_job_schedule_cron_humanized: Optional[str] = Field( - default=None, description="" - ) + dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") dbt_job_last_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") @@ -473,14 +429,10 @@ class Attributes(Dbt.Attributes): dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") dbt_tags: Optional[Set[str]] = Field(default=None, description="") dbt_connection_context: Optional[str] = Field(default=None, description="") - dbt_semantic_layer_proxy_url: Optional[str] = Field( - default=None, description="" - ) + dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") dbt_job_runs: Optional[List[DbtJobRun]] = Field(default=None, description="") tag_id: Optional[str] = Field(default=None, description="") - tag_attributes: Optional[List[SourceTagAttribute]] = Field( - default=None, description="" - ) + tag_attributes: Optional[List[SourceTagAttribute]] = Field(default=None, description="") tag_allowed_values: Optional[Set[str]] = Field(default=None, description="") mapped_atlan_tag_name: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/domo_card.py b/pyatlan/model/assets/domo_card.py index 9d0d64d7a..56a988e7d 100644 --- a/pyatlan/model/assets/domo_card.py +++ b/pyatlan/model/assets/domo_card.py @@ -30,21 +30,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DOMO_CARD_TYPE: ClassVar[KeywordField] = KeywordField( - "domoCardType", "domoCardType" - ) + DOMO_CARD_TYPE: ClassVar[KeywordField] = KeywordField("domoCardType", "domoCardType") """ Type of the Domo Card. """ - DOMO_CARD_TYPE_VALUE: ClassVar[KeywordField] = KeywordField( - "domoCardTypeValue", "domoCardTypeValue" - ) + DOMO_CARD_TYPE_VALUE: ClassVar[KeywordField] = KeywordField("domoCardTypeValue", "domoCardTypeValue") """ Type of the Domo Card. """ - DOMO_CARD_DASHBOARD_COUNT: ClassVar[NumericField] = NumericField( - "domoCardDashboardCount", "domoCardDashboardCount" - ) + DOMO_CARD_DASHBOARD_COUNT: ClassVar[NumericField] = NumericField("domoCardDashboardCount", "domoCardDashboardCount") """ Number of dashboards linked to this card. """ @@ -88,11 +82,7 @@ def domo_card_type_value(self, domo_card_type_value: Optional[str]): @property def domo_card_dashboard_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.domo_card_dashboard_count - ) + return None if self.attributes is None else self.attributes.domo_card_dashboard_count @domo_card_dashboard_count.setter def domo_card_dashboard_count(self, domo_card_dashboard_count: Optional[int]): @@ -124,12 +114,8 @@ class Attributes(Domo.Attributes): domo_card_type: Optional[DomoCardType] = Field(default=None, description="") domo_card_type_value: Optional[str] = Field(default=None, description="") domo_card_dashboard_count: Optional[int] = Field(default=None, description="") - domo_dashboards: Optional[List[DomoDashboard]] = Field( - default=None, description="" - ) # relationship - domo_dataset: Optional[DomoDataset] = Field( - default=None, description="" - ) # relationship + domo_dashboards: Optional[List[DomoDashboard]] = Field(default=None, description="") # relationship + domo_dataset: Optional[DomoDataset] = Field(default=None, description="") # relationship attributes: DomoCard.Attributes = Field( default_factory=lambda: DomoCard.Attributes(), diff --git a/pyatlan/model/assets/domo_dashboard.py b/pyatlan/model/assets/domo_dashboard.py index a6c49cad6..6d2c1464e 100644 --- a/pyatlan/model/assets/domo_dashboard.py +++ b/pyatlan/model/assets/domo_dashboard.py @@ -29,16 +29,12 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DOMO_DASHBOARD_CARD_COUNT: ClassVar[NumericField] = NumericField( - "domoDashboardCardCount", "domoDashboardCardCount" - ) + DOMO_DASHBOARD_CARD_COUNT: ClassVar[NumericField] = NumericField("domoDashboardCardCount", "domoDashboardCardCount") """ Number of cards linked to this dashboard. """ - DOMO_DASHBOARD_CHILDREN: ClassVar[RelationField] = RelationField( - "domoDashboardChildren" - ) + DOMO_DASHBOARD_CHILDREN: ClassVar[RelationField] = RelationField("domoDashboardChildren") """ TBC """ @@ -46,9 +42,7 @@ def __setattr__(self, name, value): """ TBC """ - DOMO_DASHBOARD_PARENT: ClassVar[RelationField] = RelationField( - "domoDashboardParent" - ) + DOMO_DASHBOARD_PARENT: ClassVar[RelationField] = RelationField("domoDashboardParent") """ TBC """ @@ -62,11 +56,7 @@ def __setattr__(self, name, value): @property def domo_dashboard_card_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.domo_dashboard_card_count - ) + return None if self.attributes is None else self.attributes.domo_dashboard_card_count @domo_dashboard_card_count.setter def domo_dashboard_card_count(self, domo_dashboard_card_count: Optional[int]): @@ -76,14 +66,10 @@ def domo_dashboard_card_count(self, domo_dashboard_card_count: Optional[int]): @property def domo_dashboard_children(self) -> Optional[List[DomoDashboard]]: - return ( - None if self.attributes is None else self.attributes.domo_dashboard_children - ) + return None if self.attributes is None else self.attributes.domo_dashboard_children @domo_dashboard_children.setter - def domo_dashboard_children( - self, domo_dashboard_children: Optional[List[DomoDashboard]] - ): + def domo_dashboard_children(self, domo_dashboard_children: Optional[List[DomoDashboard]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.domo_dashboard_children = domo_dashboard_children @@ -100,9 +86,7 @@ def domo_cards(self, domo_cards: Optional[List[DomoCard]]): @property def domo_dashboard_parent(self) -> Optional[DomoDashboard]: - return ( - None if self.attributes is None else self.attributes.domo_dashboard_parent - ) + return None if self.attributes is None else self.attributes.domo_dashboard_parent @domo_dashboard_parent.setter def domo_dashboard_parent(self, domo_dashboard_parent: Optional[DomoDashboard]): @@ -112,15 +96,9 @@ def domo_dashboard_parent(self, domo_dashboard_parent: Optional[DomoDashboard]): class Attributes(Domo.Attributes): domo_dashboard_card_count: Optional[int] = Field(default=None, description="") - domo_dashboard_children: Optional[List[DomoDashboard]] = Field( - default=None, description="" - ) # relationship - domo_cards: Optional[List[DomoCard]] = Field( - default=None, description="" - ) # relationship - domo_dashboard_parent: Optional[DomoDashboard] = Field( - default=None, description="" - ) # relationship + domo_dashboard_children: Optional[List[DomoDashboard]] = Field(default=None, description="") # relationship + domo_cards: Optional[List[DomoCard]] = Field(default=None, description="") # relationship + domo_dashboard_parent: Optional[DomoDashboard] = Field(default=None, description="") # relationship attributes: DomoDashboard.Attributes = Field( default_factory=lambda: DomoDashboard.Attributes(), diff --git a/pyatlan/model/assets/domo_dataset.py b/pyatlan/model/assets/domo_dataset.py index 36baa082f..b9f02a292 100644 --- a/pyatlan/model/assets/domo_dataset.py +++ b/pyatlan/model/assets/domo_dataset.py @@ -29,27 +29,19 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DOMO_DATASET_ROW_COUNT: ClassVar[NumericField] = NumericField( - "domoDatasetRowCount", "domoDatasetRowCount" - ) + DOMO_DATASET_ROW_COUNT: ClassVar[NumericField] = NumericField("domoDatasetRowCount", "domoDatasetRowCount") """ Number of rows in the Domo dataset. """ - DOMO_DATASET_COLUMN_COUNT: ClassVar[NumericField] = NumericField( - "domoDatasetColumnCount", "domoDatasetColumnCount" - ) + DOMO_DATASET_COLUMN_COUNT: ClassVar[NumericField] = NumericField("domoDatasetColumnCount", "domoDatasetColumnCount") """ Number of columns in the Domo dataset. """ - DOMO_DATASET_CARD_COUNT: ClassVar[NumericField] = NumericField( - "domoDatasetCardCount", "domoDatasetCardCount" - ) + DOMO_DATASET_CARD_COUNT: ClassVar[NumericField] = NumericField("domoDatasetCardCount", "domoDatasetCardCount") """ Number of cards linked to the Domo dataset. """ - DOMO_DATASET_LAST_RUN: ClassVar[TextField] = TextField( - "domoDatasetLastRun", "domoDatasetLastRun" - ) + DOMO_DATASET_LAST_RUN: ClassVar[TextField] = TextField("domoDatasetLastRun", "domoDatasetLastRun") """ An ISO-8601 representation of the time the DataSet was last run. """ @@ -74,9 +66,7 @@ def __setattr__(self, name, value): @property def domo_dataset_row_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.domo_dataset_row_count - ) + return None if self.attributes is None else self.attributes.domo_dataset_row_count @domo_dataset_row_count.setter def domo_dataset_row_count(self, domo_dataset_row_count: Optional[int]): @@ -86,11 +76,7 @@ def domo_dataset_row_count(self, domo_dataset_row_count: Optional[int]): @property def domo_dataset_column_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.domo_dataset_column_count - ) + return None if self.attributes is None else self.attributes.domo_dataset_column_count @domo_dataset_column_count.setter def domo_dataset_column_count(self, domo_dataset_column_count: Optional[int]): @@ -100,9 +86,7 @@ def domo_dataset_column_count(self, domo_dataset_column_count: Optional[int]): @property def domo_dataset_card_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.domo_dataset_card_count - ) + return None if self.attributes is None else self.attributes.domo_dataset_card_count @domo_dataset_card_count.setter def domo_dataset_card_count(self, domo_dataset_card_count: Optional[int]): @@ -112,9 +96,7 @@ def domo_dataset_card_count(self, domo_dataset_card_count: Optional[int]): @property def domo_dataset_last_run(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.domo_dataset_last_run - ) + return None if self.attributes is None else self.attributes.domo_dataset_last_run @domo_dataset_last_run.setter def domo_dataset_last_run(self, domo_dataset_last_run: Optional[str]): @@ -137,9 +119,7 @@ def domo_dataset_columns(self) -> Optional[List[DomoDatasetColumn]]: return None if self.attributes is None else self.attributes.domo_dataset_columns @domo_dataset_columns.setter - def domo_dataset_columns( - self, domo_dataset_columns: Optional[List[DomoDatasetColumn]] - ): + def domo_dataset_columns(self, domo_dataset_columns: Optional[List[DomoDatasetColumn]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.domo_dataset_columns = domo_dataset_columns @@ -149,12 +129,8 @@ class Attributes(Domo.Attributes): domo_dataset_column_count: Optional[int] = Field(default=None, description="") domo_dataset_card_count: Optional[int] = Field(default=None, description="") domo_dataset_last_run: Optional[str] = Field(default=None, description="") - domo_cards: Optional[List[DomoCard]] = Field( - default=None, description="" - ) # relationship - domo_dataset_columns: Optional[List[DomoDatasetColumn]] = Field( - default=None, description="" - ) # relationship + domo_cards: Optional[List[DomoCard]] = Field(default=None, description="") # relationship + domo_dataset_columns: Optional[List[DomoDatasetColumn]] = Field(default=None, description="") # relationship attributes: DomoDataset.Attributes = Field( default_factory=lambda: DomoDataset.Attributes(), diff --git a/pyatlan/model/assets/domo_dataset_column.py b/pyatlan/model/assets/domo_dataset_column.py index 840152720..1ec78c52a 100644 --- a/pyatlan/model/assets/domo_dataset_column.py +++ b/pyatlan/model/assets/domo_dataset_column.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DOMO_DATASET_COLUMN_TYPE: ClassVar[KeywordField] = KeywordField( - "domoDatasetColumnType", "domoDatasetColumnType" - ) + DOMO_DATASET_COLUMN_TYPE: ClassVar[KeywordField] = KeywordField("domoDatasetColumnType", "domoDatasetColumnType") """ Type of Domo Dataset Column. """ @@ -55,11 +53,7 @@ def __setattr__(self, name, value): @property def domo_dataset_column_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.domo_dataset_column_type - ) + return None if self.attributes is None else self.attributes.domo_dataset_column_type @domo_dataset_column_type.setter def domo_dataset_column_type(self, domo_dataset_column_type: Optional[str]): @@ -69,11 +63,7 @@ def domo_dataset_column_type(self, domo_dataset_column_type: Optional[str]): @property def domo_dataset_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.domo_dataset_qualified_name - ) + return None if self.attributes is None else self.attributes.domo_dataset_qualified_name @domo_dataset_qualified_name.setter def domo_dataset_qualified_name(self, domo_dataset_qualified_name: Optional[str]): @@ -94,9 +84,7 @@ def domo_dataset(self, domo_dataset: Optional[DomoDataset]): class Attributes(Domo.Attributes): domo_dataset_column_type: Optional[str] = Field(default=None, description="") domo_dataset_qualified_name: Optional[str] = Field(default=None, description="") - domo_dataset: Optional[DomoDataset] = Field( - default=None, description="" - ) # relationship + domo_dataset: Optional[DomoDataset] = Field(default=None, description="") # relationship attributes: DomoDatasetColumn.Attributes = Field( default_factory=lambda: DomoDatasetColumn.Attributes(), diff --git a/pyatlan/model/assets/dynamo_d_b.py b/pyatlan/model/assets/dynamo_d_b.py index 7cbd2c832..26f57b350 100644 --- a/pyatlan/model/assets/dynamo_d_b.py +++ b/pyatlan/model/assets/dynamo_d_b.py @@ -30,21 +30,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField( - "dynamoDBStatus", "dynamoDBStatus" - ) + DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField("dynamoDBStatus", "dynamoDBStatus") """ Status of the DynamoDB Asset """ - DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField( - "dynamoDBPartitionKey", "dynamoDBPartitionKey" - ) + DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBPartitionKey", "dynamoDBPartitionKey") """ Specifies the partition key of the DynamoDB Table/Index """ - DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField( - "dynamoDBSortKey", "dynamoDBSortKey" - ) + DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBSortKey", "dynamoDBSortKey") """ Specifies the sort key of the DynamoDB Table/Index """ @@ -81,11 +75,7 @@ def dynamo_d_b_status(self, dynamo_d_b_status: Optional[DynamoDBStatus]): @property def dynamo_d_b_partition_key(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_partition_key - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_partition_key @dynamo_d_b_partition_key.setter def dynamo_d_b_partition_key(self, dynamo_d_b_partition_key: Optional[str]): @@ -105,50 +95,30 @@ def dynamo_d_b_sort_key(self, dynamo_d_b_sort_key: Optional[str]): @property def dynamo_d_b_read_capacity_units(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_read_capacity_units - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_read_capacity_units @dynamo_d_b_read_capacity_units.setter - def dynamo_d_b_read_capacity_units( - self, dynamo_d_b_read_capacity_units: Optional[int] - ): + def dynamo_d_b_read_capacity_units(self, dynamo_d_b_read_capacity_units: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dynamo_d_b_read_capacity_units = dynamo_d_b_read_capacity_units @property def dynamo_d_b_write_capacity_units(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_write_capacity_units - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_write_capacity_units @dynamo_d_b_write_capacity_units.setter - def dynamo_d_b_write_capacity_units( - self, dynamo_d_b_write_capacity_units: Optional[int] - ): + def dynamo_d_b_write_capacity_units(self, dynamo_d_b_write_capacity_units: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_write_capacity_units = ( - dynamo_d_b_write_capacity_units - ) + self.attributes.dynamo_d_b_write_capacity_units = dynamo_d_b_write_capacity_units class Attributes(NoSQL.Attributes): - dynamo_d_b_status: Optional[DynamoDBStatus] = Field( - default=None, description="" - ) + dynamo_d_b_status: Optional[DynamoDBStatus] = Field(default=None, description="") dynamo_d_b_partition_key: Optional[str] = Field(default=None, description="") dynamo_d_b_sort_key: Optional[str] = Field(default=None, description="") - dynamo_d_b_read_capacity_units: Optional[int] = Field( - default=None, description="" - ) - dynamo_d_b_write_capacity_units: Optional[int] = Field( - default=None, description="" - ) + dynamo_d_b_read_capacity_units: Optional[int] = Field(default=None, description="") + dynamo_d_b_write_capacity_units: Optional[int] = Field(default=None, description="") attributes: DynamoDB.Attributes = Field( default_factory=lambda: DynamoDB.Attributes(), diff --git a/pyatlan/model/assets/dynamo_d_b_global_secondary_index.py b/pyatlan/model/assets/dynamo_d_b_global_secondary_index.py index 81ccd0c93..bb2fd3879 100644 --- a/pyatlan/model/assets/dynamo_d_b_global_secondary_index.py +++ b/pyatlan/model/assets/dynamo_d_b_global_secondary_index.py @@ -49,9 +49,7 @@ def dynamo_dbtable(self, dynamo_dbtable: Optional[DynamoDBTable]): self.attributes.dynamo_dbtable = dynamo_dbtable class Attributes(DynamoDBSecondaryIndex.Attributes): - dynamo_dbtable: Optional[DynamoDBTable] = Field( - default=None, description="" - ) # relationship + dynamo_dbtable: Optional[DynamoDBTable] = Field(default=None, description="") # relationship attributes: DynamoDBGlobalSecondaryIndex.Attributes = Field( default_factory=lambda: DynamoDBGlobalSecondaryIndex.Attributes(), diff --git a/pyatlan/model/assets/dynamo_d_b_local_secondary_index.py b/pyatlan/model/assets/dynamo_d_b_local_secondary_index.py index 32e7c821e..e4595082c 100644 --- a/pyatlan/model/assets/dynamo_d_b_local_secondary_index.py +++ b/pyatlan/model/assets/dynamo_d_b_local_secondary_index.py @@ -49,9 +49,7 @@ def dynamo_dbtable(self, dynamo_dbtable: Optional[DynamoDBTable]): self.attributes.dynamo_dbtable = dynamo_dbtable class Attributes(DynamoDBSecondaryIndex.Attributes): - dynamo_dbtable: Optional[DynamoDBTable] = Field( - default=None, description="" - ) # relationship + dynamo_dbtable: Optional[DynamoDBTable] = Field(default=None, description="") # relationship attributes: DynamoDBLocalSecondaryIndex.Attributes = Field( default_factory=lambda: DynamoDBLocalSecondaryIndex.Attributes(), diff --git a/pyatlan/model/assets/dynamo_dbtable.py b/pyatlan/model/assets/dynamo_dbtable.py index 7039d77e4..11b570bf5 100644 --- a/pyatlan/model/assets/dynamo_dbtable.py +++ b/pyatlan/model/assets/dynamo_dbtable.py @@ -38,15 +38,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DYNAMO_DB_TABLE_GSI_COUNT: ClassVar[NumericField] = NumericField( - "dynamoDBTableGSICount", "dynamoDBTableGSICount" - ) + DYNAMO_DB_TABLE_GSI_COUNT: ClassVar[NumericField] = NumericField("dynamoDBTableGSICount", "dynamoDBTableGSICount") """ Represents the number of global secondary indexes on the table. """ - DYNAMO_DB_TABLE_LSI_COUNT: ClassVar[NumericField] = NumericField( - "dynamoDBTableLSICount", "dynamoDBTableLSICount" - ) + DYNAMO_DB_TABLE_LSI_COUNT: ClassVar[NumericField] = NumericField("dynamoDBTableLSICount", "dynamoDBTableLSICount") """ Represents the number of local secondary indexes on the table. """ @@ -70,51 +66,35 @@ def __setattr__(self, name, value): """ Whether this table is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( - "isQueryPreview", "isQueryPreview" - ) + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") """ Whether preview queries are allowed for this table (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( - "queryPreviewConfig", "queryPreviewConfig" - ) + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") """ Configuration for preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField( - "externalLocation", "externalLocation" - ) + EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") """ External location of this table, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( - "externalLocationRegion", "externalLocationRegion" - ) + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") """ Region of the external location of this table, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( - "externalLocationFormat", "externalLocationFormat" - ) + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") """ Format of the external location of this table, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( - "isPartitioned", "isPartitioned" - ) + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") """ Whether this table is partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( - "partitionStrategy", "partitionStrategy" - ) + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") """ Partition strategy for this table. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField( - "partitionCount", "partitionCount" - ) + PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") """ Number of partitions in this table. """ @@ -130,21 +110,15 @@ def __setattr__(self, name, value): """ Type of the table. """ - ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField( - "icebergCatalogName", "icebergCatalogName" - ) + ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField("icebergCatalogName", "icebergCatalogName") """ iceberg table catalog name (can be any user defined name) """ - ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField( - "icebergTableType", "icebergTableType" - ) + ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField("icebergTableType", "icebergTableType") """ iceberg table type (managed vs unmanaged) """ - ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField( - "icebergCatalogSource", "icebergCatalogSource" - ) + ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField("icebergCatalogSource", "icebergCatalogSource") """ iceberg table catalog type (glue, polaris, snowflake) """ @@ -172,9 +146,7 @@ def __setattr__(self, name, value): """ iceberg table base location inside the external volume. """ - TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField( - "tableRetentionTime", "tableRetentionTime" - ) + TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField("tableRetentionTime", "tableRetentionTime") """ Data retention time in days. """ @@ -182,69 +154,47 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( - "queryUserCount", "queryUserCount" - ) + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( - "queryUserMap", "queryUserMap" - ) + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( - "queryCountUpdatedAt", "queryCountUpdatedAt" - ) + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "databaseName", "databaseName.keyword", "databaseName" - ) + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "databaseQualifiedName", "databaseQualifiedName" - ) + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "schemaName", "schemaName.keyword", "schemaName" - ) + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "schemaQualifiedName", "schemaQualifiedName" - ) + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "tableName", "tableName.keyword", "tableName" - ) + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "tableQualifiedName", "tableQualifiedName" - ) + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "viewName", "viewName.keyword", "viewName" - ) + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "viewQualifiedName", "viewQualifiedName" - ) + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -264,27 +214,19 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( - "lastProfiledAt", "lastProfiledAt" - ) + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") """ Time (epoch) at which this asset was last profiled, in milliseconds. """ - DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField( - "dynamoDBStatus", "dynamoDBStatus" - ) + DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField("dynamoDBStatus", "dynamoDBStatus") """ Status of the DynamoDB Asset """ - DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField( - "dynamoDBPartitionKey", "dynamoDBPartitionKey" - ) + DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBPartitionKey", "dynamoDBPartitionKey") """ Specifies the partition key of the DynamoDB Table/Index """ - DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField( - "dynamoDBSortKey", "dynamoDBSortKey" - ) + DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBSortKey", "dynamoDBSortKey") """ Specifies the sort key of the DynamoDB Table/Index """ @@ -300,22 +242,16 @@ def __setattr__(self, name, value): """ The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( - "noSQLSchemaDefinition", "noSQLSchemaDefinition" - ) + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") """ Represents attributes for describing the key schema for the table and indexes. """ - DYNAMO_DB_LOCAL_SECONDARY_INDEXES: ClassVar[RelationField] = RelationField( - "dynamoDBLocalSecondaryIndexes" - ) + DYNAMO_DB_LOCAL_SECONDARY_INDEXES: ClassVar[RelationField] = RelationField("dynamoDBLocalSecondaryIndexes") """ TBC """ - DYNAMO_DB_GLOBAL_SECONDARY_INDEXES: ClassVar[RelationField] = RelationField( - "dynamoDBGlobalSecondaryIndexes" - ) + DYNAMO_DB_GLOBAL_SECONDARY_INDEXES: ClassVar[RelationField] = RelationField("dynamoDBGlobalSecondaryIndexes") """ TBC """ @@ -375,11 +311,7 @@ def __setattr__(self, name, value): @property def dynamo_dbtable_g_s_i_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_dbtable_g_s_i_count - ) + return None if self.attributes is None else self.attributes.dynamo_dbtable_g_s_i_count @dynamo_dbtable_g_s_i_count.setter def dynamo_dbtable_g_s_i_count(self, dynamo_dbtable_g_s_i_count: Optional[int]): @@ -389,11 +321,7 @@ def dynamo_dbtable_g_s_i_count(self, dynamo_dbtable_g_s_i_count: Optional[int]): @property def dynamo_dbtable_l_s_i_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_dbtable_l_s_i_count - ) + return None if self.attributes is None else self.attributes.dynamo_dbtable_l_s_i_count @dynamo_dbtable_l_s_i_count.setter def dynamo_dbtable_l_s_i_count(self, dynamo_dbtable_l_s_i_count: Optional[int]): @@ -483,11 +411,7 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_region - ) + return None if self.attributes is None else self.attributes.external_location_region @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -497,11 +421,7 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.external_location_format - ) + return None if self.attributes is None else self.attributes.external_location_format @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -591,9 +511,7 @@ def iceberg_table_type(self, iceberg_table_type: Optional[str]): @property def iceberg_catalog_source(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.iceberg_catalog_source - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_source @iceberg_catalog_source.setter def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @@ -603,11 +521,7 @@ def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @property def iceberg_catalog_table_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_catalog_table_name - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_table_name @iceberg_catalog_table_name.setter def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @@ -617,29 +531,17 @@ def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @property def iceberg_catalog_table_namespace(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_catalog_table_namespace - ) + return None if self.attributes is None else self.attributes.iceberg_catalog_table_namespace @iceberg_catalog_table_namespace.setter - def iceberg_catalog_table_namespace( - self, iceberg_catalog_table_namespace: Optional[str] - ): + def iceberg_catalog_table_namespace(self, iceberg_catalog_table_namespace: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.iceberg_catalog_table_namespace = ( - iceberg_catalog_table_namespace - ) + self.attributes.iceberg_catalog_table_namespace = iceberg_catalog_table_namespace @property def table_external_volume_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.table_external_volume_name - ) + return None if self.attributes is None else self.attributes.table_external_volume_name @table_external_volume_name.setter def table_external_volume_name(self, table_external_volume_name: Optional[str]): @@ -649,11 +551,7 @@ def table_external_volume_name(self, table_external_volume_name: Optional[str]): @property def iceberg_table_base_location(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.iceberg_table_base_location - ) + return None if self.attributes is None else self.attributes.iceberg_table_base_location @iceberg_table_base_location.setter def iceberg_table_base_location(self, iceberg_table_base_location: Optional[str]): @@ -703,9 +601,7 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.query_count_updated_at - ) + return None if self.attributes is None else self.attributes.query_count_updated_at @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -725,9 +621,7 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.database_qualified_name - ) + return None if self.attributes is None else self.attributes.database_qualified_name @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -747,9 +641,7 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.schema_qualified_name - ) + return None if self.attributes is None else self.attributes.schema_qualified_name @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -799,9 +691,7 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.calculation_view_name - ) + return None if self.attributes is None else self.attributes.calculation_view_name @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -811,21 +701,13 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.calculation_view_qualified_name - ) + return None if self.attributes is None else self.attributes.calculation_view_qualified_name @calculation_view_qualified_name.setter - def calculation_view_qualified_name( - self, calculation_view_qualified_name: Optional[str] - ): + def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = ( - calculation_view_qualified_name - ) + self.attributes.calculation_view_qualified_name = calculation_view_qualified_name @property def is_profiled(self) -> Optional[bool]: @@ -859,11 +741,7 @@ def dynamo_d_b_status(self, dynamo_d_b_status: Optional[DynamoDBStatus]): @property def dynamo_d_b_partition_key(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_partition_key - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_partition_key @dynamo_d_b_partition_key.setter def dynamo_d_b_partition_key(self, dynamo_d_b_partition_key: Optional[str]): @@ -883,45 +761,27 @@ def dynamo_d_b_sort_key(self, dynamo_d_b_sort_key: Optional[str]): @property def dynamo_d_b_read_capacity_units(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_read_capacity_units - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_read_capacity_units @dynamo_d_b_read_capacity_units.setter - def dynamo_d_b_read_capacity_units( - self, dynamo_d_b_read_capacity_units: Optional[int] - ): + def dynamo_d_b_read_capacity_units(self, dynamo_d_b_read_capacity_units: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dynamo_d_b_read_capacity_units = dynamo_d_b_read_capacity_units @property def dynamo_d_b_write_capacity_units(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_write_capacity_units - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_write_capacity_units @dynamo_d_b_write_capacity_units.setter - def dynamo_d_b_write_capacity_units( - self, dynamo_d_b_write_capacity_units: Optional[int] - ): + def dynamo_d_b_write_capacity_units(self, dynamo_d_b_write_capacity_units: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_write_capacity_units = ( - dynamo_d_b_write_capacity_units - ) + self.attributes.dynamo_d_b_write_capacity_units = dynamo_d_b_write_capacity_units @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.no_s_q_l_schema_definition - ) + return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -933,11 +793,7 @@ def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): def dynamo_d_b_local_secondary_indexes( self, ) -> Optional[List[DynamoDBLocalSecondaryIndex]]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_local_secondary_indexes - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_local_secondary_indexes @dynamo_d_b_local_secondary_indexes.setter def dynamo_d_b_local_secondary_indexes( @@ -946,32 +802,22 @@ def dynamo_d_b_local_secondary_indexes( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_local_secondary_indexes = ( - dynamo_d_b_local_secondary_indexes - ) + self.attributes.dynamo_d_b_local_secondary_indexes = dynamo_d_b_local_secondary_indexes @property def dynamo_d_b_global_secondary_indexes( self, ) -> Optional[List[DynamoDBGlobalSecondaryIndex]]: - return ( - None - if self.attributes is None - else self.attributes.dynamo_d_b_global_secondary_indexes - ) + return None if self.attributes is None else self.attributes.dynamo_d_b_global_secondary_indexes @dynamo_d_b_global_secondary_indexes.setter def dynamo_d_b_global_secondary_indexes( self, - dynamo_d_b_global_secondary_indexes: Optional[ - List[DynamoDBGlobalSecondaryIndex] - ], + dynamo_d_b_global_secondary_indexes: Optional[List[DynamoDBGlobalSecondaryIndex]], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_global_secondary_indexes = ( - dynamo_d_b_global_secondary_indexes - ) + self.attributes.dynamo_d_b_global_secondary_indexes = dynamo_d_b_global_secondary_indexes class Attributes(Table.Attributes): dynamo_dbtable_g_s_i_count: Optional[int] = Field(default=None, description="") @@ -982,9 +828,7 @@ class Attributes(Table.Attributes): alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -998,9 +842,7 @@ class Attributes(Table.Attributes): iceberg_table_type: Optional[str] = Field(default=None, description="") iceberg_catalog_source: Optional[str] = Field(default=None, description="") iceberg_catalog_table_name: Optional[str] = Field(default=None, description="") - iceberg_catalog_table_namespace: Optional[str] = Field( - default=None, description="" - ) + iceberg_catalog_table_namespace: Optional[str] = Field(default=None, description="") table_external_volume_name: Optional[str] = Field(default=None, description="") iceberg_table_base_location: Optional[str] = Field(default=None, description="") table_retention_time: Optional[int] = Field(default=None, description="") @@ -1017,31 +859,19 @@ class Attributes(Table.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field( - default=None, description="" - ) + calculation_view_qualified_name: Optional[str] = Field(default=None, description="") is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dynamo_d_b_status: Optional[DynamoDBStatus] = Field( - default=None, description="" - ) + dynamo_d_b_status: Optional[DynamoDBStatus] = Field(default=None, description="") dynamo_d_b_partition_key: Optional[str] = Field(default=None, description="") dynamo_d_b_sort_key: Optional[str] = Field(default=None, description="") - dynamo_d_b_read_capacity_units: Optional[int] = Field( - default=None, description="" - ) - dynamo_d_b_write_capacity_units: Optional[int] = Field( - default=None, description="" - ) + dynamo_d_b_read_capacity_units: Optional[int] = Field(default=None, description="") + dynamo_d_b_write_capacity_units: Optional[int] = Field(default=None, description="") no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") - dynamo_d_b_local_secondary_indexes: Optional[ - List[DynamoDBLocalSecondaryIndex] - ] = Field( + dynamo_d_b_local_secondary_indexes: Optional[List[DynamoDBLocalSecondaryIndex]] = Field( default=None, description="" ) # relationship - dynamo_d_b_global_secondary_indexes: Optional[ - List[DynamoDBGlobalSecondaryIndex] - ] = Field( + dynamo_d_b_global_secondary_indexes: Optional[List[DynamoDBGlobalSecondaryIndex]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/g_c_s.py b/pyatlan/model/assets/g_c_s.py index f5c4775a6..34d432869 100644 --- a/pyatlan/model/assets/g_c_s.py +++ b/pyatlan/model/assets/g_c_s.py @@ -36,15 +36,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - GCS_STORAGE_CLASS: ClassVar[KeywordField] = KeywordField( - "gcsStorageClass", "gcsStorageClass" - ) + GCS_STORAGE_CLASS: ClassVar[KeywordField] = KeywordField("gcsStorageClass", "gcsStorageClass") """ Storage class of this asset. """ - GCS_ENCRYPTION_TYPE: ClassVar[KeywordField] = KeywordField( - "gcsEncryptionType", "gcsEncryptionType" - ) + GCS_ENCRYPTION_TYPE: ClassVar[KeywordField] = KeywordField("gcsEncryptionType", "gcsEncryptionType") """ Encryption algorithm used to encrypt this asset. """ @@ -52,27 +48,19 @@ def __setattr__(self, name, value): """ Entity tag for the asset. An entity tag is a hash of the object and represents changes to the contents of an object only, not its metadata. """ # noqa: E501 - GCS_REQUESTER_PAYS: ClassVar[BooleanField] = BooleanField( - "gcsRequesterPays", "gcsRequesterPays" - ) + GCS_REQUESTER_PAYS: ClassVar[BooleanField] = BooleanField("gcsRequesterPays", "gcsRequesterPays") """ Whether the requester pays header was sent when this asset was created (true) or not (false). """ - GCS_ACCESS_CONTROL: ClassVar[KeywordField] = KeywordField( - "gcsAccessControl", "gcsAccessControl" - ) + GCS_ACCESS_CONTROL: ClassVar[KeywordField] = KeywordField("gcsAccessControl", "gcsAccessControl") """ Access control list for this asset. """ - GCS_META_GENERATION_ID: ClassVar[NumericField] = NumericField( - "gcsMetaGenerationId", "gcsMetaGenerationId" - ) + GCS_META_GENERATION_ID: ClassVar[NumericField] = NumericField("gcsMetaGenerationId", "gcsMetaGenerationId") """ Version of metadata for this asset at this generation. Used for preconditions and detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular asset. """ # noqa: E501 - GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField( - "googleService", "googleService" - ) + GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField("googleService", "googleService") """ Service in Google in which the asset exists. """ @@ -88,21 +76,15 @@ def __setattr__(self, name, value): """ ID of the project in which the asset exists. """ - GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField( - "googleProjectNumber", "googleProjectNumber" - ) + GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField("googleProjectNumber", "googleProjectNumber") """ Number of the project in which the asset exists. """ - GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField( - "googleLocation", "googleLocation" - ) + GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField("googleLocation", "googleLocation") """ Location of this asset in Google. """ - GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField( - "googleLocationType", "googleLocationType" - ) + GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField("googleLocationType", "googleLocationType") """ Type of location of this asset in Google. """ @@ -119,9 +101,7 @@ def __setattr__(self, name, value): """ TBC """ - INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( - "inputToAirflowTasks" - ) + INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("inputToAirflowTasks") """ TBC """ @@ -129,33 +109,23 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField( - "modelImplementedAttributes" - ) + MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelImplementedAttributes") """ TBC """ - OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( - "outputFromAirflowTasks" - ) + OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("outputFromAirflowTasks") """ TBC """ - OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField( - "outputFromSparkJobs" - ) + OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField("outputFromSparkJobs") """ TBC """ - MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField( - "modelImplementedEntities" - ) + MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField("modelImplementedEntities") """ TBC """ - OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField( - "outputFromProcesses" - ) + OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField("outputFromProcesses") """ TBC """ @@ -237,9 +207,7 @@ def gcs_access_control(self, gcs_access_control: Optional[str]): @property def gcs_meta_generation_id(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.gcs_meta_generation_id - ) + return None if self.attributes is None else self.attributes.gcs_meta_generation_id @gcs_meta_generation_id.setter def gcs_meta_generation_id(self, gcs_meta_generation_id: Optional[int]): @@ -279,9 +247,7 @@ def google_project_id(self, google_project_id: Optional[str]): @property def google_project_number(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.google_project_number - ) + return None if self.attributes is None else self.attributes.google_project_number @google_project_number.setter def google_project_number(self, google_project_number: Optional[int]): @@ -341,14 +307,10 @@ def input_to_spark_jobs(self, input_to_spark_jobs: Optional[List[SparkJob]]): @property def input_to_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return ( - None if self.attributes is None else self.attributes.input_to_airflow_tasks - ) + return None if self.attributes is None else self.attributes.input_to_airflow_tasks @input_to_airflow_tasks.setter - def input_to_airflow_tasks( - self, input_to_airflow_tasks: Optional[List[AirflowTask]] - ): + def input_to_airflow_tasks(self, input_to_airflow_tasks: Optional[List[AirflowTask]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.input_to_airflow_tasks = input_to_airflow_tasks @@ -365,41 +327,27 @@ def input_to_processes(self, input_to_processes: Optional[List[Process]]): @property def model_implemented_attributes(self) -> Optional[List[ModelAttribute]]: - return ( - None - if self.attributes is None - else self.attributes.model_implemented_attributes - ) + return None if self.attributes is None else self.attributes.model_implemented_attributes @model_implemented_attributes.setter - def model_implemented_attributes( - self, model_implemented_attributes: Optional[List[ModelAttribute]] - ): + def model_implemented_attributes(self, model_implemented_attributes: Optional[List[ModelAttribute]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_attributes = model_implemented_attributes @property def output_from_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return ( - None - if self.attributes is None - else self.attributes.output_from_airflow_tasks - ) + return None if self.attributes is None else self.attributes.output_from_airflow_tasks @output_from_airflow_tasks.setter - def output_from_airflow_tasks( - self, output_from_airflow_tasks: Optional[List[AirflowTask]] - ): + def output_from_airflow_tasks(self, output_from_airflow_tasks: Optional[List[AirflowTask]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.output_from_airflow_tasks = output_from_airflow_tasks @property def output_from_spark_jobs(self) -> Optional[List[SparkJob]]: - return ( - None if self.attributes is None else self.attributes.output_from_spark_jobs - ) + return None if self.attributes is None else self.attributes.output_from_spark_jobs @output_from_spark_jobs.setter def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob]]): @@ -409,25 +357,17 @@ def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob] @property def model_implemented_entities(self) -> Optional[List[ModelEntity]]: - return ( - None - if self.attributes is None - else self.attributes.model_implemented_entities - ) + return None if self.attributes is None else self.attributes.model_implemented_entities @model_implemented_entities.setter - def model_implemented_entities( - self, model_implemented_entities: Optional[List[ModelEntity]] - ): + def model_implemented_entities(self, model_implemented_entities: Optional[List[ModelEntity]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_entities = model_implemented_entities @property def output_from_processes(self) -> Optional[List[Process]]: - return ( - None if self.attributes is None else self.attributes.output_from_processes - ) + return None if self.attributes is None else self.attributes.output_from_processes @output_from_processes.setter def output_from_processes(self, output_from_processes: Optional[List[Process]]): @@ -450,30 +390,16 @@ class Attributes(Google.Attributes): google_location_type: Optional[str] = Field(default=None, description="") google_labels: Optional[List[GoogleLabel]] = Field(default=None, description="") google_tags: Optional[List[GoogleTag]] = Field(default=None, description="") - input_to_spark_jobs: Optional[List[SparkJob]] = Field( - default=None, description="" - ) # relationship - input_to_airflow_tasks: Optional[List[AirflowTask]] = Field( - default=None, description="" - ) # relationship - input_to_processes: Optional[List[Process]] = Field( - default=None, description="" - ) # relationship + input_to_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship + input_to_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship + input_to_processes: Optional[List[Process]] = Field(default=None, description="") # relationship model_implemented_attributes: Optional[List[ModelAttribute]] = Field( default=None, description="" ) # relationship - output_from_airflow_tasks: Optional[List[AirflowTask]] = Field( - default=None, description="" - ) # relationship - output_from_spark_jobs: Optional[List[SparkJob]] = Field( - default=None, description="" - ) # relationship - model_implemented_entities: Optional[List[ModelEntity]] = Field( - default=None, description="" - ) # relationship - output_from_processes: Optional[List[Process]] = Field( - default=None, description="" - ) # relationship + output_from_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship + output_from_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship + model_implemented_entities: Optional[List[ModelEntity]] = Field(default=None, description="") # relationship + output_from_processes: Optional[List[Process]] = Field(default=None, description="") # relationship attributes: GCS.Attributes = Field( default_factory=lambda: GCS.Attributes(), diff --git a/pyatlan/model/assets/g_c_s_bucket.py b/pyatlan/model/assets/g_c_s_bucket.py index 25146a08b..ce14b0306 100644 --- a/pyatlan/model/assets/g_c_s_bucket.py +++ b/pyatlan/model/assets/g_c_s_bucket.py @@ -28,28 +28,19 @@ class GCSBucket(GCS): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> GCSBucket: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) - attributes = GCSBucket.Attributes.create( - name=name, connection_qualified_name=connection_qualified_name - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + attributes = GCSBucket.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) return cls(attributes=attributes) @classmethod @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> GCSBucket: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + return cls.creator(name=name, connection_qualified_name=connection_qualified_name) type_name: str = Field(default="GCSBucket", allow_mutation=False) @@ -64,9 +55,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - GCS_OBJECT_COUNT: ClassVar[NumericField] = NumericField( - "gcsObjectCount", "gcsObjectCount" - ) + GCS_OBJECT_COUNT: ClassVar[NumericField] = NumericField("gcsObjectCount", "gcsObjectCount") """ Number of objects within the bucket. """ @@ -94,15 +83,11 @@ def __setattr__(self, name, value): """ Effective time for retention of objects in this bucket. """ - GCS_BUCKET_LIFECYCLE_RULES: ClassVar[TextField] = TextField( - "gcsBucketLifecycleRules", "gcsBucketLifecycleRules" - ) + GCS_BUCKET_LIFECYCLE_RULES: ClassVar[TextField] = TextField("gcsBucketLifecycleRules", "gcsBucketLifecycleRules") """ Lifecycle rules for this bucket. """ - GCS_BUCKET_RETENTION_POLICY: ClassVar[TextField] = TextField( - "gcsBucketRetentionPolicy", "gcsBucketRetentionPolicy" - ) + GCS_BUCKET_RETENTION_POLICY: ClassVar[TextField] = TextField("gcsBucketRetentionPolicy", "gcsBucketRetentionPolicy") """ Retention policy for this bucket. """ @@ -135,27 +120,17 @@ def gcs_object_count(self, gcs_object_count: Optional[int]): @property def gcs_bucket_versioning_enabled(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.gcs_bucket_versioning_enabled - ) + return None if self.attributes is None else self.attributes.gcs_bucket_versioning_enabled @gcs_bucket_versioning_enabled.setter - def gcs_bucket_versioning_enabled( - self, gcs_bucket_versioning_enabled: Optional[bool] - ): + def gcs_bucket_versioning_enabled(self, gcs_bucket_versioning_enabled: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.gcs_bucket_versioning_enabled = gcs_bucket_versioning_enabled @property def gcs_bucket_retention_locked(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.gcs_bucket_retention_locked - ) + return None if self.attributes is None else self.attributes.gcs_bucket_retention_locked @gcs_bucket_retention_locked.setter def gcs_bucket_retention_locked(self, gcs_bucket_retention_locked: Optional[bool]): @@ -165,11 +140,7 @@ def gcs_bucket_retention_locked(self, gcs_bucket_retention_locked: Optional[bool @property def gcs_bucket_retention_period(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.gcs_bucket_retention_period - ) + return None if self.attributes is None else self.attributes.gcs_bucket_retention_period @gcs_bucket_retention_period.setter def gcs_bucket_retention_period(self, gcs_bucket_retention_period: Optional[int]): @@ -179,29 +150,17 @@ def gcs_bucket_retention_period(self, gcs_bucket_retention_period: Optional[int] @property def gcs_bucket_retention_effective_time(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.gcs_bucket_retention_effective_time - ) + return None if self.attributes is None else self.attributes.gcs_bucket_retention_effective_time @gcs_bucket_retention_effective_time.setter - def gcs_bucket_retention_effective_time( - self, gcs_bucket_retention_effective_time: Optional[datetime] - ): + def gcs_bucket_retention_effective_time(self, gcs_bucket_retention_effective_time: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.gcs_bucket_retention_effective_time = ( - gcs_bucket_retention_effective_time - ) + self.attributes.gcs_bucket_retention_effective_time = gcs_bucket_retention_effective_time @property def gcs_bucket_lifecycle_rules(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.gcs_bucket_lifecycle_rules - ) + return None if self.attributes is None else self.attributes.gcs_bucket_lifecycle_rules @gcs_bucket_lifecycle_rules.setter def gcs_bucket_lifecycle_rules(self, gcs_bucket_lifecycle_rules: Optional[str]): @@ -211,11 +170,7 @@ def gcs_bucket_lifecycle_rules(self, gcs_bucket_lifecycle_rules: Optional[str]): @property def gcs_bucket_retention_policy(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.gcs_bucket_retention_policy - ) + return None if self.attributes is None else self.attributes.gcs_bucket_retention_policy @gcs_bucket_retention_policy.setter def gcs_bucket_retention_policy(self, gcs_bucket_retention_policy: Optional[str]): @@ -235,37 +190,23 @@ def gcs_objects(self, gcs_objects: Optional[List[GCSObject]]): class Attributes(GCS.Attributes): gcs_object_count: Optional[int] = Field(default=None, description="") - gcs_bucket_versioning_enabled: Optional[bool] = Field( - default=None, description="" - ) - gcs_bucket_retention_locked: Optional[bool] = Field( - default=None, description="" - ) + gcs_bucket_versioning_enabled: Optional[bool] = Field(default=None, description="") + gcs_bucket_retention_locked: Optional[bool] = Field(default=None, description="") gcs_bucket_retention_period: Optional[int] = Field(default=None, description="") - gcs_bucket_retention_effective_time: Optional[datetime] = Field( - default=None, description="" - ) + gcs_bucket_retention_effective_time: Optional[datetime] = Field(default=None, description="") gcs_bucket_lifecycle_rules: Optional[str] = Field(default=None, description="") gcs_bucket_retention_policy: Optional[str] = Field(default=None, description="") - gcs_objects: Optional[List[GCSObject]] = Field( - default=None, description="" - ) # relationship + gcs_objects: Optional[List[GCSObject]] = Field(default=None, description="") # relationship @classmethod @init_guid - def create( - cls, *, name: str, connection_qualified_name: str - ) -> GCSBucket.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + def create(cls, *, name: str, connection_qualified_name: str) -> GCSBucket.Attributes: + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return GCSBucket.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: GCSBucket.Attributes = Field( diff --git a/pyatlan/model/assets/g_c_s_object.py b/pyatlan/model/assets/g_c_s_object.py index 1d6d8f57b..1e96d5ebd 100644 --- a/pyatlan/model/assets/g_c_s_object.py +++ b/pyatlan/model/assets/g_c_s_object.py @@ -53,9 +53,7 @@ def creator( gcs_bucket_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> GCSObject: - validate_required_fields( - ["name", "gcs_bucket_qualified_name"], [name, gcs_bucket_qualified_name] - ) + validate_required_fields(["name", "gcs_bucket_qualified_name"], [name, gcs_bucket_qualified_name]) attributes = GCSObject.Attributes.create( name=name, gcs_bucket_qualified_name=gcs_bucket_qualified_name, @@ -67,16 +65,11 @@ def creator( @init_guid def create(cls, *, name: str, gcs_bucket_qualified_name: str) -> GCSObject: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, gcs_bucket_qualified_name=gcs_bucket_qualified_name - ) + return cls.creator(name=name, gcs_bucket_qualified_name=gcs_bucket_qualified_name) type_name: str = Field(default="GCSObject", allow_mutation=False) @@ -105,15 +98,11 @@ def __setattr__(self, name, value): """ Unique name of the bucket in which this object exists. """ - GCS_OBJECT_SIZE: ClassVar[NumericField] = NumericField( - "gcsObjectSize", "gcsObjectSize" - ) + GCS_OBJECT_SIZE: ClassVar[NumericField] = NumericField("gcsObjectSize", "gcsObjectSize") """ Object size in bytes. """ - GCS_OBJECT_KEY: ClassVar[KeywordTextField] = KeywordTextField( - "gcsObjectKey", "gcsObjectKey", "gcsObjectKey.text" - ) + GCS_OBJECT_KEY: ClassVar[KeywordTextField] = KeywordTextField("gcsObjectKey", "gcsObjectKey", "gcsObjectKey.text") """ Key of this object, in GCS. """ @@ -123,27 +112,19 @@ def __setattr__(self, name, value): """ Media link to this object. """ - GCS_OBJECT_HOLD_TYPE: ClassVar[KeywordField] = KeywordField( - "gcsObjectHoldType", "gcsObjectHoldType" - ) + GCS_OBJECT_HOLD_TYPE: ClassVar[KeywordField] = KeywordField("gcsObjectHoldType", "gcsObjectHoldType") """ Type of hold on this object. """ - GCS_OBJECT_GENERATION_ID: ClassVar[NumericField] = NumericField( - "gcsObjectGenerationId", "gcsObjectGenerationId" - ) + GCS_OBJECT_GENERATION_ID: ClassVar[NumericField] = NumericField("gcsObjectGenerationId", "gcsObjectGenerationId") """ Generation ID of this object. """ - GCS_OBJECT_CRC32C_HASH: ClassVar[KeywordField] = KeywordField( - "gcsObjectCRC32CHash", "gcsObjectCRC32CHash" - ) + GCS_OBJECT_CRC32C_HASH: ClassVar[KeywordField] = KeywordField("gcsObjectCRC32CHash", "gcsObjectCRC32CHash") """ CRC32C hash of this object. """ - GCS_OBJECT_MD5HASH: ClassVar[KeywordField] = KeywordField( - "gcsObjectMD5Hash", "gcsObjectMD5Hash" - ) + GCS_OBJECT_MD5HASH: ClassVar[KeywordField] = KeywordField("gcsObjectMD5Hash", "gcsObjectMD5Hash") """ MD5 hash of this object. """ @@ -153,9 +134,7 @@ def __setattr__(self, name, value): """ Time (epoch) at which this object's data was last modified, in milliseconds. """ - GCS_OBJECT_CONTENT_TYPE: ClassVar[KeywordField] = KeywordField( - "gcsObjectContentType", "gcsObjectContentType" - ) + GCS_OBJECT_CONTENT_TYPE: ClassVar[KeywordField] = KeywordField("gcsObjectContentType", "gcsObjectContentType") """ Type of content in this object. """ @@ -220,11 +199,7 @@ def gcs_bucket_name(self, gcs_bucket_name: Optional[str]): @property def gcs_bucket_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.gcs_bucket_qualified_name - ) + return None if self.attributes is None else self.attributes.gcs_bucket_qualified_name @gcs_bucket_qualified_name.setter def gcs_bucket_qualified_name(self, gcs_bucket_qualified_name: Optional[str]): @@ -254,9 +229,7 @@ def gcs_object_key(self, gcs_object_key: Optional[str]): @property def gcs_object_media_link(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.gcs_object_media_link - ) + return None if self.attributes is None else self.attributes.gcs_object_media_link @gcs_object_media_link.setter def gcs_object_media_link(self, gcs_object_media_link: Optional[str]): @@ -276,11 +249,7 @@ def gcs_object_hold_type(self, gcs_object_hold_type: Optional[str]): @property def gcs_object_generation_id(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.gcs_object_generation_id - ) + return None if self.attributes is None else self.attributes.gcs_object_generation_id @gcs_object_generation_id.setter def gcs_object_generation_id(self, gcs_object_generation_id: Optional[int]): @@ -290,11 +259,7 @@ def gcs_object_generation_id(self, gcs_object_generation_id: Optional[int]): @property def gcs_object_c_r_c32_c_hash(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.gcs_object_c_r_c32_c_hash - ) + return None if self.attributes is None else self.attributes.gcs_object_c_r_c32_c_hash @gcs_object_c_r_c32_c_hash.setter def gcs_object_c_r_c32_c_hash(self, gcs_object_c_r_c32_c_hash: Optional[str]): @@ -314,27 +279,17 @@ def gcs_object_m_d5_hash(self, gcs_object_m_d5_hash: Optional[str]): @property def gcs_object_data_last_modified_time(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.gcs_object_data_last_modified_time - ) + return None if self.attributes is None else self.attributes.gcs_object_data_last_modified_time @gcs_object_data_last_modified_time.setter - def gcs_object_data_last_modified_time( - self, gcs_object_data_last_modified_time: Optional[datetime] - ): + def gcs_object_data_last_modified_time(self, gcs_object_data_last_modified_time: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.gcs_object_data_last_modified_time = ( - gcs_object_data_last_modified_time - ) + self.attributes.gcs_object_data_last_modified_time = gcs_object_data_last_modified_time @property def gcs_object_content_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.gcs_object_content_type - ) + return None if self.attributes is None else self.attributes.gcs_object_content_type @gcs_object_content_type.setter def gcs_object_content_type(self, gcs_object_content_type: Optional[str]): @@ -344,11 +299,7 @@ def gcs_object_content_type(self, gcs_object_content_type: Optional[str]): @property def gcs_object_content_encoding(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.gcs_object_content_encoding - ) + return None if self.attributes is None else self.attributes.gcs_object_content_encoding @gcs_object_content_encoding.setter def gcs_object_content_encoding(self, gcs_object_content_encoding: Optional[str]): @@ -358,27 +309,17 @@ def gcs_object_content_encoding(self, gcs_object_content_encoding: Optional[str] @property def gcs_object_content_disposition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.gcs_object_content_disposition - ) + return None if self.attributes is None else self.attributes.gcs_object_content_disposition @gcs_object_content_disposition.setter - def gcs_object_content_disposition( - self, gcs_object_content_disposition: Optional[str] - ): + def gcs_object_content_disposition(self, gcs_object_content_disposition: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.gcs_object_content_disposition = gcs_object_content_disposition @property def gcs_object_content_language(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.gcs_object_content_language - ) + return None if self.attributes is None else self.attributes.gcs_object_content_language @gcs_object_content_language.setter def gcs_object_content_language(self, gcs_object_content_language: Optional[str]): @@ -388,21 +329,13 @@ def gcs_object_content_language(self, gcs_object_content_language: Optional[str] @property def gcs_object_retention_expiration_date(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.gcs_object_retention_expiration_date - ) + return None if self.attributes is None else self.attributes.gcs_object_retention_expiration_date @gcs_object_retention_expiration_date.setter - def gcs_object_retention_expiration_date( - self, gcs_object_retention_expiration_date: Optional[datetime] - ): + def gcs_object_retention_expiration_date(self, gcs_object_retention_expiration_date: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.gcs_object_retention_expiration_date = ( - gcs_object_retention_expiration_date - ) + self.attributes.gcs_object_retention_expiration_date = gcs_object_retention_expiration_date @property def gcs_bucket(self) -> Optional[GCSBucket]: @@ -424,21 +357,13 @@ class Attributes(GCS.Attributes): gcs_object_generation_id: Optional[int] = Field(default=None, description="") gcs_object_c_r_c32_c_hash: Optional[str] = Field(default=None, description="") gcs_object_m_d5_hash: Optional[str] = Field(default=None, description="") - gcs_object_data_last_modified_time: Optional[datetime] = Field( - default=None, description="" - ) + gcs_object_data_last_modified_time: Optional[datetime] = Field(default=None, description="") gcs_object_content_type: Optional[str] = Field(default=None, description="") gcs_object_content_encoding: Optional[str] = Field(default=None, description="") - gcs_object_content_disposition: Optional[str] = Field( - default=None, description="" - ) + gcs_object_content_disposition: Optional[str] = Field(default=None, description="") gcs_object_content_language: Optional[str] = Field(default=None, description="") - gcs_object_retention_expiration_date: Optional[datetime] = Field( - default=None, description="" - ) - gcs_bucket: Optional[GCSBucket] = Field( - default=None, description="" - ) # relationship + gcs_object_retention_expiration_date: Optional[datetime] = Field(default=None, description="") + gcs_bucket: Optional[GCSBucket] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -449,13 +374,9 @@ def create( gcs_bucket_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> GCSObject.Attributes: - validate_required_fields( - ["name", "gcs_bucket_qualified_name"], [name, gcs_bucket_qualified_name] - ) + validate_required_fields(["name", "gcs_bucket_qualified_name"], [name, gcs_bucket_qualified_name]) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( gcs_bucket_qualified_name, "gcs_bucket_qualified_name", 4 diff --git a/pyatlan/model/assets/google.py b/pyatlan/model/assets/google.py index 8cda3bdea..06b95af72 100644 --- a/pyatlan/model/assets/google.py +++ b/pyatlan/model/assets/google.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField( - "googleService", "googleService" - ) + GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField("googleService", "googleService") """ Service in Google in which the asset exists. """ @@ -52,21 +50,15 @@ def __setattr__(self, name, value): """ ID of the project in which the asset exists. """ - GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField( - "googleProjectNumber", "googleProjectNumber" - ) + GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField("googleProjectNumber", "googleProjectNumber") """ Number of the project in which the asset exists. """ - GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField( - "googleLocation", "googleLocation" - ) + GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField("googleLocation", "googleLocation") """ Location of this asset in Google. """ - GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField( - "googleLocationType", "googleLocationType" - ) + GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField("googleLocationType", "googleLocationType") """ Type of location of this asset in Google. """ @@ -122,9 +114,7 @@ def google_project_id(self, google_project_id: Optional[str]): @property def google_project_number(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.google_project_number - ) + return None if self.attributes is None else self.attributes.google_project_number @google_project_number.setter def google_project_number(self, google_project_number: Optional[int]): diff --git a/pyatlan/model/assets/incident.py b/pyatlan/model/assets/incident.py index d63906521..9b599787e 100644 --- a/pyatlan/model/assets/incident.py +++ b/pyatlan/model/assets/incident.py @@ -30,9 +30,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - INCIDENT_SEVERITY: ClassVar[KeywordField] = KeywordField( - "incidentSeverity", "incidentSeverity" - ) + INCIDENT_SEVERITY: ClassVar[KeywordField] = KeywordField("incidentSeverity", "incidentSeverity") """ Status of this asset's severity. """ @@ -52,9 +50,7 @@ def incident_severity(self, incident_severity: Optional[IncidentSeverity]): self.attributes.incident_severity = incident_severity class Attributes(Asset.Attributes): - incident_severity: Optional[IncidentSeverity] = Field( - default=None, description="" - ) + incident_severity: Optional[IncidentSeverity] = Field(default=None, description="") attributes: Incident.Attributes = Field( default_factory=lambda: Incident.Attributes(), diff --git a/pyatlan/model/assets/kafka_consumer_group.py b/pyatlan/model/assets/kafka_consumer_group.py index 22c3f3c9b..c9196fff5 100644 --- a/pyatlan/model/assets/kafka_consumer_group.py +++ b/pyatlan/model/assets/kafka_consumer_group.py @@ -50,11 +50,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - KAFKA_CONSUMER_GROUP_TOPIC_CONSUMPTION_PROPERTIES: ClassVar[KeywordField] = ( - KeywordField( - "kafkaConsumerGroupTopicConsumptionProperties", - "kafkaConsumerGroupTopicConsumptionProperties", - ) + KAFKA_CONSUMER_GROUP_TOPIC_CONSUMPTION_PROPERTIES: ClassVar[KeywordField] = KeywordField( + "kafkaConsumerGroupTopicConsumptionProperties", + "kafkaConsumerGroupTopicConsumptionProperties", ) """ List of consumption properties for Kafka topics, for this consumer group. @@ -65,9 +63,7 @@ def __setattr__(self, name, value): """ Number of members in this consumer group. """ - KAFKA_TOPIC_NAMES: ClassVar[KeywordField] = KeywordField( - "kafkaTopicNames", "kafkaTopicNames" - ) + KAFKA_TOPIC_NAMES: ClassVar[KeywordField] = KeywordField("kafkaTopicNames", "kafkaTopicNames") """ Simple names of the topics consumed by this consumer group. """ @@ -95,18 +91,12 @@ def __setattr__(self, name, value): def kafka_consumer_group_topic_consumption_properties( self, ) -> Optional[List[KafkaTopicConsumption]]: - return ( - None - if self.attributes is None - else self.attributes.kafka_consumer_group_topic_consumption_properties - ) + return None if self.attributes is None else self.attributes.kafka_consumer_group_topic_consumption_properties @kafka_consumer_group_topic_consumption_properties.setter def kafka_consumer_group_topic_consumption_properties( self, - kafka_consumer_group_topic_consumption_properties: Optional[ - List[KafkaTopicConsumption] - ], + kafka_consumer_group_topic_consumption_properties: Optional[List[KafkaTopicConsumption]], ): if self.attributes is None: self.attributes = self.Attributes() @@ -116,21 +106,13 @@ def kafka_consumer_group_topic_consumption_properties( @property def kafka_consumer_group_member_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.kafka_consumer_group_member_count - ) + return None if self.attributes is None else self.attributes.kafka_consumer_group_member_count @kafka_consumer_group_member_count.setter - def kafka_consumer_group_member_count( - self, kafka_consumer_group_member_count: Optional[int] - ): + def kafka_consumer_group_member_count(self, kafka_consumer_group_member_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.kafka_consumer_group_member_count = ( - kafka_consumer_group_member_count - ) + self.attributes.kafka_consumer_group_member_count = kafka_consumer_group_member_count @property def kafka_topic_names(self) -> Optional[Set[str]]: @@ -144,16 +126,10 @@ def kafka_topic_names(self, kafka_topic_names: Optional[Set[str]]): @property def kafka_topic_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.kafka_topic_qualified_names - ) + return None if self.attributes is None else self.attributes.kafka_topic_qualified_names @kafka_topic_qualified_names.setter - def kafka_topic_qualified_names( - self, kafka_topic_qualified_names: Optional[Set[str]] - ): + def kafka_topic_qualified_names(self, kafka_topic_qualified_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_topic_qualified_names = kafka_topic_qualified_names @@ -169,19 +145,13 @@ def kafka_topics(self, kafka_topics: Optional[List[KafkaTopic]]): self.attributes.kafka_topics = kafka_topics class Attributes(Kafka.Attributes): - kafka_consumer_group_topic_consumption_properties: Optional[ - List[KafkaTopicConsumption] - ] = Field(default=None, description="") - kafka_consumer_group_member_count: Optional[int] = Field( + kafka_consumer_group_topic_consumption_properties: Optional[List[KafkaTopicConsumption]] = Field( default=None, description="" ) + kafka_consumer_group_member_count: Optional[int] = Field(default=None, description="") kafka_topic_names: Optional[Set[str]] = Field(default=None, description="") - kafka_topic_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) - kafka_topics: Optional[List[KafkaTopic]] = Field( - default=None, description="" - ) # relationship + kafka_topic_qualified_names: Optional[Set[str]] = Field(default=None, description="") + kafka_topics: Optional[List[KafkaTopic]] = Field(default=None, description="") # relationship @classmethod @init_guid diff --git a/pyatlan/model/assets/kafka_topic.py b/pyatlan/model/assets/kafka_topic.py index 4722cc50f..a34fdd893 100644 --- a/pyatlan/model/assets/kafka_topic.py +++ b/pyatlan/model/assets/kafka_topic.py @@ -30,12 +30,8 @@ class KafkaTopic(Kafka): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> KafkaTopic: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) - attributes = KafkaTopic.Attributes.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + attributes = KafkaTopic.Attributes.creator(name=name, connection_qualified_name=connection_qualified_name) return cls(attributes=attributes) type_name: str = Field(default="KafkaTopic", allow_mutation=False) @@ -51,9 +47,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - KAFKA_TOPIC_IS_INTERNAL: ClassVar[BooleanField] = BooleanField( - "kafkaTopicIsInternal", "kafkaTopicIsInternal" - ) + KAFKA_TOPIC_IS_INTERNAL: ClassVar[BooleanField] = BooleanField("kafkaTopicIsInternal", "kafkaTopicIsInternal") """ Whether this topic is an internal topic (true) or not (false). """ @@ -69,9 +63,7 @@ def __setattr__(self, name, value): """ Replication factor for this topic. """ - KAFKA_TOPIC_SEGMENT_BYTES: ClassVar[NumericField] = NumericField( - "kafkaTopicSegmentBytes", "kafkaTopicSegmentBytes" - ) + KAFKA_TOPIC_SEGMENT_BYTES: ClassVar[NumericField] = NumericField("kafkaTopicSegmentBytes", "kafkaTopicSegmentBytes") """ Segment size for this topic. """ @@ -87,15 +79,11 @@ def __setattr__(self, name, value): """ Number of partitions for this topic. """ - KAFKA_TOPIC_SIZE_IN_BYTES: ClassVar[NumericField] = NumericField( - "kafkaTopicSizeInBytes", "kafkaTopicSizeInBytes" - ) + KAFKA_TOPIC_SIZE_IN_BYTES: ClassVar[NumericField] = NumericField("kafkaTopicSizeInBytes", "kafkaTopicSizeInBytes") """ Size of this topic, in bytes. """ - KAFKA_TOPIC_RECORD_COUNT: ClassVar[NumericField] = NumericField( - "kafkaTopicRecordCount", "kafkaTopicRecordCount" - ) + KAFKA_TOPIC_RECORD_COUNT: ClassVar[NumericField] = NumericField("kafkaTopicRecordCount", "kafkaTopicRecordCount") """ Number of (unexpired) messages in this topic. """ @@ -112,9 +100,7 @@ def __setattr__(self, name, value): Comma seperated Cleanup policy for this topic. """ - KAFKA_CONSUMER_GROUPS: ClassVar[RelationField] = RelationField( - "kafkaConsumerGroups" - ) + KAFKA_CONSUMER_GROUPS: ClassVar[RelationField] = RelationField("kafkaConsumerGroups") """ TBC """ @@ -135,9 +121,7 @@ def __setattr__(self, name, value): @property def kafka_topic_is_internal(self) -> Optional[bool]: - return ( - None if self.attributes is None else self.attributes.kafka_topic_is_internal - ) + return None if self.attributes is None else self.attributes.kafka_topic_is_internal @kafka_topic_is_internal.setter def kafka_topic_is_internal(self, kafka_topic_is_internal: Optional[bool]): @@ -147,43 +131,27 @@ def kafka_topic_is_internal(self, kafka_topic_is_internal: Optional[bool]): @property def kafka_topic_compression_type(self) -> Optional[KafkaTopicCompressionType]: - return ( - None - if self.attributes is None - else self.attributes.kafka_topic_compression_type - ) + return None if self.attributes is None else self.attributes.kafka_topic_compression_type @kafka_topic_compression_type.setter - def kafka_topic_compression_type( - self, kafka_topic_compression_type: Optional[KafkaTopicCompressionType] - ): + def kafka_topic_compression_type(self, kafka_topic_compression_type: Optional[KafkaTopicCompressionType]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_topic_compression_type = kafka_topic_compression_type @property def kafka_topic_replication_factor(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.kafka_topic_replication_factor - ) + return None if self.attributes is None else self.attributes.kafka_topic_replication_factor @kafka_topic_replication_factor.setter - def kafka_topic_replication_factor( - self, kafka_topic_replication_factor: Optional[int] - ): + def kafka_topic_replication_factor(self, kafka_topic_replication_factor: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_topic_replication_factor = kafka_topic_replication_factor @property def kafka_topic_segment_bytes(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.kafka_topic_segment_bytes - ) + return None if self.attributes is None else self.attributes.kafka_topic_segment_bytes @kafka_topic_segment_bytes.setter def kafka_topic_segment_bytes(self, kafka_topic_segment_bytes: Optional[int]): @@ -193,29 +161,17 @@ def kafka_topic_segment_bytes(self, kafka_topic_segment_bytes: Optional[int]): @property def kafka_topic_retention_time_in_ms(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.kafka_topic_retention_time_in_ms - ) + return None if self.attributes is None else self.attributes.kafka_topic_retention_time_in_ms @kafka_topic_retention_time_in_ms.setter - def kafka_topic_retention_time_in_ms( - self, kafka_topic_retention_time_in_ms: Optional[int] - ): + def kafka_topic_retention_time_in_ms(self, kafka_topic_retention_time_in_ms: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.kafka_topic_retention_time_in_ms = ( - kafka_topic_retention_time_in_ms - ) + self.attributes.kafka_topic_retention_time_in_ms = kafka_topic_retention_time_in_ms @property def kafka_topic_partitions_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.kafka_topic_partitions_count - ) + return None if self.attributes is None else self.attributes.kafka_topic_partitions_count @kafka_topic_partitions_count.setter def kafka_topic_partitions_count(self, kafka_topic_partitions_count: Optional[int]): @@ -225,11 +181,7 @@ def kafka_topic_partitions_count(self, kafka_topic_partitions_count: Optional[in @property def kafka_topic_size_in_bytes(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.kafka_topic_size_in_bytes - ) + return None if self.attributes is None else self.attributes.kafka_topic_size_in_bytes @kafka_topic_size_in_bytes.setter def kafka_topic_size_in_bytes(self, kafka_topic_size_in_bytes: Optional[int]): @@ -239,11 +191,7 @@ def kafka_topic_size_in_bytes(self, kafka_topic_size_in_bytes: Optional[int]): @property def kafka_topic_record_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.kafka_topic_record_count - ) + return None if self.attributes is None else self.attributes.kafka_topic_record_count @kafka_topic_record_count.setter def kafka_topic_record_count(self, kafka_topic_record_count: Optional[int]): @@ -253,92 +201,56 @@ def kafka_topic_record_count(self, kafka_topic_record_count: Optional[int]): @property def kafka_topic_cleanup_policy(self) -> Optional[KafkaTopicCleanupPolicy]: - return ( - None - if self.attributes is None - else self.attributes.kafka_topic_cleanup_policy - ) + return None if self.attributes is None else self.attributes.kafka_topic_cleanup_policy @kafka_topic_cleanup_policy.setter - def kafka_topic_cleanup_policy( - self, kafka_topic_cleanup_policy: Optional[KafkaTopicCleanupPolicy] - ): + def kafka_topic_cleanup_policy(self, kafka_topic_cleanup_policy: Optional[KafkaTopicCleanupPolicy]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_topic_cleanup_policy = kafka_topic_cleanup_policy @property def kafka_topic_log_cleanup_policy(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.kafka_topic_log_cleanup_policy - ) + return None if self.attributes is None else self.attributes.kafka_topic_log_cleanup_policy @kafka_topic_log_cleanup_policy.setter - def kafka_topic_log_cleanup_policy( - self, kafka_topic_log_cleanup_policy: Optional[str] - ): + def kafka_topic_log_cleanup_policy(self, kafka_topic_log_cleanup_policy: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_topic_log_cleanup_policy = kafka_topic_log_cleanup_policy @property def kafka_consumer_groups(self) -> Optional[List[KafkaConsumerGroup]]: - return ( - None if self.attributes is None else self.attributes.kafka_consumer_groups - ) + return None if self.attributes is None else self.attributes.kafka_consumer_groups @kafka_consumer_groups.setter - def kafka_consumer_groups( - self, kafka_consumer_groups: Optional[List[KafkaConsumerGroup]] - ): + def kafka_consumer_groups(self, kafka_consumer_groups: Optional[List[KafkaConsumerGroup]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_consumer_groups = kafka_consumer_groups class Attributes(Kafka.Attributes): kafka_topic_is_internal: Optional[bool] = Field(default=None, description="") - kafka_topic_compression_type: Optional[KafkaTopicCompressionType] = Field( - default=None, description="" - ) - kafka_topic_replication_factor: Optional[int] = Field( - default=None, description="" - ) + kafka_topic_compression_type: Optional[KafkaTopicCompressionType] = Field(default=None, description="") + kafka_topic_replication_factor: Optional[int] = Field(default=None, description="") kafka_topic_segment_bytes: Optional[int] = Field(default=None, description="") - kafka_topic_retention_time_in_ms: Optional[int] = Field( - default=None, description="" - ) - kafka_topic_partitions_count: Optional[int] = Field( - default=None, description="" - ) + kafka_topic_retention_time_in_ms: Optional[int] = Field(default=None, description="") + kafka_topic_partitions_count: Optional[int] = Field(default=None, description="") kafka_topic_size_in_bytes: Optional[int] = Field(default=None, description="") kafka_topic_record_count: Optional[int] = Field(default=None, description="") - kafka_topic_cleanup_policy: Optional[KafkaTopicCleanupPolicy] = Field( - default=None, description="" - ) - kafka_topic_log_cleanup_policy: Optional[str] = Field( - default=None, description="" - ) - kafka_consumer_groups: Optional[List[KafkaConsumerGroup]] = Field( - default=None, description="" - ) # relationship + kafka_topic_cleanup_policy: Optional[KafkaTopicCleanupPolicy] = Field(default=None, description="") + kafka_topic_log_cleanup_policy: Optional[str] = Field(default=None, description="") + kafka_consumer_groups: Optional[List[KafkaConsumerGroup]] = Field(default=None, description="") # relationship @classmethod @init_guid - def creator( - cls, *, name: str, connection_qualified_name: str - ) -> KafkaTopic.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + def creator(cls, *, name: str, connection_qualified_name: str) -> KafkaTopic.Attributes: + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return KafkaTopic.Attributes( name=name, qualified_name=f"{connection_qualified_name}/topic/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: KafkaTopic.Attributes = Field( diff --git a/pyatlan/model/assets/looker_dashboard.py b/pyatlan/model/assets/looker_dashboard.py index 16b94b157..651f2c8f7 100644 --- a/pyatlan/model/assets/looker_dashboard.py +++ b/pyatlan/model/assets/looker_dashboard.py @@ -34,39 +34,27 @@ def __setattr__(self, name, value): """ Name of the parent folder in Looker that contains this dashboard. """ - SOURCE_USER_ID: ClassVar[NumericField] = NumericField( - "sourceUserId", "sourceUserId" - ) + SOURCE_USER_ID: ClassVar[NumericField] = NumericField("sourceUserId", "sourceUserId") """ Identifier of the user who created this dashboard, from Looker. """ - SOURCE_VIEW_COUNT: ClassVar[NumericField] = NumericField( - "sourceViewCount", "sourceViewCount" - ) + SOURCE_VIEW_COUNT: ClassVar[NumericField] = NumericField("sourceViewCount", "sourceViewCount") """ Number of times the dashboard has been viewed through the Looker web UI. """ - SOURCE_METADATA_ID: ClassVar[NumericField] = NumericField( - "sourceMetadataId", "sourceMetadataId" - ) + SOURCE_METADATA_ID: ClassVar[NumericField] = NumericField("sourceMetadataId", "sourceMetadataId") """ Identifier of the dashboard's content metadata, from Looker. """ - SOURCELAST_UPDATER_ID: ClassVar[NumericField] = NumericField( - "sourcelastUpdaterId", "sourcelastUpdaterId" - ) + SOURCELAST_UPDATER_ID: ClassVar[NumericField] = NumericField("sourcelastUpdaterId", "sourcelastUpdaterId") """ Identifier of the user who last updated the dashboard, from Looker. """ - SOURCE_LAST_ACCESSED_AT: ClassVar[NumericField] = NumericField( - "sourceLastAccessedAt", "sourceLastAccessedAt" - ) + SOURCE_LAST_ACCESSED_AT: ClassVar[NumericField] = NumericField("sourceLastAccessedAt", "sourceLastAccessedAt") """ Timestamp (epoch) when the dashboard was last accessed by a user, in milliseconds. """ - SOURCE_LAST_VIEWED_AT: ClassVar[NumericField] = NumericField( - "sourceLastViewedAt", "sourceLastViewedAt" - ) + SOURCE_LAST_VIEWED_AT: ClassVar[NumericField] = NumericField("sourceLastViewedAt", "sourceLastViewedAt") """ Timestamp (epoch) when the dashboard was last viewed by a user. """ @@ -144,9 +132,7 @@ def source_metadata_id(self, source_metadata_id: Optional[int]): @property def sourcelast_updater_id(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.sourcelast_updater_id - ) + return None if self.attributes is None else self.attributes.sourcelast_updater_id @sourcelast_updater_id.setter def sourcelast_updater_id(self, sourcelast_updater_id: Optional[int]): @@ -156,9 +142,7 @@ def sourcelast_updater_id(self, sourcelast_updater_id: Optional[int]): @property def source_last_accessed_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.source_last_accessed_at - ) + return None if self.attributes is None else self.attributes.source_last_accessed_at @source_last_accessed_at.setter def source_last_accessed_at(self, source_last_accessed_at: Optional[datetime]): @@ -168,9 +152,7 @@ def source_last_accessed_at(self, source_last_accessed_at: Optional[datetime]): @property def source_last_viewed_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.source_last_viewed_at - ) + return None if self.attributes is None else self.attributes.source_last_viewed_at @source_last_viewed_at.setter def source_last_viewed_at(self, source_last_viewed_at: Optional[datetime]): @@ -224,22 +206,12 @@ class Attributes(Looker.Attributes): source_view_count: Optional[int] = Field(default=None, description="") source_metadata_id: Optional[int] = Field(default=None, description="") sourcelast_updater_id: Optional[int] = Field(default=None, description="") - source_last_accessed_at: Optional[datetime] = Field( - default=None, description="" - ) + source_last_accessed_at: Optional[datetime] = Field(default=None, description="") source_last_viewed_at: Optional[datetime] = Field(default=None, description="") - tiles: Optional[List[LookerTile]] = Field( - default=None, description="" - ) # relationship - looks: Optional[List[LookerLook]] = Field( - default=None, description="" - ) # relationship - folder: Optional[LookerFolder] = Field( - default=None, description="" - ) # relationship - fields: Optional[List[LookerField]] = Field( - default=None, description="" - ) # relationship + tiles: Optional[List[LookerTile]] = Field(default=None, description="") # relationship + looks: Optional[List[LookerLook]] = Field(default=None, description="") # relationship + folder: Optional[LookerFolder] = Field(default=None, description="") # relationship + fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship attributes: LookerDashboard.Attributes = Field( default_factory=lambda: LookerDashboard.Attributes(), diff --git a/pyatlan/model/assets/looker_explore.py b/pyatlan/model/assets/looker_explore.py index 9f7ef5344..63ff4d219 100644 --- a/pyatlan/model/assets/looker_explore.py +++ b/pyatlan/model/assets/looker_explore.py @@ -37,15 +37,11 @@ def __setattr__(self, name, value): """ Name of the parent model of this Explore. """ - SOURCE_CONNECTION_NAME: ClassVar[TextField] = TextField( - "sourceConnectionName", "sourceConnectionName" - ) + SOURCE_CONNECTION_NAME: ClassVar[TextField] = TextField("sourceConnectionName", "sourceConnectionName") """ Connection name for the Explore, from Looker. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "viewName", "viewName.keyword", "viewName" - ) + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") """ Name of the view for the Explore. """ @@ -100,9 +96,7 @@ def model_name(self, model_name: Optional[str]): @property def source_connection_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.source_connection_name - ) + return None if self.attributes is None else self.attributes.source_connection_name @source_connection_name.setter def source_connection_name(self, source_connection_name: Optional[str]): @@ -166,15 +160,9 @@ class Attributes(Looker.Attributes): source_connection_name: Optional[str] = Field(default=None, description="") view_name: Optional[str] = Field(default=None, description="") sql_table_name: Optional[str] = Field(default=None, description="") - project: Optional[LookerProject] = Field( - default=None, description="" - ) # relationship - model: Optional[LookerModel] = Field( - default=None, description="" - ) # relationship - fields: Optional[List[LookerField]] = Field( - default=None, description="" - ) # relationship + project: Optional[LookerProject] = Field(default=None, description="") # relationship + model: Optional[LookerModel] = Field(default=None, description="") # relationship + fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship attributes: LookerExplore.Attributes = Field( default_factory=lambda: LookerExplore.Attributes(), diff --git a/pyatlan/model/assets/looker_field.py b/pyatlan/model/assets/looker_field.py index f1a8c447a..ca6c7ed70 100644 --- a/pyatlan/model/assets/looker_field.py +++ b/pyatlan/model/assets/looker_field.py @@ -84,27 +84,19 @@ def __setattr__(self, name, value): """ Name of the model in which this field exists. """ - SOURCE_DEFINITION: ClassVar[TextField] = TextField( - "sourceDefinition", "sourceDefinition" - ) + SOURCE_DEFINITION: ClassVar[TextField] = TextField("sourceDefinition", "sourceDefinition") """ Deprecated. """ - LOOKER_FIELD_DATA_TYPE: ClassVar[KeywordField] = KeywordField( - "lookerFieldDataType", "lookerFieldDataType" - ) + LOOKER_FIELD_DATA_TYPE: ClassVar[KeywordField] = KeywordField("lookerFieldDataType", "lookerFieldDataType") """ Deprecated. """ - LOOKER_TIMES_USED: ClassVar[NumericField] = NumericField( - "lookerTimesUsed", "lookerTimesUsed" - ) + LOOKER_TIMES_USED: ClassVar[NumericField] = NumericField("lookerTimesUsed", "lookerTimesUsed") """ Deprecated. """ - LOOKER_FIELD_IS_REFINED: ClassVar[BooleanField] = BooleanField( - "lookerFieldIsRefined", "lookerFieldIsRefined" - ) + LOOKER_FIELD_IS_REFINED: ClassVar[BooleanField] = BooleanField("lookerFieldIsRefined", "lookerFieldIsRefined") """ Whether the looker field asset is coming from a refinement """ @@ -185,27 +177,17 @@ def project_name(self, project_name: Optional[str]): @property def looker_explore_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.looker_explore_qualified_name - ) + return None if self.attributes is None else self.attributes.looker_explore_qualified_name @looker_explore_qualified_name.setter - def looker_explore_qualified_name( - self, looker_explore_qualified_name: Optional[str] - ): + def looker_explore_qualified_name(self, looker_explore_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.looker_explore_qualified_name = looker_explore_qualified_name @property def looker_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.looker_view_qualified_name - ) + return None if self.attributes is None else self.attributes.looker_view_qualified_name @looker_view_qualified_name.setter def looker_view_qualified_name(self, looker_view_qualified_name: Optional[str]): @@ -215,11 +197,7 @@ def looker_view_qualified_name(self, looker_view_qualified_name: Optional[str]): @property def looker_tile_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.looker_tile_qualified_name - ) + return None if self.attributes is None else self.attributes.looker_tile_qualified_name @looker_tile_qualified_name.setter def looker_tile_qualified_name(self, looker_tile_qualified_name: Optional[str]): @@ -229,11 +207,7 @@ def looker_tile_qualified_name(self, looker_tile_qualified_name: Optional[str]): @property def looker_look_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.looker_look_qualified_name - ) + return None if self.attributes is None else self.attributes.looker_look_qualified_name @looker_look_qualified_name.setter def looker_look_qualified_name(self, looker_look_qualified_name: Optional[str]): @@ -243,21 +217,13 @@ def looker_look_qualified_name(self, looker_look_qualified_name: Optional[str]): @property def looker_dashboard_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.looker_dashboard_qualified_name - ) + return None if self.attributes is None else self.attributes.looker_dashboard_qualified_name @looker_dashboard_qualified_name.setter - def looker_dashboard_qualified_name( - self, looker_dashboard_qualified_name: Optional[str] - ): + def looker_dashboard_qualified_name(self, looker_dashboard_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.looker_dashboard_qualified_name = ( - looker_dashboard_qualified_name - ) + self.attributes.looker_dashboard_qualified_name = looker_dashboard_qualified_name @property def model_name(self) -> Optional[str]: @@ -281,9 +247,7 @@ def source_definition(self, source_definition: Optional[str]): @property def looker_field_data_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.looker_field_data_type - ) + return None if self.attributes is None else self.attributes.looker_field_data_type @looker_field_data_type.setter def looker_field_data_type(self, looker_field_data_type: Optional[str]): @@ -303,9 +267,7 @@ def looker_times_used(self, looker_times_used: Optional[int]): @property def looker_field_is_refined(self) -> Optional[bool]: - return ( - None if self.attributes is None else self.attributes.looker_field_is_refined - ) + return None if self.attributes is None else self.attributes.looker_field_is_refined @looker_field_is_refined.setter def looker_field_is_refined(self, looker_field_is_refined: Optional[bool]): @@ -315,39 +277,23 @@ def looker_field_is_refined(self, looker_field_is_refined: Optional[bool]): @property def looker_field_refinement_file_path(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.looker_field_refinement_file_path - ) + return None if self.attributes is None else self.attributes.looker_field_refinement_file_path @looker_field_refinement_file_path.setter - def looker_field_refinement_file_path( - self, looker_field_refinement_file_path: Optional[str] - ): + def looker_field_refinement_file_path(self, looker_field_refinement_file_path: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.looker_field_refinement_file_path = ( - looker_field_refinement_file_path - ) + self.attributes.looker_field_refinement_file_path = looker_field_refinement_file_path @property def looker_field_refinement_line_number(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.looker_field_refinement_line_number - ) + return None if self.attributes is None else self.attributes.looker_field_refinement_line_number @looker_field_refinement_line_number.setter - def looker_field_refinement_line_number( - self, looker_field_refinement_line_number: Optional[str] - ): + def looker_field_refinement_line_number(self, looker_field_refinement_line_number: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.looker_field_refinement_line_number = ( - looker_field_refinement_line_number - ) + self.attributes.looker_field_refinement_line_number = looker_field_refinement_line_number @property def project(self) -> Optional[LookerProject]: @@ -421,40 +367,24 @@ def look(self, look: Optional[LookerLook]): class Attributes(Looker.Attributes): project_name: Optional[str] = Field(default=None, description="") - looker_explore_qualified_name: Optional[str] = Field( - default=None, description="" - ) + looker_explore_qualified_name: Optional[str] = Field(default=None, description="") looker_view_qualified_name: Optional[str] = Field(default=None, description="") looker_tile_qualified_name: Optional[str] = Field(default=None, description="") looker_look_qualified_name: Optional[str] = Field(default=None, description="") - looker_dashboard_qualified_name: Optional[str] = Field( - default=None, description="" - ) + looker_dashboard_qualified_name: Optional[str] = Field(default=None, description="") model_name: Optional[str] = Field(default=None, description="") source_definition: Optional[str] = Field(default=None, description="") looker_field_data_type: Optional[str] = Field(default=None, description="") looker_times_used: Optional[int] = Field(default=None, description="") looker_field_is_refined: Optional[bool] = Field(default=None, description="") - looker_field_refinement_file_path: Optional[str] = Field( - default=None, description="" - ) - looker_field_refinement_line_number: Optional[str] = Field( - default=None, description="" - ) - project: Optional[LookerProject] = Field( - default=None, description="" - ) # relationship + looker_field_refinement_file_path: Optional[str] = Field(default=None, description="") + looker_field_refinement_line_number: Optional[str] = Field(default=None, description="") + project: Optional[LookerProject] = Field(default=None, description="") # relationship view: Optional[LookerView] = Field(default=None, description="") # relationship tile: Optional[LookerTile] = Field(default=None, description="") # relationship - model: Optional[LookerModel] = Field( - default=None, description="" - ) # relationship - dashboard: Optional[LookerDashboard] = Field( - default=None, description="" - ) # relationship - explore: Optional[LookerExplore] = Field( - default=None, description="" - ) # relationship + model: Optional[LookerModel] = Field(default=None, description="") # relationship + dashboard: Optional[LookerDashboard] = Field(default=None, description="") # relationship + explore: Optional[LookerExplore] = Field(default=None, description="") # relationship look: Optional[LookerLook] = Field(default=None, description="") # relationship attributes: LookerField.Attributes = Field( diff --git a/pyatlan/model/assets/looker_folder.py b/pyatlan/model/assets/looker_folder.py index e3eb20153..f18d38cf8 100644 --- a/pyatlan/model/assets/looker_folder.py +++ b/pyatlan/model/assets/looker_folder.py @@ -35,21 +35,15 @@ def __setattr__(self, name, value): """ Identifier for the folder's content metadata in Looker. """ - SOURCE_CREATOR_ID: ClassVar[NumericField] = NumericField( - "sourceCreatorId", "sourceCreatorId" - ) + SOURCE_CREATOR_ID: ClassVar[NumericField] = NumericField("sourceCreatorId", "sourceCreatorId") """ Identifier of the user who created the folder, from Looker. """ - SOURCE_CHILD_COUNT: ClassVar[NumericField] = NumericField( - "sourceChildCount", "sourceChildCount" - ) + SOURCE_CHILD_COUNT: ClassVar[NumericField] = NumericField("sourceChildCount", "sourceChildCount") """ Number of subfolders in this folder. """ - SOURCE_PARENT_ID: ClassVar[NumericField] = NumericField( - "sourceParentID", "sourceParentID" - ) + SOURCE_PARENT_ID: ClassVar[NumericField] = NumericField("sourceParentID", "sourceParentID") """ Identifier of the parent folder of this folder, from Looker. """ @@ -84,11 +78,7 @@ def __setattr__(self, name, value): @property def source_content_metadata_id(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.source_content_metadata_id - ) + return None if self.attributes is None else self.attributes.source_content_metadata_id @source_content_metadata_id.setter def source_content_metadata_id(self, source_content_metadata_id: Optional[int]): @@ -171,18 +161,10 @@ class Attributes(Looker.Attributes): source_creator_id: Optional[int] = Field(default=None, description="") source_child_count: Optional[int] = Field(default=None, description="") source_parent_i_d: Optional[int] = Field(default=None, description="") - looker_sub_folders: Optional[List[LookerFolder]] = Field( - default=None, description="" - ) # relationship - dashboards: Optional[List[LookerDashboard]] = Field( - default=None, description="" - ) # relationship - looks: Optional[List[LookerLook]] = Field( - default=None, description="" - ) # relationship - looker_parent_folder: Optional[LookerFolder] = Field( - default=None, description="" - ) # relationship + looker_sub_folders: Optional[List[LookerFolder]] = Field(default=None, description="") # relationship + dashboards: Optional[List[LookerDashboard]] = Field(default=None, description="") # relationship + looks: Optional[List[LookerLook]] = Field(default=None, description="") # relationship + looker_parent_folder: Optional[LookerFolder] = Field(default=None, description="") # relationship attributes: LookerFolder.Attributes = Field( default_factory=lambda: LookerFolder.Attributes(), diff --git a/pyatlan/model/assets/looker_look.py b/pyatlan/model/assets/looker_look.py index 65052e789..634ea9993 100644 --- a/pyatlan/model/assets/looker_look.py +++ b/pyatlan/model/assets/looker_look.py @@ -34,33 +34,23 @@ def __setattr__(self, name, value): """ Name of the folder in which the Look is organized. """ - SOURCE_USER_ID: ClassVar[NumericField] = NumericField( - "sourceUserId", "sourceUserId" - ) + SOURCE_USER_ID: ClassVar[NumericField] = NumericField("sourceUserId", "sourceUserId") """ Identifier of the user who created the Look, from Looker. """ - SOURCE_VIEW_COUNT: ClassVar[NumericField] = NumericField( - "sourceViewCount", "sourceViewCount" - ) + SOURCE_VIEW_COUNT: ClassVar[NumericField] = NumericField("sourceViewCount", "sourceViewCount") """ Number of times the look has been viewed in the Looker web UI. """ - SOURCELAST_UPDATER_ID: ClassVar[NumericField] = NumericField( - "sourcelastUpdaterId", "sourcelastUpdaterId" - ) + SOURCELAST_UPDATER_ID: ClassVar[NumericField] = NumericField("sourcelastUpdaterId", "sourcelastUpdaterId") """ Identifier of the user that last updated the Look, from Looker. """ - SOURCE_LAST_ACCESSED_AT: ClassVar[NumericField] = NumericField( - "sourceLastAccessedAt", "sourceLastAccessedAt" - ) + SOURCE_LAST_ACCESSED_AT: ClassVar[NumericField] = NumericField("sourceLastAccessedAt", "sourceLastAccessedAt") """ Time (epoch) when the Look was last accessed by a user, in milliseconds. """ - SOURCE_LAST_VIEWED_AT: ClassVar[NumericField] = NumericField( - "sourceLastViewedAt", "sourceLastViewedAt" - ) + SOURCE_LAST_VIEWED_AT: ClassVar[NumericField] = NumericField("sourceLastViewedAt", "sourceLastViewedAt") """ Time (epoch) when the Look was last viewed by a user, in milliseconds. """ @@ -70,9 +60,7 @@ def __setattr__(self, name, value): """ Identifier of the Look's content metadata, from Looker. """ - SOURCE_QUERY_ID: ClassVar[NumericField] = NumericField( - "sourceQueryId", "sourceQueryId" - ) + SOURCE_QUERY_ID: ClassVar[NumericField] = NumericField("sourceQueryId", "sourceQueryId") """ Identifier of the query for the Look, from Looker. """ @@ -156,9 +144,7 @@ def source_view_count(self, source_view_count: Optional[int]): @property def sourcelast_updater_id(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.sourcelast_updater_id - ) + return None if self.attributes is None else self.attributes.sourcelast_updater_id @sourcelast_updater_id.setter def sourcelast_updater_id(self, sourcelast_updater_id: Optional[int]): @@ -168,9 +154,7 @@ def sourcelast_updater_id(self, sourcelast_updater_id: Optional[int]): @property def source_last_accessed_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.source_last_accessed_at - ) + return None if self.attributes is None else self.attributes.source_last_accessed_at @source_last_accessed_at.setter def source_last_accessed_at(self, source_last_accessed_at: Optional[datetime]): @@ -180,9 +164,7 @@ def source_last_accessed_at(self, source_last_accessed_at: Optional[datetime]): @property def source_last_viewed_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.source_last_viewed_at - ) + return None if self.attributes is None else self.attributes.source_last_viewed_at @source_last_viewed_at.setter def source_last_viewed_at(self, source_last_viewed_at: Optional[datetime]): @@ -192,11 +174,7 @@ def source_last_viewed_at(self, source_last_viewed_at: Optional[datetime]): @property def source_content_metadata_id(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.source_content_metadata_id - ) + return None if self.attributes is None else self.attributes.source_content_metadata_id @source_content_metadata_id.setter def source_content_metadata_id(self, source_content_metadata_id: Optional[int]): @@ -289,29 +267,17 @@ class Attributes(Looker.Attributes): source_user_id: Optional[int] = Field(default=None, description="") source_view_count: Optional[int] = Field(default=None, description="") sourcelast_updater_id: Optional[int] = Field(default=None, description="") - source_last_accessed_at: Optional[datetime] = Field( - default=None, description="" - ) + source_last_accessed_at: Optional[datetime] = Field(default=None, description="") source_last_viewed_at: Optional[datetime] = Field(default=None, description="") source_content_metadata_id: Optional[int] = Field(default=None, description="") source_query_id: Optional[int] = Field(default=None, description="") model_name: Optional[str] = Field(default=None, description="") tile: Optional[LookerTile] = Field(default=None, description="") # relationship - model: Optional[LookerModel] = Field( - default=None, description="" - ) # relationship - dashboard: Optional[LookerDashboard] = Field( - default=None, description="" - ) # relationship - query: Optional[LookerQuery] = Field( - default=None, description="" - ) # relationship - folder: Optional[LookerFolder] = Field( - default=None, description="" - ) # relationship - fields: Optional[List[LookerField]] = Field( - default=None, description="" - ) # relationship + model: Optional[LookerModel] = Field(default=None, description="") # relationship + dashboard: Optional[LookerDashboard] = Field(default=None, description="") # relationship + query: Optional[LookerQuery] = Field(default=None, description="") # relationship + folder: Optional[LookerFolder] = Field(default=None, description="") # relationship + fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship attributes: LookerLook.Attributes = Field( default_factory=lambda: LookerLook.Attributes(), diff --git a/pyatlan/model/assets/looker_model.py b/pyatlan/model/assets/looker_model.py index 0b3b7b4c1..62d196dcc 100644 --- a/pyatlan/model/assets/looker_model.py +++ b/pyatlan/model/assets/looker_model.py @@ -126,19 +126,11 @@ def fields(self, fields: Optional[List[LookerField]]): class Attributes(Looker.Attributes): project_name: Optional[str] = Field(default=None, description="") - explores: Optional[List[LookerExplore]] = Field( - default=None, description="" - ) # relationship - project: Optional[LookerProject] = Field( - default=None, description="" - ) # relationship + explores: Optional[List[LookerExplore]] = Field(default=None, description="") # relationship + project: Optional[LookerProject] = Field(default=None, description="") # relationship look: Optional[LookerLook] = Field(default=None, description="") # relationship - queries: Optional[List[LookerQuery]] = Field( - default=None, description="" - ) # relationship - fields: Optional[List[LookerField]] = Field( - default=None, description="" - ) # relationship + queries: Optional[List[LookerQuery]] = Field(default=None, description="") # relationship + fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship attributes: LookerModel.Attributes = Field( default_factory=lambda: LookerModel.Attributes(), diff --git a/pyatlan/model/assets/looker_project.py b/pyatlan/model/assets/looker_project.py index 6c3bc635b..26af1886f 100644 --- a/pyatlan/model/assets/looker_project.py +++ b/pyatlan/model/assets/looker_project.py @@ -41,15 +41,11 @@ def __setattr__(self, name, value): """ TBC """ - LOOKER_PARENT_PROJECTS: ClassVar[RelationField] = RelationField( - "lookerParentProjects" - ) + LOOKER_PARENT_PROJECTS: ClassVar[RelationField] = RelationField("lookerParentProjects") """ TBC """ - LOOKER_CHILD_PROJECTS: ClassVar[RelationField] = RelationField( - "lookerChildProjects" - ) + LOOKER_CHILD_PROJECTS: ClassVar[RelationField] = RelationField("lookerChildProjects") """ TBC """ @@ -99,28 +95,20 @@ def models(self, models: Optional[List[LookerModel]]): @property def looker_parent_projects(self) -> Optional[List[LookerProject]]: - return ( - None if self.attributes is None else self.attributes.looker_parent_projects - ) + return None if self.attributes is None else self.attributes.looker_parent_projects @looker_parent_projects.setter - def looker_parent_projects( - self, looker_parent_projects: Optional[List[LookerProject]] - ): + def looker_parent_projects(self, looker_parent_projects: Optional[List[LookerProject]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.looker_parent_projects = looker_parent_projects @property def looker_child_projects(self) -> Optional[List[LookerProject]]: - return ( - None if self.attributes is None else self.attributes.looker_child_projects - ) + return None if self.attributes is None else self.attributes.looker_child_projects @looker_child_projects.setter - def looker_child_projects( - self, looker_child_projects: Optional[List[LookerProject]] - ): + def looker_child_projects(self, looker_child_projects: Optional[List[LookerProject]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.looker_child_projects = looker_child_projects @@ -136,24 +124,12 @@ def fields(self, fields: Optional[List[LookerField]]): self.attributes.fields = fields class Attributes(Looker.Attributes): - explores: Optional[List[LookerExplore]] = Field( - default=None, description="" - ) # relationship - views: Optional[List[LookerView]] = Field( - default=None, description="" - ) # relationship - models: Optional[List[LookerModel]] = Field( - default=None, description="" - ) # relationship - looker_parent_projects: Optional[List[LookerProject]] = Field( - default=None, description="" - ) # relationship - looker_child_projects: Optional[List[LookerProject]] = Field( - default=None, description="" - ) # relationship - fields: Optional[List[LookerField]] = Field( - default=None, description="" - ) # relationship + explores: Optional[List[LookerExplore]] = Field(default=None, description="") # relationship + views: Optional[List[LookerView]] = Field(default=None, description="") # relationship + models: Optional[List[LookerModel]] = Field(default=None, description="") # relationship + looker_parent_projects: Optional[List[LookerProject]] = Field(default=None, description="") # relationship + looker_child_projects: Optional[List[LookerProject]] = Field(default=None, description="") # relationship + fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship attributes: LookerProject.Attributes = Field( default_factory=lambda: LookerProject.Attributes(), diff --git a/pyatlan/model/assets/looker_query.py b/pyatlan/model/assets/looker_query.py index 3fda73d76..5f4d61b57 100644 --- a/pyatlan/model/assets/looker_query.py +++ b/pyatlan/model/assets/looker_query.py @@ -29,21 +29,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SOURCE_DEFINITION: ClassVar[TextField] = TextField( - "sourceDefinition", "sourceDefinition" - ) + SOURCE_DEFINITION: ClassVar[TextField] = TextField("sourceDefinition", "sourceDefinition") """ Deprecated. """ - SOURCE_DEFINITION_DATABASE: ClassVar[TextField] = TextField( - "sourceDefinitionDatabase", "sourceDefinitionDatabase" - ) + SOURCE_DEFINITION_DATABASE: ClassVar[TextField] = TextField("sourceDefinitionDatabase", "sourceDefinitionDatabase") """ Deprecated. """ - SOURCE_DEFINITION_SCHEMA: ClassVar[TextField] = TextField( - "sourceDefinitionSchema", "sourceDefinitionSchema" - ) + SOURCE_DEFINITION_SCHEMA: ClassVar[TextField] = TextField("sourceDefinitionSchema", "sourceDefinitionSchema") """ Deprecated. """ @@ -87,11 +81,7 @@ def source_definition(self, source_definition: Optional[str]): @property def source_definition_database(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.source_definition_database - ) + return None if self.attributes is None else self.attributes.source_definition_database @source_definition_database.setter def source_definition_database(self, source_definition_database: Optional[str]): @@ -101,11 +91,7 @@ def source_definition_database(self, source_definition_database: Optional[str]): @property def source_definition_schema(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.source_definition_schema - ) + return None if self.attributes is None else self.attributes.source_definition_schema @source_definition_schema.setter def source_definition_schema(self, source_definition_schema: Optional[str]): @@ -158,15 +144,9 @@ class Attributes(Looker.Attributes): source_definition_database: Optional[str] = Field(default=None, description="") source_definition_schema: Optional[str] = Field(default=None, description="") fields: Optional[Set[str]] = Field(default=None, description="") - tiles: Optional[List[LookerTile]] = Field( - default=None, description="" - ) # relationship - looks: Optional[List[LookerLook]] = Field( - default=None, description="" - ) # relationship - model: Optional[LookerModel] = Field( - default=None, description="" - ) # relationship + tiles: Optional[List[LookerTile]] = Field(default=None, description="") # relationship + looks: Optional[List[LookerLook]] = Field(default=None, description="") # relationship + model: Optional[LookerModel] = Field(default=None, description="") # relationship attributes: LookerQuery.Attributes = Field( default_factory=lambda: LookerQuery.Attributes(), diff --git a/pyatlan/model/assets/looker_tile.py b/pyatlan/model/assets/looker_tile.py index 2283a3f28..1a3aca168 100644 --- a/pyatlan/model/assets/looker_tile.py +++ b/pyatlan/model/assets/looker_tile.py @@ -45,9 +45,7 @@ def __setattr__(self, name, value): """ Identifier for the query used to build this tile, from Looker. """ - RESULT_MAKER_ID: ClassVar[NumericField] = NumericField( - "resultMakerID", "resultMakerID" - ) + RESULT_MAKER_ID: ClassVar[NumericField] = NumericField("resultMakerID", "resultMakerID") """ Identifier of the ResultMarkerLookup entry, from Looker. """ @@ -209,16 +207,10 @@ class Attributes(Looker.Attributes): result_maker_i_d: Optional[int] = Field(default=None, description="") subtitle_text: Optional[str] = Field(default=None, description="") look_id: Optional[int] = Field(default=None, description="") - dashboard: Optional[LookerDashboard] = Field( - default=None, description="" - ) # relationship - query: Optional[LookerQuery] = Field( - default=None, description="" - ) # relationship + dashboard: Optional[LookerDashboard] = Field(default=None, description="") # relationship + query: Optional[LookerQuery] = Field(default=None, description="") # relationship look: Optional[LookerLook] = Field(default=None, description="") # relationship - fields: Optional[List[LookerField]] = Field( - default=None, description="" - ) # relationship + fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship attributes: LookerTile.Attributes = Field( default_factory=lambda: LookerTile.Attributes(), diff --git a/pyatlan/model/assets/looker_view.py b/pyatlan/model/assets/looker_view.py index cb048ae99..755783b4b 100644 --- a/pyatlan/model/assets/looker_view.py +++ b/pyatlan/model/assets/looker_view.py @@ -33,15 +33,11 @@ def __setattr__(self, name, value): """ Name of the project in which this view exists. """ - LOOKER_VIEW_FILE_PATH: ClassVar[TextField] = TextField( - "lookerViewFilePath", "lookerViewFilePath" - ) + LOOKER_VIEW_FILE_PATH: ClassVar[TextField] = TextField("lookerViewFilePath", "lookerViewFilePath") """ File path of this view within the project. """ - LOOKER_VIEW_FILE_NAME: ClassVar[KeywordField] = KeywordField( - "lookerViewFileName", "lookerViewFileName" - ) + LOOKER_VIEW_FILE_NAME: ClassVar[KeywordField] = KeywordField("lookerViewFileName", "lookerViewFileName") """ File name of this view. """ @@ -75,9 +71,7 @@ def project_name(self, project_name: Optional[str]): @property def looker_view_file_path(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.looker_view_file_path - ) + return None if self.attributes is None else self.attributes.looker_view_file_path @looker_view_file_path.setter def looker_view_file_path(self, looker_view_file_path: Optional[str]): @@ -87,9 +81,7 @@ def looker_view_file_path(self, looker_view_file_path: Optional[str]): @property def looker_view_file_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.looker_view_file_name - ) + return None if self.attributes is None else self.attributes.looker_view_file_name @looker_view_file_name.setter def looker_view_file_name(self, looker_view_file_name: Optional[str]): @@ -121,12 +113,8 @@ class Attributes(Looker.Attributes): project_name: Optional[str] = Field(default=None, description="") looker_view_file_path: Optional[str] = Field(default=None, description="") looker_view_file_name: Optional[str] = Field(default=None, description="") - project: Optional[LookerProject] = Field( - default=None, description="" - ) # relationship - fields: Optional[List[LookerField]] = Field( - default=None, description="" - ) # relationship + project: Optional[LookerProject] = Field(default=None, description="") # relationship + fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship attributes: LookerView.Attributes = Field( default_factory=lambda: LookerView.Attributes(), diff --git a/pyatlan/model/assets/metabase.py b/pyatlan/model/assets/metabase.py index 0c203c79f..2d3408741 100644 --- a/pyatlan/model/assets/metabase.py +++ b/pyatlan/model/assets/metabase.py @@ -53,11 +53,7 @@ def __setattr__(self, name, value): @property def metabase_collection_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.metabase_collection_name - ) + return None if self.attributes is None else self.attributes.metabase_collection_name @metabase_collection_name.setter def metabase_collection_name(self, metabase_collection_name: Optional[str]): @@ -67,27 +63,17 @@ def metabase_collection_name(self, metabase_collection_name: Optional[str]): @property def metabase_collection_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.metabase_collection_qualified_name - ) + return None if self.attributes is None else self.attributes.metabase_collection_qualified_name @metabase_collection_qualified_name.setter - def metabase_collection_qualified_name( - self, metabase_collection_qualified_name: Optional[str] - ): + def metabase_collection_qualified_name(self, metabase_collection_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.metabase_collection_qualified_name = ( - metabase_collection_qualified_name - ) + self.attributes.metabase_collection_qualified_name = metabase_collection_qualified_name class Attributes(BI.Attributes): metabase_collection_name: Optional[str] = Field(default=None, description="") - metabase_collection_qualified_name: Optional[str] = Field( - default=None, description="" - ) + metabase_collection_qualified_name: Optional[str] = Field(default=None, description="") attributes: Metabase.Attributes = Field( default_factory=lambda: Metabase.Attributes(), diff --git a/pyatlan/model/assets/metabase_collection.py b/pyatlan/model/assets/metabase_collection.py index c8aa12d0f..f0104c532 100644 --- a/pyatlan/model/assets/metabase_collection.py +++ b/pyatlan/model/assets/metabase_collection.py @@ -34,15 +34,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - METABASE_SLUG: ClassVar[KeywordTextField] = KeywordTextField( - "metabaseSlug", "metabaseSlug", "metabaseSlug.text" - ) + METABASE_SLUG: ClassVar[KeywordTextField] = KeywordTextField("metabaseSlug", "metabaseSlug", "metabaseSlug.text") """ """ - METABASE_COLOR: ClassVar[KeywordField] = KeywordField( - "metabaseColor", "metabaseColor" - ) + METABASE_COLOR: ClassVar[KeywordField] = KeywordField("metabaseColor", "metabaseColor") """ """ @@ -109,30 +105,20 @@ def metabase_namespace(self, metabase_namespace: Optional[str]): @property def metabase_is_personal_collection(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.metabase_is_personal_collection - ) + return None if self.attributes is None else self.attributes.metabase_is_personal_collection @metabase_is_personal_collection.setter - def metabase_is_personal_collection( - self, metabase_is_personal_collection: Optional[bool] - ): + def metabase_is_personal_collection(self, metabase_is_personal_collection: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.metabase_is_personal_collection = ( - metabase_is_personal_collection - ) + self.attributes.metabase_is_personal_collection = metabase_is_personal_collection @property def metabase_dashboards(self) -> Optional[List[MetabaseDashboard]]: return None if self.attributes is None else self.attributes.metabase_dashboards @metabase_dashboards.setter - def metabase_dashboards( - self, metabase_dashboards: Optional[List[MetabaseDashboard]] - ): + def metabase_dashboards(self, metabase_dashboards: Optional[List[MetabaseDashboard]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.metabase_dashboards = metabase_dashboards @@ -151,15 +137,9 @@ class Attributes(Metabase.Attributes): metabase_slug: Optional[str] = Field(default=None, description="") metabase_color: Optional[str] = Field(default=None, description="") metabase_namespace: Optional[str] = Field(default=None, description="") - metabase_is_personal_collection: Optional[bool] = Field( - default=None, description="" - ) - metabase_dashboards: Optional[List[MetabaseDashboard]] = Field( - default=None, description="" - ) # relationship - metabase_questions: Optional[List[MetabaseQuestion]] = Field( - default=None, description="" - ) # relationship + metabase_is_personal_collection: Optional[bool] = Field(default=None, description="") + metabase_dashboards: Optional[List[MetabaseDashboard]] = Field(default=None, description="") # relationship + metabase_questions: Optional[List[MetabaseQuestion]] = Field(default=None, description="") # relationship attributes: MetabaseCollection.Attributes = Field( default_factory=lambda: MetabaseCollection.Attributes(), diff --git a/pyatlan/model/assets/metabase_dashboard.py b/pyatlan/model/assets/metabase_dashboard.py index d1080bab0..ac25372ab 100644 --- a/pyatlan/model/assets/metabase_dashboard.py +++ b/pyatlan/model/assets/metabase_dashboard.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - METABASE_QUESTION_COUNT: ClassVar[NumericField] = NumericField( - "metabaseQuestionCount", "metabaseQuestionCount" - ) + METABASE_QUESTION_COUNT: ClassVar[NumericField] = NumericField("metabaseQuestionCount", "metabaseQuestionCount") """ """ @@ -53,9 +51,7 @@ def __setattr__(self, name, value): @property def metabase_question_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.metabase_question_count - ) + return None if self.attributes is None else self.attributes.metabase_question_count @metabase_question_count.setter def metabase_question_count(self, metabase_question_count: Optional[int]): @@ -85,12 +81,8 @@ def metabase_collection(self, metabase_collection: Optional[MetabaseCollection]) class Attributes(Metabase.Attributes): metabase_question_count: Optional[int] = Field(default=None, description="") - metabase_questions: Optional[List[MetabaseQuestion]] = Field( - default=None, description="" - ) # relationship - metabase_collection: Optional[MetabaseCollection] = Field( - default=None, description="" - ) # relationship + metabase_questions: Optional[List[MetabaseQuestion]] = Field(default=None, description="") # relationship + metabase_collection: Optional[MetabaseCollection] = Field(default=None, description="") # relationship attributes: MetabaseDashboard.Attributes = Field( default_factory=lambda: MetabaseDashboard.Attributes(), diff --git a/pyatlan/model/assets/metabase_question.py b/pyatlan/model/assets/metabase_question.py index 61ed21f03..0b1ae6be6 100644 --- a/pyatlan/model/assets/metabase_question.py +++ b/pyatlan/model/assets/metabase_question.py @@ -33,9 +33,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - METABASE_DASHBOARD_COUNT: ClassVar[NumericField] = NumericField( - "metabaseDashboardCount", "metabaseDashboardCount" - ) + METABASE_DASHBOARD_COUNT: ClassVar[NumericField] = NumericField("metabaseDashboardCount", "metabaseDashboardCount") """ """ @@ -71,11 +69,7 @@ def __setattr__(self, name, value): @property def metabase_dashboard_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.metabase_dashboard_count - ) + return None if self.attributes is None else self.attributes.metabase_dashboard_count @metabase_dashboard_count.setter def metabase_dashboard_count(self, metabase_dashboard_count: Optional[int]): @@ -108,9 +102,7 @@ def metabase_dashboards(self) -> Optional[List[MetabaseDashboard]]: return None if self.attributes is None else self.attributes.metabase_dashboards @metabase_dashboards.setter - def metabase_dashboards( - self, metabase_dashboards: Optional[List[MetabaseDashboard]] - ): + def metabase_dashboards(self, metabase_dashboards: Optional[List[MetabaseDashboard]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.metabase_dashboards = metabase_dashboards @@ -129,12 +121,8 @@ class Attributes(Metabase.Attributes): metabase_dashboard_count: Optional[int] = Field(default=None, description="") metabase_query_type: Optional[str] = Field(default=None, description="") metabase_query: Optional[str] = Field(default=None, description="") - metabase_dashboards: Optional[List[MetabaseDashboard]] = Field( - default=None, description="" - ) # relationship - metabase_collection: Optional[MetabaseCollection] = Field( - default=None, description="" - ) # relationship + metabase_dashboards: Optional[List[MetabaseDashboard]] = Field(default=None, description="") # relationship + metabase_collection: Optional[MetabaseCollection] = Field(default=None, description="") # relationship attributes: MetabaseQuestion.Attributes = Field( default_factory=lambda: MetabaseQuestion.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy.py b/pyatlan/model/assets/micro_strategy.py index 77e6a86ab..4b61c22a7 100644 --- a/pyatlan/model/assets/micro_strategy.py +++ b/pyatlan/model/assets/micro_strategy.py @@ -35,12 +35,10 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MICRO_STRATEGY_PROJECT_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( - KeywordTextField( - "microStrategyProjectQualifiedName", - "microStrategyProjectQualifiedName", - "microStrategyProjectQualifiedName.text", - ) + MICRO_STRATEGY_PROJECT_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "microStrategyProjectQualifiedName", + "microStrategyProjectQualifiedName", + "microStrategyProjectQualifiedName.text", ) """ Unique name of the project in which this asset exists. @@ -69,12 +67,10 @@ def __setattr__(self, name, value): """ Simple names of the cubes related to this asset. """ - MICRO_STRATEGY_REPORT_QUALIFIED_NAMES: ClassVar[KeywordTextField] = ( - KeywordTextField( - "microStrategyReportQualifiedNames", - "microStrategyReportQualifiedNames", - "microStrategyReportQualifiedNames.text", - ) + MICRO_STRATEGY_REPORT_QUALIFIED_NAMES: ClassVar[KeywordTextField] = KeywordTextField( + "microStrategyReportQualifiedNames", + "microStrategyReportQualifiedNames", + "microStrategyReportQualifiedNames.text", ) """ Unique names of the reports related to this asset. @@ -105,9 +101,7 @@ def __setattr__(self, name, value): """ Time (epoch) this asset was certified in MicroStrategy, in milliseconds. """ - MICRO_STRATEGY_LOCATION: ClassVar[KeywordField] = KeywordField( - "microStrategyLocation", "microStrategyLocation" - ) + MICRO_STRATEGY_LOCATION: ClassVar[KeywordField] = KeywordField("microStrategyLocation", "microStrategyLocation") """ Location of this asset in MicroStrategy. """ @@ -127,29 +121,17 @@ def __setattr__(self, name, value): @property def micro_strategy_project_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_project_qualified_name - ) + return None if self.attributes is None else self.attributes.micro_strategy_project_qualified_name @micro_strategy_project_qualified_name.setter - def micro_strategy_project_qualified_name( - self, micro_strategy_project_qualified_name: Optional[str] - ): + def micro_strategy_project_qualified_name(self, micro_strategy_project_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_project_qualified_name = ( - micro_strategy_project_qualified_name - ) + self.attributes.micro_strategy_project_qualified_name = micro_strategy_project_qualified_name @property def micro_strategy_project_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_project_name - ) + return None if self.attributes is None else self.attributes.micro_strategy_project_name @micro_strategy_project_name.setter def micro_strategy_project_name(self, micro_strategy_project_name: Optional[str]): @@ -159,29 +141,17 @@ def micro_strategy_project_name(self, micro_strategy_project_name: Optional[str] @property def micro_strategy_cube_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_cube_qualified_names - ) + return None if self.attributes is None else self.attributes.micro_strategy_cube_qualified_names @micro_strategy_cube_qualified_names.setter - def micro_strategy_cube_qualified_names( - self, micro_strategy_cube_qualified_names: Optional[Set[str]] - ): + def micro_strategy_cube_qualified_names(self, micro_strategy_cube_qualified_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_cube_qualified_names = ( - micro_strategy_cube_qualified_names - ) + self.attributes.micro_strategy_cube_qualified_names = micro_strategy_cube_qualified_names @property def micro_strategy_cube_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_cube_names - ) + return None if self.attributes is None else self.attributes.micro_strategy_cube_names @micro_strategy_cube_names.setter def micro_strategy_cube_names(self, micro_strategy_cube_names: Optional[Set[str]]): @@ -191,45 +161,27 @@ def micro_strategy_cube_names(self, micro_strategy_cube_names: Optional[Set[str] @property def micro_strategy_report_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_report_qualified_names - ) + return None if self.attributes is None else self.attributes.micro_strategy_report_qualified_names @micro_strategy_report_qualified_names.setter - def micro_strategy_report_qualified_names( - self, micro_strategy_report_qualified_names: Optional[Set[str]] - ): + def micro_strategy_report_qualified_names(self, micro_strategy_report_qualified_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_report_qualified_names = ( - micro_strategy_report_qualified_names - ) + self.attributes.micro_strategy_report_qualified_names = micro_strategy_report_qualified_names @property def micro_strategy_report_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_report_names - ) + return None if self.attributes is None else self.attributes.micro_strategy_report_names @micro_strategy_report_names.setter - def micro_strategy_report_names( - self, micro_strategy_report_names: Optional[Set[str]] - ): + def micro_strategy_report_names(self, micro_strategy_report_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_report_names = micro_strategy_report_names @property def micro_strategy_is_certified(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_is_certified - ) + return None if self.attributes is None else self.attributes.micro_strategy_is_certified @micro_strategy_is_certified.setter def micro_strategy_is_certified(self, micro_strategy_is_certified: Optional[bool]): @@ -239,11 +191,7 @@ def micro_strategy_is_certified(self, micro_strategy_is_certified: Optional[bool @property def micro_strategy_certified_by(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_certified_by - ) + return None if self.attributes is None else self.attributes.micro_strategy_certified_by @micro_strategy_certified_by.setter def micro_strategy_certified_by(self, micro_strategy_certified_by: Optional[str]): @@ -253,61 +201,35 @@ def micro_strategy_certified_by(self, micro_strategy_certified_by: Optional[str] @property def micro_strategy_certified_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_certified_at - ) + return None if self.attributes is None else self.attributes.micro_strategy_certified_at @micro_strategy_certified_at.setter - def micro_strategy_certified_at( - self, micro_strategy_certified_at: Optional[datetime] - ): + def micro_strategy_certified_at(self, micro_strategy_certified_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_certified_at = micro_strategy_certified_at @property def micro_strategy_location(self) -> Optional[List[Dict[str, str]]]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_location - ) + return None if self.attributes is None else self.attributes.micro_strategy_location @micro_strategy_location.setter - def micro_strategy_location( - self, micro_strategy_location: Optional[List[Dict[str, str]]] - ): + def micro_strategy_location(self, micro_strategy_location: Optional[List[Dict[str, str]]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_location = micro_strategy_location class Attributes(BI.Attributes): - micro_strategy_project_qualified_name: Optional[str] = Field( - default=None, description="" - ) + micro_strategy_project_qualified_name: Optional[str] = Field(default=None, description="") micro_strategy_project_name: Optional[str] = Field(default=None, description="") - micro_strategy_cube_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) - micro_strategy_cube_names: Optional[Set[str]] = Field( - default=None, description="" - ) - micro_strategy_report_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) - micro_strategy_report_names: Optional[Set[str]] = Field( - default=None, description="" - ) - micro_strategy_is_certified: Optional[bool] = Field( - default=None, description="" - ) + micro_strategy_cube_qualified_names: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_cube_names: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_report_qualified_names: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_report_names: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_is_certified: Optional[bool] = Field(default=None, description="") micro_strategy_certified_by: Optional[str] = Field(default=None, description="") - micro_strategy_certified_at: Optional[datetime] = Field( - default=None, description="" - ) - micro_strategy_location: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) + micro_strategy_certified_at: Optional[datetime] = Field(default=None, description="") + micro_strategy_location: Optional[List[Dict[str, str]]] = Field(default=None, description="") attributes: MicroStrategy.Attributes = Field( default_factory=lambda: MicroStrategy.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy_attribute.py b/pyatlan/model/assets/micro_strategy_attribute.py index 90e5a3f39..500bb72ad 100644 --- a/pyatlan/model/assets/micro_strategy_attribute.py +++ b/pyatlan/model/assets/micro_strategy_attribute.py @@ -36,15 +36,11 @@ def __setattr__(self, name, value): JSON string specifying the attribute's name, description, displayFormat, etc. """ - MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField( - "microStrategyReports" - ) + MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField("microStrategyReports") """ TBC """ - MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField( - "microStrategyMetrics" - ) + MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField("microStrategyMetrics") """ TBC """ @@ -52,9 +48,7 @@ def __setattr__(self, name, value): """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( - "microStrategyProject" - ) + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") """ TBC """ @@ -69,44 +63,30 @@ def __setattr__(self, name, value): @property def micro_strategy_attribute_forms(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_attribute_forms - ) + return None if self.attributes is None else self.attributes.micro_strategy_attribute_forms @micro_strategy_attribute_forms.setter - def micro_strategy_attribute_forms( - self, micro_strategy_attribute_forms: Optional[str] - ): + def micro_strategy_attribute_forms(self, micro_strategy_attribute_forms: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attribute_forms = micro_strategy_attribute_forms @property def micro_strategy_reports(self) -> Optional[List[MicroStrategyReport]]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_reports - ) + return None if self.attributes is None else self.attributes.micro_strategy_reports @micro_strategy_reports.setter - def micro_strategy_reports( - self, micro_strategy_reports: Optional[List[MicroStrategyReport]] - ): + def micro_strategy_reports(self, micro_strategy_reports: Optional[List[MicroStrategyReport]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_reports = micro_strategy_reports @property def micro_strategy_metrics(self) -> Optional[List[MicroStrategyMetric]]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_metrics - ) + return None if self.attributes is None else self.attributes.micro_strategy_metrics @micro_strategy_metrics.setter - def micro_strategy_metrics( - self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]] - ): + def micro_strategy_metrics(self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metrics = micro_strategy_metrics @@ -116,43 +96,31 @@ def micro_strategy_cubes(self) -> Optional[List[MicroStrategyCube]]: return None if self.attributes is None else self.attributes.micro_strategy_cubes @micro_strategy_cubes.setter - def micro_strategy_cubes( - self, micro_strategy_cubes: Optional[List[MicroStrategyCube]] - ): + def micro_strategy_cubes(self, micro_strategy_cubes: Optional[List[MicroStrategyCube]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_cubes = micro_strategy_cubes @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_project - ) + return None if self.attributes is None else self.attributes.micro_strategy_project @micro_strategy_project.setter - def micro_strategy_project( - self, micro_strategy_project: Optional[MicroStrategyProject] - ): + def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project class Attributes(MicroStrategy.Attributes): - micro_strategy_attribute_forms: Optional[str] = Field( - default=None, description="" - ) + micro_strategy_attribute_forms: Optional[str] = Field(default=None, description="") micro_strategy_reports: Optional[List[MicroStrategyReport]] = Field( default=None, description="" ) # relationship micro_strategy_metrics: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field( - default=None, description="" - ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field( - default=None, description="" - ) # relationship + micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field(default=None, description="") # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship attributes: MicroStrategyAttribute.Attributes = Field( default_factory=lambda: MicroStrategyAttribute.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy_cube.py b/pyatlan/model/assets/micro_strategy_cube.py index 9e41827f6..f6230fed3 100644 --- a/pyatlan/model/assets/micro_strategy_cube.py +++ b/pyatlan/model/assets/micro_strategy_cube.py @@ -29,34 +29,24 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MICRO_STRATEGY_CUBE_TYPE: ClassVar[KeywordField] = KeywordField( - "microStrategyCubeType", "microStrategyCubeType" - ) + MICRO_STRATEGY_CUBE_TYPE: ClassVar[KeywordField] = KeywordField("microStrategyCubeType", "microStrategyCubeType") """ Type of cube, for example: OLAP or MTDI. """ - MICRO_STRATEGY_CUBE_QUERY: ClassVar[TextField] = TextField( - "microStrategyCubeQuery", "microStrategyCubeQuery" - ) + MICRO_STRATEGY_CUBE_QUERY: ClassVar[TextField] = TextField("microStrategyCubeQuery", "microStrategyCubeQuery") """ Query used to create the cube. """ - MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField( - "microStrategyMetrics" - ) + MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField("microStrategyMetrics") """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( - "microStrategyProject" - ) + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") """ TBC """ - MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField( - "microStrategyAttributes" - ) + MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField("microStrategyAttributes") """ TBC """ @@ -71,11 +61,7 @@ def __setattr__(self, name, value): @property def micro_strategy_cube_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_cube_type - ) + return None if self.attributes is None else self.attributes.micro_strategy_cube_type @micro_strategy_cube_type.setter def micro_strategy_cube_type(self, micro_strategy_cube_type: Optional[str]): @@ -85,11 +71,7 @@ def micro_strategy_cube_type(self, micro_strategy_cube_type: Optional[str]): @property def micro_strategy_cube_query(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_cube_query - ) + return None if self.attributes is None else self.attributes.micro_strategy_cube_query @micro_strategy_cube_query.setter def micro_strategy_cube_query(self, micro_strategy_cube_query: Optional[str]): @@ -99,44 +81,30 @@ def micro_strategy_cube_query(self, micro_strategy_cube_query: Optional[str]): @property def micro_strategy_metrics(self) -> Optional[List[MicroStrategyMetric]]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_metrics - ) + return None if self.attributes is None else self.attributes.micro_strategy_metrics @micro_strategy_metrics.setter - def micro_strategy_metrics( - self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]] - ): + def micro_strategy_metrics(self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metrics = micro_strategy_metrics @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_project - ) + return None if self.attributes is None else self.attributes.micro_strategy_project @micro_strategy_project.setter - def micro_strategy_project( - self, micro_strategy_project: Optional[MicroStrategyProject] - ): + def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project @property def micro_strategy_attributes(self) -> Optional[List[MicroStrategyAttribute]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_attributes - ) + return None if self.attributes is None else self.attributes.micro_strategy_attributes @micro_strategy_attributes.setter - def micro_strategy_attributes( - self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] - ): + def micro_strategy_attributes(self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attributes = micro_strategy_attributes @@ -147,9 +115,7 @@ class Attributes(MicroStrategy.Attributes): micro_strategy_metrics: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field( - default=None, description="" - ) # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/micro_strategy_document.py b/pyatlan/model/assets/micro_strategy_document.py index 060f6ea59..df02dfa1a 100644 --- a/pyatlan/model/assets/micro_strategy_document.py +++ b/pyatlan/model/assets/micro_strategy_document.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( - "microStrategyProject" - ) + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") """ TBC """ @@ -42,22 +40,16 @@ def __setattr__(self, name, value): @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_project - ) + return None if self.attributes is None else self.attributes.micro_strategy_project @micro_strategy_project.setter - def micro_strategy_project( - self, micro_strategy_project: Optional[MicroStrategyProject] - ): + def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project class Attributes(MicroStrategy.Attributes): - micro_strategy_project: Optional[MicroStrategyProject] = Field( - default=None, description="" - ) # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship attributes: MicroStrategyDocument.Attributes = Field( default_factory=lambda: MicroStrategyDocument.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy_dossier.py b/pyatlan/model/assets/micro_strategy_dossier.py index 85dcd8a5e..b088c16ea 100644 --- a/pyatlan/model/assets/micro_strategy_dossier.py +++ b/pyatlan/model/assets/micro_strategy_dossier.py @@ -36,15 +36,11 @@ def __setattr__(self, name, value): List of chapter names in this dossier. """ - MICRO_STRATEGY_VISUALIZATIONS: ClassVar[RelationField] = RelationField( - "microStrategyVisualizations" - ) + MICRO_STRATEGY_VISUALIZATIONS: ClassVar[RelationField] = RelationField("microStrategyVisualizations") """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( - "microStrategyProject" - ) + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") """ TBC """ @@ -57,64 +53,42 @@ def __setattr__(self, name, value): @property def micro_strategy_dossier_chapter_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_dossier_chapter_names - ) + return None if self.attributes is None else self.attributes.micro_strategy_dossier_chapter_names @micro_strategy_dossier_chapter_names.setter - def micro_strategy_dossier_chapter_names( - self, micro_strategy_dossier_chapter_names: Optional[Set[str]] - ): + def micro_strategy_dossier_chapter_names(self, micro_strategy_dossier_chapter_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_dossier_chapter_names = ( - micro_strategy_dossier_chapter_names - ) + self.attributes.micro_strategy_dossier_chapter_names = micro_strategy_dossier_chapter_names @property def micro_strategy_visualizations( self, ) -> Optional[List[MicroStrategyVisualization]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_visualizations - ) + return None if self.attributes is None else self.attributes.micro_strategy_visualizations @micro_strategy_visualizations.setter - def micro_strategy_visualizations( - self, micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] - ): + def micro_strategy_visualizations(self, micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_visualizations = micro_strategy_visualizations @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_project - ) + return None if self.attributes is None else self.attributes.micro_strategy_project @micro_strategy_project.setter - def micro_strategy_project( - self, micro_strategy_project: Optional[MicroStrategyProject] - ): + def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project class Attributes(MicroStrategy.Attributes): - micro_strategy_dossier_chapter_names: Optional[Set[str]] = Field( - default=None, description="" - ) - micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] = ( - Field(default=None, description="") - ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field( + micro_strategy_dossier_chapter_names: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] = Field( default=None, description="" ) # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship attributes: MicroStrategyDossier.Attributes = Field( default_factory=lambda: MicroStrategyDossier.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy_fact.py b/pyatlan/model/assets/micro_strategy_fact.py index edb65a598..fa2d27ce5 100644 --- a/pyatlan/model/assets/micro_strategy_fact.py +++ b/pyatlan/model/assets/micro_strategy_fact.py @@ -36,15 +36,11 @@ def __setattr__(self, name, value): List of expressions for this fact. """ - MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField( - "microStrategyMetrics" - ) + MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField("microStrategyMetrics") """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( - "microStrategyProject" - ) + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") """ TBC """ @@ -57,60 +53,40 @@ def __setattr__(self, name, value): @property def micro_strategy_fact_expressions(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_fact_expressions - ) + return None if self.attributes is None else self.attributes.micro_strategy_fact_expressions @micro_strategy_fact_expressions.setter - def micro_strategy_fact_expressions( - self, micro_strategy_fact_expressions: Optional[Set[str]] - ): + def micro_strategy_fact_expressions(self, micro_strategy_fact_expressions: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_fact_expressions = ( - micro_strategy_fact_expressions - ) + self.attributes.micro_strategy_fact_expressions = micro_strategy_fact_expressions @property def micro_strategy_metrics(self) -> Optional[List[MicroStrategyMetric]]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_metrics - ) + return None if self.attributes is None else self.attributes.micro_strategy_metrics @micro_strategy_metrics.setter - def micro_strategy_metrics( - self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]] - ): + def micro_strategy_metrics(self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metrics = micro_strategy_metrics @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_project - ) + return None if self.attributes is None else self.attributes.micro_strategy_project @micro_strategy_project.setter - def micro_strategy_project( - self, micro_strategy_project: Optional[MicroStrategyProject] - ): + def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project class Attributes(MicroStrategy.Attributes): - micro_strategy_fact_expressions: Optional[Set[str]] = Field( - default=None, description="" - ) + micro_strategy_fact_expressions: Optional[Set[str]] = Field(default=None, description="") micro_strategy_metrics: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field( - default=None, description="" - ) # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship attributes: MicroStrategyFact.Attributes = Field( default_factory=lambda: MicroStrategyFact.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy_metric.py b/pyatlan/model/assets/micro_strategy_metric.py index d6d2ab6d9..5c62e6c2b 100644 --- a/pyatlan/model/assets/micro_strategy_metric.py +++ b/pyatlan/model/assets/micro_strategy_metric.py @@ -35,12 +35,10 @@ def __setattr__(self, name, value): """ Text specifiying this metric's expression. """ - MICRO_STRATEGY_ATTRIBUTE_QUALIFIED_NAMES: ClassVar[KeywordTextField] = ( - KeywordTextField( - "microStrategyAttributeQualifiedNames", - "microStrategyAttributeQualifiedNames", - "microStrategyAttributeQualifiedNames.text", - ) + MICRO_STRATEGY_ATTRIBUTE_QUALIFIED_NAMES: ClassVar[KeywordTextField] = KeywordTextField( + "microStrategyAttributeQualifiedNames", + "microStrategyAttributeQualifiedNames", + "microStrategyAttributeQualifiedNames.text", ) """ List of unique names of attributes related to this metric. @@ -69,12 +67,10 @@ def __setattr__(self, name, value): """ List of simple names of facts related to this metric. """ - MICRO_STRATEGY_METRIC_PARENT_QUALIFIED_NAMES: ClassVar[KeywordTextField] = ( - KeywordTextField( - "microStrategyMetricParentQualifiedNames", - "microStrategyMetricParentQualifiedNames", - "microStrategyMetricParentQualifiedNames.text", - ) + MICRO_STRATEGY_METRIC_PARENT_QUALIFIED_NAMES: ClassVar[KeywordTextField] = KeywordTextField( + "microStrategyMetricParentQualifiedNames", + "microStrategyMetricParentQualifiedNames", + "microStrategyMetricParentQualifiedNames.text", ) """ List of unique names of parent metrics of this metric. @@ -88,9 +84,7 @@ def __setattr__(self, name, value): List of simple names of parent metrics of this metric. """ - MICRO_STRATEGY_METRIC_PARENTS: ClassVar[RelationField] = RelationField( - "microStrategyMetricParents" - ) + MICRO_STRATEGY_METRIC_PARENTS: ClassVar[RelationField] = RelationField("microStrategyMetricParents") """ TBC """ @@ -98,9 +92,7 @@ def __setattr__(self, name, value): """ TBC """ - MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField( - "microStrategyReports" - ) + MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField("microStrategyReports") """ TBC """ @@ -108,21 +100,15 @@ def __setattr__(self, name, value): """ TBC """ - MICRO_STRATEGY_METRIC_CHILDREN: ClassVar[RelationField] = RelationField( - "microStrategyMetricChildren" - ) + MICRO_STRATEGY_METRIC_CHILDREN: ClassVar[RelationField] = RelationField("microStrategyMetricChildren") """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( - "microStrategyProject" - ) + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") """ TBC """ - MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField( - "microStrategyAttributes" - ) + MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField("microStrategyAttributes") """ TBC """ @@ -146,81 +132,47 @@ def __setattr__(self, name, value): @property def micro_strategy_metric_expression(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_metric_expression - ) + return None if self.attributes is None else self.attributes.micro_strategy_metric_expression @micro_strategy_metric_expression.setter - def micro_strategy_metric_expression( - self, micro_strategy_metric_expression: Optional[str] - ): + def micro_strategy_metric_expression(self, micro_strategy_metric_expression: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_metric_expression = ( - micro_strategy_metric_expression - ) + self.attributes.micro_strategy_metric_expression = micro_strategy_metric_expression @property def micro_strategy_attribute_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_attribute_qualified_names - ) + return None if self.attributes is None else self.attributes.micro_strategy_attribute_qualified_names @micro_strategy_attribute_qualified_names.setter - def micro_strategy_attribute_qualified_names( - self, micro_strategy_attribute_qualified_names: Optional[Set[str]] - ): + def micro_strategy_attribute_qualified_names(self, micro_strategy_attribute_qualified_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_attribute_qualified_names = ( - micro_strategy_attribute_qualified_names - ) + self.attributes.micro_strategy_attribute_qualified_names = micro_strategy_attribute_qualified_names @property def micro_strategy_attribute_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_attribute_names - ) + return None if self.attributes is None else self.attributes.micro_strategy_attribute_names @micro_strategy_attribute_names.setter - def micro_strategy_attribute_names( - self, micro_strategy_attribute_names: Optional[Set[str]] - ): + def micro_strategy_attribute_names(self, micro_strategy_attribute_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attribute_names = micro_strategy_attribute_names @property def micro_strategy_fact_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_fact_qualified_names - ) + return None if self.attributes is None else self.attributes.micro_strategy_fact_qualified_names @micro_strategy_fact_qualified_names.setter - def micro_strategy_fact_qualified_names( - self, micro_strategy_fact_qualified_names: Optional[Set[str]] - ): + def micro_strategy_fact_qualified_names(self, micro_strategy_fact_qualified_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_fact_qualified_names = ( - micro_strategy_fact_qualified_names - ) + self.attributes.micro_strategy_fact_qualified_names = micro_strategy_fact_qualified_names @property def micro_strategy_fact_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_fact_names - ) + return None if self.attributes is None else self.attributes.micro_strategy_fact_names @micro_strategy_fact_names.setter def micro_strategy_fact_names(self, micro_strategy_fact_names: Optional[Set[str]]): @@ -230,11 +182,7 @@ def micro_strategy_fact_names(self, micro_strategy_fact_names: Optional[Set[str] @property def micro_strategy_metric_parent_qualified_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_metric_parent_qualified_names - ) + return None if self.attributes is None else self.attributes.micro_strategy_metric_parent_qualified_names @micro_strategy_metric_parent_qualified_names.setter def micro_strategy_metric_parent_qualified_names( @@ -242,40 +190,24 @@ def micro_strategy_metric_parent_qualified_names( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_metric_parent_qualified_names = ( - micro_strategy_metric_parent_qualified_names - ) + self.attributes.micro_strategy_metric_parent_qualified_names = micro_strategy_metric_parent_qualified_names @property def micro_strategy_metric_parent_names(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_metric_parent_names - ) + return None if self.attributes is None else self.attributes.micro_strategy_metric_parent_names @micro_strategy_metric_parent_names.setter - def micro_strategy_metric_parent_names( - self, micro_strategy_metric_parent_names: Optional[Set[str]] - ): + def micro_strategy_metric_parent_names(self, micro_strategy_metric_parent_names: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_metric_parent_names = ( - micro_strategy_metric_parent_names - ) + self.attributes.micro_strategy_metric_parent_names = micro_strategy_metric_parent_names @property def micro_strategy_metric_parents(self) -> Optional[List[MicroStrategyMetric]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_metric_parents - ) + return None if self.attributes is None else self.attributes.micro_strategy_metric_parents @micro_strategy_metric_parents.setter - def micro_strategy_metric_parents( - self, micro_strategy_metric_parents: Optional[List[MicroStrategyMetric]] - ): + def micro_strategy_metric_parents(self, micro_strategy_metric_parents: Optional[List[MicroStrategyMetric]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metric_parents = micro_strategy_metric_parents @@ -285,23 +217,17 @@ def micro_strategy_facts(self) -> Optional[List[MicroStrategyFact]]: return None if self.attributes is None else self.attributes.micro_strategy_facts @micro_strategy_facts.setter - def micro_strategy_facts( - self, micro_strategy_facts: Optional[List[MicroStrategyFact]] - ): + def micro_strategy_facts(self, micro_strategy_facts: Optional[List[MicroStrategyFact]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_facts = micro_strategy_facts @property def micro_strategy_reports(self) -> Optional[List[MicroStrategyReport]]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_reports - ) + return None if self.attributes is None else self.attributes.micro_strategy_reports @micro_strategy_reports.setter - def micro_strategy_reports( - self, micro_strategy_reports: Optional[List[MicroStrategyReport]] - ): + def micro_strategy_reports(self, micro_strategy_reports: Optional[List[MicroStrategyReport]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_reports = micro_strategy_reports @@ -311,99 +237,61 @@ def micro_strategy_cubes(self) -> Optional[List[MicroStrategyCube]]: return None if self.attributes is None else self.attributes.micro_strategy_cubes @micro_strategy_cubes.setter - def micro_strategy_cubes( - self, micro_strategy_cubes: Optional[List[MicroStrategyCube]] - ): + def micro_strategy_cubes(self, micro_strategy_cubes: Optional[List[MicroStrategyCube]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_cubes = micro_strategy_cubes @property def micro_strategy_metric_children(self) -> Optional[List[MicroStrategyMetric]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_metric_children - ) + return None if self.attributes is None else self.attributes.micro_strategy_metric_children @micro_strategy_metric_children.setter - def micro_strategy_metric_children( - self, micro_strategy_metric_children: Optional[List[MicroStrategyMetric]] - ): + def micro_strategy_metric_children(self, micro_strategy_metric_children: Optional[List[MicroStrategyMetric]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metric_children = micro_strategy_metric_children @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_project - ) + return None if self.attributes is None else self.attributes.micro_strategy_project @micro_strategy_project.setter - def micro_strategy_project( - self, micro_strategy_project: Optional[MicroStrategyProject] - ): + def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project @property def micro_strategy_attributes(self) -> Optional[List[MicroStrategyAttribute]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_attributes - ) + return None if self.attributes is None else self.attributes.micro_strategy_attributes @micro_strategy_attributes.setter - def micro_strategy_attributes( - self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] - ): + def micro_strategy_attributes(self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attributes = micro_strategy_attributes class Attributes(MicroStrategy.Attributes): - micro_strategy_metric_expression: Optional[str] = Field( - default=None, description="" - ) - micro_strategy_attribute_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) - micro_strategy_attribute_names: Optional[Set[str]] = Field( - default=None, description="" - ) - micro_strategy_fact_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) - micro_strategy_fact_names: Optional[Set[str]] = Field( - default=None, description="" - ) - micro_strategy_metric_parent_qualified_names: Optional[Set[str]] = Field( - default=None, description="" - ) - micro_strategy_metric_parent_names: Optional[Set[str]] = Field( - default=None, description="" - ) + micro_strategy_metric_expression: Optional[str] = Field(default=None, description="") + micro_strategy_attribute_qualified_names: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_attribute_names: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_fact_qualified_names: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_fact_names: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_metric_parent_qualified_names: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_metric_parent_names: Optional[Set[str]] = Field(default=None, description="") micro_strategy_metric_parents: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_facts: Optional[List[MicroStrategyFact]] = Field( - default=None, description="" - ) # relationship + micro_strategy_facts: Optional[List[MicroStrategyFact]] = Field(default=None, description="") # relationship micro_strategy_reports: Optional[List[MicroStrategyReport]] = Field( default=None, description="" ) # relationship - micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field( - default=None, description="" - ) # relationship + micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field(default=None, description="") # relationship micro_strategy_metric_children: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field( - default=None, description="" - ) # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/micro_strategy_project.py b/pyatlan/model/assets/micro_strategy_project.py index c08043fde..27a5f04c0 100644 --- a/pyatlan/model/assets/micro_strategy_project.py +++ b/pyatlan/model/assets/micro_strategy_project.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField( - "microStrategyReports" - ) + MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField("microStrategyReports") """ TBC """ @@ -39,21 +37,15 @@ def __setattr__(self, name, value): """ TBC """ - MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField( - "microStrategyMetrics" - ) + MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField("microStrategyMetrics") """ TBC """ - MICRO_STRATEGY_VISUALIZATIONS: ClassVar[RelationField] = RelationField( - "microStrategyVisualizations" - ) + MICRO_STRATEGY_VISUALIZATIONS: ClassVar[RelationField] = RelationField("microStrategyVisualizations") """ TBC """ - MICRO_STRATEGY_DOCUMENTS: ClassVar[RelationField] = RelationField( - "microStrategyDocuments" - ) + MICRO_STRATEGY_DOCUMENTS: ClassVar[RelationField] = RelationField("microStrategyDocuments") """ TBC """ @@ -61,15 +53,11 @@ def __setattr__(self, name, value): """ TBC """ - MICRO_STRATEGY_DOSSIERS: ClassVar[RelationField] = RelationField( - "microStrategyDossiers" - ) + MICRO_STRATEGY_DOSSIERS: ClassVar[RelationField] = RelationField("microStrategyDossiers") """ TBC """ - MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField( - "microStrategyAttributes" - ) + MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField("microStrategyAttributes") """ TBC """ @@ -87,14 +75,10 @@ def __setattr__(self, name, value): @property def micro_strategy_reports(self) -> Optional[List[MicroStrategyReport]]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_reports - ) + return None if self.attributes is None else self.attributes.micro_strategy_reports @micro_strategy_reports.setter - def micro_strategy_reports( - self, micro_strategy_reports: Optional[List[MicroStrategyReport]] - ): + def micro_strategy_reports(self, micro_strategy_reports: Optional[List[MicroStrategyReport]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_reports = micro_strategy_reports @@ -104,23 +88,17 @@ def micro_strategy_facts(self) -> Optional[List[MicroStrategyFact]]: return None if self.attributes is None else self.attributes.micro_strategy_facts @micro_strategy_facts.setter - def micro_strategy_facts( - self, micro_strategy_facts: Optional[List[MicroStrategyFact]] - ): + def micro_strategy_facts(self, micro_strategy_facts: Optional[List[MicroStrategyFact]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_facts = micro_strategy_facts @property def micro_strategy_metrics(self) -> Optional[List[MicroStrategyMetric]]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_metrics - ) + return None if self.attributes is None else self.attributes.micro_strategy_metrics @micro_strategy_metrics.setter - def micro_strategy_metrics( - self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]] - ): + def micro_strategy_metrics(self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metrics = micro_strategy_metrics @@ -129,32 +107,20 @@ def micro_strategy_metrics( def micro_strategy_visualizations( self, ) -> Optional[List[MicroStrategyVisualization]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_visualizations - ) + return None if self.attributes is None else self.attributes.micro_strategy_visualizations @micro_strategy_visualizations.setter - def micro_strategy_visualizations( - self, micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] - ): + def micro_strategy_visualizations(self, micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_visualizations = micro_strategy_visualizations @property def micro_strategy_documents(self) -> Optional[List[MicroStrategyDocument]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_documents - ) + return None if self.attributes is None else self.attributes.micro_strategy_documents @micro_strategy_documents.setter - def micro_strategy_documents( - self, micro_strategy_documents: Optional[List[MicroStrategyDocument]] - ): + def micro_strategy_documents(self, micro_strategy_documents: Optional[List[MicroStrategyDocument]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_documents = micro_strategy_documents @@ -164,39 +130,27 @@ def micro_strategy_cubes(self) -> Optional[List[MicroStrategyCube]]: return None if self.attributes is None else self.attributes.micro_strategy_cubes @micro_strategy_cubes.setter - def micro_strategy_cubes( - self, micro_strategy_cubes: Optional[List[MicroStrategyCube]] - ): + def micro_strategy_cubes(self, micro_strategy_cubes: Optional[List[MicroStrategyCube]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_cubes = micro_strategy_cubes @property def micro_strategy_dossiers(self) -> Optional[List[MicroStrategyDossier]]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_dossiers - ) + return None if self.attributes is None else self.attributes.micro_strategy_dossiers @micro_strategy_dossiers.setter - def micro_strategy_dossiers( - self, micro_strategy_dossiers: Optional[List[MicroStrategyDossier]] - ): + def micro_strategy_dossiers(self, micro_strategy_dossiers: Optional[List[MicroStrategyDossier]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_dossiers = micro_strategy_dossiers @property def micro_strategy_attributes(self) -> Optional[List[MicroStrategyAttribute]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_attributes - ) + return None if self.attributes is None else self.attributes.micro_strategy_attributes @micro_strategy_attributes.setter - def micro_strategy_attributes( - self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] - ): + def micro_strategy_attributes(self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attributes = micro_strategy_attributes @@ -205,21 +159,17 @@ class Attributes(MicroStrategy.Attributes): micro_strategy_reports: Optional[List[MicroStrategyReport]] = Field( default=None, description="" ) # relationship - micro_strategy_facts: Optional[List[MicroStrategyFact]] = Field( - default=None, description="" - ) # relationship + micro_strategy_facts: Optional[List[MicroStrategyFact]] = Field(default=None, description="") # relationship micro_strategy_metrics: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] = ( - Field(default=None, description="") - ) # relationship - micro_strategy_documents: Optional[List[MicroStrategyDocument]] = Field( + micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] = Field( default=None, description="" ) # relationship - micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field( + micro_strategy_documents: Optional[List[MicroStrategyDocument]] = Field( default=None, description="" ) # relationship + micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field(default=None, description="") # relationship micro_strategy_dossiers: Optional[List[MicroStrategyDossier]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/micro_strategy_report.py b/pyatlan/model/assets/micro_strategy_report.py index 463f18fa8..f575a3f68 100644 --- a/pyatlan/model/assets/micro_strategy_report.py +++ b/pyatlan/model/assets/micro_strategy_report.py @@ -36,21 +36,15 @@ def __setattr__(self, name, value): Type of report, for example: Grid or Chart. """ - MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField( - "microStrategyMetrics" - ) + MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField("microStrategyMetrics") """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( - "microStrategyProject" - ) + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") """ TBC """ - MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField( - "microStrategyAttributes" - ) + MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField("microStrategyAttributes") """ TBC """ @@ -64,11 +58,7 @@ def __setattr__(self, name, value): @property def micro_strategy_report_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_report_type - ) + return None if self.attributes is None else self.attributes.micro_strategy_report_type @micro_strategy_report_type.setter def micro_strategy_report_type(self, micro_strategy_report_type: Optional[str]): @@ -78,44 +68,30 @@ def micro_strategy_report_type(self, micro_strategy_report_type: Optional[str]): @property def micro_strategy_metrics(self) -> Optional[List[MicroStrategyMetric]]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_metrics - ) + return None if self.attributes is None else self.attributes.micro_strategy_metrics @micro_strategy_metrics.setter - def micro_strategy_metrics( - self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]] - ): + def micro_strategy_metrics(self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metrics = micro_strategy_metrics @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_project - ) + return None if self.attributes is None else self.attributes.micro_strategy_project @micro_strategy_project.setter - def micro_strategy_project( - self, micro_strategy_project: Optional[MicroStrategyProject] - ): + def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project @property def micro_strategy_attributes(self) -> Optional[List[MicroStrategyAttribute]]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_attributes - ) + return None if self.attributes is None else self.attributes.micro_strategy_attributes @micro_strategy_attributes.setter - def micro_strategy_attributes( - self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] - ): + def micro_strategy_attributes(self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attributes = micro_strategy_attributes @@ -125,9 +101,7 @@ class Attributes(MicroStrategy.Attributes): micro_strategy_metrics: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field( - default=None, description="" - ) # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/micro_strategy_visualization.py b/pyatlan/model/assets/micro_strategy_visualization.py index 3486a1b74..3071f3ec8 100644 --- a/pyatlan/model/assets/micro_strategy_visualization.py +++ b/pyatlan/model/assets/micro_strategy_visualization.py @@ -39,12 +39,10 @@ def __setattr__(self, name, value): """ Type of visualization. """ - MICRO_STRATEGY_DOSSIER_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( - KeywordTextField( - "microStrategyDossierQualifiedName", - "microStrategyDossierQualifiedName", - "microStrategyDossierQualifiedName.text", - ) + MICRO_STRATEGY_DOSSIER_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "microStrategyDossierQualifiedName", + "microStrategyDossierQualifiedName", + "microStrategyDossierQualifiedName.text", ) """ Unique name of the dossier in which this visualization exists. @@ -58,15 +56,11 @@ def __setattr__(self, name, value): Simple name of the dossier in which this visualization exists. """ - MICRO_STRATEGY_DOSSIER: ClassVar[RelationField] = RelationField( - "microStrategyDossier" - ) + MICRO_STRATEGY_DOSSIER: ClassVar[RelationField] = RelationField("microStrategyDossier") """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( - "microStrategyProject" - ) + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") """ TBC """ @@ -81,47 +75,27 @@ def __setattr__(self, name, value): @property def micro_strategy_visualization_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_visualization_type - ) + return None if self.attributes is None else self.attributes.micro_strategy_visualization_type @micro_strategy_visualization_type.setter - def micro_strategy_visualization_type( - self, micro_strategy_visualization_type: Optional[str] - ): + def micro_strategy_visualization_type(self, micro_strategy_visualization_type: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_visualization_type = ( - micro_strategy_visualization_type - ) + self.attributes.micro_strategy_visualization_type = micro_strategy_visualization_type @property def micro_strategy_dossier_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_dossier_qualified_name - ) + return None if self.attributes is None else self.attributes.micro_strategy_dossier_qualified_name @micro_strategy_dossier_qualified_name.setter - def micro_strategy_dossier_qualified_name( - self, micro_strategy_dossier_qualified_name: Optional[str] - ): + def micro_strategy_dossier_qualified_name(self, micro_strategy_dossier_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_dossier_qualified_name = ( - micro_strategy_dossier_qualified_name - ) + self.attributes.micro_strategy_dossier_qualified_name = micro_strategy_dossier_qualified_name @property def micro_strategy_dossier_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.micro_strategy_dossier_name - ) + return None if self.attributes is None else self.attributes.micro_strategy_dossier_name @micro_strategy_dossier_name.setter def micro_strategy_dossier_name(self, micro_strategy_dossier_name: Optional[str]): @@ -131,46 +105,30 @@ def micro_strategy_dossier_name(self, micro_strategy_dossier_name: Optional[str] @property def micro_strategy_dossier(self) -> Optional[MicroStrategyDossier]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_dossier - ) + return None if self.attributes is None else self.attributes.micro_strategy_dossier @micro_strategy_dossier.setter - def micro_strategy_dossier( - self, micro_strategy_dossier: Optional[MicroStrategyDossier] - ): + def micro_strategy_dossier(self, micro_strategy_dossier: Optional[MicroStrategyDossier]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_dossier = micro_strategy_dossier @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return ( - None if self.attributes is None else self.attributes.micro_strategy_project - ) + return None if self.attributes is None else self.attributes.micro_strategy_project @micro_strategy_project.setter - def micro_strategy_project( - self, micro_strategy_project: Optional[MicroStrategyProject] - ): + def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project class Attributes(MicroStrategy.Attributes): - micro_strategy_visualization_type: Optional[str] = Field( - default=None, description="" - ) - micro_strategy_dossier_qualified_name: Optional[str] = Field( - default=None, description="" - ) + micro_strategy_visualization_type: Optional[str] = Field(default=None, description="") + micro_strategy_dossier_qualified_name: Optional[str] = Field(default=None, description="") micro_strategy_dossier_name: Optional[str] = Field(default=None, description="") - micro_strategy_dossier: Optional[MicroStrategyDossier] = Field( - default=None, description="" - ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field( - default=None, description="" - ) # relationship + micro_strategy_dossier: Optional[MicroStrategyDossier] = Field(default=None, description="") # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship attributes: MicroStrategyVisualization.Attributes = Field( default_factory=lambda: MicroStrategyVisualization.Attributes(), diff --git a/pyatlan/model/assets/mode.py b/pyatlan/model/assets/mode.py index 3a6f706fe..aa8bcd423 100644 --- a/pyatlan/model/assets/mode.py +++ b/pyatlan/model/assets/mode.py @@ -33,9 +33,7 @@ def __setattr__(self, name, value): """ """ - MODE_TOKEN: ClassVar[KeywordTextField] = KeywordTextField( - "modeToken", "modeToken", "modeToken.text" - ) + MODE_TOKEN: ClassVar[KeywordTextField] = KeywordTextField("modeToken", "modeToken", "modeToken.text") """ """ @@ -132,9 +130,7 @@ def mode_workspace_name(self, mode_workspace_name: Optional[str]): @property def mode_workspace_username(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.mode_workspace_username - ) + return None if self.attributes is None else self.attributes.mode_workspace_username @mode_workspace_username.setter def mode_workspace_username(self, mode_workspace_username: Optional[str]): @@ -144,16 +140,10 @@ def mode_workspace_username(self, mode_workspace_username: Optional[str]): @property def mode_workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mode_workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.mode_workspace_qualified_name @mode_workspace_qualified_name.setter - def mode_workspace_qualified_name( - self, mode_workspace_qualified_name: Optional[str] - ): + def mode_workspace_qualified_name(self, mode_workspace_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mode_workspace_qualified_name = mode_workspace_qualified_name @@ -170,11 +160,7 @@ def mode_report_name(self, mode_report_name: Optional[str]): @property def mode_report_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mode_report_qualified_name - ) + return None if self.attributes is None else self.attributes.mode_report_qualified_name @mode_report_qualified_name.setter def mode_report_qualified_name(self, mode_report_qualified_name: Optional[str]): @@ -194,11 +180,7 @@ def mode_query_name(self, mode_query_name: Optional[str]): @property def mode_query_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.mode_query_qualified_name - ) + return None if self.attributes is None else self.attributes.mode_query_qualified_name @mode_query_qualified_name.setter def mode_query_qualified_name(self, mode_query_qualified_name: Optional[str]): @@ -211,9 +193,7 @@ class Attributes(BI.Attributes): mode_token: Optional[str] = Field(default=None, description="") mode_workspace_name: Optional[str] = Field(default=None, description="") mode_workspace_username: Optional[str] = Field(default=None, description="") - mode_workspace_qualified_name: Optional[str] = Field( - default=None, description="" - ) + mode_workspace_qualified_name: Optional[str] = Field(default=None, description="") mode_report_name: Optional[str] = Field(default=None, description="") mode_report_qualified_name: Optional[str] = Field(default=None, description="") mode_query_name: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/mode_chart.py b/pyatlan/model/assets/mode_chart.py index 80d3f76bf..9c94728ca 100644 --- a/pyatlan/model/assets/mode_chart.py +++ b/pyatlan/model/assets/mode_chart.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODE_CHART_TYPE: ClassVar[KeywordField] = KeywordField( - "modeChartType", "modeChartType" - ) + MODE_CHART_TYPE: ClassVar[KeywordField] = KeywordField("modeChartType", "modeChartType") """ Type of chart. """ @@ -68,9 +66,7 @@ def mode_query(self, mode_query: Optional[ModeQuery]): class Attributes(Mode.Attributes): mode_chart_type: Optional[str] = Field(default=None, description="") - mode_query: Optional[ModeQuery] = Field( - default=None, description="" - ) # relationship + mode_query: Optional[ModeQuery] = Field(default=None, description="") # relationship attributes: ModeChart.Attributes = Field( default_factory=lambda: ModeChart.Attributes(), diff --git a/pyatlan/model/assets/mode_collection.py b/pyatlan/model/assets/mode_collection.py index 02afbfadf..2c3c64593 100644 --- a/pyatlan/model/assets/mode_collection.py +++ b/pyatlan/model/assets/mode_collection.py @@ -29,15 +29,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODE_COLLECTION_TYPE: ClassVar[KeywordField] = KeywordField( - "modeCollectionType", "modeCollectionType" - ) + MODE_COLLECTION_TYPE: ClassVar[KeywordField] = KeywordField("modeCollectionType", "modeCollectionType") """ Type of this collection. """ - MODE_COLLECTION_STATE: ClassVar[KeywordField] = KeywordField( - "modeCollectionState", "modeCollectionState" - ) + MODE_COLLECTION_STATE: ClassVar[KeywordField] = KeywordField("modeCollectionState", "modeCollectionState") """ State of this collection. """ @@ -70,9 +66,7 @@ def mode_collection_type(self, mode_collection_type: Optional[str]): @property def mode_collection_state(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.mode_collection_state - ) + return None if self.attributes is None else self.attributes.mode_collection_state @mode_collection_state.setter def mode_collection_state(self, mode_collection_state: Optional[str]): @@ -103,12 +97,8 @@ def mode_reports(self, mode_reports: Optional[List[ModeReport]]): class Attributes(Mode.Attributes): mode_collection_type: Optional[str] = Field(default=None, description="") mode_collection_state: Optional[str] = Field(default=None, description="") - mode_workspace: Optional[ModeWorkspace] = Field( - default=None, description="" - ) # relationship - mode_reports: Optional[List[ModeReport]] = Field( - default=None, description="" - ) # relationship + mode_workspace: Optional[ModeWorkspace] = Field(default=None, description="") # relationship + mode_reports: Optional[List[ModeReport]] = Field(default=None, description="") # relationship attributes: ModeCollection.Attributes = Field( default_factory=lambda: ModeCollection.Attributes(), diff --git a/pyatlan/model/assets/mode_query.py b/pyatlan/model/assets/mode_query.py index 4ff140c93..867b73e30 100644 --- a/pyatlan/model/assets/mode_query.py +++ b/pyatlan/model/assets/mode_query.py @@ -33,9 +33,7 @@ def __setattr__(self, name, value): """ """ - MODE_REPORT_IMPORT_COUNT: ClassVar[NumericField] = NumericField( - "modeReportImportCount", "modeReportImportCount" - ) + MODE_REPORT_IMPORT_COUNT: ClassVar[NumericField] = NumericField("modeReportImportCount", "modeReportImportCount") """ """ @@ -68,11 +66,7 @@ def mode_raw_query(self, mode_raw_query: Optional[str]): @property def mode_report_import_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.mode_report_import_count - ) + return None if self.attributes is None else self.attributes.mode_report_import_count @mode_report_import_count.setter def mode_report_import_count(self, mode_report_import_count: Optional[int]): @@ -103,12 +97,8 @@ def mode_charts(self, mode_charts: Optional[List[ModeChart]]): class Attributes(Mode.Attributes): mode_raw_query: Optional[str] = Field(default=None, description="") mode_report_import_count: Optional[int] = Field(default=None, description="") - mode_report: Optional[ModeReport] = Field( - default=None, description="" - ) # relationship - mode_charts: Optional[List[ModeChart]] = Field( - default=None, description="" - ) # relationship + mode_report: Optional[ModeReport] = Field(default=None, description="") # relationship + mode_charts: Optional[List[ModeChart]] = Field(default=None, description="") # relationship attributes: ModeQuery.Attributes = Field( default_factory=lambda: ModeQuery.Attributes(), diff --git a/pyatlan/model/assets/mode_report.py b/pyatlan/model/assets/mode_report.py index e87807862..2b0ba055c 100644 --- a/pyatlan/model/assets/mode_report.py +++ b/pyatlan/model/assets/mode_report.py @@ -36,45 +36,31 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODE_COLLECTION_TOKEN: ClassVar[KeywordField] = KeywordField( - "modeCollectionToken", "modeCollectionToken" - ) + MODE_COLLECTION_TOKEN: ClassVar[KeywordField] = KeywordField("modeCollectionToken", "modeCollectionToken") """ """ - MODE_REPORT_PUBLISHED_AT: ClassVar[NumericField] = NumericField( - "modeReportPublishedAt", "modeReportPublishedAt" - ) + MODE_REPORT_PUBLISHED_AT: ClassVar[NumericField] = NumericField("modeReportPublishedAt", "modeReportPublishedAt") """ """ - MODE_QUERY_COUNT: ClassVar[NumericField] = NumericField( - "modeQueryCount", "modeQueryCount" - ) + MODE_QUERY_COUNT: ClassVar[NumericField] = NumericField("modeQueryCount", "modeQueryCount") """ """ - MODE_CHART_COUNT: ClassVar[NumericField] = NumericField( - "modeChartCount", "modeChartCount" - ) + MODE_CHART_COUNT: ClassVar[NumericField] = NumericField("modeChartCount", "modeChartCount") """ """ - MODE_QUERY_PREVIEW: ClassVar[TextField] = TextField( - "modeQueryPreview", "modeQueryPreview" - ) + MODE_QUERY_PREVIEW: ClassVar[TextField] = TextField("modeQueryPreview", "modeQueryPreview") """ """ - MODE_IS_PUBLIC: ClassVar[BooleanField] = BooleanField( - "modeIsPublic", "modeIsPublic" - ) + MODE_IS_PUBLIC: ClassVar[BooleanField] = BooleanField("modeIsPublic", "modeIsPublic") """ """ - MODE_IS_SHARED: ClassVar[BooleanField] = BooleanField( - "modeIsShared", "modeIsShared" - ) + MODE_IS_SHARED: ClassVar[BooleanField] = BooleanField("modeIsShared", "modeIsShared") """ """ @@ -102,9 +88,7 @@ def __setattr__(self, name, value): @property def mode_collection_token(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.mode_collection_token - ) + return None if self.attributes is None else self.attributes.mode_collection_token @mode_collection_token.setter def mode_collection_token(self, mode_collection_token: Optional[str]): @@ -114,11 +98,7 @@ def mode_collection_token(self, mode_collection_token: Optional[str]): @property def mode_report_published_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.mode_report_published_at - ) + return None if self.attributes is None else self.attributes.mode_report_published_at @mode_report_published_at.setter def mode_report_published_at(self, mode_report_published_at: Optional[datetime]): @@ -198,20 +178,14 @@ def mode_collections(self, mode_collections: Optional[List[ModeCollection]]): class Attributes(Mode.Attributes): mode_collection_token: Optional[str] = Field(default=None, description="") - mode_report_published_at: Optional[datetime] = Field( - default=None, description="" - ) + mode_report_published_at: Optional[datetime] = Field(default=None, description="") mode_query_count: Optional[int] = Field(default=None, description="") mode_chart_count: Optional[int] = Field(default=None, description="") mode_query_preview: Optional[str] = Field(default=None, description="") mode_is_public: Optional[bool] = Field(default=None, description="") mode_is_shared: Optional[bool] = Field(default=None, description="") - mode_queries: Optional[List[ModeQuery]] = Field( - default=None, description="" - ) # relationship - mode_collections: Optional[List[ModeCollection]] = Field( - default=None, description="" - ) # relationship + mode_queries: Optional[List[ModeQuery]] = Field(default=None, description="") # relationship + mode_collections: Optional[List[ModeCollection]] = Field(default=None, description="") # relationship attributes: ModeReport.Attributes = Field( default_factory=lambda: ModeReport.Attributes(), diff --git a/pyatlan/model/assets/mode_workspace.py b/pyatlan/model/assets/mode_workspace.py index bbd9e8240..d7a762566 100644 --- a/pyatlan/model/assets/mode_workspace.py +++ b/pyatlan/model/assets/mode_workspace.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODE_COLLECTION_COUNT: ClassVar[NumericField] = NumericField( - "modeCollectionCount", "modeCollectionCount" - ) + MODE_COLLECTION_COUNT: ClassVar[NumericField] = NumericField("modeCollectionCount", "modeCollectionCount") """ Number of collections in this workspace. """ @@ -48,9 +46,7 @@ def __setattr__(self, name, value): @property def mode_collection_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.mode_collection_count - ) + return None if self.attributes is None else self.attributes.mode_collection_count @mode_collection_count.setter def mode_collection_count(self, mode_collection_count: Optional[int]): @@ -70,9 +66,7 @@ def mode_collections(self, mode_collections: Optional[List[ModeCollection]]): class Attributes(Mode.Attributes): mode_collection_count: Optional[int] = Field(default=None, description="") - mode_collections: Optional[List[ModeCollection]] = Field( - default=None, description="" - ) # relationship + mode_collections: Optional[List[ModeCollection]] = Field(default=None, description="") # relationship attributes: ModeWorkspace.Attributes = Field( default_factory=lambda: ModeWorkspace.Attributes(), diff --git a/pyatlan/model/assets/multi_dimensional_dataset.py b/pyatlan/model/assets/multi_dimensional_dataset.py index 2e328493a..af58deb7f 100644 --- a/pyatlan/model/assets/multi_dimensional_dataset.py +++ b/pyatlan/model/assets/multi_dimensional_dataset.py @@ -29,15 +29,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - CUBE_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "cubeName", "cubeName.keyword", "cubeName" - ) + CUBE_NAME: ClassVar[KeywordTextField] = KeywordTextField("cubeName", "cubeName.keyword", "cubeName") """ Simple name of the cube in which this asset exists, or empty if it is itself a cube. """ - CUBE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "cubeQualifiedName", "cubeQualifiedName" - ) + CUBE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("cubeQualifiedName", "cubeQualifiedName") """ Unique name of the cube in which this asset exists, or empty if it is itself a cube. """ @@ -107,16 +103,10 @@ def cube_dimension_name(self, cube_dimension_name: Optional[str]): @property def cube_dimension_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cube_dimension_qualified_name - ) + return None if self.attributes is None else self.attributes.cube_dimension_qualified_name @cube_dimension_qualified_name.setter - def cube_dimension_qualified_name( - self, cube_dimension_qualified_name: Optional[str] - ): + def cube_dimension_qualified_name(self, cube_dimension_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cube_dimension_qualified_name = cube_dimension_qualified_name @@ -133,16 +123,10 @@ def cube_hierarchy_name(self, cube_hierarchy_name: Optional[str]): @property def cube_hierarchy_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.cube_hierarchy_qualified_name - ) + return None if self.attributes is None else self.attributes.cube_hierarchy_qualified_name @cube_hierarchy_qualified_name.setter - def cube_hierarchy_qualified_name( - self, cube_hierarchy_qualified_name: Optional[str] - ): + def cube_hierarchy_qualified_name(self, cube_hierarchy_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cube_hierarchy_qualified_name = cube_hierarchy_qualified_name @@ -151,13 +135,9 @@ class Attributes(Catalog.Attributes): cube_name: Optional[str] = Field(default=None, description="") cube_qualified_name: Optional[str] = Field(default=None, description="") cube_dimension_name: Optional[str] = Field(default=None, description="") - cube_dimension_qualified_name: Optional[str] = Field( - default=None, description="" - ) + cube_dimension_qualified_name: Optional[str] = Field(default=None, description="") cube_hierarchy_name: Optional[str] = Field(default=None, description="") - cube_hierarchy_qualified_name: Optional[str] = Field( - default=None, description="" - ) + cube_hierarchy_qualified_name: Optional[str] = Field(default=None, description="") attributes: MultiDimensionalDataset.Attributes = Field( default_factory=lambda: MultiDimensionalDataset.Attributes(), diff --git a/pyatlan/model/assets/preset.py b/pyatlan/model/assets/preset.py index 04b98621c..315e50093 100644 --- a/pyatlan/model/assets/preset.py +++ b/pyatlan/model/assets/preset.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - PRESET_WORKSPACE_ID: ClassVar[NumericField] = NumericField( - "presetWorkspaceId", "presetWorkspaceId" - ) + PRESET_WORKSPACE_ID: ClassVar[NumericField] = NumericField("presetWorkspaceId", "presetWorkspaceId") """ Identifier of the workspace in which this asset exists, in Preset. """ @@ -43,9 +41,7 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this asset exists. """ - PRESET_DASHBOARD_ID: ClassVar[NumericField] = NumericField( - "presetDashboardId", "presetDashboardId" - ) + PRESET_DASHBOARD_ID: ClassVar[NumericField] = NumericField("presetDashboardId", "presetDashboardId") """ Identifier of the dashboard in which this asset exists, in Preset. """ @@ -77,21 +73,13 @@ def preset_workspace_id(self, preset_workspace_id: Optional[int]): @property def preset_workspace_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.preset_workspace_qualified_name - ) + return None if self.attributes is None else self.attributes.preset_workspace_qualified_name @preset_workspace_qualified_name.setter - def preset_workspace_qualified_name( - self, preset_workspace_qualified_name: Optional[str] - ): + def preset_workspace_qualified_name(self, preset_workspace_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_workspace_qualified_name = ( - preset_workspace_qualified_name - ) + self.attributes.preset_workspace_qualified_name = preset_workspace_qualified_name @property def preset_dashboard_id(self) -> Optional[int]: @@ -105,31 +93,19 @@ def preset_dashboard_id(self, preset_dashboard_id: Optional[int]): @property def preset_dashboard_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.preset_dashboard_qualified_name - ) + return None if self.attributes is None else self.attributes.preset_dashboard_qualified_name @preset_dashboard_qualified_name.setter - def preset_dashboard_qualified_name( - self, preset_dashboard_qualified_name: Optional[str] - ): + def preset_dashboard_qualified_name(self, preset_dashboard_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_dashboard_qualified_name = ( - preset_dashboard_qualified_name - ) + self.attributes.preset_dashboard_qualified_name = preset_dashboard_qualified_name class Attributes(BI.Attributes): preset_workspace_id: Optional[int] = Field(default=None, description="") - preset_workspace_qualified_name: Optional[str] = Field( - default=None, description="" - ) + preset_workspace_qualified_name: Optional[str] = Field(default=None, description="") preset_dashboard_id: Optional[int] = Field(default=None, description="") - preset_dashboard_qualified_name: Optional[str] = Field( - default=None, description="" - ) + preset_dashboard_qualified_name: Optional[str] = Field(default=None, description="") attributes: Preset.Attributes = Field( default_factory=lambda: Preset.Attributes(), diff --git a/pyatlan/model/assets/preset_chart.py b/pyatlan/model/assets/preset_chart.py index 21f7e1c90..2157da924 100644 --- a/pyatlan/model/assets/preset_chart.py +++ b/pyatlan/model/assets/preset_chart.py @@ -62,16 +62,11 @@ def creator( @init_guid def create(cls, *, name: str, preset_dashboard_qualified_name: str) -> PresetChart: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name - ) + return cls.creator(name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name) type_name: str = Field(default="PresetChart", allow_mutation=False) @@ -92,9 +87,7 @@ def __setattr__(self, name, value): """ """ - PRESET_CHART_FORM_DATA: ClassVar[KeywordField] = KeywordField( - "presetChartFormData", "presetChartFormData" - ) + PRESET_CHART_FORM_DATA: ClassVar[KeywordField] = KeywordField("presetChartFormData", "presetChartFormData") """ """ @@ -112,27 +105,17 @@ def __setattr__(self, name, value): @property def preset_chart_description_markdown(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.preset_chart_description_markdown - ) + return None if self.attributes is None else self.attributes.preset_chart_description_markdown @preset_chart_description_markdown.setter - def preset_chart_description_markdown( - self, preset_chart_description_markdown: Optional[str] - ): + def preset_chart_description_markdown(self, preset_chart_description_markdown: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_chart_description_markdown = ( - preset_chart_description_markdown - ) + self.attributes.preset_chart_description_markdown = preset_chart_description_markdown @property def preset_chart_form_data(self) -> Optional[Dict[str, str]]: - return ( - None if self.attributes is None else self.attributes.preset_chart_form_data - ) + return None if self.attributes is None else self.attributes.preset_chart_form_data @preset_chart_form_data.setter def preset_chart_form_data(self, preset_chart_form_data: Optional[Dict[str, str]]): @@ -151,15 +134,9 @@ def preset_dashboard(self, preset_dashboard: Optional[PresetDashboard]): self.attributes.preset_dashboard = preset_dashboard class Attributes(Preset.Attributes): - preset_chart_description_markdown: Optional[str] = Field( - default=None, description="" - ) - preset_chart_form_data: Optional[Dict[str, str]] = Field( - default=None, description="" - ) - preset_dashboard: Optional[PresetDashboard] = Field( - default=None, description="" - ) # relationship + preset_chart_description_markdown: Optional[str] = Field(default=None, description="") + preset_chart_form_data: Optional[Dict[str, str]] = Field(default=None, description="") + preset_dashboard: Optional[PresetDashboard] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -175,9 +152,7 @@ def create( [name, preset_dashboard_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( preset_dashboard_qualified_name, @@ -191,9 +166,7 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{preset_dashboard_qualified_name}/{name}", connector_name=connector_name, - preset_dashboard=PresetDashboard.ref_by_qualified_name( - preset_dashboard_qualified_name - ), + preset_dashboard=PresetDashboard.ref_by_qualified_name(preset_dashboard_qualified_name), ) attributes: PresetChart.Attributes = Field( diff --git a/pyatlan/model/assets/preset_dashboard.py b/pyatlan/model/assets/preset_dashboard.py index 027479dd6..70a6c13ff 100644 --- a/pyatlan/model/assets/preset_dashboard.py +++ b/pyatlan/model/assets/preset_dashboard.py @@ -66,20 +66,13 @@ def creator( @classmethod @init_guid - def create( - cls, *, name: str, preset_workspace_qualified_name: str - ) -> PresetDashboard: + def create(cls, *, name: str, preset_workspace_qualified_name: str) -> PresetDashboard: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, preset_workspace_qualified_name=preset_workspace_qualified_name - ) + return cls.creator(name=name, preset_workspace_qualified_name=preset_workspace_qualified_name) type_name: str = Field(default="PresetDashboard", allow_mutation=False) @@ -94,13 +87,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - PRESET_DASHBOARD_CHANGED_BY_NAME: ClassVar[KeywordTextStemmedField] = ( - KeywordTextStemmedField( - "presetDashboardChangedByName", - "presetDashboardChangedByName.keyword", - "presetDashboardChangedByName", - "presetDashboardChangedByName.stemmed", - ) + PRESET_DASHBOARD_CHANGED_BY_NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( + "presetDashboardChangedByName", + "presetDashboardChangedByName.keyword", + "presetDashboardChangedByName", + "presetDashboardChangedByName.stemmed", ) """ @@ -163,97 +154,57 @@ def __setattr__(self, name, value): @property def preset_dashboard_changed_by_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.preset_dashboard_changed_by_name - ) + return None if self.attributes is None else self.attributes.preset_dashboard_changed_by_name @preset_dashboard_changed_by_name.setter - def preset_dashboard_changed_by_name( - self, preset_dashboard_changed_by_name: Optional[str] - ): + def preset_dashboard_changed_by_name(self, preset_dashboard_changed_by_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_dashboard_changed_by_name = ( - preset_dashboard_changed_by_name - ) + self.attributes.preset_dashboard_changed_by_name = preset_dashboard_changed_by_name @property def preset_dashboard_changed_by_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.preset_dashboard_changed_by_url - ) + return None if self.attributes is None else self.attributes.preset_dashboard_changed_by_url @preset_dashboard_changed_by_url.setter - def preset_dashboard_changed_by_url( - self, preset_dashboard_changed_by_url: Optional[str] - ): + def preset_dashboard_changed_by_url(self, preset_dashboard_changed_by_url: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_dashboard_changed_by_url = ( - preset_dashboard_changed_by_url - ) + self.attributes.preset_dashboard_changed_by_url = preset_dashboard_changed_by_url @property def preset_dashboard_is_managed_externally(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.preset_dashboard_is_managed_externally - ) + return None if self.attributes is None else self.attributes.preset_dashboard_is_managed_externally @preset_dashboard_is_managed_externally.setter - def preset_dashboard_is_managed_externally( - self, preset_dashboard_is_managed_externally: Optional[bool] - ): + def preset_dashboard_is_managed_externally(self, preset_dashboard_is_managed_externally: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_dashboard_is_managed_externally = ( - preset_dashboard_is_managed_externally - ) + self.attributes.preset_dashboard_is_managed_externally = preset_dashboard_is_managed_externally @property def preset_dashboard_is_published(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.preset_dashboard_is_published - ) + return None if self.attributes is None else self.attributes.preset_dashboard_is_published @preset_dashboard_is_published.setter - def preset_dashboard_is_published( - self, preset_dashboard_is_published: Optional[bool] - ): + def preset_dashboard_is_published(self, preset_dashboard_is_published: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.preset_dashboard_is_published = preset_dashboard_is_published @property def preset_dashboard_thumbnail_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.preset_dashboard_thumbnail_url - ) + return None if self.attributes is None else self.attributes.preset_dashboard_thumbnail_url @preset_dashboard_thumbnail_url.setter - def preset_dashboard_thumbnail_url( - self, preset_dashboard_thumbnail_url: Optional[str] - ): + def preset_dashboard_thumbnail_url(self, preset_dashboard_thumbnail_url: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.preset_dashboard_thumbnail_url = preset_dashboard_thumbnail_url @property def preset_dashboard_chart_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.preset_dashboard_chart_count - ) + return None if self.attributes is None else self.attributes.preset_dashboard_chart_count @preset_dashboard_chart_count.setter def preset_dashboard_chart_count(self, preset_dashboard_chart_count: Optional[int]): @@ -292,33 +243,15 @@ def preset_workspace(self, preset_workspace: Optional[PresetWorkspace]): self.attributes.preset_workspace = preset_workspace class Attributes(Preset.Attributes): - preset_dashboard_changed_by_name: Optional[str] = Field( - default=None, description="" - ) - preset_dashboard_changed_by_url: Optional[str] = Field( - default=None, description="" - ) - preset_dashboard_is_managed_externally: Optional[bool] = Field( - default=None, description="" - ) - preset_dashboard_is_published: Optional[bool] = Field( - default=None, description="" - ) - preset_dashboard_thumbnail_url: Optional[str] = Field( - default=None, description="" - ) - preset_dashboard_chart_count: Optional[int] = Field( - default=None, description="" - ) - preset_datasets: Optional[List[PresetDataset]] = Field( - default=None, description="" - ) # relationship - preset_charts: Optional[List[PresetChart]] = Field( - default=None, description="" - ) # relationship - preset_workspace: Optional[PresetWorkspace] = Field( - default=None, description="" - ) # relationship + preset_dashboard_changed_by_name: Optional[str] = Field(default=None, description="") + preset_dashboard_changed_by_url: Optional[str] = Field(default=None, description="") + preset_dashboard_is_managed_externally: Optional[bool] = Field(default=None, description="") + preset_dashboard_is_published: Optional[bool] = Field(default=None, description="") + preset_dashboard_thumbnail_url: Optional[str] = Field(default=None, description="") + preset_dashboard_chart_count: Optional[int] = Field(default=None, description="") + preset_datasets: Optional[List[PresetDataset]] = Field(default=None, description="") # relationship + preset_charts: Optional[List[PresetChart]] = Field(default=None, description="") # relationship + preset_workspace: Optional[PresetWorkspace] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -334,9 +267,7 @@ def create( [name, preset_workspace_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( preset_workspace_qualified_name, @@ -350,9 +281,7 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{preset_workspace_qualified_name}/{name}", connector_name=connector_name, - preset_workspace=PresetWorkspace.ref_by_qualified_name( - preset_workspace_qualified_name - ), + preset_workspace=PresetWorkspace.ref_by_qualified_name(preset_workspace_qualified_name), ) attributes: PresetDashboard.Attributes = Field( diff --git a/pyatlan/model/assets/preset_dataset.py b/pyatlan/model/assets/preset_dataset.py index af85bb3a8..bdb63fc2a 100644 --- a/pyatlan/model/assets/preset_dataset.py +++ b/pyatlan/model/assets/preset_dataset.py @@ -65,20 +65,13 @@ def creator( @classmethod @init_guid - def create( - cls, *, name: str, preset_dashboard_qualified_name: str - ) -> PresetDataset: + def create(cls, *, name: str, preset_dashboard_qualified_name: str) -> PresetDataset: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name - ) + return cls.creator(name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name) type_name: str = Field(default="PresetDataset", allow_mutation=False) @@ -93,26 +86,20 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - PRESET_DATASET_DATASOURCE_NAME: ClassVar[KeywordTextStemmedField] = ( - KeywordTextStemmedField( - "presetDatasetDatasourceName", - "presetDatasetDatasourceName.keyword", - "presetDatasetDatasourceName", - "presetDatasetDatasourceName.stemmed", - ) + PRESET_DATASET_DATASOURCE_NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( + "presetDatasetDatasourceName", + "presetDatasetDatasourceName.keyword", + "presetDatasetDatasourceName", + "presetDatasetDatasourceName.stemmed", ) """ """ - PRESET_DATASET_ID: ClassVar[NumericField] = NumericField( - "presetDatasetId", "presetDatasetId" - ) + PRESET_DATASET_ID: ClassVar[NumericField] = NumericField("presetDatasetId", "presetDatasetId") """ """ - PRESET_DATASET_TYPE: ClassVar[KeywordField] = KeywordField( - "presetDatasetType", "presetDatasetType" - ) + PRESET_DATASET_TYPE: ClassVar[KeywordField] = KeywordField("presetDatasetType", "presetDatasetType") """ """ @@ -131,16 +118,10 @@ def __setattr__(self, name, value): @property def preset_dataset_datasource_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.preset_dataset_datasource_name - ) + return None if self.attributes is None else self.attributes.preset_dataset_datasource_name @preset_dataset_datasource_name.setter - def preset_dataset_datasource_name( - self, preset_dataset_datasource_name: Optional[str] - ): + def preset_dataset_datasource_name(self, preset_dataset_datasource_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.preset_dataset_datasource_name = preset_dataset_datasource_name @@ -176,14 +157,10 @@ def preset_dashboard(self, preset_dashboard: Optional[PresetDashboard]): self.attributes.preset_dashboard = preset_dashboard class Attributes(Preset.Attributes): - preset_dataset_datasource_name: Optional[str] = Field( - default=None, description="" - ) + preset_dataset_datasource_name: Optional[str] = Field(default=None, description="") preset_dataset_id: Optional[int] = Field(default=None, description="") preset_dataset_type: Optional[str] = Field(default=None, description="") - preset_dashboard: Optional[PresetDashboard] = Field( - default=None, description="" - ) # relationship + preset_dashboard: Optional[PresetDashboard] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -199,9 +176,7 @@ def create( [name, preset_dashboard_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( preset_dashboard_qualified_name, @@ -215,9 +190,7 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{preset_dashboard_qualified_name}/{name}", connector_name=connector_name, - preset_dashboard=PresetDashboard.ref_by_qualified_name( - preset_dashboard_qualified_name - ), + preset_dashboard=PresetDashboard.ref_by_qualified_name(preset_dashboard_qualified_name), ) attributes: PresetDataset.Attributes = Field( diff --git a/pyatlan/model/assets/preset_workspace.py b/pyatlan/model/assets/preset_workspace.py index 04d637903..c6201034b 100644 --- a/pyatlan/model/assets/preset_workspace.py +++ b/pyatlan/model/assets/preset_workspace.py @@ -28,28 +28,19 @@ class PresetWorkspace(Preset): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> PresetWorkspace: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) - attributes = PresetWorkspace.Attributes.create( - name=name, connection_qualified_name=connection_qualified_name - ) + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + attributes = PresetWorkspace.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) return cls(attributes=attributes) @classmethod @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> PresetWorkspace: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + return cls.creator(name=name, connection_qualified_name=connection_qualified_name) type_name: str = Field(default="PresetWorkspace", allow_mutation=False) @@ -97,9 +88,7 @@ def __setattr__(self, name, value): """ """ - PRESET_WORKSPACE_STATUS: ClassVar[KeywordField] = KeywordField( - "presetWorkspaceStatus", "presetWorkspaceStatus" - ) + PRESET_WORKSPACE_STATUS: ClassVar[KeywordField] = KeywordField("presetWorkspaceStatus", "presetWorkspaceStatus") """ """ @@ -142,29 +131,17 @@ def __setattr__(self, name, value): @property def preset_workspace_public_dashboards_allowed(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.preset_workspace_public_dashboards_allowed - ) + return None if self.attributes is None else self.attributes.preset_workspace_public_dashboards_allowed @preset_workspace_public_dashboards_allowed.setter - def preset_workspace_public_dashboards_allowed( - self, preset_workspace_public_dashboards_allowed: Optional[bool] - ): + def preset_workspace_public_dashboards_allowed(self, preset_workspace_public_dashboards_allowed: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_workspace_public_dashboards_allowed = ( - preset_workspace_public_dashboards_allowed - ) + self.attributes.preset_workspace_public_dashboards_allowed = preset_workspace_public_dashboards_allowed @property def preset_workspace_cluster_id(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.preset_workspace_cluster_id - ) + return None if self.attributes is None else self.attributes.preset_workspace_cluster_id @preset_workspace_cluster_id.setter def preset_workspace_cluster_id(self, preset_workspace_cluster_id: Optional[int]): @@ -174,11 +151,7 @@ def preset_workspace_cluster_id(self, preset_workspace_cluster_id: Optional[int] @property def preset_workspace_hostname(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.preset_workspace_hostname - ) + return None if self.attributes is None else self.attributes.preset_workspace_hostname @preset_workspace_hostname.setter def preset_workspace_hostname(self, preset_workspace_hostname: Optional[str]): @@ -188,27 +161,17 @@ def preset_workspace_hostname(self, preset_workspace_hostname: Optional[str]): @property def preset_workspace_is_in_maintenance_mode(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.preset_workspace_is_in_maintenance_mode - ) + return None if self.attributes is None else self.attributes.preset_workspace_is_in_maintenance_mode @preset_workspace_is_in_maintenance_mode.setter - def preset_workspace_is_in_maintenance_mode( - self, preset_workspace_is_in_maintenance_mode: Optional[bool] - ): + def preset_workspace_is_in_maintenance_mode(self, preset_workspace_is_in_maintenance_mode: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_workspace_is_in_maintenance_mode = ( - preset_workspace_is_in_maintenance_mode - ) + self.attributes.preset_workspace_is_in_maintenance_mode = preset_workspace_is_in_maintenance_mode @property def preset_workspace_region(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.preset_workspace_region - ) + return None if self.attributes is None else self.attributes.preset_workspace_region @preset_workspace_region.setter def preset_workspace_region(self, preset_workspace_region: Optional[str]): @@ -218,9 +181,7 @@ def preset_workspace_region(self, preset_workspace_region: Optional[str]): @property def preset_workspace_status(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.preset_workspace_status - ) + return None if self.attributes is None else self.attributes.preset_workspace_status @preset_workspace_status.setter def preset_workspace_status(self, preset_workspace_status: Optional[str]): @@ -230,50 +191,30 @@ def preset_workspace_status(self, preset_workspace_status: Optional[str]): @property def preset_workspace_deployment_id(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.preset_workspace_deployment_id - ) + return None if self.attributes is None else self.attributes.preset_workspace_deployment_id @preset_workspace_deployment_id.setter - def preset_workspace_deployment_id( - self, preset_workspace_deployment_id: Optional[int] - ): + def preset_workspace_deployment_id(self, preset_workspace_deployment_id: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.preset_workspace_deployment_id = preset_workspace_deployment_id @property def preset_workspace_dashboard_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.preset_workspace_dashboard_count - ) + return None if self.attributes is None else self.attributes.preset_workspace_dashboard_count @preset_workspace_dashboard_count.setter - def preset_workspace_dashboard_count( - self, preset_workspace_dashboard_count: Optional[int] - ): + def preset_workspace_dashboard_count(self, preset_workspace_dashboard_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_workspace_dashboard_count = ( - preset_workspace_dashboard_count - ) + self.attributes.preset_workspace_dashboard_count = preset_workspace_dashboard_count @property def preset_workspace_dataset_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.preset_workspace_dataset_count - ) + return None if self.attributes is None else self.attributes.preset_workspace_dataset_count @preset_workspace_dataset_count.setter - def preset_workspace_dataset_count( - self, preset_workspace_dataset_count: Optional[int] - ): + def preset_workspace_dataset_count(self, preset_workspace_dataset_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.preset_workspace_dataset_count = preset_workspace_dataset_count @@ -289,44 +230,26 @@ def preset_dashboards(self, preset_dashboards: Optional[List[PresetDashboard]]): self.attributes.preset_dashboards = preset_dashboards class Attributes(Preset.Attributes): - preset_workspace_public_dashboards_allowed: Optional[bool] = Field( - default=None, description="" - ) + preset_workspace_public_dashboards_allowed: Optional[bool] = Field(default=None, description="") preset_workspace_cluster_id: Optional[int] = Field(default=None, description="") preset_workspace_hostname: Optional[str] = Field(default=None, description="") - preset_workspace_is_in_maintenance_mode: Optional[bool] = Field( - default=None, description="" - ) + preset_workspace_is_in_maintenance_mode: Optional[bool] = Field(default=None, description="") preset_workspace_region: Optional[str] = Field(default=None, description="") preset_workspace_status: Optional[str] = Field(default=None, description="") - preset_workspace_deployment_id: Optional[int] = Field( - default=None, description="" - ) - preset_workspace_dashboard_count: Optional[int] = Field( - default=None, description="" - ) - preset_workspace_dataset_count: Optional[int] = Field( - default=None, description="" - ) - preset_dashboards: Optional[List[PresetDashboard]] = Field( - default=None, description="" - ) # relationship + preset_workspace_deployment_id: Optional[int] = Field(default=None, description="") + preset_workspace_dashboard_count: Optional[int] = Field(default=None, description="") + preset_workspace_dataset_count: Optional[int] = Field(default=None, description="") + preset_dashboards: Optional[List[PresetDashboard]] = Field(default=None, description="") # relationship @classmethod @init_guid - def create( - cls, *, name: str, connection_qualified_name: str - ) -> PresetWorkspace.Attributes: - validate_required_fields( - ["name", "connection_qualified_name"], [name, connection_qualified_name] - ) + def create(cls, *, name: str, connection_qualified_name: str) -> PresetWorkspace.Attributes: + validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) return PresetWorkspace.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: PresetWorkspace.Attributes = Field( diff --git a/pyatlan/model/assets/purpose.py b/pyatlan/model/assets/purpose.py index 14dfc9933..a64be34e6 100644 --- a/pyatlan/model/assets/purpose.py +++ b/pyatlan/model/assets/purpose.py @@ -39,10 +39,7 @@ def creator(cls, *, name: str, atlan_tags: List[AtlanTagName]) -> Purpose: @init_guid def create(cls, *, name: str, atlan_tags: List[AtlanTagName]) -> Purpose: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -84,9 +81,7 @@ def create_metadata_policy( for group_name in policy_groups: if not GroupCache.get_id_for_name(group_name): - raise ValueError( - f"Provided group name {group_name} was not found in Atlan." - ) + raise ValueError(f"Provided group name {group_name} was not found in Atlan.") target_found = True policy.policy_groups = policy_groups else: @@ -96,9 +91,7 @@ def create_metadata_policy( for username in policy_users: if not UserCache.get_id_for_name(username): - raise ValueError( - f"Provided username {username} was not found in Atlan." - ) + raise ValueError(f"Provided username {username} was not found in Atlan.") target_found = True policy.policy_users = policy_users else: @@ -119,9 +112,7 @@ def create_data_policy( policy_users: Optional[Set[str]] = None, all_users: bool = False, ) -> AuthPolicy: - validate_required_fields( - ["name", "purpose_id", "policy_type"], [name, purpose_id, policy_type] - ) + validate_required_fields(["name", "purpose_id", "policy_type"], [name, purpose_id, policy_type]) policy = AuthPolicy._AuthPolicy__create(name=name) # type: ignore[attr-defined] policy.policy_actions = {DataAction.SELECT.value} policy.policy_category = AuthPolicyCategory.PURPOSE.value @@ -141,9 +132,7 @@ def create_data_policy( for group_name in policy_groups: if not GroupCache.get_id_for_name(group_name): - raise ValueError( - f"Provided group name {group_name} was not found in Atlan." - ) + raise ValueError(f"Provided group name {group_name} was not found in Atlan.") target_found = True policy.policy_groups = policy_groups else: @@ -153,9 +142,7 @@ def create_data_policy( for username in policy_users: if not UserCache.get_id_for_name(username): - raise ValueError( - f"Provided username {username} was not found in Atlan." - ) + raise ValueError(f"Provided username {username} was not found in Atlan.") target_found = True policy.policy_users = policy_users else: @@ -193,16 +180,11 @@ def create_for_modification( is_enabled: bool = True, ) -> Purpose: warn( - ( - "This method is deprecated, please use 'updater' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.updater( - qualified_name=qualified_name, name=name, is_enabled=is_enabled - ) + return cls.updater(qualified_name=qualified_name, name=name, is_enabled=is_enabled) type_name: str = Field(default="Purpose", allow_mutation=False) @@ -217,9 +199,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - PURPOSE_CLASSIFICATIONS: ClassVar[KeywordField] = KeywordField( - "purposeClassifications", "purposeClassifications" - ) + PURPOSE_CLASSIFICATIONS: ClassVar[KeywordField] = KeywordField("purposeClassifications", "purposeClassifications") """ TBC """ @@ -239,15 +219,11 @@ def purpose_atlan_tags(self, purpose_atlan_tags: Optional[List[AtlanTagName]]): self.attributes.purpose_atlan_tags = purpose_atlan_tags class Attributes(AccessControl.Attributes): - purpose_atlan_tags: Optional[List[AtlanTagName]] = Field( - default=None, description="" - ) + purpose_atlan_tags: Optional[List[AtlanTagName]] = Field(default=None, description="") @classmethod @init_guid - def create( - cls, name: str, atlan_tags: List[AtlanTagName] - ) -> Purpose.Attributes: + def create(cls, name: str, atlan_tags: List[AtlanTagName]) -> Purpose.Attributes: validate_required_fields(["name", "atlan_tags"], [name, atlan_tags]) return Purpose.Attributes( qualified_name=name, diff --git a/pyatlan/model/assets/qlik.py b/pyatlan/model/assets/qlik.py index 4ba4da568..7a2414b7c 100644 --- a/pyatlan/model/assets/qlik.py +++ b/pyatlan/model/assets/qlik.py @@ -37,9 +37,7 @@ def __setattr__(self, name, value): """ Identifier of this asset, from Qlik. """ - QLIK_QRI: ClassVar[KeywordTextField] = KeywordTextField( - "qlikQRI", "qlikQRI", "qlikQRI.text" - ) + QLIK_QRI: ClassVar[KeywordTextField] = KeywordTextField("qlikQRI", "qlikQRI", "qlikQRI.text") """ Unique QRI of this asset, from Qlik. """ @@ -69,9 +67,7 @@ def __setattr__(self, name, value): """ Identifier of the owner of this asset, in Qlik. """ - QLIK_IS_PUBLISHED: ClassVar[BooleanField] = BooleanField( - "qlikIsPublished", "qlikIsPublished" - ) + QLIK_IS_PUBLISHED: ClassVar[BooleanField] = BooleanField("qlikIsPublished", "qlikIsPublished") """ Whether this asset is published in Qlik (true) or not (false). """ @@ -119,11 +115,7 @@ def qlik_space_id(self, qlik_space_id: Optional[str]): @property def qlik_space_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.qlik_space_qualified_name - ) + return None if self.attributes is None else self.attributes.qlik_space_qualified_name @qlik_space_qualified_name.setter def qlik_space_qualified_name(self, qlik_space_qualified_name: Optional[str]): @@ -143,9 +135,7 @@ def qlik_app_id(self, qlik_app_id: Optional[str]): @property def qlik_app_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.qlik_app_qualified_name - ) + return None if self.attributes is None else self.attributes.qlik_app_qualified_name @qlik_app_qualified_name.setter def qlik_app_qualified_name(self, qlik_app_qualified_name: Optional[str]): diff --git a/pyatlan/model/assets/qlik_app.py b/pyatlan/model/assets/qlik_app.py index 3c1fac7c3..4b9134d33 100644 --- a/pyatlan/model/assets/qlik_app.py +++ b/pyatlan/model/assets/qlik_app.py @@ -34,33 +34,23 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QLIK_HAS_SECTION_ACCESS: ClassVar[BooleanField] = BooleanField( - "qlikHasSectionAccess", "qlikHasSectionAccess" - ) + QLIK_HAS_SECTION_ACCESS: ClassVar[BooleanField] = BooleanField("qlikHasSectionAccess", "qlikHasSectionAccess") """ Whether section access or data masking is enabled on the source (true) or not (false). """ - QLIK_ORIGIN_APP_ID: ClassVar[KeywordField] = KeywordField( - "qlikOriginAppId", "qlikOriginAppId" - ) + QLIK_ORIGIN_APP_ID: ClassVar[KeywordField] = KeywordField("qlikOriginAppId", "qlikOriginAppId") """ Value of originAppId for this app. """ - QLIK_IS_ENCRYPTED: ClassVar[BooleanField] = BooleanField( - "qlikIsEncrypted", "qlikIsEncrypted" - ) + QLIK_IS_ENCRYPTED: ClassVar[BooleanField] = BooleanField("qlikIsEncrypted", "qlikIsEncrypted") """ Whether this app is encrypted (true) or not (false). """ - QLIK_IS_DIRECT_QUERY_MODE: ClassVar[BooleanField] = BooleanField( - "qlikIsDirectQueryMode", "qlikIsDirectQueryMode" - ) + QLIK_IS_DIRECT_QUERY_MODE: ClassVar[BooleanField] = BooleanField("qlikIsDirectQueryMode", "qlikIsDirectQueryMode") """ Whether this app is in direct query mode (true) or not (false). """ - QLIK_APP_STATIC_BYTE_SIZE: ClassVar[NumericField] = NumericField( - "qlikAppStaticByteSize", "qlikAppStaticByteSize" - ) + QLIK_APP_STATIC_BYTE_SIZE: ClassVar[NumericField] = NumericField("qlikAppStaticByteSize", "qlikAppStaticByteSize") """ Static space used by this app, in bytes. """ @@ -86,9 +76,7 @@ def __setattr__(self, name, value): @property def qlik_has_section_access(self) -> Optional[bool]: - return ( - None if self.attributes is None else self.attributes.qlik_has_section_access - ) + return None if self.attributes is None else self.attributes.qlik_has_section_access @qlik_has_section_access.setter def qlik_has_section_access(self, qlik_has_section_access: Optional[bool]): @@ -118,11 +106,7 @@ def qlik_is_encrypted(self, qlik_is_encrypted: Optional[bool]): @property def qlik_is_direct_query_mode(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.qlik_is_direct_query_mode - ) + return None if self.attributes is None else self.attributes.qlik_is_direct_query_mode @qlik_is_direct_query_mode.setter def qlik_is_direct_query_mode(self, qlik_is_direct_query_mode: Optional[bool]): @@ -132,11 +116,7 @@ def qlik_is_direct_query_mode(self, qlik_is_direct_query_mode: Optional[bool]): @property def qlik_app_static_byte_size(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.qlik_app_static_byte_size - ) + return None if self.attributes is None else self.attributes.qlik_app_static_byte_size @qlik_app_static_byte_size.setter def qlik_app_static_byte_size(self, qlik_app_static_byte_size: Optional[int]): @@ -170,12 +150,8 @@ class Attributes(Qlik.Attributes): qlik_is_encrypted: Optional[bool] = Field(default=None, description="") qlik_is_direct_query_mode: Optional[bool] = Field(default=None, description="") qlik_app_static_byte_size: Optional[int] = Field(default=None, description="") - qlik_space: Optional[QlikSpace] = Field( - default=None, description="" - ) # relationship - qlik_sheets: Optional[List[QlikSheet]] = Field( - default=None, description="" - ) # relationship + qlik_space: Optional[QlikSpace] = Field(default=None, description="") # relationship + qlik_sheets: Optional[List[QlikSheet]] = Field(default=None, description="") # relationship attributes: QlikApp.Attributes = Field( default_factory=lambda: QlikApp.Attributes(), diff --git a/pyatlan/model/assets/qlik_chart.py b/pyatlan/model/assets/qlik_chart.py index 130361682..15ff1e991 100644 --- a/pyatlan/model/assets/qlik_chart.py +++ b/pyatlan/model/assets/qlik_chart.py @@ -29,27 +29,19 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QLIK_CHART_SUBTITLE: ClassVar[TextField] = TextField( - "qlikChartSubtitle", "qlikChartSubtitle" - ) + QLIK_CHART_SUBTITLE: ClassVar[TextField] = TextField("qlikChartSubtitle", "qlikChartSubtitle") """ Subtitle of this chart. """ - QLIK_CHART_FOOTNOTE: ClassVar[TextField] = TextField( - "qlikChartFootnote", "qlikChartFootnote" - ) + QLIK_CHART_FOOTNOTE: ClassVar[TextField] = TextField("qlikChartFootnote", "qlikChartFootnote") """ Footnote of this chart. """ - QLIK_CHART_ORIENTATION: ClassVar[KeywordField] = KeywordField( - "qlikChartOrientation", "qlikChartOrientation" - ) + QLIK_CHART_ORIENTATION: ClassVar[KeywordField] = KeywordField("qlikChartOrientation", "qlikChartOrientation") """ Orientation of this chart. """ - QLIK_CHART_TYPE: ClassVar[KeywordField] = KeywordField( - "qlikChartType", "qlikChartType" - ) + QLIK_CHART_TYPE: ClassVar[KeywordField] = KeywordField("qlikChartType", "qlikChartType") """ Subtype of this chart, for example: bar, graph, pie, etc. """ @@ -89,9 +81,7 @@ def qlik_chart_footnote(self, qlik_chart_footnote: Optional[str]): @property def qlik_chart_orientation(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.qlik_chart_orientation - ) + return None if self.attributes is None else self.attributes.qlik_chart_orientation @qlik_chart_orientation.setter def qlik_chart_orientation(self, qlik_chart_orientation: Optional[str]): @@ -124,9 +114,7 @@ class Attributes(Qlik.Attributes): qlik_chart_footnote: Optional[str] = Field(default=None, description="") qlik_chart_orientation: Optional[str] = Field(default=None, description="") qlik_chart_type: Optional[str] = Field(default=None, description="") - qlik_sheet: Optional[QlikSheet] = Field( - default=None, description="" - ) # relationship + qlik_sheet: Optional[QlikSheet] = Field(default=None, description="") # relationship attributes: QlikChart.Attributes = Field( default_factory=lambda: QlikChart.Attributes(), diff --git a/pyatlan/model/assets/qlik_dataset.py b/pyatlan/model/assets/qlik_dataset.py index 68a8305d5..302887b69 100644 --- a/pyatlan/model/assets/qlik_dataset.py +++ b/pyatlan/model/assets/qlik_dataset.py @@ -41,9 +41,7 @@ def __setattr__(self, name, value): """ Technical name of this asset. """ - QLIK_DATASET_TYPE: ClassVar[KeywordField] = KeywordField( - "qlikDatasetType", "qlikDatasetType" - ) + QLIK_DATASET_TYPE: ClassVar[KeywordField] = KeywordField("qlikDatasetType", "qlikDatasetType") """ Type of this data asset, for example: qix-df, snowflake, etc. """ @@ -53,9 +51,7 @@ def __setattr__(self, name, value): """ URI of this dataset. """ - QLIK_DATASET_SUBTYPE: ClassVar[KeywordField] = KeywordField( - "qlikDatasetSubtype", "qlikDatasetSubtype" - ) + QLIK_DATASET_SUBTYPE: ClassVar[KeywordField] = KeywordField("qlikDatasetSubtype", "qlikDatasetSubtype") """ Subtype this dataset asset. """ @@ -75,11 +71,7 @@ def __setattr__(self, name, value): @property def qlik_dataset_technical_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.qlik_dataset_technical_name - ) + return None if self.attributes is None else self.attributes.qlik_dataset_technical_name @qlik_dataset_technical_name.setter def qlik_dataset_technical_name(self, qlik_dataset_technical_name: Optional[str]): @@ -132,9 +124,7 @@ class Attributes(Qlik.Attributes): qlik_dataset_type: Optional[str] = Field(default=None, description="") qlik_dataset_uri: Optional[str] = Field(default=None, description="") qlik_dataset_subtype: Optional[str] = Field(default=None, description="") - qlik_space: Optional[QlikSpace] = Field( - default=None, description="" - ) # relationship + qlik_space: Optional[QlikSpace] = Field(default=None, description="") # relationship attributes: QlikDataset.Attributes = Field( default_factory=lambda: QlikDataset.Attributes(), diff --git a/pyatlan/model/assets/qlik_sheet.py b/pyatlan/model/assets/qlik_sheet.py index f3983f062..23f574556 100644 --- a/pyatlan/model/assets/qlik_sheet.py +++ b/pyatlan/model/assets/qlik_sheet.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QLIK_SHEET_IS_APPROVED: ClassVar[BooleanField] = BooleanField( - "qlikSheetIsApproved", "qlikSheetIsApproved" - ) + QLIK_SHEET_IS_APPROVED: ClassVar[BooleanField] = BooleanField("qlikSheetIsApproved", "qlikSheetIsApproved") """ Whether this is approved (true) or not (false). """ @@ -53,9 +51,7 @@ def __setattr__(self, name, value): @property def qlik_sheet_is_approved(self) -> Optional[bool]: - return ( - None if self.attributes is None else self.attributes.qlik_sheet_is_approved - ) + return None if self.attributes is None else self.attributes.qlik_sheet_is_approved @qlik_sheet_is_approved.setter def qlik_sheet_is_approved(self, qlik_sheet_is_approved: Optional[bool]): @@ -85,12 +81,8 @@ def qlik_charts(self, qlik_charts: Optional[List[QlikChart]]): class Attributes(Qlik.Attributes): qlik_sheet_is_approved: Optional[bool] = Field(default=None, description="") - qlik_app: Optional[QlikApp] = Field( - default=None, description="" - ) # relationship - qlik_charts: Optional[List[QlikChart]] = Field( - default=None, description="" - ) # relationship + qlik_app: Optional[QlikApp] = Field(default=None, description="") # relationship + qlik_charts: Optional[List[QlikChart]] = Field(default=None, description="") # relationship attributes: QlikSheet.Attributes = Field( default_factory=lambda: QlikSheet.Attributes(), diff --git a/pyatlan/model/assets/qlik_space.py b/pyatlan/model/assets/qlik_space.py index bc8ba1730..04ce1485c 100644 --- a/pyatlan/model/assets/qlik_space.py +++ b/pyatlan/model/assets/qlik_space.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QLIK_SPACE_TYPE: ClassVar[KeywordField] = KeywordField( - "qlikSpaceType", "qlikSpaceType" - ) + QLIK_SPACE_TYPE: ClassVar[KeywordField] = KeywordField("qlikSpaceType", "qlikSpaceType") """ Type of this space, for exmaple: Private, Shared, etc. """ @@ -83,12 +81,8 @@ def qlik_apps(self, qlik_apps: Optional[List[QlikApp]]): class Attributes(Qlik.Attributes): qlik_space_type: Optional[str] = Field(default=None, description="") - qlik_datasets: Optional[List[QlikDataset]] = Field( - default=None, description="" - ) # relationship - qlik_apps: Optional[List[QlikApp]] = Field( - default=None, description="" - ) # relationship + qlik_datasets: Optional[List[QlikDataset]] = Field(default=None, description="") # relationship + qlik_apps: Optional[List[QlikApp]] = Field(default=None, description="") # relationship attributes: QlikSpace.Attributes = Field( default_factory=lambda: QlikSpace.Attributes(), diff --git a/pyatlan/model/assets/quick_sight.py b/pyatlan/model/assets/quick_sight.py index 0d2c9bab0..f5f2ff87d 100644 --- a/pyatlan/model/assets/quick_sight.py +++ b/pyatlan/model/assets/quick_sight.py @@ -29,15 +29,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QUICK_SIGHT_ID: ClassVar[KeywordField] = KeywordField( - "quickSightId", "quickSightId" - ) + QUICK_SIGHT_ID: ClassVar[KeywordField] = KeywordField("quickSightId", "quickSightId") """ """ - QUICK_SIGHT_SHEET_ID: ClassVar[KeywordField] = KeywordField( - "quickSightSheetId", "quickSightSheetId" - ) + QUICK_SIGHT_SHEET_ID: ClassVar[KeywordField] = KeywordField("quickSightSheetId", "quickSightSheetId") """ """ @@ -76,9 +72,7 @@ def quick_sight_sheet_id(self, quick_sight_sheet_id: Optional[str]): @property def quick_sight_sheet_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.quick_sight_sheet_name - ) + return None if self.attributes is None else self.attributes.quick_sight_sheet_name @quick_sight_sheet_name.setter def quick_sight_sheet_name(self, quick_sight_sheet_name: Optional[str]): diff --git a/pyatlan/model/assets/quick_sight_analysis.py b/pyatlan/model/assets/quick_sight_analysis.py index 2d430a72f..c46afddee 100644 --- a/pyatlan/model/assets/quick_sight_analysis.py +++ b/pyatlan/model/assets/quick_sight_analysis.py @@ -100,15 +100,11 @@ def __setattr__(self, name, value): List of filter groups used for this analysis. """ - QUICK_SIGHT_ANALYSIS_VISUALS: ClassVar[RelationField] = RelationField( - "quickSightAnalysisVisuals" - ) + QUICK_SIGHT_ANALYSIS_VISUALS: ClassVar[RelationField] = RelationField("quickSightAnalysisVisuals") """ TBC """ - QUICK_SIGHT_ANALYSIS_FOLDERS: ClassVar[RelationField] = RelationField( - "quickSightAnalysisFolders" - ) + QUICK_SIGHT_ANALYSIS_FOLDERS: ClassVar[RelationField] = RelationField("quickSightAnalysisFolders") """ TBC """ @@ -124,45 +120,27 @@ def __setattr__(self, name, value): @property def quick_sight_analysis_status(self) -> Optional[QuickSightAnalysisStatus]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_analysis_status - ) + return None if self.attributes is None else self.attributes.quick_sight_analysis_status @quick_sight_analysis_status.setter - def quick_sight_analysis_status( - self, quick_sight_analysis_status: Optional[QuickSightAnalysisStatus] - ): + def quick_sight_analysis_status(self, quick_sight_analysis_status: Optional[QuickSightAnalysisStatus]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_analysis_status = quick_sight_analysis_status @property def quick_sight_analysis_calculated_fields(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_analysis_calculated_fields - ) + return None if self.attributes is None else self.attributes.quick_sight_analysis_calculated_fields @quick_sight_analysis_calculated_fields.setter - def quick_sight_analysis_calculated_fields( - self, quick_sight_analysis_calculated_fields: Optional[Set[str]] - ): + def quick_sight_analysis_calculated_fields(self, quick_sight_analysis_calculated_fields: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_analysis_calculated_fields = ( - quick_sight_analysis_calculated_fields - ) + self.attributes.quick_sight_analysis_calculated_fields = quick_sight_analysis_calculated_fields @property def quick_sight_analysis_parameter_declarations(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_analysis_parameter_declarations - ) + return None if self.attributes is None else self.attributes.quick_sight_analysis_parameter_declarations @quick_sight_analysis_parameter_declarations.setter def quick_sight_analysis_parameter_declarations( @@ -170,73 +148,43 @@ def quick_sight_analysis_parameter_declarations( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_analysis_parameter_declarations = ( - quick_sight_analysis_parameter_declarations - ) + self.attributes.quick_sight_analysis_parameter_declarations = quick_sight_analysis_parameter_declarations @property def quick_sight_analysis_filter_groups(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_analysis_filter_groups - ) + return None if self.attributes is None else self.attributes.quick_sight_analysis_filter_groups @quick_sight_analysis_filter_groups.setter - def quick_sight_analysis_filter_groups( - self, quick_sight_analysis_filter_groups: Optional[Set[str]] - ): + def quick_sight_analysis_filter_groups(self, quick_sight_analysis_filter_groups: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_analysis_filter_groups = ( - quick_sight_analysis_filter_groups - ) + self.attributes.quick_sight_analysis_filter_groups = quick_sight_analysis_filter_groups @property def quick_sight_analysis_visuals(self) -> Optional[List[QuickSightAnalysisVisual]]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_analysis_visuals - ) + return None if self.attributes is None else self.attributes.quick_sight_analysis_visuals @quick_sight_analysis_visuals.setter - def quick_sight_analysis_visuals( - self, quick_sight_analysis_visuals: Optional[List[QuickSightAnalysisVisual]] - ): + def quick_sight_analysis_visuals(self, quick_sight_analysis_visuals: Optional[List[QuickSightAnalysisVisual]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_analysis_visuals = quick_sight_analysis_visuals @property def quick_sight_analysis_folders(self) -> Optional[List[QuickSightFolder]]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_analysis_folders - ) + return None if self.attributes is None else self.attributes.quick_sight_analysis_folders @quick_sight_analysis_folders.setter - def quick_sight_analysis_folders( - self, quick_sight_analysis_folders: Optional[List[QuickSightFolder]] - ): + def quick_sight_analysis_folders(self, quick_sight_analysis_folders: Optional[List[QuickSightFolder]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_analysis_folders = quick_sight_analysis_folders class Attributes(QuickSight.Attributes): - quick_sight_analysis_status: Optional[QuickSightAnalysisStatus] = Field( - default=None, description="" - ) - quick_sight_analysis_calculated_fields: Optional[Set[str]] = Field( - default=None, description="" - ) - quick_sight_analysis_parameter_declarations: Optional[Set[str]] = Field( - default=None, description="" - ) - quick_sight_analysis_filter_groups: Optional[Set[str]] = Field( - default=None, description="" - ) + quick_sight_analysis_status: Optional[QuickSightAnalysisStatus] = Field(default=None, description="") + quick_sight_analysis_calculated_fields: Optional[Set[str]] = Field(default=None, description="") + quick_sight_analysis_parameter_declarations: Optional[Set[str]] = Field(default=None, description="") + quick_sight_analysis_filter_groups: Optional[Set[str]] = Field(default=None, description="") quick_sight_analysis_visuals: Optional[List[QuickSightAnalysisVisual]] = Field( default=None, description="" ) # relationship @@ -270,9 +218,7 @@ def creator( quick_sight_id=quick_sight_id, qualified_name=f"{connection_qualified_name}/{quick_sight_id}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), quick_sight_analysis_folders=folders, ) diff --git a/pyatlan/model/assets/quick_sight_analysis_visual.py b/pyatlan/model/assets/quick_sight_analysis_visual.py index 60a05a982..4b452885d 100644 --- a/pyatlan/model/assets/quick_sight_analysis_visual.py +++ b/pyatlan/model/assets/quick_sight_analysis_visual.py @@ -115,21 +115,13 @@ def __setattr__(self, name, value): @property def quick_sight_analysis_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_analysis_qualified_name - ) + return None if self.attributes is None else self.attributes.quick_sight_analysis_qualified_name @quick_sight_analysis_qualified_name.setter - def quick_sight_analysis_qualified_name( - self, quick_sight_analysis_qualified_name: Optional[str] - ): + def quick_sight_analysis_qualified_name(self, quick_sight_analysis_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_analysis_qualified_name = ( - quick_sight_analysis_qualified_name - ) + self.attributes.quick_sight_analysis_qualified_name = quick_sight_analysis_qualified_name @property def quick_sight_analysis(self) -> Optional[QuickSightAnalysis]: @@ -142,12 +134,8 @@ def quick_sight_analysis(self, quick_sight_analysis: Optional[QuickSightAnalysis self.attributes.quick_sight_analysis = quick_sight_analysis class Attributes(QuickSight.Attributes): - quick_sight_analysis_qualified_name: Optional[str] = Field( - default=None, description="" - ) - quick_sight_analysis: Optional[QuickSightAnalysis] = Field( - default=None, description="" - ) # relationship + quick_sight_analysis_qualified_name: Optional[str] = Field(default=None, description="") + quick_sight_analysis: Optional[QuickSightAnalysis] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -179,9 +167,7 @@ def creator( ) assert quick_sight_analysis_qualified_name if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( quick_sight_analysis_qualified_name, diff --git a/pyatlan/model/assets/quick_sight_dashboard.py b/pyatlan/model/assets/quick_sight_dashboard.py index 018c87481..a7fece74e 100644 --- a/pyatlan/model/assets/quick_sight_dashboard.py +++ b/pyatlan/model/assets/quick_sight_dashboard.py @@ -75,11 +75,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QUICK_SIGHT_DASHBOARD_PUBLISHED_VERSION_NUMBER: ClassVar[NumericField] = ( - NumericField( - "quickSightDashboardPublishedVersionNumber", - "quickSightDashboardPublishedVersionNumber", - ) + QUICK_SIGHT_DASHBOARD_PUBLISHED_VERSION_NUMBER: ClassVar[NumericField] = NumericField( + "quickSightDashboardPublishedVersionNumber", + "quickSightDashboardPublishedVersionNumber", ) """ Version number of the published dashboard. @@ -91,15 +89,11 @@ def __setattr__(self, name, value): Time (epoch) at which this dashboard was last published, in milliseconds. """ - QUICK_SIGHT_DASHBOARD_FOLDERS: ClassVar[RelationField] = RelationField( - "quickSightDashboardFolders" - ) + QUICK_SIGHT_DASHBOARD_FOLDERS: ClassVar[RelationField] = RelationField("quickSightDashboardFolders") """ TBC """ - QUICK_SIGHT_DASHBOARD_VISUALS: ClassVar[RelationField] = RelationField( - "quickSightDashboardVisuals" - ) + QUICK_SIGHT_DASHBOARD_VISUALS: ClassVar[RelationField] = RelationField("quickSightDashboardVisuals") """ TBC """ @@ -113,11 +107,7 @@ def __setattr__(self, name, value): @property def quick_sight_dashboard_published_version_number(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_dashboard_published_version_number - ) + return None if self.attributes is None else self.attributes.quick_sight_dashboard_published_version_number @quick_sight_dashboard_published_version_number.setter def quick_sight_dashboard_published_version_number( @@ -125,40 +115,24 @@ def quick_sight_dashboard_published_version_number( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dashboard_published_version_number = ( - quick_sight_dashboard_published_version_number - ) + self.attributes.quick_sight_dashboard_published_version_number = quick_sight_dashboard_published_version_number @property def quick_sight_dashboard_last_published_time(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_dashboard_last_published_time - ) + return None if self.attributes is None else self.attributes.quick_sight_dashboard_last_published_time @quick_sight_dashboard_last_published_time.setter - def quick_sight_dashboard_last_published_time( - self, quick_sight_dashboard_last_published_time: Optional[datetime] - ): + def quick_sight_dashboard_last_published_time(self, quick_sight_dashboard_last_published_time: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dashboard_last_published_time = ( - quick_sight_dashboard_last_published_time - ) + self.attributes.quick_sight_dashboard_last_published_time = quick_sight_dashboard_last_published_time @property def quick_sight_dashboard_folders(self) -> Optional[List[QuickSightFolder]]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_dashboard_folders - ) + return None if self.attributes is None else self.attributes.quick_sight_dashboard_folders @quick_sight_dashboard_folders.setter - def quick_sight_dashboard_folders( - self, quick_sight_dashboard_folders: Optional[List[QuickSightFolder]] - ): + def quick_sight_dashboard_folders(self, quick_sight_dashboard_folders: Optional[List[QuickSightFolder]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dashboard_folders = quick_sight_dashboard_folders @@ -167,32 +141,22 @@ def quick_sight_dashboard_folders( def quick_sight_dashboard_visuals( self, ) -> Optional[List[QuickSightDashboardVisual]]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_dashboard_visuals - ) + return None if self.attributes is None else self.attributes.quick_sight_dashboard_visuals @quick_sight_dashboard_visuals.setter - def quick_sight_dashboard_visuals( - self, quick_sight_dashboard_visuals: Optional[List[QuickSightDashboardVisual]] - ): + def quick_sight_dashboard_visuals(self, quick_sight_dashboard_visuals: Optional[List[QuickSightDashboardVisual]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dashboard_visuals = quick_sight_dashboard_visuals class Attributes(QuickSight.Attributes): - quick_sight_dashboard_published_version_number: Optional[int] = Field( - default=None, description="" - ) - quick_sight_dashboard_last_published_time: Optional[datetime] = Field( - default=None, description="" - ) + quick_sight_dashboard_published_version_number: Optional[int] = Field(default=None, description="") + quick_sight_dashboard_last_published_time: Optional[datetime] = Field(default=None, description="") quick_sight_dashboard_folders: Optional[List[QuickSightFolder]] = Field( default=None, description="" ) # relationship - quick_sight_dashboard_visuals: Optional[List[QuickSightDashboardVisual]] = ( - Field(default=None, description="") + quick_sight_dashboard_visuals: Optional[List[QuickSightDashboardVisual]] = Field( + default=None, description="" ) # relationship @classmethod @@ -221,9 +185,7 @@ def creator( quick_sight_id=quick_sight_id, qualified_name=f"{connection_qualified_name}/{quick_sight_id}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), quick_sight_dashboard_folders=folders, ) diff --git a/pyatlan/model/assets/quick_sight_dashboard_visual.py b/pyatlan/model/assets/quick_sight_dashboard_visual.py index 29324002f..7c6e7f51f 100644 --- a/pyatlan/model/assets/quick_sight_dashboard_visual.py +++ b/pyatlan/model/assets/quick_sight_dashboard_visual.py @@ -103,9 +103,7 @@ def __setattr__(self, name, value): Unique name of the dashboard in which this visual exists. """ - QUICK_SIGHT_DASHBOARD: ClassVar[RelationField] = RelationField( - "quickSightDashboard" - ) + QUICK_SIGHT_DASHBOARD: ClassVar[RelationField] = RelationField("quickSightDashboard") """ TBC """ @@ -117,43 +115,27 @@ def __setattr__(self, name, value): @property def quick_sight_dashboard_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_dashboard_qualified_name - ) + return None if self.attributes is None else self.attributes.quick_sight_dashboard_qualified_name @quick_sight_dashboard_qualified_name.setter - def quick_sight_dashboard_qualified_name( - self, quick_sight_dashboard_qualified_name: Optional[str] - ): + def quick_sight_dashboard_qualified_name(self, quick_sight_dashboard_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dashboard_qualified_name = ( - quick_sight_dashboard_qualified_name - ) + self.attributes.quick_sight_dashboard_qualified_name = quick_sight_dashboard_qualified_name @property def quick_sight_dashboard(self) -> Optional[QuickSightDashboard]: - return ( - None if self.attributes is None else self.attributes.quick_sight_dashboard - ) + return None if self.attributes is None else self.attributes.quick_sight_dashboard @quick_sight_dashboard.setter - def quick_sight_dashboard( - self, quick_sight_dashboard: Optional[QuickSightDashboard] - ): + def quick_sight_dashboard(self, quick_sight_dashboard: Optional[QuickSightDashboard]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dashboard = quick_sight_dashboard class Attributes(QuickSight.Attributes): - quick_sight_dashboard_qualified_name: Optional[str] = Field( - default=None, description="" - ) - quick_sight_dashboard: Optional[QuickSightDashboard] = Field( - default=None, description="" - ) # relationship + quick_sight_dashboard_qualified_name: Optional[str] = Field(default=None, description="") + quick_sight_dashboard: Optional[QuickSightDashboard] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -185,9 +167,7 @@ def creator( ) assert quick_sight_dashboard_qualified_name if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( quick_sight_dashboard_qualified_name, @@ -202,9 +182,7 @@ def creator( quick_sight_sheet_id=quick_sight_sheet_id, quick_sight_sheet_name=quick_sight_sheet_name, quick_sight_dashboard_qualified_name=quick_sight_dashboard_qualified_name, - quick_sight_dashboard=QuickSightDashboard.ref_by_qualified_name( - quick_sight_dashboard_qualified_name - ), + quick_sight_dashboard=QuickSightDashboard.ref_by_qualified_name(quick_sight_dashboard_qualified_name), connection_qualified_name=connection_qualified_name, connector_name=connector_name, ) diff --git a/pyatlan/model/assets/quick_sight_dataset.py b/pyatlan/model/assets/quick_sight_dataset.py index c1a2557ef..8fb5defb9 100644 --- a/pyatlan/model/assets/quick_sight_dataset.py +++ b/pyatlan/model/assets/quick_sight_dataset.py @@ -90,15 +90,11 @@ def __setattr__(self, name, value): Number of columns present in this dataset. """ - QUICK_SIGHT_DATASET_FOLDERS: ClassVar[RelationField] = RelationField( - "quickSightDatasetFolders" - ) + QUICK_SIGHT_DATASET_FOLDERS: ClassVar[RelationField] = RelationField("quickSightDatasetFolders") """ TBC """ - QUICK_SIGHT_DATASET_FIELDS: ClassVar[RelationField] = RelationField( - "quickSightDatasetFields" - ) + QUICK_SIGHT_DATASET_FIELDS: ClassVar[RelationField] = RelationField("quickSightDatasetFields") """ TBC """ @@ -112,79 +108,47 @@ def __setattr__(self, name, value): @property def quick_sight_dataset_import_mode(self) -> Optional[QuickSightDatasetImportMode]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_dataset_import_mode - ) + return None if self.attributes is None else self.attributes.quick_sight_dataset_import_mode @quick_sight_dataset_import_mode.setter - def quick_sight_dataset_import_mode( - self, quick_sight_dataset_import_mode: Optional[QuickSightDatasetImportMode] - ): + def quick_sight_dataset_import_mode(self, quick_sight_dataset_import_mode: Optional[QuickSightDatasetImportMode]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dataset_import_mode = ( - quick_sight_dataset_import_mode - ) + self.attributes.quick_sight_dataset_import_mode = quick_sight_dataset_import_mode @property def quick_sight_dataset_column_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_dataset_column_count - ) + return None if self.attributes is None else self.attributes.quick_sight_dataset_column_count @quick_sight_dataset_column_count.setter - def quick_sight_dataset_column_count( - self, quick_sight_dataset_column_count: Optional[int] - ): + def quick_sight_dataset_column_count(self, quick_sight_dataset_column_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dataset_column_count = ( - quick_sight_dataset_column_count - ) + self.attributes.quick_sight_dataset_column_count = quick_sight_dataset_column_count @property def quick_sight_dataset_folders(self) -> Optional[List[QuickSightFolder]]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_dataset_folders - ) + return None if self.attributes is None else self.attributes.quick_sight_dataset_folders @quick_sight_dataset_folders.setter - def quick_sight_dataset_folders( - self, quick_sight_dataset_folders: Optional[List[QuickSightFolder]] - ): + def quick_sight_dataset_folders(self, quick_sight_dataset_folders: Optional[List[QuickSightFolder]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dataset_folders = quick_sight_dataset_folders @property def quick_sight_dataset_fields(self) -> Optional[List[QuickSightDatasetField]]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_dataset_fields - ) + return None if self.attributes is None else self.attributes.quick_sight_dataset_fields @quick_sight_dataset_fields.setter - def quick_sight_dataset_fields( - self, quick_sight_dataset_fields: Optional[List[QuickSightDatasetField]] - ): + def quick_sight_dataset_fields(self, quick_sight_dataset_fields: Optional[List[QuickSightDatasetField]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dataset_fields = quick_sight_dataset_fields class Attributes(QuickSight.Attributes): - quick_sight_dataset_import_mode: Optional[QuickSightDatasetImportMode] = Field( - default=None, description="" - ) - quick_sight_dataset_column_count: Optional[int] = Field( - default=None, description="" - ) + quick_sight_dataset_import_mode: Optional[QuickSightDatasetImportMode] = Field(default=None, description="") + quick_sight_dataset_column_count: Optional[int] = Field(default=None, description="") quick_sight_dataset_folders: Optional[List[QuickSightFolder]] = Field( default=None, description="" ) # relationship @@ -200,9 +164,7 @@ def creator( name: str, connection_qualified_name: str, quick_sight_id: str, - quick_sight_dataset_import_mode: Optional[ - QuickSightDatasetImportMode - ] = None, + quick_sight_dataset_import_mode: Optional[QuickSightDatasetImportMode] = None, quick_sight_dataset_folders: Optional[List[str]] = None, ) -> QuickSightDataset.Attributes: validate_required_fields( @@ -221,9 +183,7 @@ def creator( quick_sight_id=quick_sight_id, qualified_name=f"{connection_qualified_name}/{quick_sight_id}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), quick_sight_dataset_import_mode=quick_sight_dataset_import_mode, quick_sight_dataset_folders=folders, ) diff --git a/pyatlan/model/assets/quick_sight_dataset_field.py b/pyatlan/model/assets/quick_sight_dataset_field.py index b3a1c7f5b..de5aa0001 100644 --- a/pyatlan/model/assets/quick_sight_dataset_field.py +++ b/pyatlan/model/assets/quick_sight_dataset_field.py @@ -109,37 +109,23 @@ def __setattr__(self, name, value): @property def quick_sight_dataset_field_type(self) -> Optional[QuickSightDatasetFieldType]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_dataset_field_type - ) + return None if self.attributes is None else self.attributes.quick_sight_dataset_field_type @quick_sight_dataset_field_type.setter - def quick_sight_dataset_field_type( - self, quick_sight_dataset_field_type: Optional[QuickSightDatasetFieldType] - ): + def quick_sight_dataset_field_type(self, quick_sight_dataset_field_type: Optional[QuickSightDatasetFieldType]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dataset_field_type = quick_sight_dataset_field_type @property def quick_sight_dataset_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_dataset_qualified_name - ) + return None if self.attributes is None else self.attributes.quick_sight_dataset_qualified_name @quick_sight_dataset_qualified_name.setter - def quick_sight_dataset_qualified_name( - self, quick_sight_dataset_qualified_name: Optional[str] - ): + def quick_sight_dataset_qualified_name(self, quick_sight_dataset_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dataset_qualified_name = ( - quick_sight_dataset_qualified_name - ) + self.attributes.quick_sight_dataset_qualified_name = quick_sight_dataset_qualified_name @property def quick_sight_dataset(self) -> Optional[QuickSightDataset]: @@ -152,15 +138,9 @@ def quick_sight_dataset(self, quick_sight_dataset: Optional[QuickSightDataset]): self.attributes.quick_sight_dataset = quick_sight_dataset class Attributes(QuickSight.Attributes): - quick_sight_dataset_field_type: Optional[QuickSightDatasetFieldType] = Field( - default=None, description="" - ) - quick_sight_dataset_qualified_name: Optional[str] = Field( - default=None, description="" - ) - quick_sight_dataset: Optional[QuickSightDataset] = Field( - default=None, description="" - ) # relationship + quick_sight_dataset_field_type: Optional[QuickSightDatasetFieldType] = Field(default=None, description="") + quick_sight_dataset_qualified_name: Optional[str] = Field(default=None, description="") + quick_sight_dataset: Optional[QuickSightDataset] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -179,9 +159,7 @@ def creator( ) assert quick_sight_dataset_qualified_name if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( quick_sight_dataset_qualified_name, @@ -193,9 +171,7 @@ def creator( name=name, quick_sight_dataset_qualified_name=quick_sight_dataset_qualified_name, quick_sight_id=quick_sight_id, - quick_sight_dataset=QuickSightDataset.ref_by_qualified_name( - quick_sight_dataset_qualified_name - ), + quick_sight_dataset=QuickSightDataset.ref_by_qualified_name(quick_sight_dataset_qualified_name), qualified_name=f"{quick_sight_dataset_qualified_name}/{quick_sight_id}", connection_qualified_name=connection_qualified_name, connector_name=connector_name, diff --git a/pyatlan/model/assets/quick_sight_folder.py b/pyatlan/model/assets/quick_sight_folder.py index 1fae18349..8ab14f173 100644 --- a/pyatlan/model/assets/quick_sight_folder.py +++ b/pyatlan/model/assets/quick_sight_folder.py @@ -74,9 +74,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QUICK_SIGHT_FOLDER_TYPE: ClassVar[KeywordField] = KeywordField( - "quickSightFolderType", "quickSightFolderType" - ) + QUICK_SIGHT_FOLDER_TYPE: ClassVar[KeywordField] = KeywordField("quickSightFolderType", "quickSightFolderType") """ Type of this folder, for example: SHARED. """ @@ -91,9 +89,7 @@ def __setattr__(self, name, value): """ TBC """ - QUICK_SIGHT_DASHBOARDS: ClassVar[RelationField] = RelationField( - "quickSightDashboards" - ) + QUICK_SIGHT_DASHBOARDS: ClassVar[RelationField] = RelationField("quickSightDashboards") """ TBC """ @@ -112,30 +108,20 @@ def __setattr__(self, name, value): @property def quick_sight_folder_type(self) -> Optional[QuickSightFolderType]: - return ( - None if self.attributes is None else self.attributes.quick_sight_folder_type - ) + return None if self.attributes is None else self.attributes.quick_sight_folder_type @quick_sight_folder_type.setter - def quick_sight_folder_type( - self, quick_sight_folder_type: Optional[QuickSightFolderType] - ): + def quick_sight_folder_type(self, quick_sight_folder_type: Optional[QuickSightFolderType]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_folder_type = quick_sight_folder_type @property def quick_sight_folder_hierarchy(self) -> Optional[List[Dict[str, str]]]: - return ( - None - if self.attributes is None - else self.attributes.quick_sight_folder_hierarchy - ) + return None if self.attributes is None else self.attributes.quick_sight_folder_hierarchy @quick_sight_folder_hierarchy.setter - def quick_sight_folder_hierarchy( - self, quick_sight_folder_hierarchy: Optional[List[Dict[str, str]]] - ): + def quick_sight_folder_hierarchy(self, quick_sight_folder_hierarchy: Optional[List[Dict[str, str]]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_folder_hierarchy = quick_sight_folder_hierarchy @@ -145,23 +131,17 @@ def quick_sight_analyses(self) -> Optional[List[QuickSightAnalysis]]: return None if self.attributes is None else self.attributes.quick_sight_analyses @quick_sight_analyses.setter - def quick_sight_analyses( - self, quick_sight_analyses: Optional[List[QuickSightAnalysis]] - ): + def quick_sight_analyses(self, quick_sight_analyses: Optional[List[QuickSightAnalysis]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_analyses = quick_sight_analyses @property def quick_sight_dashboards(self) -> Optional[List[QuickSightDashboard]]: - return ( - None if self.attributes is None else self.attributes.quick_sight_dashboards - ) + return None if self.attributes is None else self.attributes.quick_sight_dashboards @quick_sight_dashboards.setter - def quick_sight_dashboards( - self, quick_sight_dashboards: Optional[List[QuickSightDashboard]] - ): + def quick_sight_dashboards(self, quick_sight_dashboards: Optional[List[QuickSightDashboard]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dashboards = quick_sight_dashboards @@ -171,29 +151,19 @@ def quick_sight_datasets(self) -> Optional[List[QuickSightDataset]]: return None if self.attributes is None else self.attributes.quick_sight_datasets @quick_sight_datasets.setter - def quick_sight_datasets( - self, quick_sight_datasets: Optional[List[QuickSightDataset]] - ): + def quick_sight_datasets(self, quick_sight_datasets: Optional[List[QuickSightDataset]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_datasets = quick_sight_datasets class Attributes(QuickSight.Attributes): - quick_sight_folder_type: Optional[QuickSightFolderType] = Field( - default=None, description="" - ) - quick_sight_folder_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - quick_sight_analyses: Optional[List[QuickSightAnalysis]] = Field( - default=None, description="" - ) # relationship + quick_sight_folder_type: Optional[QuickSightFolderType] = Field(default=None, description="") + quick_sight_folder_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + quick_sight_analyses: Optional[List[QuickSightAnalysis]] = Field(default=None, description="") # relationship quick_sight_dashboards: Optional[List[QuickSightDashboard]] = Field( default=None, description="" ) # relationship - quick_sight_datasets: Optional[List[QuickSightDataset]] = Field( - default=None, description="" - ) # relationship + quick_sight_datasets: Optional[List[QuickSightDataset]] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -214,9 +184,7 @@ def creator( quick_sight_id=quick_sight_id, qualified_name=f"{connection_qualified_name}/{quick_sight_id}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), quick_sight_folder_type=quick_sight_folder_type, ) diff --git a/pyatlan/model/assets/redash.py b/pyatlan/model/assets/redash.py index 602c9c4fa..81aa37bbc 100644 --- a/pyatlan/model/assets/redash.py +++ b/pyatlan/model/assets/redash.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - REDASH_IS_PUBLISHED: ClassVar[BooleanField] = BooleanField( - "redashIsPublished", "redashIsPublished" - ) + REDASH_IS_PUBLISHED: ClassVar[BooleanField] = BooleanField("redashIsPublished", "redashIsPublished") """ Whether this asset is published in Redash (true) or not (false). """ diff --git a/pyatlan/model/assets/redash_dashboard.py b/pyatlan/model/assets/redash_dashboard.py index 9f86e0a80..de6938ad8 100644 --- a/pyatlan/model/assets/redash_dashboard.py +++ b/pyatlan/model/assets/redash_dashboard.py @@ -42,24 +42,16 @@ def __setattr__(self, name, value): @property def redash_dashboard_widget_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.redash_dashboard_widget_count - ) + return None if self.attributes is None else self.attributes.redash_dashboard_widget_count @redash_dashboard_widget_count.setter - def redash_dashboard_widget_count( - self, redash_dashboard_widget_count: Optional[int] - ): + def redash_dashboard_widget_count(self, redash_dashboard_widget_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.redash_dashboard_widget_count = redash_dashboard_widget_count class Attributes(Redash.Attributes): - redash_dashboard_widget_count: Optional[int] = Field( - default=None, description="" - ) + redash_dashboard_widget_count: Optional[int] = Field(default=None, description="") attributes: RedashDashboard.Attributes = Field( default_factory=lambda: RedashDashboard.Attributes(), diff --git a/pyatlan/model/assets/redash_query.py b/pyatlan/model/assets/redash_query.py index 5e18319f5..ba03f8da9 100644 --- a/pyatlan/model/assets/redash_query.py +++ b/pyatlan/model/assets/redash_query.py @@ -36,21 +36,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - REDASH_QUERY_SQL: ClassVar[TextField] = TextField( - "redashQuerySQL", "redashQuerySQL" - ) + REDASH_QUERY_SQL: ClassVar[TextField] = TextField("redashQuerySQL", "redashQuerySQL") """ SQL code of this query. """ - REDASH_QUERY_PARAMETERS: ClassVar[TextField] = TextField( - "redashQueryParameters", "redashQueryParameters" - ) + REDASH_QUERY_PARAMETERS: ClassVar[TextField] = TextField("redashQueryParameters", "redashQueryParameters") """ Parameters of this query. """ - REDASH_QUERY_SCHEDULE: ClassVar[KeywordField] = KeywordField( - "redashQuerySchedule", "redashQuerySchedule" - ) + REDASH_QUERY_SCHEDULE: ClassVar[KeywordField] = KeywordField("redashQuerySchedule", "redashQuerySchedule") """ Schedule for this query. """ @@ -75,9 +69,7 @@ def __setattr__(self, name, value): Schdule for this query in readable text for overview tab and filtering. """ - REDASH_VISUALIZATIONS: ClassVar[RelationField] = RelationField( - "redashVisualizations" - ) + REDASH_VISUALIZATIONS: ClassVar[RelationField] = RelationField("redashVisualizations") """ TBC """ @@ -104,9 +96,7 @@ def redash_query_s_q_l(self, redash_query_s_q_l: Optional[str]): @property def redash_query_parameters(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.redash_query_parameters - ) + return None if self.attributes is None else self.attributes.redash_query_parameters @redash_query_parameters.setter def redash_query_parameters(self, redash_query_parameters: Optional[str]): @@ -116,9 +106,7 @@ def redash_query_parameters(self, redash_query_parameters: Optional[str]): @property def redash_query_schedule(self) -> Optional[Dict[str, str]]: - return ( - None if self.attributes is None else self.attributes.redash_query_schedule - ) + return None if self.attributes is None else self.attributes.redash_query_schedule @redash_query_schedule.setter def redash_query_schedule(self, redash_query_schedule: Optional[Dict[str, str]]): @@ -128,66 +116,40 @@ def redash_query_schedule(self, redash_query_schedule: Optional[Dict[str, str]]) @property def redash_query_last_execution_runtime(self) -> Optional[float]: - return ( - None - if self.attributes is None - else self.attributes.redash_query_last_execution_runtime - ) + return None if self.attributes is None else self.attributes.redash_query_last_execution_runtime @redash_query_last_execution_runtime.setter - def redash_query_last_execution_runtime( - self, redash_query_last_execution_runtime: Optional[float] - ): + def redash_query_last_execution_runtime(self, redash_query_last_execution_runtime: Optional[float]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.redash_query_last_execution_runtime = ( - redash_query_last_execution_runtime - ) + self.attributes.redash_query_last_execution_runtime = redash_query_last_execution_runtime @property def redash_query_last_executed_at(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.redash_query_last_executed_at - ) + return None if self.attributes is None else self.attributes.redash_query_last_executed_at @redash_query_last_executed_at.setter - def redash_query_last_executed_at( - self, redash_query_last_executed_at: Optional[datetime] - ): + def redash_query_last_executed_at(self, redash_query_last_executed_at: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.redash_query_last_executed_at = redash_query_last_executed_at @property def redash_query_schedule_humanized(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.redash_query_schedule_humanized - ) + return None if self.attributes is None else self.attributes.redash_query_schedule_humanized @redash_query_schedule_humanized.setter - def redash_query_schedule_humanized( - self, redash_query_schedule_humanized: Optional[str] - ): + def redash_query_schedule_humanized(self, redash_query_schedule_humanized: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.redash_query_schedule_humanized = ( - redash_query_schedule_humanized - ) + self.attributes.redash_query_schedule_humanized = redash_query_schedule_humanized @property def redash_visualizations(self) -> Optional[List[RedashVisualization]]: - return ( - None if self.attributes is None else self.attributes.redash_visualizations - ) + return None if self.attributes is None else self.attributes.redash_visualizations @redash_visualizations.setter - def redash_visualizations( - self, redash_visualizations: Optional[List[RedashVisualization]] - ): + def redash_visualizations(self, redash_visualizations: Optional[List[RedashVisualization]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.redash_visualizations = redash_visualizations @@ -195,21 +157,11 @@ def redash_visualizations( class Attributes(Redash.Attributes): redash_query_s_q_l: Optional[str] = Field(default=None, description="") redash_query_parameters: Optional[str] = Field(default=None, description="") - redash_query_schedule: Optional[Dict[str, str]] = Field( - default=None, description="" - ) - redash_query_last_execution_runtime: Optional[float] = Field( - default=None, description="" - ) - redash_query_last_executed_at: Optional[datetime] = Field( - default=None, description="" - ) - redash_query_schedule_humanized: Optional[str] = Field( - default=None, description="" - ) - redash_visualizations: Optional[List[RedashVisualization]] = Field( - default=None, description="" - ) # relationship + redash_query_schedule: Optional[Dict[str, str]] = Field(default=None, description="") + redash_query_last_execution_runtime: Optional[float] = Field(default=None, description="") + redash_query_last_executed_at: Optional[datetime] = Field(default=None, description="") + redash_query_schedule_humanized: Optional[str] = Field(default=None, description="") + redash_visualizations: Optional[List[RedashVisualization]] = Field(default=None, description="") # relationship attributes: RedashQuery.Attributes = Field( default_factory=lambda: RedashQuery.Attributes(), diff --git a/pyatlan/model/assets/redash_visualization.py b/pyatlan/model/assets/redash_visualization.py index 9f097c8bd..c335e15de 100644 --- a/pyatlan/model/assets/redash_visualization.py +++ b/pyatlan/model/assets/redash_visualization.py @@ -68,11 +68,7 @@ def __setattr__(self, name, value): @property def redash_visualization_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.redash_visualization_type - ) + return None if self.attributes is None else self.attributes.redash_visualization_type @redash_visualization_type.setter def redash_visualization_type(self, redash_visualization_type: Optional[str]): @@ -92,11 +88,7 @@ def redash_query_name(self, redash_query_name: Optional[str]): @property def redash_query_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.redash_query_qualified_name - ) + return None if self.attributes is None else self.attributes.redash_query_qualified_name @redash_query_qualified_name.setter def redash_query_qualified_name(self, redash_query_qualified_name: Optional[str]): @@ -118,9 +110,7 @@ class Attributes(Redash.Attributes): redash_visualization_type: Optional[str] = Field(default=None, description="") redash_query_name: Optional[str] = Field(default=None, description="") redash_query_qualified_name: Optional[str] = Field(default=None, description="") - redash_query: Optional[RedashQuery] = Field( - default=None, description="" - ) # relationship + redash_query: Optional[RedashQuery] = Field(default=None, description="") # relationship attributes: RedashVisualization.Attributes = Field( default_factory=lambda: RedashVisualization.Attributes(), diff --git a/pyatlan/model/assets/s3.py b/pyatlan/model/assets/s3.py index 8e4891389..19140aeb1 100644 --- a/pyatlan/model/assets/s3.py +++ b/pyatlan/model/assets/s3.py @@ -30,9 +30,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - S3E_TAG: ClassVar[KeywordTextField] = KeywordTextField( - "s3ETag", "s3ETag", "s3ETag.text" - ) + S3E_TAG: ClassVar[KeywordTextField] = KeywordTextField("s3ETag", "s3ETag", "s3ETag.text") """ Entity tag for the asset. An entity tag is a hash of the object and represents changes to the contents of an object only, not its metadata. """ # noqa: E501 @@ -40,9 +38,7 @@ def __setattr__(self, name, value): """ """ - AWS_ARN: ClassVar[KeywordTextField] = KeywordTextField( - "awsArn", "awsArn", "awsArn.text" - ) + AWS_ARN: ClassVar[KeywordTextField] = KeywordTextField("awsArn", "awsArn", "awsArn.text") """ Amazon Resource Name (ARN) for this asset. This uniquely identifies the asset in AWS, and thus must be unique across all AWS asset instances. """ # noqa: E501 @@ -58,21 +54,15 @@ def __setattr__(self, name, value): """ Physical region where the data center in which the asset exists is clustered. """ - AWS_ACCOUNT_ID: ClassVar[KeywordField] = KeywordField( - "awsAccountId", "awsAccountId" - ) + AWS_ACCOUNT_ID: ClassVar[KeywordField] = KeywordField("awsAccountId", "awsAccountId") """ 12-digit number that uniquely identifies an AWS account. """ - AWS_RESOURCE_ID: ClassVar[KeywordField] = KeywordField( - "awsResourceId", "awsResourceId" - ) + AWS_RESOURCE_ID: ClassVar[KeywordField] = KeywordField("awsResourceId", "awsResourceId") """ Unique resource ID assigned when a new resource is created. """ - AWS_OWNER_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "awsOwnerName", "awsOwnerName", "awsOwnerName.text" - ) + AWS_OWNER_NAME: ClassVar[KeywordTextField] = KeywordTextField("awsOwnerName", "awsOwnerName", "awsOwnerName.text") """ Root user's name. """ diff --git a/pyatlan/model/assets/s3_bucket.py b/pyatlan/model/assets/s3_bucket.py index f9fc7a765..cf10dc475 100644 --- a/pyatlan/model/assets/s3_bucket.py +++ b/pyatlan/model/assets/s3_bucket.py @@ -43,9 +43,7 @@ def creator( @classmethod @init_guid - def creator( - cls, *, name: str, connection_qualified_name: str, aws_arn: Optional[str] = None - ) -> S3Bucket: + def creator(cls, *, name: str, connection_qualified_name: str, aws_arn: Optional[str] = None) -> S3Bucket: validate_required_fields( ["name", "connection_qualified_name"], [name, connection_qualified_name], @@ -81,14 +79,9 @@ def create( @classmethod @init_guid - def create( - cls, *, name: str, connection_qualified_name: str, aws_arn: Optional[str] = None - ) -> S3Bucket: + def create(cls, *, name: str, connection_qualified_name: str, aws_arn: Optional[str] = None) -> S3Bucket: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -111,9 +104,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - S3OBJECT_COUNT: ClassVar[NumericField] = NumericField( - "s3ObjectCount", "s3ObjectCount" - ) + S3OBJECT_COUNT: ClassVar[NumericField] = NumericField("s3ObjectCount", "s3ObjectCount") """ Number of objects within the bucket. """ @@ -147,16 +138,10 @@ def s3_object_count(self, s3_object_count: Optional[int]): @property def s3_bucket_versioning_enabled(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.s3_bucket_versioning_enabled - ) + return None if self.attributes is None else self.attributes.s3_bucket_versioning_enabled @s3_bucket_versioning_enabled.setter - def s3_bucket_versioning_enabled( - self, s3_bucket_versioning_enabled: Optional[bool] - ): + def s3_bucket_versioning_enabled(self, s3_bucket_versioning_enabled: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.s3_bucket_versioning_enabled = s3_bucket_versioning_enabled @@ -173,12 +158,8 @@ def objects(self, objects: Optional[List[S3Object]]): class Attributes(S3.Attributes): s3_object_count: Optional[int] = Field(default=None, description="") - s3_bucket_versioning_enabled: Optional[bool] = Field( - default=None, description="" - ) - objects: Optional[List[S3Object]] = Field( - default=None, description="" - ) # relationship + s3_bucket_versioning_enabled: Optional[bool] = Field(default=None, description="") + objects: Optional[List[S3Object]] = Field(default=None, description="") # relationship @classmethod @init_guid diff --git a/pyatlan/model/assets/s3_object.py b/pyatlan/model/assets/s3_object.py index a0971ccbb..88740711c 100644 --- a/pyatlan/model/assets/s3_object.py +++ b/pyatlan/model/assets/s3_object.py @@ -73,10 +73,7 @@ def create( s3_bucket_qualified_name: str, ) -> S3Object: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -143,15 +140,11 @@ def __setattr__(self, name, value): """ Time (epoch) at which this object was last updated, in milliseconds, or when it was created if it has never been modified. """ # noqa: E501 - S3BUCKET_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "s3BucketName", "s3BucketName", "s3BucketName.text" - ) + S3BUCKET_NAME: ClassVar[KeywordTextField] = KeywordTextField("s3BucketName", "s3BucketName", "s3BucketName.text") """ Simple name of the bucket in which this object exists. """ - S3BUCKET_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "s3BucketQualifiedName", "s3BucketQualifiedName" - ) + S3BUCKET_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("s3BucketQualifiedName", "s3BucketQualifiedName") """ Unique name of the bucket in which this object exists. """ @@ -159,21 +152,15 @@ def __setattr__(self, name, value): """ Object size in bytes. """ - S3OBJECT_STORAGE_CLASS: ClassVar[KeywordField] = KeywordField( - "s3ObjectStorageClass", "s3ObjectStorageClass" - ) + S3OBJECT_STORAGE_CLASS: ClassVar[KeywordField] = KeywordField("s3ObjectStorageClass", "s3ObjectStorageClass") """ Storage class used for storing this object, for example: standard, intelligent-tiering, glacier, etc. """ - S3OBJECT_KEY: ClassVar[KeywordTextField] = KeywordTextField( - "s3ObjectKey", "s3ObjectKey", "s3ObjectKey.text" - ) + S3OBJECT_KEY: ClassVar[KeywordTextField] = KeywordTextField("s3ObjectKey", "s3ObjectKey", "s3ObjectKey.text") """ Unique identity of this object in an S3 bucket. This is usually the concatenation of any prefix (folder) in the S3 bucket with the name of the object (file) itself. """ # noqa: E501 - S3OBJECT_CONTENT_TYPE: ClassVar[KeywordField] = KeywordField( - "s3ObjectContentType", "s3ObjectContentType" - ) + S3OBJECT_CONTENT_TYPE: ClassVar[KeywordField] = KeywordField("s3ObjectContentType", "s3ObjectContentType") """ Type of content in this object, for example: text/plain, application/json, etc. """ @@ -183,9 +170,7 @@ def __setattr__(self, name, value): """ Information about how this object's content should be presented. """ - S3OBJECT_VERSION_ID: ClassVar[KeywordField] = KeywordField( - "s3ObjectVersionId", "s3ObjectVersionId" - ) + S3OBJECT_VERSION_ID: ClassVar[KeywordField] = KeywordField("s3ObjectVersionId", "s3ObjectVersionId") """ Version of this object. This is only applicable when versioning is enabled on the bucket in which this object exists. """ # noqa: E501 @@ -210,16 +195,10 @@ def __setattr__(self, name, value): @property def s3_object_last_modified_time(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.s3_object_last_modified_time - ) + return None if self.attributes is None else self.attributes.s3_object_last_modified_time @s3_object_last_modified_time.setter - def s3_object_last_modified_time( - self, s3_object_last_modified_time: Optional[datetime] - ): + def s3_object_last_modified_time(self, s3_object_last_modified_time: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.s3_object_last_modified_time = s3_object_last_modified_time @@ -236,11 +215,7 @@ def s3_bucket_name(self, s3_bucket_name: Optional[str]): @property def s3_bucket_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.s3_bucket_qualified_name - ) + return None if self.attributes is None else self.attributes.s3_bucket_qualified_name @s3_bucket_qualified_name.setter def s3_bucket_qualified_name(self, s3_bucket_qualified_name: Optional[str]): @@ -260,9 +235,7 @@ def s3_object_size(self, s3_object_size: Optional[int]): @property def s3_object_storage_class(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.s3_object_storage_class - ) + return None if self.attributes is None else self.attributes.s3_object_storage_class @s3_object_storage_class.setter def s3_object_storage_class(self, s3_object_storage_class: Optional[str]): @@ -282,9 +255,7 @@ def s3_object_key(self, s3_object_key: Optional[str]): @property def s3_object_content_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.s3_object_content_type - ) + return None if self.attributes is None else self.attributes.s3_object_content_type @s3_object_content_type.setter def s3_object_content_type(self, s3_object_content_type: Optional[str]): @@ -294,16 +265,10 @@ def s3_object_content_type(self, s3_object_content_type: Optional[str]): @property def s3_object_content_disposition(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.s3_object_content_disposition - ) + return None if self.attributes is None else self.attributes.s3_object_content_disposition @s3_object_content_disposition.setter - def s3_object_content_disposition( - self, s3_object_content_disposition: Optional[str] - ): + def s3_object_content_disposition(self, s3_object_content_disposition: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.s3_object_content_disposition = s3_object_content_disposition @@ -329,18 +294,14 @@ def bucket(self, bucket: Optional[S3Bucket]): self.attributes.bucket = bucket class Attributes(S3.Attributes): - s3_object_last_modified_time: Optional[datetime] = Field( - default=None, description="" - ) + s3_object_last_modified_time: Optional[datetime] = Field(default=None, description="") s3_bucket_name: Optional[str] = Field(default=None, description="") s3_bucket_qualified_name: Optional[str] = Field(default=None, description="") s3_object_size: Optional[int] = Field(default=None, description="") s3_object_storage_class: Optional[str] = Field(default=None, description="") s3_object_key: Optional[str] = Field(default=None, description="") s3_object_content_type: Optional[str] = Field(default=None, description="") - s3_object_content_disposition: Optional[str] = Field( - default=None, description="" - ) + s3_object_content_disposition: Optional[str] = Field(default=None, description="") s3_object_version_id: Optional[str] = Field(default=None, description="") bucket: Optional[S3Bucket] = Field(default=None, description="") # relationship diff --git a/pyatlan/model/assets/salesforce.py b/pyatlan/model/assets/salesforce.py index 32da0ae50..22509bacc 100644 --- a/pyatlan/model/assets/salesforce.py +++ b/pyatlan/model/assets/salesforce.py @@ -35,9 +35,7 @@ def __setattr__(self, name, value): """ Fully-qualified name of the organization in Salesforce. """ - API_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "apiName", "apiName.keyword", "apiName" - ) + API_NAME: ClassVar[KeywordTextField] = KeywordTextField("apiName", "apiName.keyword", "apiName") """ Name of this asset in the Salesforce API. """ @@ -49,11 +47,7 @@ def __setattr__(self, name, value): @property def organization_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.organization_qualified_name - ) + return None if self.attributes is None else self.attributes.organization_qualified_name @organization_qualified_name.setter def organization_qualified_name(self, organization_qualified_name: Optional[str]): diff --git a/pyatlan/model/assets/salesforce_dashboard.py b/pyatlan/model/assets/salesforce_dashboard.py index c679a9a41..0f435274b 100644 --- a/pyatlan/model/assets/salesforce_dashboard.py +++ b/pyatlan/model/assets/salesforce_dashboard.py @@ -113,12 +113,8 @@ class Attributes(Salesforce.Attributes): source_id: Optional[str] = Field(default=None, description="") dashboard_type: Optional[str] = Field(default=None, description="") report_count: Optional[int] = Field(default=None, description="") - reports: Optional[List[SalesforceReport]] = Field( - default=None, description="" - ) # relationship - organization: Optional[SalesforceOrganization] = Field( - default=None, description="" - ) # relationship + reports: Optional[List[SalesforceReport]] = Field(default=None, description="") # relationship + organization: Optional[SalesforceOrganization] = Field(default=None, description="") # relationship attributes: SalesforceDashboard.Attributes = Field( default_factory=lambda: SalesforceDashboard.Attributes(), diff --git a/pyatlan/model/assets/salesforce_field.py b/pyatlan/model/assets/salesforce_field.py index 74bac5d9f..45014b6d3 100644 --- a/pyatlan/model/assets/salesforce_field.py +++ b/pyatlan/model/assets/salesforce_field.py @@ -36,15 +36,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATA_TYPE: ClassVar[KeywordTextField] = KeywordTextField( - "dataType", "dataType", "dataType.text" - ) + DATA_TYPE: ClassVar[KeywordTextField] = KeywordTextField("dataType", "dataType", "dataType.text") """ Data type of values in this field. """ - OBJECT_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "objectQualifiedName", "objectQualifiedName" - ) + OBJECT_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("objectQualifiedName", "objectQualifiedName") """ Unique name of the object in which this field exists. """ @@ -52,9 +48,7 @@ def __setattr__(self, name, value): """ Order (position) of this field within the object. """ - INLINE_HELP_TEXT: ClassVar[TextField] = TextField( - "inlineHelpText", "inlineHelpText.text" - ) + INLINE_HELP_TEXT: ClassVar[TextField] = TextField("inlineHelpText", "inlineHelpText.text") """ Help text for this field. """ @@ -66,9 +60,7 @@ def __setattr__(self, name, value): """ Formula for this field, if it is a calculated field. """ - IS_CASE_SENSITIVE: ClassVar[BooleanField] = BooleanField( - "isCaseSensitive", "isCaseSensitive" - ) + IS_CASE_SENSITIVE: ClassVar[BooleanField] = BooleanField("isCaseSensitive", "isCaseSensitive") """ Whether this field is case sensitive (true) or in-sensitive (false). """ @@ -106,9 +98,7 @@ def __setattr__(self, name, value): """ Whether this field references a record of multiple objects (true) or not (false). """ - DEFAULT_VALUE_FORMULA: ClassVar[TextField] = TextField( - "defaultValueFormula", "defaultValueFormula" - ) + DEFAULT_VALUE_FORMULA: ClassVar[TextField] = TextField("defaultValueFormula", "defaultValueFormula") """ Formula for the default value for this field. """ @@ -155,9 +145,7 @@ def data_type(self, data_type: Optional[str]): @property def object_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.object_qualified_name - ) + return None if self.attributes is None else self.attributes.object_qualified_name @object_qualified_name.setter def object_qualified_name(self, object_qualified_name: Optional[str]): @@ -287,11 +275,7 @@ def picklist_values(self, picklist_values: Optional[Set[str]]): @property def is_polymorphic_foreign_key(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.is_polymorphic_foreign_key - ) + return None if self.attributes is None else self.attributes.is_polymorphic_foreign_key @is_polymorphic_foreign_key.setter def is_polymorphic_foreign_key(self, is_polymorphic_foreign_key: Optional[bool]): @@ -301,9 +285,7 @@ def is_polymorphic_foreign_key(self, is_polymorphic_foreign_key: Optional[bool]) @property def default_value_formula(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.default_value_formula - ) + return None if self.attributes is None else self.attributes.default_value_formula @default_value_formula.setter def default_value_formula(self, default_value_formula: Optional[str]): @@ -348,12 +330,8 @@ class Attributes(Salesforce.Attributes): picklist_values: Optional[Set[str]] = Field(default=None, description="") is_polymorphic_foreign_key: Optional[bool] = Field(default=None, description="") default_value_formula: Optional[str] = Field(default=None, description="") - lookup_objects: Optional[List[SalesforceObject]] = Field( - default=None, description="" - ) # relationship - object: Optional[SalesforceObject] = Field( - default=None, description="" - ) # relationship + lookup_objects: Optional[List[SalesforceObject]] = Field(default=None, description="") # relationship + object: Optional[SalesforceObject] = Field(default=None, description="") # relationship attributes: SalesforceField.Attributes = Field( default_factory=lambda: SalesforceField.Attributes(), diff --git a/pyatlan/model/assets/salesforce_object.py b/pyatlan/model/assets/salesforce_object.py index 709638be8..e468bee13 100644 --- a/pyatlan/model/assets/salesforce_object.py +++ b/pyatlan/model/assets/salesforce_object.py @@ -144,15 +144,9 @@ class Attributes(Salesforce.Attributes): is_mergable: Optional[bool] = Field(default=None, description="") is_queryable: Optional[bool] = Field(default=None, description="") field_count: Optional[int] = Field(default=None, description="") - lookup_fields: Optional[List[SalesforceField]] = Field( - default=None, description="" - ) # relationship - organization: Optional[SalesforceOrganization] = Field( - default=None, description="" - ) # relationship - fields: Optional[List[SalesforceField]] = Field( - default=None, description="" - ) # relationship + lookup_fields: Optional[List[SalesforceField]] = Field(default=None, description="") # relationship + organization: Optional[SalesforceOrganization] = Field(default=None, description="") # relationship + fields: Optional[List[SalesforceField]] = Field(default=None, description="") # relationship attributes: SalesforceObject.Attributes = Field( default_factory=lambda: SalesforceObject.Attributes(), diff --git a/pyatlan/model/assets/salesforce_organization.py b/pyatlan/model/assets/salesforce_organization.py index ebae9fb6b..abf4cf96c 100644 --- a/pyatlan/model/assets/salesforce_organization.py +++ b/pyatlan/model/assets/salesforce_organization.py @@ -96,15 +96,9 @@ def dashboards(self, dashboards: Optional[List[SalesforceDashboard]]): class Attributes(Salesforce.Attributes): source_id: Optional[str] = Field(default=None, description="") - reports: Optional[List[SalesforceReport]] = Field( - default=None, description="" - ) # relationship - objects: Optional[List[SalesforceObject]] = Field( - default=None, description="" - ) # relationship - dashboards: Optional[List[SalesforceDashboard]] = Field( - default=None, description="" - ) # relationship + reports: Optional[List[SalesforceReport]] = Field(default=None, description="") # relationship + objects: Optional[List[SalesforceObject]] = Field(default=None, description="") # relationship + dashboards: Optional[List[SalesforceDashboard]] = Field(default=None, description="") # relationship attributes: SalesforceOrganization.Attributes = Field( default_factory=lambda: SalesforceOrganization.Attributes(), diff --git a/pyatlan/model/assets/salesforce_report.py b/pyatlan/model/assets/salesforce_report.py index 0972cdc9d..9569d563b 100644 --- a/pyatlan/model/assets/salesforce_report.py +++ b/pyatlan/model/assets/salesforce_report.py @@ -37,9 +37,7 @@ def __setattr__(self, name, value): """ Type of report in Salesforce. """ - DETAIL_COLUMNS: ClassVar[KeywordField] = KeywordField( - "detailColumns", "detailColumns" - ) + DETAIL_COLUMNS: ClassVar[KeywordField] = KeywordField("detailColumns", "detailColumns") """ List of column names on the report. """ @@ -115,12 +113,8 @@ class Attributes(Salesforce.Attributes): source_id: Optional[str] = Field(default=None, description="") report_type: Optional[Dict[str, str]] = Field(default=None, description="") detail_columns: Optional[Set[str]] = Field(default=None, description="") - dashboards: Optional[List[SalesforceDashboard]] = Field( - default=None, description="" - ) # relationship - organization: Optional[SalesforceOrganization] = Field( - default=None, description="" - ) # relationship + dashboards: Optional[List[SalesforceDashboard]] = Field(default=None, description="") # relationship + organization: Optional[SalesforceOrganization] = Field(default=None, description="") # relationship attributes: SalesforceReport.Attributes = Field( default_factory=lambda: SalesforceReport.Attributes(), diff --git a/pyatlan/model/assets/sigma.py b/pyatlan/model/assets/sigma.py index 57497e5c0..d1cc7053e 100644 --- a/pyatlan/model/assets/sigma.py +++ b/pyatlan/model/assets/sigma.py @@ -83,16 +83,10 @@ def __setattr__(self, name, value): @property def sigma_workbook_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sigma_workbook_qualified_name - ) + return None if self.attributes is None else self.attributes.sigma_workbook_qualified_name @sigma_workbook_qualified_name.setter - def sigma_workbook_qualified_name( - self, sigma_workbook_qualified_name: Optional[str] - ): + def sigma_workbook_qualified_name(self, sigma_workbook_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sigma_workbook_qualified_name = sigma_workbook_qualified_name @@ -109,11 +103,7 @@ def sigma_workbook_name(self, sigma_workbook_name: Optional[str]): @property def sigma_page_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sigma_page_qualified_name - ) + return None if self.attributes is None else self.attributes.sigma_page_qualified_name @sigma_page_qualified_name.setter def sigma_page_qualified_name(self, sigma_page_qualified_name: Optional[str]): @@ -133,27 +123,17 @@ def sigma_page_name(self, sigma_page_name: Optional[str]): @property def sigma_data_element_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sigma_data_element_qualified_name - ) + return None if self.attributes is None else self.attributes.sigma_data_element_qualified_name @sigma_data_element_qualified_name.setter - def sigma_data_element_qualified_name( - self, sigma_data_element_qualified_name: Optional[str] - ): + def sigma_data_element_qualified_name(self, sigma_data_element_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sigma_data_element_qualified_name = ( - sigma_data_element_qualified_name - ) + self.attributes.sigma_data_element_qualified_name = sigma_data_element_qualified_name @property def sigma_data_element_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.sigma_data_element_name - ) + return None if self.attributes is None else self.attributes.sigma_data_element_name @sigma_data_element_name.setter def sigma_data_element_name(self, sigma_data_element_name: Optional[str]): @@ -162,15 +142,11 @@ def sigma_data_element_name(self, sigma_data_element_name: Optional[str]): self.attributes.sigma_data_element_name = sigma_data_element_name class Attributes(BI.Attributes): - sigma_workbook_qualified_name: Optional[str] = Field( - default=None, description="" - ) + sigma_workbook_qualified_name: Optional[str] = Field(default=None, description="") sigma_workbook_name: Optional[str] = Field(default=None, description="") sigma_page_qualified_name: Optional[str] = Field(default=None, description="") sigma_page_name: Optional[str] = Field(default=None, description="") - sigma_data_element_qualified_name: Optional[str] = Field( - default=None, description="" - ) + sigma_data_element_qualified_name: Optional[str] = Field(default=None, description="") sigma_data_element_name: Optional[str] = Field(default=None, description="") attributes: Sigma.Attributes = Field( diff --git a/pyatlan/model/assets/sigma_data_element.py b/pyatlan/model/assets/sigma_data_element.py index 30db2720a..c2011da3d 100644 --- a/pyatlan/model/assets/sigma_data_element.py +++ b/pyatlan/model/assets/sigma_data_element.py @@ -34,15 +34,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SIGMA_DATA_ELEMENT_QUERY: ClassVar[TextField] = TextField( - "sigmaDataElementQuery", "sigmaDataElementQuery" - ) + SIGMA_DATA_ELEMENT_QUERY: ClassVar[TextField] = TextField("sigmaDataElementQuery", "sigmaDataElementQuery") """ """ - SIGMA_DATA_ELEMENT_TYPE: ClassVar[KeywordField] = KeywordField( - "sigmaDataElementType", "sigmaDataElementType" - ) + SIGMA_DATA_ELEMENT_TYPE: ClassVar[KeywordField] = KeywordField("sigmaDataElementType", "sigmaDataElementType") """ """ @@ -57,9 +53,7 @@ def __setattr__(self, name, value): """ TBC """ - SIGMA_DATA_ELEMENT_FIELDS: ClassVar[RelationField] = RelationField( - "sigmaDataElementFields" - ) + SIGMA_DATA_ELEMENT_FIELDS: ClassVar[RelationField] = RelationField("sigmaDataElementFields") """ TBC """ @@ -74,11 +68,7 @@ def __setattr__(self, name, value): @property def sigma_data_element_query(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sigma_data_element_query - ) + return None if self.attributes is None else self.attributes.sigma_data_element_query @sigma_data_element_query.setter def sigma_data_element_query(self, sigma_data_element_query: Optional[str]): @@ -88,9 +78,7 @@ def sigma_data_element_query(self, sigma_data_element_query: Optional[str]): @property def sigma_data_element_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.sigma_data_element_type - ) + return None if self.attributes is None else self.attributes.sigma_data_element_type @sigma_data_element_type.setter def sigma_data_element_type(self, sigma_data_element_type: Optional[str]): @@ -100,16 +88,10 @@ def sigma_data_element_type(self, sigma_data_element_type: Optional[str]): @property def sigma_data_element_field_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.sigma_data_element_field_count - ) + return None if self.attributes is None else self.attributes.sigma_data_element_field_count @sigma_data_element_field_count.setter - def sigma_data_element_field_count( - self, sigma_data_element_field_count: Optional[int] - ): + def sigma_data_element_field_count(self, sigma_data_element_field_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sigma_data_element_field_count = sigma_data_element_field_count @@ -126,16 +108,10 @@ def sigma_page(self, sigma_page: Optional[SigmaPage]): @property def sigma_data_element_fields(self) -> Optional[List[SigmaDataElementField]]: - return ( - None - if self.attributes is None - else self.attributes.sigma_data_element_fields - ) + return None if self.attributes is None else self.attributes.sigma_data_element_fields @sigma_data_element_fields.setter - def sigma_data_element_fields( - self, sigma_data_element_fields: Optional[List[SigmaDataElementField]] - ): + def sigma_data_element_fields(self, sigma_data_element_fields: Optional[List[SigmaDataElementField]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sigma_data_element_fields = sigma_data_element_fields @@ -143,12 +119,8 @@ def sigma_data_element_fields( class Attributes(Sigma.Attributes): sigma_data_element_query: Optional[str] = Field(default=None, description="") sigma_data_element_type: Optional[str] = Field(default=None, description="") - sigma_data_element_field_count: Optional[int] = Field( - default=None, description="" - ) - sigma_page: Optional[SigmaPage] = Field( - default=None, description="" - ) # relationship + sigma_data_element_field_count: Optional[int] = Field(default=None, description="") + sigma_page: Optional[SigmaPage] = Field(default=None, description="") # relationship sigma_data_element_fields: Optional[List[SigmaDataElementField]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/sigma_data_element_field.py b/pyatlan/model/assets/sigma_data_element_field.py index 7be2beb92..c57f26dff 100644 --- a/pyatlan/model/assets/sigma_data_element_field.py +++ b/pyatlan/model/assets/sigma_data_element_field.py @@ -55,39 +55,23 @@ def __setattr__(self, name, value): @property def sigma_data_element_field_is_hidden(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.sigma_data_element_field_is_hidden - ) + return None if self.attributes is None else self.attributes.sigma_data_element_field_is_hidden @sigma_data_element_field_is_hidden.setter - def sigma_data_element_field_is_hidden( - self, sigma_data_element_field_is_hidden: Optional[bool] - ): + def sigma_data_element_field_is_hidden(self, sigma_data_element_field_is_hidden: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sigma_data_element_field_is_hidden = ( - sigma_data_element_field_is_hidden - ) + self.attributes.sigma_data_element_field_is_hidden = sigma_data_element_field_is_hidden @property def sigma_data_element_field_formula(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sigma_data_element_field_formula - ) + return None if self.attributes is None else self.attributes.sigma_data_element_field_formula @sigma_data_element_field_formula.setter - def sigma_data_element_field_formula( - self, sigma_data_element_field_formula: Optional[str] - ): + def sigma_data_element_field_formula(self, sigma_data_element_field_formula: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sigma_data_element_field_formula = ( - sigma_data_element_field_formula - ) + self.attributes.sigma_data_element_field_formula = sigma_data_element_field_formula @property def sigma_data_element(self) -> Optional[SigmaDataElement]: @@ -100,15 +84,9 @@ def sigma_data_element(self, sigma_data_element: Optional[SigmaDataElement]): self.attributes.sigma_data_element = sigma_data_element class Attributes(Sigma.Attributes): - sigma_data_element_field_is_hidden: Optional[bool] = Field( - default=None, description="" - ) - sigma_data_element_field_formula: Optional[str] = Field( - default=None, description="" - ) - sigma_data_element: Optional[SigmaDataElement] = Field( - default=None, description="" - ) # relationship + sigma_data_element_field_is_hidden: Optional[bool] = Field(default=None, description="") + sigma_data_element_field_formula: Optional[str] = Field(default=None, description="") + sigma_data_element: Optional[SigmaDataElement] = Field(default=None, description="") # relationship attributes: SigmaDataElementField.Attributes = Field( default_factory=lambda: SigmaDataElementField.Attributes(), diff --git a/pyatlan/model/assets/sigma_dataset.py b/pyatlan/model/assets/sigma_dataset.py index fbe9c6b7a..3ab0e8cba 100644 --- a/pyatlan/model/assets/sigma_dataset.py +++ b/pyatlan/model/assets/sigma_dataset.py @@ -36,9 +36,7 @@ def __setattr__(self, name, value): Number of columns in this dataset. """ - SIGMA_DATASET_COLUMNS: ClassVar[RelationField] = RelationField( - "sigmaDatasetColumns" - ) + SIGMA_DATASET_COLUMNS: ClassVar[RelationField] = RelationField("sigmaDatasetColumns") """ TBC """ @@ -50,11 +48,7 @@ def __setattr__(self, name, value): @property def sigma_dataset_column_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.sigma_dataset_column_count - ) + return None if self.attributes is None else self.attributes.sigma_dataset_column_count @sigma_dataset_column_count.setter def sigma_dataset_column_count(self, sigma_dataset_column_count: Optional[int]): @@ -64,23 +58,17 @@ def sigma_dataset_column_count(self, sigma_dataset_column_count: Optional[int]): @property def sigma_dataset_columns(self) -> Optional[List[SigmaDatasetColumn]]: - return ( - None if self.attributes is None else self.attributes.sigma_dataset_columns - ) + return None if self.attributes is None else self.attributes.sigma_dataset_columns @sigma_dataset_columns.setter - def sigma_dataset_columns( - self, sigma_dataset_columns: Optional[List[SigmaDatasetColumn]] - ): + def sigma_dataset_columns(self, sigma_dataset_columns: Optional[List[SigmaDatasetColumn]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sigma_dataset_columns = sigma_dataset_columns class Attributes(Sigma.Attributes): sigma_dataset_column_count: Optional[int] = Field(default=None, description="") - sigma_dataset_columns: Optional[List[SigmaDatasetColumn]] = Field( - default=None, description="" - ) # relationship + sigma_dataset_columns: Optional[List[SigmaDatasetColumn]] = Field(default=None, description="") # relationship attributes: SigmaDataset.Attributes = Field( default_factory=lambda: SigmaDataset.Attributes(), diff --git a/pyatlan/model/assets/sigma_dataset_column.py b/pyatlan/model/assets/sigma_dataset_column.py index 44de778ee..d04e968e7 100644 --- a/pyatlan/model/assets/sigma_dataset_column.py +++ b/pyatlan/model/assets/sigma_dataset_column.py @@ -57,11 +57,7 @@ def __setattr__(self, name, value): @property def sigma_dataset_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sigma_dataset_qualified_name - ) + return None if self.attributes is None else self.attributes.sigma_dataset_qualified_name @sigma_dataset_qualified_name.setter def sigma_dataset_qualified_name(self, sigma_dataset_qualified_name: Optional[str]): @@ -90,13 +86,9 @@ def sigma_dataset(self, sigma_dataset: Optional[SigmaDataset]): self.attributes.sigma_dataset = sigma_dataset class Attributes(Sigma.Attributes): - sigma_dataset_qualified_name: Optional[str] = Field( - default=None, description="" - ) + sigma_dataset_qualified_name: Optional[str] = Field(default=None, description="") sigma_dataset_name: Optional[str] = Field(default=None, description="") - sigma_dataset: Optional[SigmaDataset] = Field( - default=None, description="" - ) # relationship + sigma_dataset: Optional[SigmaDataset] = Field(default=None, description="") # relationship attributes: SigmaDatasetColumn.Attributes = Field( default_factory=lambda: SigmaDatasetColumn.Attributes(), diff --git a/pyatlan/model/assets/sigma_page.py b/pyatlan/model/assets/sigma_page.py index a33b75215..87f04a789 100644 --- a/pyatlan/model/assets/sigma_page.py +++ b/pyatlan/model/assets/sigma_page.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SIGMA_DATA_ELEMENT_COUNT: ClassVar[NumericField] = NumericField( - "sigmaDataElementCount", "sigmaDataElementCount" - ) + SIGMA_DATA_ELEMENT_COUNT: ClassVar[NumericField] = NumericField("sigmaDataElementCount", "sigmaDataElementCount") """ Number of data elements on this page. """ @@ -53,11 +51,7 @@ def __setattr__(self, name, value): @property def sigma_data_element_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.sigma_data_element_count - ) + return None if self.attributes is None else self.attributes.sigma_data_element_count @sigma_data_element_count.setter def sigma_data_element_count(self, sigma_data_element_count: Optional[int]): @@ -80,21 +74,15 @@ def sigma_data_elements(self) -> Optional[List[SigmaDataElement]]: return None if self.attributes is None else self.attributes.sigma_data_elements @sigma_data_elements.setter - def sigma_data_elements( - self, sigma_data_elements: Optional[List[SigmaDataElement]] - ): + def sigma_data_elements(self, sigma_data_elements: Optional[List[SigmaDataElement]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sigma_data_elements = sigma_data_elements class Attributes(Sigma.Attributes): sigma_data_element_count: Optional[int] = Field(default=None, description="") - sigma_workbook: Optional[SigmaWorkbook] = Field( - default=None, description="" - ) # relationship - sigma_data_elements: Optional[List[SigmaDataElement]] = Field( - default=None, description="" - ) # relationship + sigma_workbook: Optional[SigmaWorkbook] = Field(default=None, description="") # relationship + sigma_data_elements: Optional[List[SigmaDataElement]] = Field(default=None, description="") # relationship attributes: SigmaPage.Attributes = Field( default_factory=lambda: SigmaPage.Attributes(), diff --git a/pyatlan/model/assets/sigma_workbook.py b/pyatlan/model/assets/sigma_workbook.py index 6ecb9690d..1e01e9a66 100644 --- a/pyatlan/model/assets/sigma_workbook.py +++ b/pyatlan/model/assets/sigma_workbook.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SIGMA_PAGE_COUNT: ClassVar[NumericField] = NumericField( - "sigmaPageCount", "sigmaPageCount" - ) + SIGMA_PAGE_COUNT: ClassVar[NumericField] = NumericField("sigmaPageCount", "sigmaPageCount") """ Number of pages in this workbook. """ @@ -68,9 +66,7 @@ def sigma_pages(self, sigma_pages: Optional[List[SigmaPage]]): class Attributes(Sigma.Attributes): sigma_page_count: Optional[int] = Field(default=None, description="") - sigma_pages: Optional[List[SigmaPage]] = Field( - default=None, description="" - ) # relationship + sigma_pages: Optional[List[SigmaPage]] = Field(default=None, description="") # relationship attributes: SigmaWorkbook.Attributes = Field( default_factory=lambda: SigmaWorkbook.Attributes(), diff --git a/pyatlan/model/assets/sisense_dashboard.py b/pyatlan/model/assets/sisense_dashboard.py index e8c743631..0454a9d19 100644 --- a/pyatlan/model/assets/sisense_dashboard.py +++ b/pyatlan/model/assets/sisense_dashboard.py @@ -33,12 +33,10 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SISENSE_DASHBOARD_FOLDER_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( - KeywordTextField( - "sisenseDashboardFolderQualifiedName", - "sisenseDashboardFolderQualifiedName", - "sisenseDashboardFolderQualifiedName.text", - ) + SISENSE_DASHBOARD_FOLDER_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "sisenseDashboardFolderQualifiedName", + "sisenseDashboardFolderQualifiedName", + "sisenseDashboardFolderQualifiedName.text", ) """ Unique name of the folder in which this dashboard exists. @@ -73,34 +71,20 @@ def __setattr__(self, name, value): @property def sisense_dashboard_folder_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_dashboard_folder_qualified_name - ) + return None if self.attributes is None else self.attributes.sisense_dashboard_folder_qualified_name @sisense_dashboard_folder_qualified_name.setter - def sisense_dashboard_folder_qualified_name( - self, sisense_dashboard_folder_qualified_name: Optional[str] - ): + def sisense_dashboard_folder_qualified_name(self, sisense_dashboard_folder_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_dashboard_folder_qualified_name = ( - sisense_dashboard_folder_qualified_name - ) + self.attributes.sisense_dashboard_folder_qualified_name = sisense_dashboard_folder_qualified_name @property def sisense_dashboard_widget_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.sisense_dashboard_widget_count - ) + return None if self.attributes is None else self.attributes.sisense_dashboard_widget_count @sisense_dashboard_widget_count.setter - def sisense_dashboard_widget_count( - self, sisense_dashboard_widget_count: Optional[int] - ): + def sisense_dashboard_widget_count(self, sisense_dashboard_widget_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sisense_dashboard_widget_count = sisense_dashboard_widget_count @@ -136,21 +120,11 @@ def sisense_folder(self, sisense_folder: Optional[SisenseFolder]): self.attributes.sisense_folder = sisense_folder class Attributes(Sisense.Attributes): - sisense_dashboard_folder_qualified_name: Optional[str] = Field( - default=None, description="" - ) - sisense_dashboard_widget_count: Optional[int] = Field( - default=None, description="" - ) - sisense_datamodels: Optional[List[SisenseDatamodel]] = Field( - default=None, description="" - ) # relationship - sisense_widgets: Optional[List[SisenseWidget]] = Field( - default=None, description="" - ) # relationship - sisense_folder: Optional[SisenseFolder] = Field( - default=None, description="" - ) # relationship + sisense_dashboard_folder_qualified_name: Optional[str] = Field(default=None, description="") + sisense_dashboard_widget_count: Optional[int] = Field(default=None, description="") + sisense_datamodels: Optional[List[SisenseDatamodel]] = Field(default=None, description="") # relationship + sisense_widgets: Optional[List[SisenseWidget]] = Field(default=None, description="") # relationship + sisense_folder: Optional[SisenseFolder] = Field(default=None, description="") # relationship attributes: SisenseDashboard.Attributes = Field( default_factory=lambda: SisenseDashboard.Attributes(), diff --git a/pyatlan/model/assets/sisense_datamodel.py b/pyatlan/model/assets/sisense_datamodel.py index e08d11104..420d0cdb1 100644 --- a/pyatlan/model/assets/sisense_datamodel.py +++ b/pyatlan/model/assets/sisense_datamodel.py @@ -36,9 +36,7 @@ def __setattr__(self, name, value): """ Number of tables in this datamodel. """ - SISENSE_DATAMODEL_SERVER: ClassVar[KeywordField] = KeywordField( - "sisenseDatamodelServer", "sisenseDatamodelServer" - ) + SISENSE_DATAMODEL_SERVER: ClassVar[KeywordField] = KeywordField("sisenseDatamodelServer", "sisenseDatamodelServer") """ Hostname of the server on which this datamodel was created. """ @@ -67,9 +65,7 @@ def __setattr__(self, name, value): """ Time (epoch) when this datamodel was last published, in milliseconds. """ - SISENSE_DATAMODEL_TYPE: ClassVar[KeywordField] = KeywordField( - "sisenseDatamodelType", "sisenseDatamodelType" - ) + SISENSE_DATAMODEL_TYPE: ClassVar[KeywordField] = KeywordField("sisenseDatamodelType", "sisenseDatamodelType") """ Type of this datamodel, for example: 'extract' or 'custom'. """ @@ -80,9 +76,7 @@ def __setattr__(self, name, value): Default relation type for this datamodel. 'extract' type Datamodels have regular relations by default. 'live' type Datamodels have direct relations by default. """ # noqa: E501 - SISENSE_DATAMODEL_TABLES: ClassVar[RelationField] = RelationField( - "sisenseDatamodelTables" - ) + SISENSE_DATAMODEL_TABLES: ClassVar[RelationField] = RelationField("sisenseDatamodelTables") """ TBC """ @@ -106,27 +100,17 @@ def __setattr__(self, name, value): @property def sisense_datamodel_table_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_table_count - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_table_count @sisense_datamodel_table_count.setter - def sisense_datamodel_table_count( - self, sisense_datamodel_table_count: Optional[int] - ): + def sisense_datamodel_table_count(self, sisense_datamodel_table_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sisense_datamodel_table_count = sisense_datamodel_table_count @property def sisense_datamodel_server(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_server - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_server @sisense_datamodel_server.setter def sisense_datamodel_server(self, sisense_datamodel_server: Optional[str]): @@ -136,11 +120,7 @@ def sisense_datamodel_server(self, sisense_datamodel_server: Optional[str]): @property def sisense_datamodel_revision(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_revision - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_revision @sisense_datamodel_revision.setter def sisense_datamodel_revision(self, sisense_datamodel_revision: Optional[str]): @@ -150,29 +130,17 @@ def sisense_datamodel_revision(self, sisense_datamodel_revision: Optional[str]): @property def sisense_datamodel_last_build_time(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_last_build_time - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_last_build_time @sisense_datamodel_last_build_time.setter - def sisense_datamodel_last_build_time( - self, sisense_datamodel_last_build_time: Optional[datetime] - ): + def sisense_datamodel_last_build_time(self, sisense_datamodel_last_build_time: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_last_build_time = ( - sisense_datamodel_last_build_time - ) + self.attributes.sisense_datamodel_last_build_time = sisense_datamodel_last_build_time @property def sisense_datamodel_last_successful_build_time(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_last_successful_build_time - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_last_successful_build_time @sisense_datamodel_last_successful_build_time.setter def sisense_datamodel_last_successful_build_time( @@ -180,33 +148,21 @@ def sisense_datamodel_last_successful_build_time( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_last_successful_build_time = ( - sisense_datamodel_last_successful_build_time - ) + self.attributes.sisense_datamodel_last_successful_build_time = sisense_datamodel_last_successful_build_time @property def sisense_datamodel_last_publish_time(self) -> Optional[datetime]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_last_publish_time - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_last_publish_time @sisense_datamodel_last_publish_time.setter - def sisense_datamodel_last_publish_time( - self, sisense_datamodel_last_publish_time: Optional[datetime] - ): + def sisense_datamodel_last_publish_time(self, sisense_datamodel_last_publish_time: Optional[datetime]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_last_publish_time = ( - sisense_datamodel_last_publish_time - ) + self.attributes.sisense_datamodel_last_publish_time = sisense_datamodel_last_publish_time @property def sisense_datamodel_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.sisense_datamodel_type - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_type @sisense_datamodel_type.setter def sisense_datamodel_type(self, sisense_datamodel_type: Optional[str]): @@ -216,34 +172,20 @@ def sisense_datamodel_type(self, sisense_datamodel_type: Optional[str]): @property def sisense_datamodel_relation_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_relation_type - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_relation_type @sisense_datamodel_relation_type.setter - def sisense_datamodel_relation_type( - self, sisense_datamodel_relation_type: Optional[str] - ): + def sisense_datamodel_relation_type(self, sisense_datamodel_relation_type: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_relation_type = ( - sisense_datamodel_relation_type - ) + self.attributes.sisense_datamodel_relation_type = sisense_datamodel_relation_type @property def sisense_datamodel_tables(self) -> Optional[List[SisenseDatamodelTable]]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_tables - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_tables @sisense_datamodel_tables.setter - def sisense_datamodel_tables( - self, sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]] - ): + def sisense_datamodel_tables(self, sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sisense_datamodel_tables = sisense_datamodel_tables @@ -259,30 +201,18 @@ def sisense_dashboards(self, sisense_dashboards: Optional[List[SisenseDashboard] self.attributes.sisense_dashboards = sisense_dashboards class Attributes(Sisense.Attributes): - sisense_datamodel_table_count: Optional[int] = Field( - default=None, description="" - ) + sisense_datamodel_table_count: Optional[int] = Field(default=None, description="") sisense_datamodel_server: Optional[str] = Field(default=None, description="") sisense_datamodel_revision: Optional[str] = Field(default=None, description="") - sisense_datamodel_last_build_time: Optional[datetime] = Field( - default=None, description="" - ) - sisense_datamodel_last_successful_build_time: Optional[datetime] = Field( - default=None, description="" - ) - sisense_datamodel_last_publish_time: Optional[datetime] = Field( - default=None, description="" - ) + sisense_datamodel_last_build_time: Optional[datetime] = Field(default=None, description="") + sisense_datamodel_last_successful_build_time: Optional[datetime] = Field(default=None, description="") + sisense_datamodel_last_publish_time: Optional[datetime] = Field(default=None, description="") sisense_datamodel_type: Optional[str] = Field(default=None, description="") - sisense_datamodel_relation_type: Optional[str] = Field( - default=None, description="" - ) + sisense_datamodel_relation_type: Optional[str] = Field(default=None, description="") sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]] = Field( default=None, description="" ) # relationship - sisense_dashboards: Optional[List[SisenseDashboard]] = Field( - default=None, description="" - ) # relationship + sisense_dashboards: Optional[List[SisenseDashboard]] = Field(default=None, description="") # relationship attributes: SisenseDatamodel.Attributes = Field( default_factory=lambda: SisenseDatamodel.Attributes(), diff --git a/pyatlan/model/assets/sisense_datamodel_table.py b/pyatlan/model/assets/sisense_datamodel_table.py index ddaa5a5e3..11948f677 100644 --- a/pyatlan/model/assets/sisense_datamodel_table.py +++ b/pyatlan/model/assets/sisense_datamodel_table.py @@ -112,47 +112,27 @@ def __setattr__(self, name, value): @property def sisense_datamodel_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_qualified_name - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_qualified_name @sisense_datamodel_qualified_name.setter - def sisense_datamodel_qualified_name( - self, sisense_datamodel_qualified_name: Optional[str] - ): + def sisense_datamodel_qualified_name(self, sisense_datamodel_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_qualified_name = ( - sisense_datamodel_qualified_name - ) + self.attributes.sisense_datamodel_qualified_name = sisense_datamodel_qualified_name @property def sisense_datamodel_table_column_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_table_column_count - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_table_column_count @sisense_datamodel_table_column_count.setter - def sisense_datamodel_table_column_count( - self, sisense_datamodel_table_column_count: Optional[int] - ): + def sisense_datamodel_table_column_count(self, sisense_datamodel_table_column_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_column_count = ( - sisense_datamodel_table_column_count - ) + self.attributes.sisense_datamodel_table_column_count = sisense_datamodel_table_column_count @property def sisense_datamodel_table_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_table_type - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_table_type @sisense_datamodel_table_type.setter def sisense_datamodel_table_type(self, sisense_datamodel_table_type: Optional[str]): @@ -162,93 +142,53 @@ def sisense_datamodel_table_type(self, sisense_datamodel_table_type: Optional[st @property def sisense_datamodel_table_expression(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_table_expression - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_table_expression @sisense_datamodel_table_expression.setter - def sisense_datamodel_table_expression( - self, sisense_datamodel_table_expression: Optional[str] - ): + def sisense_datamodel_table_expression(self, sisense_datamodel_table_expression: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_expression = ( - sisense_datamodel_table_expression - ) + self.attributes.sisense_datamodel_table_expression = sisense_datamodel_table_expression @property def sisense_datamodel_table_is_materialized(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_table_is_materialized - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_table_is_materialized @sisense_datamodel_table_is_materialized.setter - def sisense_datamodel_table_is_materialized( - self, sisense_datamodel_table_is_materialized: Optional[bool] - ): + def sisense_datamodel_table_is_materialized(self, sisense_datamodel_table_is_materialized: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_is_materialized = ( - sisense_datamodel_table_is_materialized - ) + self.attributes.sisense_datamodel_table_is_materialized = sisense_datamodel_table_is_materialized @property def sisense_datamodel_table_is_hidden(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_table_is_hidden - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_table_is_hidden @sisense_datamodel_table_is_hidden.setter - def sisense_datamodel_table_is_hidden( - self, sisense_datamodel_table_is_hidden: Optional[bool] - ): + def sisense_datamodel_table_is_hidden(self, sisense_datamodel_table_is_hidden: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_is_hidden = ( - sisense_datamodel_table_is_hidden - ) + self.attributes.sisense_datamodel_table_is_hidden = sisense_datamodel_table_is_hidden @property def sisense_datamodel_table_schedule(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_table_schedule - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_table_schedule @sisense_datamodel_table_schedule.setter - def sisense_datamodel_table_schedule( - self, sisense_datamodel_table_schedule: Optional[str] - ): + def sisense_datamodel_table_schedule(self, sisense_datamodel_table_schedule: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_schedule = ( - sisense_datamodel_table_schedule - ) + self.attributes.sisense_datamodel_table_schedule = sisense_datamodel_table_schedule @property def sisense_datamodel_table_live_query_settings(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_table_live_query_settings - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_table_live_query_settings @sisense_datamodel_table_live_query_settings.setter - def sisense_datamodel_table_live_query_settings( - self, sisense_datamodel_table_live_query_settings: Optional[str] - ): + def sisense_datamodel_table_live_query_settings(self, sisense_datamodel_table_live_query_settings: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_live_query_settings = ( - sisense_datamodel_table_live_query_settings - ) + self.attributes.sisense_datamodel_table_live_query_settings = sisense_datamodel_table_live_query_settings @property def sisense_widgets(self) -> Optional[List[SisenseWidget]]: @@ -271,36 +211,16 @@ def sisense_datamodel(self, sisense_datamodel: Optional[SisenseDatamodel]): self.attributes.sisense_datamodel = sisense_datamodel class Attributes(Sisense.Attributes): - sisense_datamodel_qualified_name: Optional[str] = Field( - default=None, description="" - ) - sisense_datamodel_table_column_count: Optional[int] = Field( - default=None, description="" - ) - sisense_datamodel_table_type: Optional[str] = Field( - default=None, description="" - ) - sisense_datamodel_table_expression: Optional[str] = Field( - default=None, description="" - ) - sisense_datamodel_table_is_materialized: Optional[bool] = Field( - default=None, description="" - ) - sisense_datamodel_table_is_hidden: Optional[bool] = Field( - default=None, description="" - ) - sisense_datamodel_table_schedule: Optional[str] = Field( - default=None, description="" - ) - sisense_datamodel_table_live_query_settings: Optional[str] = Field( - default=None, description="" - ) - sisense_widgets: Optional[List[SisenseWidget]] = Field( - default=None, description="" - ) # relationship - sisense_datamodel: Optional[SisenseDatamodel] = Field( - default=None, description="" - ) # relationship + sisense_datamodel_qualified_name: Optional[str] = Field(default=None, description="") + sisense_datamodel_table_column_count: Optional[int] = Field(default=None, description="") + sisense_datamodel_table_type: Optional[str] = Field(default=None, description="") + sisense_datamodel_table_expression: Optional[str] = Field(default=None, description="") + sisense_datamodel_table_is_materialized: Optional[bool] = Field(default=None, description="") + sisense_datamodel_table_is_hidden: Optional[bool] = Field(default=None, description="") + sisense_datamodel_table_schedule: Optional[str] = Field(default=None, description="") + sisense_datamodel_table_live_query_settings: Optional[str] = Field(default=None, description="") + sisense_widgets: Optional[List[SisenseWidget]] = Field(default=None, description="") # relationship + sisense_datamodel: Optional[SisenseDatamodel] = Field(default=None, description="") # relationship attributes: SisenseDatamodelTable.Attributes = Field( default_factory=lambda: SisenseDatamodelTable.Attributes(), diff --git a/pyatlan/model/assets/sisense_folder.py b/pyatlan/model/assets/sisense_folder.py index 000a59671..19f6660e8 100644 --- a/pyatlan/model/assets/sisense_folder.py +++ b/pyatlan/model/assets/sisense_folder.py @@ -29,12 +29,10 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SISENSE_FOLDER_PARENT_FOLDER_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( - KeywordTextField( - "sisenseFolderParentFolderQualifiedName", - "sisenseFolderParentFolderQualifiedName", - "sisenseFolderParentFolderQualifiedName.text", - ) + SISENSE_FOLDER_PARENT_FOLDER_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "sisenseFolderParentFolderQualifiedName", + "sisenseFolderParentFolderQualifiedName", + "sisenseFolderParentFolderQualifiedName.text", ) """ Unique name of the parent folder in which this folder exists. @@ -44,9 +42,7 @@ def __setattr__(self, name, value): """ TBC """ - SISENSE_CHILD_FOLDERS: ClassVar[RelationField] = RelationField( - "sisenseChildFolders" - ) + SISENSE_CHILD_FOLDERS: ClassVar[RelationField] = RelationField("sisenseChildFolders") """ TBC """ @@ -54,9 +50,7 @@ def __setattr__(self, name, value): """ TBC """ - SISENSE_PARENT_FOLDER: ClassVar[RelationField] = RelationField( - "sisenseParentFolder" - ) + SISENSE_PARENT_FOLDER: ClassVar[RelationField] = RelationField("sisenseParentFolder") """ TBC """ @@ -71,21 +65,13 @@ def __setattr__(self, name, value): @property def sisense_folder_parent_folder_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_folder_parent_folder_qualified_name - ) + return None if self.attributes is None else self.attributes.sisense_folder_parent_folder_qualified_name @sisense_folder_parent_folder_qualified_name.setter - def sisense_folder_parent_folder_qualified_name( - self, sisense_folder_parent_folder_qualified_name: Optional[str] - ): + def sisense_folder_parent_folder_qualified_name(self, sisense_folder_parent_folder_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_folder_parent_folder_qualified_name = ( - sisense_folder_parent_folder_qualified_name - ) + self.attributes.sisense_folder_parent_folder_qualified_name = sisense_folder_parent_folder_qualified_name @property def sisense_widgets(self) -> Optional[List[SisenseWidget]]: @@ -99,14 +85,10 @@ def sisense_widgets(self, sisense_widgets: Optional[List[SisenseWidget]]): @property def sisense_child_folders(self) -> Optional[List[SisenseFolder]]: - return ( - None if self.attributes is None else self.attributes.sisense_child_folders - ) + return None if self.attributes is None else self.attributes.sisense_child_folders @sisense_child_folders.setter - def sisense_child_folders( - self, sisense_child_folders: Optional[List[SisenseFolder]] - ): + def sisense_child_folders(self, sisense_child_folders: Optional[List[SisenseFolder]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sisense_child_folders = sisense_child_folders @@ -123,9 +105,7 @@ def sisense_dashboards(self, sisense_dashboards: Optional[List[SisenseDashboard] @property def sisense_parent_folder(self) -> Optional[SisenseFolder]: - return ( - None if self.attributes is None else self.attributes.sisense_parent_folder - ) + return None if self.attributes is None else self.attributes.sisense_parent_folder @sisense_parent_folder.setter def sisense_parent_folder(self, sisense_parent_folder: Optional[SisenseFolder]): @@ -134,21 +114,11 @@ def sisense_parent_folder(self, sisense_parent_folder: Optional[SisenseFolder]): self.attributes.sisense_parent_folder = sisense_parent_folder class Attributes(Sisense.Attributes): - sisense_folder_parent_folder_qualified_name: Optional[str] = Field( - default=None, description="" - ) - sisense_widgets: Optional[List[SisenseWidget]] = Field( - default=None, description="" - ) # relationship - sisense_child_folders: Optional[List[SisenseFolder]] = Field( - default=None, description="" - ) # relationship - sisense_dashboards: Optional[List[SisenseDashboard]] = Field( - default=None, description="" - ) # relationship - sisense_parent_folder: Optional[SisenseFolder] = Field( - default=None, description="" - ) # relationship + sisense_folder_parent_folder_qualified_name: Optional[str] = Field(default=None, description="") + sisense_widgets: Optional[List[SisenseWidget]] = Field(default=None, description="") # relationship + sisense_child_folders: Optional[List[SisenseFolder]] = Field(default=None, description="") # relationship + sisense_dashboards: Optional[List[SisenseDashboard]] = Field(default=None, description="") # relationship + sisense_parent_folder: Optional[SisenseFolder] = Field(default=None, description="") # relationship attributes: SisenseFolder.Attributes = Field( default_factory=lambda: SisenseFolder.Attributes(), diff --git a/pyatlan/model/assets/sisense_widget.py b/pyatlan/model/assets/sisense_widget.py index 7750faa3b..c97353958 100644 --- a/pyatlan/model/assets/sisense_widget.py +++ b/pyatlan/model/assets/sisense_widget.py @@ -40,24 +40,18 @@ def __setattr__(self, name, value): """ Number of columns used in this widget. """ - SISENSE_WIDGET_SUB_TYPE: ClassVar[KeywordField] = KeywordField( - "sisenseWidgetSubType", "sisenseWidgetSubType" - ) + SISENSE_WIDGET_SUB_TYPE: ClassVar[KeywordField] = KeywordField("sisenseWidgetSubType", "sisenseWidgetSubType") """ Subtype of this widget. """ - SISENSE_WIDGET_SIZE: ClassVar[KeywordField] = KeywordField( - "sisenseWidgetSize", "sisenseWidgetSize" - ) + SISENSE_WIDGET_SIZE: ClassVar[KeywordField] = KeywordField("sisenseWidgetSize", "sisenseWidgetSize") """ Size of this widget. """ - SISENSE_WIDGET_DASHBOARD_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( - KeywordTextField( - "sisenseWidgetDashboardQualifiedName", - "sisenseWidgetDashboardQualifiedName", - "sisenseWidgetDashboardQualifiedName.text", - ) + SISENSE_WIDGET_DASHBOARD_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "sisenseWidgetDashboardQualifiedName", + "sisenseWidgetDashboardQualifiedName", + "sisenseWidgetDashboardQualifiedName.text", ) """ Unique name of the dashboard in which this widget exists. @@ -71,9 +65,7 @@ def __setattr__(self, name, value): Unique name of the folder in which this widget exists. """ - SISENSE_DATAMODEL_TABLES: ClassVar[RelationField] = RelationField( - "sisenseDatamodelTables" - ) + SISENSE_DATAMODEL_TABLES: ClassVar[RelationField] = RelationField("sisenseDatamodelTables") """ TBC """ @@ -99,11 +91,7 @@ def __setattr__(self, name, value): @property def sisense_widget_column_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.sisense_widget_column_count - ) + return None if self.attributes is None else self.attributes.sisense_widget_column_count @sisense_widget_column_count.setter def sisense_widget_column_count(self, sisense_widget_column_count: Optional[int]): @@ -113,9 +101,7 @@ def sisense_widget_column_count(self, sisense_widget_column_count: Optional[int] @property def sisense_widget_sub_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.sisense_widget_sub_type - ) + return None if self.attributes is None else self.attributes.sisense_widget_sub_type @sisense_widget_sub_type.setter def sisense_widget_sub_type(self, sisense_widget_sub_type: Optional[str]): @@ -135,52 +121,30 @@ def sisense_widget_size(self, sisense_widget_size: Optional[str]): @property def sisense_widget_dashboard_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_widget_dashboard_qualified_name - ) + return None if self.attributes is None else self.attributes.sisense_widget_dashboard_qualified_name @sisense_widget_dashboard_qualified_name.setter - def sisense_widget_dashboard_qualified_name( - self, sisense_widget_dashboard_qualified_name: Optional[str] - ): + def sisense_widget_dashboard_qualified_name(self, sisense_widget_dashboard_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_widget_dashboard_qualified_name = ( - sisense_widget_dashboard_qualified_name - ) + self.attributes.sisense_widget_dashboard_qualified_name = sisense_widget_dashboard_qualified_name @property def sisense_widget_folder_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.sisense_widget_folder_qualified_name - ) + return None if self.attributes is None else self.attributes.sisense_widget_folder_qualified_name @sisense_widget_folder_qualified_name.setter - def sisense_widget_folder_qualified_name( - self, sisense_widget_folder_qualified_name: Optional[str] - ): + def sisense_widget_folder_qualified_name(self, sisense_widget_folder_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_widget_folder_qualified_name = ( - sisense_widget_folder_qualified_name - ) + self.attributes.sisense_widget_folder_qualified_name = sisense_widget_folder_qualified_name @property def sisense_datamodel_tables(self) -> Optional[List[SisenseDatamodelTable]]: - return ( - None - if self.attributes is None - else self.attributes.sisense_datamodel_tables - ) + return None if self.attributes is None else self.attributes.sisense_datamodel_tables @sisense_datamodel_tables.setter - def sisense_datamodel_tables( - self, sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]] - ): + def sisense_datamodel_tables(self, sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sisense_datamodel_tables = sisense_datamodel_tables @@ -209,21 +173,13 @@ class Attributes(Sisense.Attributes): sisense_widget_column_count: Optional[int] = Field(default=None, description="") sisense_widget_sub_type: Optional[str] = Field(default=None, description="") sisense_widget_size: Optional[str] = Field(default=None, description="") - sisense_widget_dashboard_qualified_name: Optional[str] = Field( - default=None, description="" - ) - sisense_widget_folder_qualified_name: Optional[str] = Field( - default=None, description="" - ) + sisense_widget_dashboard_qualified_name: Optional[str] = Field(default=None, description="") + sisense_widget_folder_qualified_name: Optional[str] = Field(default=None, description="") sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]] = Field( default=None, description="" ) # relationship - sisense_folder: Optional[SisenseFolder] = Field( - default=None, description="" - ) # relationship - sisense_dashboard: Optional[SisenseDashboard] = Field( - default=None, description="" - ) # relationship + sisense_folder: Optional[SisenseFolder] = Field(default=None, description="") # relationship + sisense_dashboard: Optional[SisenseDashboard] = Field(default=None, description="") # relationship attributes: SisenseWidget.Attributes = Field( default_factory=lambda: SisenseWidget.Attributes(), diff --git a/pyatlan/model/assets/superset.py b/pyatlan/model/assets/superset.py index 3e6fdcf01..602f9c926 100644 --- a/pyatlan/model/assets/superset.py +++ b/pyatlan/model/assets/superset.py @@ -29,9 +29,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SUPERSET_DASHBOARD_ID: ClassVar[NumericField] = NumericField( - "supersetDashboardId", "supersetDashboardId" - ) + SUPERSET_DASHBOARD_ID: ClassVar[NumericField] = NumericField("supersetDashboardId", "supersetDashboardId") """ Identifier of the dashboard in which this asset exists, in Superset. """ @@ -51,9 +49,7 @@ def __setattr__(self, name, value): @property def superset_dashboard_id(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.superset_dashboard_id - ) + return None if self.attributes is None else self.attributes.superset_dashboard_id @superset_dashboard_id.setter def superset_dashboard_id(self, superset_dashboard_id: Optional[int]): @@ -63,27 +59,17 @@ def superset_dashboard_id(self, superset_dashboard_id: Optional[int]): @property def superset_dashboard_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.superset_dashboard_qualified_name - ) + return None if self.attributes is None else self.attributes.superset_dashboard_qualified_name @superset_dashboard_qualified_name.setter - def superset_dashboard_qualified_name( - self, superset_dashboard_qualified_name: Optional[str] - ): + def superset_dashboard_qualified_name(self, superset_dashboard_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_qualified_name = ( - superset_dashboard_qualified_name - ) + self.attributes.superset_dashboard_qualified_name = superset_dashboard_qualified_name class Attributes(BI.Attributes): superset_dashboard_id: Optional[int] = Field(default=None, description="") - superset_dashboard_qualified_name: Optional[str] = Field( - default=None, description="" - ) + superset_dashboard_qualified_name: Optional[str] = Field(default=None, description="") attributes: Superset.Attributes = Field( default_factory=lambda: Superset.Attributes(), diff --git a/pyatlan/model/assets/superset_chart.py b/pyatlan/model/assets/superset_chart.py index 19745ba0c..b9b2b77ca 100644 --- a/pyatlan/model/assets/superset_chart.py +++ b/pyatlan/model/assets/superset_chart.py @@ -60,14 +60,9 @@ def creator( @classmethod @init_guid - def create( - cls, *, name: str, superset_dashboard_qualified_name: str - ) -> SupersetChart: + def create(cls, *, name: str, superset_dashboard_qualified_name: str) -> SupersetChart: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -95,9 +90,7 @@ def __setattr__(self, name, value): """ Description markdown of the chart. """ - SUPERSET_CHART_FORM_DATA: ClassVar[KeywordField] = KeywordField( - "supersetChartFormData", "supersetChartFormData" - ) + SUPERSET_CHART_FORM_DATA: ClassVar[KeywordField] = KeywordField("supersetChartFormData", "supersetChartFormData") """ Data stored for the chart in key value pairs. """ @@ -115,34 +108,20 @@ def __setattr__(self, name, value): @property def superset_chart_description_markdown(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.superset_chart_description_markdown - ) + return None if self.attributes is None else self.attributes.superset_chart_description_markdown @superset_chart_description_markdown.setter - def superset_chart_description_markdown( - self, superset_chart_description_markdown: Optional[str] - ): + def superset_chart_description_markdown(self, superset_chart_description_markdown: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_chart_description_markdown = ( - superset_chart_description_markdown - ) + self.attributes.superset_chart_description_markdown = superset_chart_description_markdown @property def superset_chart_form_data(self) -> Optional[Dict[str, str]]: - return ( - None - if self.attributes is None - else self.attributes.superset_chart_form_data - ) + return None if self.attributes is None else self.attributes.superset_chart_form_data @superset_chart_form_data.setter - def superset_chart_form_data( - self, superset_chart_form_data: Optional[Dict[str, str]] - ): + def superset_chart_form_data(self, superset_chart_form_data: Optional[Dict[str, str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.superset_chart_form_data = superset_chart_form_data @@ -158,15 +137,9 @@ def superset_dashboard(self, superset_dashboard: Optional[SupersetDashboard]): self.attributes.superset_dashboard = superset_dashboard class Attributes(Superset.Attributes): - superset_chart_description_markdown: Optional[str] = Field( - default=None, description="" - ) - superset_chart_form_data: Optional[Dict[str, str]] = Field( - default=None, description="" - ) - superset_dashboard: Optional[SupersetDashboard] = Field( - default=None, description="" - ) # relationship + superset_chart_description_markdown: Optional[str] = Field(default=None, description="") + superset_chart_form_data: Optional[Dict[str, str]] = Field(default=None, description="") + superset_dashboard: Optional[SupersetDashboard] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -182,9 +155,7 @@ def create( [name, superset_dashboard_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( superset_dashboard_qualified_name, @@ -198,9 +169,7 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{superset_dashboard_qualified_name}/{name}", connector_name=connector_name, - superset_dashboard=SupersetDashboard.ref_by_qualified_name( - superset_dashboard_qualified_name - ), + superset_dashboard=SupersetDashboard.ref_by_qualified_name(superset_dashboard_qualified_name), ) attributes: SupersetChart.Attributes = Field( diff --git a/pyatlan/model/assets/superset_dashboard.py b/pyatlan/model/assets/superset_dashboard.py index ebb551cf6..69b3293a4 100644 --- a/pyatlan/model/assets/superset_dashboard.py +++ b/pyatlan/model/assets/superset_dashboard.py @@ -42,16 +42,11 @@ def creator(cls, *, name: str, connection_qualified_name: str) -> SupersetDashbo @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> SupersetDashboard: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) - return cls.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + return cls.creator(name=name, connection_qualified_name=connection_qualified_name) type_name: str = Field(default="SupersetDashboard", allow_mutation=False) @@ -66,13 +61,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SUPERSET_DASHBOARD_CHANGED_BY_NAME: ClassVar[KeywordTextStemmedField] = ( - KeywordTextStemmedField( - "supersetDashboardChangedByName", - "supersetDashboardChangedByName.keyword", - "supersetDashboardChangedByName", - "supersetDashboardChangedByName.stemmed", - ) + SUPERSET_DASHBOARD_CHANGED_BY_NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( + "supersetDashboardChangedByName", + "supersetDashboardChangedByName.keyword", + "supersetDashboardChangedByName", + "supersetDashboardChangedByName.stemmed", ) """ Name of the user who changed the dashboard. @@ -130,106 +123,60 @@ def __setattr__(self, name, value): @property def superset_dashboard_changed_by_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.superset_dashboard_changed_by_name - ) + return None if self.attributes is None else self.attributes.superset_dashboard_changed_by_name @superset_dashboard_changed_by_name.setter - def superset_dashboard_changed_by_name( - self, superset_dashboard_changed_by_name: Optional[str] - ): + def superset_dashboard_changed_by_name(self, superset_dashboard_changed_by_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_changed_by_name = ( - superset_dashboard_changed_by_name - ) + self.attributes.superset_dashboard_changed_by_name = superset_dashboard_changed_by_name @property def superset_dashboard_changed_by_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.superset_dashboard_changed_by_url - ) + return None if self.attributes is None else self.attributes.superset_dashboard_changed_by_url @superset_dashboard_changed_by_url.setter - def superset_dashboard_changed_by_url( - self, superset_dashboard_changed_by_url: Optional[str] - ): + def superset_dashboard_changed_by_url(self, superset_dashboard_changed_by_url: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_changed_by_url = ( - superset_dashboard_changed_by_url - ) + self.attributes.superset_dashboard_changed_by_url = superset_dashboard_changed_by_url @property def superset_dashboard_is_managed_externally(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.superset_dashboard_is_managed_externally - ) + return None if self.attributes is None else self.attributes.superset_dashboard_is_managed_externally @superset_dashboard_is_managed_externally.setter - def superset_dashboard_is_managed_externally( - self, superset_dashboard_is_managed_externally: Optional[bool] - ): + def superset_dashboard_is_managed_externally(self, superset_dashboard_is_managed_externally: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_is_managed_externally = ( - superset_dashboard_is_managed_externally - ) + self.attributes.superset_dashboard_is_managed_externally = superset_dashboard_is_managed_externally @property def superset_dashboard_is_published(self) -> Optional[bool]: - return ( - None - if self.attributes is None - else self.attributes.superset_dashboard_is_published - ) + return None if self.attributes is None else self.attributes.superset_dashboard_is_published @superset_dashboard_is_published.setter - def superset_dashboard_is_published( - self, superset_dashboard_is_published: Optional[bool] - ): + def superset_dashboard_is_published(self, superset_dashboard_is_published: Optional[bool]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_is_published = ( - superset_dashboard_is_published - ) + self.attributes.superset_dashboard_is_published = superset_dashboard_is_published @property def superset_dashboard_thumbnail_url(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.superset_dashboard_thumbnail_url - ) + return None if self.attributes is None else self.attributes.superset_dashboard_thumbnail_url @superset_dashboard_thumbnail_url.setter - def superset_dashboard_thumbnail_url( - self, superset_dashboard_thumbnail_url: Optional[str] - ): + def superset_dashboard_thumbnail_url(self, superset_dashboard_thumbnail_url: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_thumbnail_url = ( - superset_dashboard_thumbnail_url - ) + self.attributes.superset_dashboard_thumbnail_url = superset_dashboard_thumbnail_url @property def superset_dashboard_chart_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.superset_dashboard_chart_count - ) + return None if self.attributes is None else self.attributes.superset_dashboard_chart_count @superset_dashboard_chart_count.setter - def superset_dashboard_chart_count( - self, superset_dashboard_chart_count: Optional[int] - ): + def superset_dashboard_chart_count(self, superset_dashboard_chart_count: Optional[int]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.superset_dashboard_chart_count = superset_dashboard_chart_count @@ -255,36 +202,18 @@ def superset_charts(self, superset_charts: Optional[List[SupersetChart]]): self.attributes.superset_charts = superset_charts class Attributes(Superset.Attributes): - superset_dashboard_changed_by_name: Optional[str] = Field( - default=None, description="" - ) - superset_dashboard_changed_by_url: Optional[str] = Field( - default=None, description="" - ) - superset_dashboard_is_managed_externally: Optional[bool] = Field( - default=None, description="" - ) - superset_dashboard_is_published: Optional[bool] = Field( - default=None, description="" - ) - superset_dashboard_thumbnail_url: Optional[str] = Field( - default=None, description="" - ) - superset_dashboard_chart_count: Optional[int] = Field( - default=None, description="" - ) - superset_datasets: Optional[List[SupersetDataset]] = Field( - default=None, description="" - ) # relationship - superset_charts: Optional[List[SupersetChart]] = Field( - default=None, description="" - ) # relationship + superset_dashboard_changed_by_name: Optional[str] = Field(default=None, description="") + superset_dashboard_changed_by_url: Optional[str] = Field(default=None, description="") + superset_dashboard_is_managed_externally: Optional[bool] = Field(default=None, description="") + superset_dashboard_is_published: Optional[bool] = Field(default=None, description="") + superset_dashboard_thumbnail_url: Optional[str] = Field(default=None, description="") + superset_dashboard_chart_count: Optional[int] = Field(default=None, description="") + superset_datasets: Optional[List[SupersetDataset]] = Field(default=None, description="") # relationship + superset_charts: Optional[List[SupersetChart]] = Field(default=None, description="") # relationship @classmethod @init_guid - def create( - cls, *, name: str, connection_qualified_name: str - ) -> SupersetDashboard.Attributes: + def create(cls, *, name: str, connection_qualified_name: str) -> SupersetDashboard.Attributes: validate_required_fields( ["name", "connection_qualified_name"], [name, connection_qualified_name], @@ -293,9 +222,7 @@ def create( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name( - connection_qualified_name - ), + connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), ) attributes: SupersetDashboard.Attributes = Field( diff --git a/pyatlan/model/assets/superset_dataset.py b/pyatlan/model/assets/superset_dataset.py index 8238b481d..46b19e814 100644 --- a/pyatlan/model/assets/superset_dataset.py +++ b/pyatlan/model/assets/superset_dataset.py @@ -65,14 +65,9 @@ def creator( @classmethod @init_guid - def create( - cls, *, name: str, superset_dashboard_qualified_name: str - ) -> SupersetDataset: + def create(cls, *, name: str, superset_dashboard_qualified_name: str) -> SupersetDataset: warn( - ( - "This method is deprecated, please use 'creator' " - "instead, which offers identical functionality." - ), + ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), DeprecationWarning, stacklevel=2, ) @@ -94,26 +89,20 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SUPERSET_DATASET_DATASOURCE_NAME: ClassVar[KeywordTextStemmedField] = ( - KeywordTextStemmedField( - "supersetDatasetDatasourceName", - "supersetDatasetDatasourceName.keyword", - "supersetDatasetDatasourceName", - "supersetDatasetDatasourceName.stemmed", - ) + SUPERSET_DATASET_DATASOURCE_NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( + "supersetDatasetDatasourceName", + "supersetDatasetDatasourceName.keyword", + "supersetDatasetDatasourceName", + "supersetDatasetDatasourceName.stemmed", ) """ Name of the datasource for the dataset. """ - SUPERSET_DATASET_ID: ClassVar[NumericField] = NumericField( - "supersetDatasetId", "supersetDatasetId" - ) + SUPERSET_DATASET_ID: ClassVar[NumericField] = NumericField("supersetDatasetId", "supersetDatasetId") """ Id of the dataset in superset. """ - SUPERSET_DATASET_TYPE: ClassVar[KeywordField] = KeywordField( - "supersetDatasetType", "supersetDatasetType" - ) + SUPERSET_DATASET_TYPE: ClassVar[KeywordField] = KeywordField("supersetDatasetType", "supersetDatasetType") """ Type of the dataset in superset. """ @@ -132,21 +121,13 @@ def __setattr__(self, name, value): @property def superset_dataset_datasource_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.superset_dataset_datasource_name - ) + return None if self.attributes is None else self.attributes.superset_dataset_datasource_name @superset_dataset_datasource_name.setter - def superset_dataset_datasource_name( - self, superset_dataset_datasource_name: Optional[str] - ): + def superset_dataset_datasource_name(self, superset_dataset_datasource_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dataset_datasource_name = ( - superset_dataset_datasource_name - ) + self.attributes.superset_dataset_datasource_name = superset_dataset_datasource_name @property def superset_dataset_id(self) -> Optional[int]: @@ -160,9 +141,7 @@ def superset_dataset_id(self, superset_dataset_id: Optional[int]): @property def superset_dataset_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.superset_dataset_type - ) + return None if self.attributes is None else self.attributes.superset_dataset_type @superset_dataset_type.setter def superset_dataset_type(self, superset_dataset_type: Optional[str]): @@ -181,14 +160,10 @@ def superset_dashboard(self, superset_dashboard: Optional[SupersetDashboard]): self.attributes.superset_dashboard = superset_dashboard class Attributes(Superset.Attributes): - superset_dataset_datasource_name: Optional[str] = Field( - default=None, description="" - ) + superset_dataset_datasource_name: Optional[str] = Field(default=None, description="") superset_dataset_id: Optional[int] = Field(default=None, description="") superset_dataset_type: Optional[str] = Field(default=None, description="") - superset_dashboard: Optional[SupersetDashboard] = Field( - default=None, description="" - ) # relationship + superset_dashboard: Optional[SupersetDashboard] = Field(default=None, description="") # relationship @classmethod @init_guid @@ -204,9 +179,7 @@ def create( [name, superset_dashboard_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name( - connection_qualified_name - ) + connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( superset_dashboard_qualified_name, @@ -220,9 +193,7 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{superset_dashboard_qualified_name}/{name}", connector_name=connector_name, - superset_dashboard=SupersetDashboard.ref_by_qualified_name( - superset_dashboard_qualified_name - ), + superset_dashboard=SupersetDashboard.ref_by_qualified_name(superset_dashboard_qualified_name), ) attributes: SupersetDataset.Attributes = Field( diff --git a/pyatlan/model/assets/tableau_calculated_field.py b/pyatlan/model/assets/tableau_calculated_field.py index 789e13d1a..6dbc154e7 100644 --- a/pyatlan/model/assets/tableau_calculated_field.py +++ b/pyatlan/model/assets/tableau_calculated_field.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "siteQualifiedName", "siteQualifiedName" - ) + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") """ Unique name of the site in which this calculated field exists. """ @@ -52,21 +50,15 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this calculated field exists. """ - WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "workbookQualifiedName", "workbookQualifiedName" - ) + WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField("workbookQualifiedName", "workbookQualifiedName") """ Unique name of the workbook in which this calculated field exists. """ - DATASOURCE_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "datasourceQualifiedName", "datasourceQualifiedName" - ) + DATASOURCE_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasourceQualifiedName", "datasourceQualifiedName") """ Unique name of the datasource in which this calculated field exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( - "projectHierarchy", "projectHierarchy" - ) + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") """ List of top-level projects and their nested projects. """ @@ -88,9 +80,7 @@ def __setattr__(self, name, value): """ Formula for this calculated field. """ - UPSTREAM_FIELDS: ClassVar[KeywordField] = KeywordField( - "upstreamFields", "upstreamFields" - ) + UPSTREAM_FIELDS: ClassVar[KeywordField] = KeywordField("upstreamFields", "upstreamFields") """ List of fields that are upstream to this calculated field. """ @@ -132,9 +122,7 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.project_qualified_name - ) + return None if self.attributes is None else self.attributes.project_qualified_name @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -144,27 +132,17 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.top_level_project_qualified_name - ) + return None if self.attributes is None else self.attributes.top_level_project_qualified_name @top_level_project_qualified_name.setter - def top_level_project_qualified_name( - self, top_level_project_qualified_name: Optional[str] - ): + def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = ( - top_level_project_qualified_name - ) + self.attributes.top_level_project_qualified_name = top_level_project_qualified_name @property def workbook_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.workbook_qualified_name - ) + return None if self.attributes is None else self.attributes.workbook_qualified_name @workbook_qualified_name.setter def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @@ -174,11 +152,7 @@ def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @property def datasource_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.datasource_qualified_name - ) + return None if self.attributes is None else self.attributes.datasource_qualified_name @datasource_qualified_name.setter def datasource_qualified_name(self, datasource_qualified_name: Optional[str]): @@ -269,27 +243,17 @@ def datasource(self, datasource: Optional[TableauDatasource]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field( - default=None, description="" - ) + top_level_project_qualified_name: Optional[str] = Field(default=None, description="") workbook_qualified_name: Optional[str] = Field(default=None, description="") datasource_qualified_name: Optional[str] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) + project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") data_category: Optional[str] = Field(default=None, description="") role: Optional[str] = Field(default=None, description="") tableau_data_type: Optional[str] = Field(default=None, description="") formula: Optional[str] = Field(default=None, description="") - upstream_fields: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - worksheets: Optional[List[TableauWorksheet]] = Field( - default=None, description="" - ) # relationship - datasource: Optional[TableauDatasource] = Field( - default=None, description="" - ) # relationship + upstream_fields: Optional[List[Dict[str, str]]] = Field(default=None, description="") + worksheets: Optional[List[TableauWorksheet]] = Field(default=None, description="") # relationship + datasource: Optional[TableauDatasource] = Field(default=None, description="") # relationship attributes: TableauCalculatedField.Attributes = Field( default_factory=lambda: TableauCalculatedField.Attributes(), diff --git a/pyatlan/model/assets/tableau_dashboard.py b/pyatlan/model/assets/tableau_dashboard.py index 7878a9da6..b7a377a21 100644 --- a/pyatlan/model/assets/tableau_dashboard.py +++ b/pyatlan/model/assets/tableau_dashboard.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "siteQualifiedName", "siteQualifiedName" - ) + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") """ Unique name of the site in which this dashboard exists. """ @@ -46,9 +44,7 @@ def __setattr__(self, name, value): """ Unique name of the project in which this dashboard exists. """ - WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "workbookQualifiedName", "workbookQualifiedName" - ) + WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField("workbookQualifiedName", "workbookQualifiedName") """ Unique name of the workbook in which this dashboard exists. """ @@ -58,9 +54,7 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this dashboard exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( - "projectHierarchy", "projectHierarchy" - ) + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") """ List of top-level projects and their nested child projects. """ @@ -96,9 +90,7 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.project_qualified_name - ) + return None if self.attributes is None else self.attributes.project_qualified_name @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -108,9 +100,7 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def workbook_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.workbook_qualified_name - ) + return None if self.attributes is None else self.attributes.workbook_qualified_name @workbook_qualified_name.setter def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @@ -120,21 +110,13 @@ def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.top_level_project_qualified_name - ) + return None if self.attributes is None else self.attributes.top_level_project_qualified_name @top_level_project_qualified_name.setter - def top_level_project_qualified_name( - self, top_level_project_qualified_name: Optional[str] - ): + def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = ( - top_level_project_qualified_name - ) + self.attributes.top_level_project_qualified_name = top_level_project_qualified_name @property def project_hierarchy(self) -> Optional[List[Dict[str, str]]]: @@ -170,18 +152,10 @@ class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") workbook_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field( - default=None, description="" - ) - project_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - workbook: Optional[TableauWorkbook] = Field( - default=None, description="" - ) # relationship - worksheets: Optional[List[TableauWorksheet]] = Field( - default=None, description="" - ) # relationship + top_level_project_qualified_name: Optional[str] = Field(default=None, description="") + project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + workbook: Optional[TableauWorkbook] = Field(default=None, description="") # relationship + worksheets: Optional[List[TableauWorksheet]] = Field(default=None, description="") # relationship attributes: TableauDashboard.Attributes = Field( default_factory=lambda: TableauDashboard.Attributes(), diff --git a/pyatlan/model/assets/tableau_datasource.py b/pyatlan/model/assets/tableau_datasource.py index c06bb8985..4dd3b5f1c 100644 --- a/pyatlan/model/assets/tableau_datasource.py +++ b/pyatlan/model/assets/tableau_datasource.py @@ -35,9 +35,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "siteQualifiedName", "siteQualifiedName" - ) + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") """ Unique name of the site in which this datasource exists. """ @@ -53,15 +51,11 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this datasource exists. """ - WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "workbookQualifiedName", "workbookQualifiedName" - ) + WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField("workbookQualifiedName", "workbookQualifiedName") """ Unique name of the workbook in which this datasource exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( - "projectHierarchy", "projectHierarchy" - ) + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") """ List of top-level projects with their nested child projects. """ @@ -81,27 +75,19 @@ def __setattr__(self, name, value): """ Users that have marked this datasource as cerified, in Tableau. """ - CERTIFICATION_NOTE: ClassVar[TextField] = TextField( - "certificationNote", "certificationNote" - ) + CERTIFICATION_NOTE: ClassVar[TextField] = TextField("certificationNote", "certificationNote") """ Notes related to this datasource being cerfified, in Tableau. """ - CERTIFIER_DISPLAY_NAME: ClassVar[TextField] = TextField( - "certifierDisplayName", "certifierDisplayName" - ) + CERTIFIER_DISPLAY_NAME: ClassVar[TextField] = TextField("certifierDisplayName", "certifierDisplayName") """ Name of the user who cerified this datasource, in Tableau. """ - UPSTREAM_TABLES: ClassVar[KeywordField] = KeywordField( - "upstreamTables", "upstreamTables" - ) + UPSTREAM_TABLES: ClassVar[KeywordField] = KeywordField("upstreamTables", "upstreamTables") """ List of tables that are upstream of this datasource. """ - UPSTREAM_DATASOURCES: ClassVar[KeywordField] = KeywordField( - "upstreamDatasources", "upstreamDatasources" - ) + UPSTREAM_DATASOURCES: ClassVar[KeywordField] = KeywordField("upstreamDatasources", "upstreamDatasources") """ List of datasources that are upstream of this datasource. """ @@ -150,9 +136,7 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.project_qualified_name - ) + return None if self.attributes is None else self.attributes.project_qualified_name @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -162,27 +146,17 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.top_level_project_qualified_name - ) + return None if self.attributes is None else self.attributes.top_level_project_qualified_name @top_level_project_qualified_name.setter - def top_level_project_qualified_name( - self, top_level_project_qualified_name: Optional[str] - ): + def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = ( - top_level_project_qualified_name - ) + self.attributes.top_level_project_qualified_name = top_level_project_qualified_name @property def workbook_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.workbook_qualified_name - ) + return None if self.attributes is None else self.attributes.workbook_qualified_name @workbook_qualified_name.setter def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @@ -252,9 +226,7 @@ def certification_note(self, certification_note: Optional[str]): @property def certifier_display_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.certifier_display_name - ) + return None if self.attributes is None else self.attributes.certifier_display_name @certifier_display_name.setter def certifier_display_name(self, certifier_display_name: Optional[str]): @@ -267,9 +239,7 @@ def upstream_tables(self) -> Optional[List[Dict[str, Optional[str]]]]: return None if self.attributes is None else self.attributes.upstream_tables @upstream_tables.setter - def upstream_tables( - self, upstream_tables: Optional[List[Dict[str, Optional[str]]]] - ): + def upstream_tables(self, upstream_tables: Optional[List[Dict[str, Optional[str]]]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.upstream_tables = upstream_tables @@ -279,9 +249,7 @@ def upstream_datasources(self) -> Optional[List[Dict[str, Optional[str]]]]: return None if self.attributes is None else self.attributes.upstream_datasources @upstream_datasources.setter - def upstream_datasources( - self, upstream_datasources: Optional[List[Dict[str, Optional[str]]]] - ): + def upstream_datasources(self, upstream_datasources: Optional[List[Dict[str, Optional[str]]]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.upstream_datasources = upstream_datasources @@ -319,34 +287,20 @@ def fields(self, fields: Optional[List[TableauDatasourceField]]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field( - default=None, description="" - ) + top_level_project_qualified_name: Optional[str] = Field(default=None, description="") workbook_qualified_name: Optional[str] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) + project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") is_published: Optional[bool] = Field(default=None, description="") has_extracts: Optional[bool] = Field(default=None, description="") is_certified: Optional[bool] = Field(default=None, description="") certifier: Optional[Dict[str, str]] = Field(default=None, description="") certification_note: Optional[str] = Field(default=None, description="") certifier_display_name: Optional[str] = Field(default=None, description="") - upstream_tables: Optional[List[Dict[str, Optional[str]]]] = Field( - default=None, description="" - ) - upstream_datasources: Optional[List[Dict[str, Optional[str]]]] = Field( - default=None, description="" - ) - project: Optional[TableauProject] = Field( - default=None, description="" - ) # relationship - workbook: Optional[TableauWorkbook] = Field( - default=None, description="" - ) # relationship - fields: Optional[List[TableauDatasourceField]] = Field( - default=None, description="" - ) # relationship + upstream_tables: Optional[List[Dict[str, Optional[str]]]] = Field(default=None, description="") + upstream_datasources: Optional[List[Dict[str, Optional[str]]]] = Field(default=None, description="") + project: Optional[TableauProject] = Field(default=None, description="") # relationship + workbook: Optional[TableauWorkbook] = Field(default=None, description="") # relationship + fields: Optional[List[TableauDatasourceField]] = Field(default=None, description="") # relationship attributes: TableauDatasource.Attributes = Field( default_factory=lambda: TableauDatasource.Attributes(), diff --git a/pyatlan/model/assets/tableau_datasource_field.py b/pyatlan/model/assets/tableau_datasource_field.py index bc11d6f3f..4bac0e80d 100644 --- a/pyatlan/model/assets/tableau_datasource_field.py +++ b/pyatlan/model/assets/tableau_datasource_field.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "siteQualifiedName", "siteQualifiedName" - ) + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") """ Unique name of the site in which this datasource field exists. """ @@ -52,27 +50,19 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this datasource field exists. """ - WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "workbookQualifiedName", "workbookQualifiedName" - ) + WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField("workbookQualifiedName", "workbookQualifiedName") """ Unique name of the workbook in which this datasource field exists. """ - DATASOURCE_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "datasourceQualifiedName", "datasourceQualifiedName" - ) + DATASOURCE_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasourceQualifiedName", "datasourceQualifiedName") """ Unique name of the datasource in which this datasource field exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( - "projectHierarchy", "projectHierarchy" - ) + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") """ List of top-level projects and their nested child projects. """ - FULLY_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "fullyQualifiedName", "fullyQualifiedName" - ) + FULLY_QUALIFIED_NAME: ClassVar[TextField] = TextField("fullyQualifiedName", "fullyQualifiedName") """ Name used internally in Tableau to uniquely identify this field. """ @@ -96,9 +86,7 @@ def __setattr__(self, name, value): """ Data type of this field. """ - UPSTREAM_TABLES: ClassVar[KeywordField] = KeywordField( - "upstreamTables", "upstreamTables" - ) + UPSTREAM_TABLES: ClassVar[KeywordField] = KeywordField("upstreamTables", "upstreamTables") """ Tables upstream to this datasource field. """ @@ -114,21 +102,15 @@ def __setattr__(self, name, value): """ Bin size of this field. """ - UPSTREAM_COLUMNS: ClassVar[KeywordField] = KeywordField( - "upstreamColumns", "upstreamColumns" - ) + UPSTREAM_COLUMNS: ClassVar[KeywordField] = KeywordField("upstreamColumns", "upstreamColumns") """ Columns upstream to this field. """ - UPSTREAM_FIELDS: ClassVar[KeywordField] = KeywordField( - "upstreamFields", "upstreamFields" - ) + UPSTREAM_FIELDS: ClassVar[KeywordField] = KeywordField("upstreamFields", "upstreamFields") """ Fields upstream to this field. """ - DATASOURCE_FIELD_TYPE: ClassVar[TextField] = TextField( - "datasourceFieldType", "datasourceFieldType" - ) + DATASOURCE_FIELD_TYPE: ClassVar[TextField] = TextField("datasourceFieldType", "datasourceFieldType") """ Type of this datasource field. """ @@ -175,9 +157,7 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.project_qualified_name - ) + return None if self.attributes is None else self.attributes.project_qualified_name @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -187,27 +167,17 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.top_level_project_qualified_name - ) + return None if self.attributes is None else self.attributes.top_level_project_qualified_name @top_level_project_qualified_name.setter - def top_level_project_qualified_name( - self, top_level_project_qualified_name: Optional[str] - ): + def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = ( - top_level_project_qualified_name - ) + self.attributes.top_level_project_qualified_name = top_level_project_qualified_name @property def workbook_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.workbook_qualified_name - ) + return None if self.attributes is None else self.attributes.workbook_qualified_name @workbook_qualified_name.setter def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @@ -217,11 +187,7 @@ def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @property def datasource_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.datasource_qualified_name - ) + return None if self.attributes is None else self.attributes.datasource_qualified_name @datasource_qualified_name.setter def datasource_qualified_name(self, datasource_qualified_name: Optional[str]): @@ -251,103 +217,63 @@ def fully_qualified_name(self, fully_qualified_name: Optional[str]): @property def tableau_datasource_field_data_category(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.tableau_datasource_field_data_category - ) + return None if self.attributes is None else self.attributes.tableau_datasource_field_data_category @tableau_datasource_field_data_category.setter - def tableau_datasource_field_data_category( - self, tableau_datasource_field_data_category: Optional[str] - ): + def tableau_datasource_field_data_category(self, tableau_datasource_field_data_category: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.tableau_datasource_field_data_category = ( - tableau_datasource_field_data_category - ) + self.attributes.tableau_datasource_field_data_category = tableau_datasource_field_data_category @property def tableau_datasource_field_role(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.tableau_datasource_field_role - ) + return None if self.attributes is None else self.attributes.tableau_datasource_field_role @tableau_datasource_field_role.setter - def tableau_datasource_field_role( - self, tableau_datasource_field_role: Optional[str] - ): + def tableau_datasource_field_role(self, tableau_datasource_field_role: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.tableau_datasource_field_role = tableau_datasource_field_role @property def tableau_datasource_field_data_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.tableau_datasource_field_data_type - ) + return None if self.attributes is None else self.attributes.tableau_datasource_field_data_type @tableau_datasource_field_data_type.setter - def tableau_datasource_field_data_type( - self, tableau_datasource_field_data_type: Optional[str] - ): + def tableau_datasource_field_data_type(self, tableau_datasource_field_data_type: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.tableau_datasource_field_data_type = ( - tableau_datasource_field_data_type - ) + self.attributes.tableau_datasource_field_data_type = tableau_datasource_field_data_type @property def upstream_tables(self) -> Optional[List[Dict[str, Optional[str]]]]: return None if self.attributes is None else self.attributes.upstream_tables @upstream_tables.setter - def upstream_tables( - self, upstream_tables: Optional[List[Dict[str, Optional[str]]]] - ): + def upstream_tables(self, upstream_tables: Optional[List[Dict[str, Optional[str]]]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.upstream_tables = upstream_tables @property def tableau_datasource_field_formula(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.tableau_datasource_field_formula - ) + return None if self.attributes is None else self.attributes.tableau_datasource_field_formula @tableau_datasource_field_formula.setter - def tableau_datasource_field_formula( - self, tableau_datasource_field_formula: Optional[str] - ): + def tableau_datasource_field_formula(self, tableau_datasource_field_formula: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.tableau_datasource_field_formula = ( - tableau_datasource_field_formula - ) + self.attributes.tableau_datasource_field_formula = tableau_datasource_field_formula @property def tableau_datasource_field_bin_size(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.tableau_datasource_field_bin_size - ) + return None if self.attributes is None else self.attributes.tableau_datasource_field_bin_size @tableau_datasource_field_bin_size.setter - def tableau_datasource_field_bin_size( - self, tableau_datasource_field_bin_size: Optional[str] - ): + def tableau_datasource_field_bin_size(self, tableau_datasource_field_bin_size: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.tableau_datasource_field_bin_size = ( - tableau_datasource_field_bin_size - ) + self.attributes.tableau_datasource_field_bin_size = tableau_datasource_field_bin_size @property def upstream_columns(self) -> Optional[List[Dict[str, str]]]: @@ -371,9 +297,7 @@ def upstream_fields(self, upstream_fields: Optional[List[Dict[str, str]]]): @property def datasource_field_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.datasource_field_type - ) + return None if self.attributes is None else self.attributes.datasource_field_type @datasource_field_type.setter def datasource_field_type(self, datasource_field_type: Optional[str]): @@ -404,46 +328,22 @@ def datasource(self, datasource: Optional[TableauDatasource]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field( - default=None, description="" - ) + top_level_project_qualified_name: Optional[str] = Field(default=None, description="") workbook_qualified_name: Optional[str] = Field(default=None, description="") datasource_qualified_name: Optional[str] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) + project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") fully_qualified_name: Optional[str] = Field(default=None, description="") - tableau_datasource_field_data_category: Optional[str] = Field( - default=None, description="" - ) - tableau_datasource_field_role: Optional[str] = Field( - default=None, description="" - ) - tableau_datasource_field_data_type: Optional[str] = Field( - default=None, description="" - ) - upstream_tables: Optional[List[Dict[str, Optional[str]]]] = Field( - default=None, description="" - ) - tableau_datasource_field_formula: Optional[str] = Field( - default=None, description="" - ) - tableau_datasource_field_bin_size: Optional[str] = Field( - default=None, description="" - ) - upstream_columns: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - upstream_fields: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) + tableau_datasource_field_data_category: Optional[str] = Field(default=None, description="") + tableau_datasource_field_role: Optional[str] = Field(default=None, description="") + tableau_datasource_field_data_type: Optional[str] = Field(default=None, description="") + upstream_tables: Optional[List[Dict[str, Optional[str]]]] = Field(default=None, description="") + tableau_datasource_field_formula: Optional[str] = Field(default=None, description="") + tableau_datasource_field_bin_size: Optional[str] = Field(default=None, description="") + upstream_columns: Optional[List[Dict[str, str]]] = Field(default=None, description="") + upstream_fields: Optional[List[Dict[str, str]]] = Field(default=None, description="") datasource_field_type: Optional[str] = Field(default=None, description="") - worksheets: Optional[List[TableauWorksheet]] = Field( - default=None, description="" - ) # relationship - datasource: Optional[TableauDatasource] = Field( - default=None, description="" - ) # relationship + worksheets: Optional[List[TableauWorksheet]] = Field(default=None, description="") # relationship + datasource: Optional[TableauDatasource] = Field(default=None, description="") # relationship attributes: TableauDatasourceField.Attributes = Field( default_factory=lambda: TableauDatasourceField.Attributes(), diff --git a/pyatlan/model/assets/tableau_flow.py b/pyatlan/model/assets/tableau_flow.py index ecbe98676..4f938868c 100644 --- a/pyatlan/model/assets/tableau_flow.py +++ b/pyatlan/model/assets/tableau_flow.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "siteQualifiedName", "siteQualifiedName" - ) + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") """ Unique name of the site in which this flow exists. """ @@ -52,9 +50,7 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this flow exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( - "projectHierarchy", "projectHierarchy" - ) + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") """ List of top-level projects with their nested child projects. """ @@ -99,9 +95,7 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.project_qualified_name - ) + return None if self.attributes is None else self.attributes.project_qualified_name @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -111,21 +105,13 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.top_level_project_qualified_name - ) + return None if self.attributes is None else self.attributes.top_level_project_qualified_name @top_level_project_qualified_name.setter - def top_level_project_qualified_name( - self, top_level_project_qualified_name: Optional[str] - ): + def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = ( - top_level_project_qualified_name - ) + self.attributes.top_level_project_qualified_name = top_level_project_qualified_name @property def project_hierarchy(self) -> Optional[List[Dict[str, str]]]: @@ -180,24 +166,12 @@ def project(self, project: Optional[TableauProject]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field( - default=None, description="" - ) - project_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - input_fields: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - output_fields: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - output_steps: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - project: Optional[TableauProject] = Field( - default=None, description="" - ) # relationship + top_level_project_qualified_name: Optional[str] = Field(default=None, description="") + project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + input_fields: Optional[List[Dict[str, str]]] = Field(default=None, description="") + output_fields: Optional[List[Dict[str, str]]] = Field(default=None, description="") + output_steps: Optional[List[Dict[str, str]]] = Field(default=None, description="") + project: Optional[TableauProject] = Field(default=None, description="") # relationship attributes: TableauFlow.Attributes = Field( default_factory=lambda: TableauFlow.Attributes(), diff --git a/pyatlan/model/assets/tableau_metric.py b/pyatlan/model/assets/tableau_metric.py index 5bf7689da..c471896d4 100644 --- a/pyatlan/model/assets/tableau_metric.py +++ b/pyatlan/model/assets/tableau_metric.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "siteQualifiedName", "siteQualifiedName" - ) + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") """ Unique name of the site in which this metric exists. """ @@ -52,9 +50,7 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this metric exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( - "projectHierarchy", "projectHierarchy" - ) + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") """ List of top-level projects with their nested child projects. """ @@ -84,9 +80,7 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.project_qualified_name - ) + return None if self.attributes is None else self.attributes.project_qualified_name @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -96,21 +90,13 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.top_level_project_qualified_name - ) + return None if self.attributes is None else self.attributes.top_level_project_qualified_name @top_level_project_qualified_name.setter - def top_level_project_qualified_name( - self, top_level_project_qualified_name: Optional[str] - ): + def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = ( - top_level_project_qualified_name - ) + self.attributes.top_level_project_qualified_name = top_level_project_qualified_name @property def project_hierarchy(self) -> Optional[List[Dict[str, str]]]: @@ -135,15 +121,9 @@ def project(self, project: Optional[TableauProject]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field( - default=None, description="" - ) - project_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - project: Optional[TableauProject] = Field( - default=None, description="" - ) # relationship + top_level_project_qualified_name: Optional[str] = Field(default=None, description="") + project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + project: Optional[TableauProject] = Field(default=None, description="") # relationship attributes: TableauMetric.Attributes = Field( default_factory=lambda: TableauMetric.Attributes(), diff --git a/pyatlan/model/assets/tableau_project.py b/pyatlan/model/assets/tableau_project.py index ecfbfc439..5ea1bcb34 100644 --- a/pyatlan/model/assets/tableau_project.py +++ b/pyatlan/model/assets/tableau_project.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "siteQualifiedName", "siteQualifiedName" - ) + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") """ Unique name of the site in which this project exists. """ @@ -46,15 +44,11 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this project exists, if this is a nested project. """ - IS_TOP_LEVEL_PROJECT: ClassVar[BooleanField] = BooleanField( - "isTopLevelProject", "isTopLevelProject" - ) + IS_TOP_LEVEL_PROJECT: ClassVar[BooleanField] = BooleanField("isTopLevelProject", "isTopLevelProject") """ Whether this project is a top-level project (true) or not (false). """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( - "projectHierarchy", "projectHierarchy" - ) + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") """ List of top-level projects with their nested child projects. """ @@ -109,21 +103,13 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.top_level_project_qualified_name - ) + return None if self.attributes is None else self.attributes.top_level_project_qualified_name @top_level_project_qualified_name.setter - def top_level_project_qualified_name( - self, top_level_project_qualified_name: Optional[str] - ): + def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = ( - top_level_project_qualified_name - ) + self.attributes.top_level_project_qualified_name = top_level_project_qualified_name @property def is_top_level_project(self) -> Optional[bool]: @@ -207,31 +193,15 @@ def datasources(self, datasources: Optional[List[TableauDatasource]]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field( - default=None, description="" - ) + top_level_project_qualified_name: Optional[str] = Field(default=None, description="") is_top_level_project: Optional[bool] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - workbooks: Optional[List[TableauWorkbook]] = Field( - default=None, description="" - ) # relationship - flows: Optional[List[TableauFlow]] = Field( - default=None, description="" - ) # relationship - child_projects: Optional[List[TableauProject]] = Field( - default=None, description="" - ) # relationship - parent_project: Optional[TableauProject] = Field( - default=None, description="" - ) # relationship - site: Optional[TableauSite] = Field( - default=None, description="" - ) # relationship - datasources: Optional[List[TableauDatasource]] = Field( - default=None, description="" - ) # relationship + project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + workbooks: Optional[List[TableauWorkbook]] = Field(default=None, description="") # relationship + flows: Optional[List[TableauFlow]] = Field(default=None, description="") # relationship + child_projects: Optional[List[TableauProject]] = Field(default=None, description="") # relationship + parent_project: Optional[TableauProject] = Field(default=None, description="") # relationship + site: Optional[TableauSite] = Field(default=None, description="") # relationship + datasources: Optional[List[TableauDatasource]] = Field(default=None, description="") # relationship attributes: TableauProject.Attributes = Field( default_factory=lambda: TableauProject.Attributes(), diff --git a/pyatlan/model/assets/tableau_site.py b/pyatlan/model/assets/tableau_site.py index 03660f335..b8f3a1056 100644 --- a/pyatlan/model/assets/tableau_site.py +++ b/pyatlan/model/assets/tableau_site.py @@ -49,9 +49,7 @@ def projects(self, projects: Optional[List[TableauProject]]): self.attributes.projects = projects class Attributes(Tableau.Attributes): - projects: Optional[List[TableauProject]] = Field( - default=None, description="" - ) # relationship + projects: Optional[List[TableauProject]] = Field(default=None, description="") # relationship attributes: TableauSite.Attributes = Field( default_factory=lambda: TableauSite.Attributes(), diff --git a/pyatlan/model/assets/tableau_workbook.py b/pyatlan/model/assets/tableau_workbook.py index d315aa5ef..45db92cf4 100644 --- a/pyatlan/model/assets/tableau_workbook.py +++ b/pyatlan/model/assets/tableau_workbook.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "siteQualifiedName", "siteQualifiedName" - ) + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") """ Unique name of the site in which this workbook exists. """ @@ -46,9 +44,7 @@ def __setattr__(self, name, value): """ Unique name of the project in which this workbook exists. """ - TOP_LEVEL_PROJECT_NAME: ClassVar[TextField] = TextField( - "topLevelProjectName", "topLevelProjectName" - ) + TOP_LEVEL_PROJECT_NAME: ClassVar[TextField] = TextField("topLevelProjectName", "topLevelProjectName") """ Simple name of the top-level project in which this workbook exists. """ @@ -58,9 +54,7 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this workbook exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( - "projectHierarchy", "projectHierarchy" - ) + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") """ List of top-level projects with their nested child projects. """ @@ -106,9 +100,7 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.project_qualified_name - ) + return None if self.attributes is None else self.attributes.project_qualified_name @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -118,9 +110,7 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.top_level_project_name - ) + return None if self.attributes is None else self.attributes.top_level_project_name @top_level_project_name.setter def top_level_project_name(self, top_level_project_name: Optional[str]): @@ -130,21 +120,13 @@ def top_level_project_name(self, top_level_project_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.top_level_project_qualified_name - ) + return None if self.attributes is None else self.attributes.top_level_project_qualified_name @top_level_project_qualified_name.setter - def top_level_project_qualified_name( - self, top_level_project_qualified_name: Optional[str] - ): + def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = ( - top_level_project_qualified_name - ) + self.attributes.top_level_project_qualified_name = top_level_project_qualified_name @property def project_hierarchy(self) -> Optional[List[Dict[str, str]]]: @@ -200,24 +182,12 @@ class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") top_level_project_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field( - default=None, description="" - ) - project_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) - project: Optional[TableauProject] = Field( - default=None, description="" - ) # relationship - dashboards: Optional[List[TableauDashboard]] = Field( - default=None, description="" - ) # relationship - worksheets: Optional[List[TableauWorksheet]] = Field( - default=None, description="" - ) # relationship - datasources: Optional[List[TableauDatasource]] = Field( - default=None, description="" - ) # relationship + top_level_project_qualified_name: Optional[str] = Field(default=None, description="") + project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + project: Optional[TableauProject] = Field(default=None, description="") # relationship + dashboards: Optional[List[TableauDashboard]] = Field(default=None, description="") # relationship + worksheets: Optional[List[TableauWorksheet]] = Field(default=None, description="") # relationship + datasources: Optional[List[TableauDatasource]] = Field(default=None, description="") # relationship attributes: TableauWorkbook.Attributes = Field( default_factory=lambda: TableauWorkbook.Attributes(), diff --git a/pyatlan/model/assets/tableau_worksheet.py b/pyatlan/model/assets/tableau_worksheet.py index 55920a4bb..476846166 100644 --- a/pyatlan/model/assets/tableau_worksheet.py +++ b/pyatlan/model/assets/tableau_worksheet.py @@ -34,9 +34,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "siteQualifiedName", "siteQualifiedName" - ) + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") """ Unique name of the site in which this worksheet exists. """ @@ -52,15 +50,11 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this worksheet exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( - "projectHierarchy", "projectHierarchy" - ) + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") """ List of top-level projects with their nested child projects. """ - WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField( - "workbookQualifiedName", "workbookQualifiedName" - ) + WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField("workbookQualifiedName", "workbookQualifiedName") """ Unique name of the workbook in which this worksheet exists. """ @@ -106,9 +100,7 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.project_qualified_name - ) + return None if self.attributes is None else self.attributes.project_qualified_name @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -118,21 +110,13 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.top_level_project_qualified_name - ) + return None if self.attributes is None else self.attributes.top_level_project_qualified_name @top_level_project_qualified_name.setter - def top_level_project_qualified_name( - self, top_level_project_qualified_name: Optional[str] - ): + def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = ( - top_level_project_qualified_name - ) + self.attributes.top_level_project_qualified_name = top_level_project_qualified_name @property def project_hierarchy(self) -> Optional[List[Dict[str, str]]]: @@ -146,9 +130,7 @@ def project_hierarchy(self, project_hierarchy: Optional[List[Dict[str, str]]]): @property def workbook_qualified_name(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.workbook_qualified_name - ) + return None if self.attributes is None else self.attributes.workbook_qualified_name @workbook_qualified_name.setter def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @@ -161,9 +143,7 @@ def datasource_fields(self) -> Optional[List[TableauDatasourceField]]: return None if self.attributes is None else self.attributes.datasource_fields @datasource_fields.setter - def datasource_fields( - self, datasource_fields: Optional[List[TableauDatasourceField]] - ): + def datasource_fields(self, datasource_fields: Optional[List[TableauDatasourceField]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.datasource_fields = datasource_fields @@ -193,9 +173,7 @@ def calculated_fields(self) -> Optional[List[TableauCalculatedField]]: return None if self.attributes is None else self.attributes.calculated_fields @calculated_fields.setter - def calculated_fields( - self, calculated_fields: Optional[List[TableauCalculatedField]] - ): + def calculated_fields(self, calculated_fields: Optional[List[TableauCalculatedField]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.calculated_fields = calculated_fields @@ -203,25 +181,13 @@ def calculated_fields( class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field( - default=None, description="" - ) - project_hierarchy: Optional[List[Dict[str, str]]] = Field( - default=None, description="" - ) + top_level_project_qualified_name: Optional[str] = Field(default=None, description="") + project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") workbook_qualified_name: Optional[str] = Field(default=None, description="") - datasource_fields: Optional[List[TableauDatasourceField]] = Field( - default=None, description="" - ) # relationship - dashboards: Optional[List[TableauDashboard]] = Field( - default=None, description="" - ) # relationship - workbook: Optional[TableauWorkbook] = Field( - default=None, description="" - ) # relationship - calculated_fields: Optional[List[TableauCalculatedField]] = Field( - default=None, description="" - ) # relationship + datasource_fields: Optional[List[TableauDatasourceField]] = Field(default=None, description="") # relationship + dashboards: Optional[List[TableauDashboard]] = Field(default=None, description="") # relationship + workbook: Optional[TableauWorkbook] = Field(default=None, description="") # relationship + calculated_fields: Optional[List[TableauCalculatedField]] = Field(default=None, description="") # relationship attributes: TableauWorksheet.Attributes = Field( default_factory=lambda: TableauWorksheet.Attributes(), diff --git a/pyatlan/model/assets/tag_attachment.py b/pyatlan/model/assets/tag_attachment.py index ecd43303e..35dca3844 100644 --- a/pyatlan/model/assets/tag_attachment.py +++ b/pyatlan/model/assets/tag_attachment.py @@ -61,11 +61,7 @@ def tag_qualified_name(self, tag_qualified_name: Optional[str]): @property def tag_attachment_string_value(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.tag_attachment_string_value - ) + return None if self.attributes is None else self.attributes.tag_attachment_string_value @tag_attachment_string_value.setter def tag_attachment_string_value(self, tag_attachment_string_value: Optional[str]): diff --git a/pyatlan/model/assets/task.py b/pyatlan/model/assets/task.py index d16acd39c..d83a8d438 100644 --- a/pyatlan/model/assets/task.py +++ b/pyatlan/model/assets/task.py @@ -36,9 +36,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - TASK_RECIPIENT: ClassVar[KeywordField] = KeywordField( - "taskRecipient", "taskRecipient" - ) + TASK_RECIPIENT: ClassVar[KeywordField] = KeywordField("taskRecipient", "taskRecipient") """ recipient of the task """ @@ -46,9 +44,7 @@ def __setattr__(self, name, value): """ type of task """ - TASK_REQUESTOR: ClassVar[KeywordField] = KeywordField( - "taskRequestor", "taskRequestor" - ) + TASK_REQUESTOR: ClassVar[KeywordField] = KeywordField("taskRequestor", "taskRequestor") """ requestor of the task """ @@ -56,15 +52,11 @@ def __setattr__(self, name, value): """ flag to make task read/unread """ - TASK_REQUESTOR_COMMENT: ClassVar[TextField] = TextField( - "taskRequestorComment", "taskRequestorComment" - ) + TASK_REQUESTOR_COMMENT: ClassVar[TextField] = TextField("taskRequestorComment", "taskRequestorComment") """ comment of requestor for the task """ - TASK_RELATED_ASSET_GUID: ClassVar[KeywordField] = KeywordField( - "taskRelatedAssetGuid", "taskRelatedAssetGuid" - ) + TASK_RELATED_ASSET_GUID: ClassVar[KeywordField] = KeywordField("taskRelatedAssetGuid", "taskRelatedAssetGuid") """ assetId to preview """ @@ -72,9 +64,7 @@ def __setattr__(self, name, value): """ contains the payload that is proposed to the task """ - TASK_EXPIRES_AT: ClassVar[NumericField] = NumericField( - "taskExpiresAt", "taskExpiresAt" - ) + TASK_EXPIRES_AT: ClassVar[NumericField] = NumericField("taskExpiresAt", "taskExpiresAt") """ Time (epoch) at which the task expires . """ @@ -82,33 +72,23 @@ def __setattr__(self, name, value): """ List of actions associated with this task. """ - TASK_EXECUTION_COMMENT: ClassVar[TextField] = TextField( - "taskExecutionComment", "taskExecutionComment" - ) + TASK_EXECUTION_COMMENT: ClassVar[TextField] = TextField("taskExecutionComment", "taskExecutionComment") """ comment for the action executed by user """ - TASK_EXECUTION_ACTION: ClassVar[KeywordField] = KeywordField( - "taskExecutionAction", "taskExecutionAction" - ) + TASK_EXECUTION_ACTION: ClassVar[KeywordField] = KeywordField("taskExecutionAction", "taskExecutionAction") """ action executed by the recipient """ - TASK_INTEGRATION_CONFIG: ClassVar[TextField] = TextField( - "taskIntegrationConfig", "taskIntegrationConfig" - ) + TASK_INTEGRATION_CONFIG: ClassVar[TextField] = TextField("taskIntegrationConfig", "taskIntegrationConfig") """ contains external integration config for the task """ - TASK_CREATED_BY: ClassVar[KeywordField] = KeywordField( - "taskCreatedBy", "taskCreatedBy" - ) + TASK_CREATED_BY: ClassVar[KeywordField] = KeywordField("taskCreatedBy", "taskCreatedBy") """ username of the user who created this task """ - TASK_UPDATED_BY: ClassVar[KeywordField] = KeywordField( - "taskUpdatedBy", "taskUpdatedBy" - ) + TASK_UPDATED_BY: ClassVar[KeywordField] = KeywordField("taskUpdatedBy", "taskUpdatedBy") """ username of the user who updated this task """ @@ -172,9 +152,7 @@ def task_is_read(self, task_is_read: Optional[bool]): @property def task_requestor_comment(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.task_requestor_comment - ) + return None if self.attributes is None else self.attributes.task_requestor_comment @task_requestor_comment.setter def task_requestor_comment(self, task_requestor_comment: Optional[str]): @@ -184,9 +162,7 @@ def task_requestor_comment(self, task_requestor_comment: Optional[str]): @property def task_related_asset_guid(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.task_related_asset_guid - ) + return None if self.attributes is None else self.attributes.task_related_asset_guid @task_related_asset_guid.setter def task_related_asset_guid(self, task_related_asset_guid: Optional[str]): @@ -226,9 +202,7 @@ def task_actions(self, task_actions: Optional[List[Action]]): @property def task_execution_comment(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.task_execution_comment - ) + return None if self.attributes is None else self.attributes.task_execution_comment @task_execution_comment.setter def task_execution_comment(self, task_execution_comment: Optional[str]): @@ -238,9 +212,7 @@ def task_execution_comment(self, task_execution_comment: Optional[str]): @property def task_execution_action(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.task_execution_action - ) + return None if self.attributes is None else self.attributes.task_execution_action @task_execution_action.setter def task_execution_action(self, task_execution_action: Optional[str]): @@ -250,9 +222,7 @@ def task_execution_action(self, task_execution_action: Optional[str]): @property def task_integration_config(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.task_integration_config - ) + return None if self.attributes is None else self.attributes.task_integration_config @task_integration_config.setter def task_integration_config(self, task_integration_config: Optional[str]): diff --git a/pyatlan/model/assets/thoughtspot.py b/pyatlan/model/assets/thoughtspot.py index a95f63d31..e89ee4949 100644 --- a/pyatlan/model/assets/thoughtspot.py +++ b/pyatlan/model/assets/thoughtspot.py @@ -29,27 +29,19 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - THOUGHTSPOT_CHART_TYPE: ClassVar[KeywordField] = KeywordField( - "thoughtspotChartType", "thoughtspotChartType" - ) + THOUGHTSPOT_CHART_TYPE: ClassVar[KeywordField] = KeywordField("thoughtspotChartType", "thoughtspotChartType") """ """ - THOUGHTSPOT_QUESTION_TEXT: ClassVar[TextField] = TextField( - "thoughtspotQuestionText", "thoughtspotQuestionText" - ) + THOUGHTSPOT_QUESTION_TEXT: ClassVar[TextField] = TextField("thoughtspotQuestionText", "thoughtspotQuestionText") """ """ - THOUGHTSPOT_JOIN_COUNT: ClassVar[NumericField] = NumericField( - "thoughtspotJoinCount", "thoughtspotJoinCount" - ) + THOUGHTSPOT_JOIN_COUNT: ClassVar[NumericField] = NumericField("thoughtspotJoinCount", "thoughtspotJoinCount") """ Total number of data table joins executed for analysis. """ - THOUGHTSPOT_COLUMN_COUNT: ClassVar[NumericField] = NumericField( - "thoughtspotColumnCount", "thoughtspotColumnCount" - ) + THOUGHTSPOT_COLUMN_COUNT: ClassVar[NumericField] = NumericField("thoughtspotColumnCount", "thoughtspotColumnCount") """ Number of Columns. """ @@ -63,9 +55,7 @@ def __setattr__(self, name, value): @property def thoughtspot_chart_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.thoughtspot_chart_type - ) + return None if self.attributes is None else self.attributes.thoughtspot_chart_type @thoughtspot_chart_type.setter def thoughtspot_chart_type(self, thoughtspot_chart_type: Optional[str]): @@ -75,11 +65,7 @@ def thoughtspot_chart_type(self, thoughtspot_chart_type: Optional[str]): @property def thoughtspot_question_text(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.thoughtspot_question_text - ) + return None if self.attributes is None else self.attributes.thoughtspot_question_text @thoughtspot_question_text.setter def thoughtspot_question_text(self, thoughtspot_question_text: Optional[str]): @@ -89,9 +75,7 @@ def thoughtspot_question_text(self, thoughtspot_question_text: Optional[str]): @property def thoughtspot_join_count(self) -> Optional[int]: - return ( - None if self.attributes is None else self.attributes.thoughtspot_join_count - ) + return None if self.attributes is None else self.attributes.thoughtspot_join_count @thoughtspot_join_count.setter def thoughtspot_join_count(self, thoughtspot_join_count: Optional[int]): @@ -101,11 +85,7 @@ def thoughtspot_join_count(self, thoughtspot_join_count: Optional[int]): @property def thoughtspot_column_count(self) -> Optional[int]: - return ( - None - if self.attributes is None - else self.attributes.thoughtspot_column_count - ) + return None if self.attributes is None else self.attributes.thoughtspot_column_count @thoughtspot_column_count.setter def thoughtspot_column_count(self, thoughtspot_column_count: Optional[int]): diff --git a/pyatlan/model/assets/thoughtspot_column.py b/pyatlan/model/assets/thoughtspot_column.py index 9ce4150d2..4194a2a90 100644 --- a/pyatlan/model/assets/thoughtspot_column.py +++ b/pyatlan/model/assets/thoughtspot_column.py @@ -63,9 +63,7 @@ def __setattr__(self, name, value): """ Specifies the technical format of data stored in a column such as integer, float, string, date, boolean etc. """ - THOUGHTSPOT_COLUMN_TYPE: ClassVar[KeywordField] = KeywordField( - "thoughtspotColumnType", "thoughtspotColumnType" - ) + THOUGHTSPOT_COLUMN_TYPE: ClassVar[KeywordField] = KeywordField("thoughtspotColumnType", "thoughtspotColumnType") """ Defines the analytical role of a column in data analysis categorizing it as a dimension, measure, or attribute. """ @@ -74,9 +72,7 @@ def __setattr__(self, name, value): """ TBC """ - THOUGHTSPOT_WORKSHEET: ClassVar[RelationField] = RelationField( - "thoughtspotWorksheet" - ) + THOUGHTSPOT_WORKSHEET: ClassVar[RelationField] = RelationField("thoughtspotWorksheet") """ TBC """ @@ -98,65 +94,37 @@ def __setattr__(self, name, value): @property def thoughtspot_table_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.thoughtspot_table_qualified_name - ) + return None if self.attributes is None else self.attributes.thoughtspot_table_qualified_name @thoughtspot_table_qualified_name.setter - def thoughtspot_table_qualified_name( - self, thoughtspot_table_qualified_name: Optional[str] - ): + def thoughtspot_table_qualified_name(self, thoughtspot_table_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.thoughtspot_table_qualified_name = ( - thoughtspot_table_qualified_name - ) + self.attributes.thoughtspot_table_qualified_name = thoughtspot_table_qualified_name @property def thoughtspot_view_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.thoughtspot_view_qualified_name - ) + return None if self.attributes is None else self.attributes.thoughtspot_view_qualified_name @thoughtspot_view_qualified_name.setter - def thoughtspot_view_qualified_name( - self, thoughtspot_view_qualified_name: Optional[str] - ): + def thoughtspot_view_qualified_name(self, thoughtspot_view_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.thoughtspot_view_qualified_name = ( - thoughtspot_view_qualified_name - ) + self.attributes.thoughtspot_view_qualified_name = thoughtspot_view_qualified_name @property def thoughtspot_worksheet_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.thoughtspot_worksheet_qualified_name - ) + return None if self.attributes is None else self.attributes.thoughtspot_worksheet_qualified_name @thoughtspot_worksheet_qualified_name.setter - def thoughtspot_worksheet_qualified_name( - self, thoughtspot_worksheet_qualified_name: Optional[str] - ): + def thoughtspot_worksheet_qualified_name(self, thoughtspot_worksheet_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.thoughtspot_worksheet_qualified_name = ( - thoughtspot_worksheet_qualified_name - ) + self.attributes.thoughtspot_worksheet_qualified_name = thoughtspot_worksheet_qualified_name @property def thoughtspot_column_data_type(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.thoughtspot_column_data_type - ) + return None if self.attributes is None else self.attributes.thoughtspot_column_data_type @thoughtspot_column_data_type.setter def thoughtspot_column_data_type(self, thoughtspot_column_data_type: Optional[str]): @@ -166,9 +134,7 @@ def thoughtspot_column_data_type(self, thoughtspot_column_data_type: Optional[st @property def thoughtspot_column_type(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.thoughtspot_column_type - ) + return None if self.attributes is None else self.attributes.thoughtspot_column_type @thoughtspot_column_type.setter def thoughtspot_column_type(self, thoughtspot_column_type: Optional[str]): @@ -188,14 +154,10 @@ def thoughtspot_view(self, thoughtspot_view: Optional[ThoughtspotView]): @property def thoughtspot_worksheet(self) -> Optional[ThoughtspotWorksheet]: - return ( - None if self.attributes is None else self.attributes.thoughtspot_worksheet - ) + return None if self.attributes is None else self.attributes.thoughtspot_worksheet @thoughtspot_worksheet.setter - def thoughtspot_worksheet( - self, thoughtspot_worksheet: Optional[ThoughtspotWorksheet] - ): + def thoughtspot_worksheet(self, thoughtspot_worksheet: Optional[ThoughtspotWorksheet]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_worksheet = thoughtspot_worksheet @@ -211,28 +173,14 @@ def thoughtspot_table(self, thoughtspot_table: Optional[ThoughtspotTable]): self.attributes.thoughtspot_table = thoughtspot_table class Attributes(Thoughtspot.Attributes): - thoughtspot_table_qualified_name: Optional[str] = Field( - default=None, description="" - ) - thoughtspot_view_qualified_name: Optional[str] = Field( - default=None, description="" - ) - thoughtspot_worksheet_qualified_name: Optional[str] = Field( - default=None, description="" - ) - thoughtspot_column_data_type: Optional[str] = Field( - default=None, description="" - ) + thoughtspot_table_qualified_name: Optional[str] = Field(default=None, description="") + thoughtspot_view_qualified_name: Optional[str] = Field(default=None, description="") + thoughtspot_worksheet_qualified_name: Optional[str] = Field(default=None, description="") + thoughtspot_column_data_type: Optional[str] = Field(default=None, description="") thoughtspot_column_type: Optional[str] = Field(default=None, description="") - thoughtspot_view: Optional[ThoughtspotView] = Field( - default=None, description="" - ) # relationship - thoughtspot_worksheet: Optional[ThoughtspotWorksheet] = Field( - default=None, description="" - ) # relationship - thoughtspot_table: Optional[ThoughtspotTable] = Field( - default=None, description="" - ) # relationship + thoughtspot_view: Optional[ThoughtspotView] = Field(default=None, description="") # relationship + thoughtspot_worksheet: Optional[ThoughtspotWorksheet] = Field(default=None, description="") # relationship + thoughtspot_table: Optional[ThoughtspotTable] = Field(default=None, description="") # relationship attributes: ThoughtspotColumn.Attributes = Field( default_factory=lambda: ThoughtspotColumn.Attributes(), diff --git a/pyatlan/model/assets/thoughtspot_dashlet.py b/pyatlan/model/assets/thoughtspot_dashlet.py index 6bb567ed4..fdd41bee6 100644 --- a/pyatlan/model/assets/thoughtspot_dashlet.py +++ b/pyatlan/model/assets/thoughtspot_dashlet.py @@ -46,9 +46,7 @@ def __setattr__(self, name, value): Unique name of the liveboard in which this dashlet exists. """ - THOUGHTSPOT_LIVEBOARD: ClassVar[RelationField] = RelationField( - "thoughtspotLiveboard" - ) + THOUGHTSPOT_LIVEBOARD: ClassVar[RelationField] = RelationField("thoughtspotLiveboard") """ TBC """ @@ -61,11 +59,7 @@ def __setattr__(self, name, value): @property def thoughtspot_liveboard_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.thoughtspot_liveboard_name - ) + return None if self.attributes is None else self.attributes.thoughtspot_liveboard_name @thoughtspot_liveboard_name.setter def thoughtspot_liveboard_name(self, thoughtspot_liveboard_name: Optional[str]): @@ -75,44 +69,28 @@ def thoughtspot_liveboard_name(self, thoughtspot_liveboard_name: Optional[str]): @property def thoughtspot_liveboard_qualified_name(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.thoughtspot_liveboard_qualified_name - ) + return None if self.attributes is None else self.attributes.thoughtspot_liveboard_qualified_name @thoughtspot_liveboard_qualified_name.setter - def thoughtspot_liveboard_qualified_name( - self, thoughtspot_liveboard_qualified_name: Optional[str] - ): + def thoughtspot_liveboard_qualified_name(self, thoughtspot_liveboard_qualified_name: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.thoughtspot_liveboard_qualified_name = ( - thoughtspot_liveboard_qualified_name - ) + self.attributes.thoughtspot_liveboard_qualified_name = thoughtspot_liveboard_qualified_name @property def thoughtspot_liveboard(self) -> Optional[ThoughtspotLiveboard]: - return ( - None if self.attributes is None else self.attributes.thoughtspot_liveboard - ) + return None if self.attributes is None else self.attributes.thoughtspot_liveboard @thoughtspot_liveboard.setter - def thoughtspot_liveboard( - self, thoughtspot_liveboard: Optional[ThoughtspotLiveboard] - ): + def thoughtspot_liveboard(self, thoughtspot_liveboard: Optional[ThoughtspotLiveboard]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_liveboard = thoughtspot_liveboard class Attributes(Thoughtspot.Attributes): thoughtspot_liveboard_name: Optional[str] = Field(default=None, description="") - thoughtspot_liveboard_qualified_name: Optional[str] = Field( - default=None, description="" - ) - thoughtspot_liveboard: Optional[ThoughtspotLiveboard] = Field( - default=None, description="" - ) # relationship + thoughtspot_liveboard_qualified_name: Optional[str] = Field(default=None, description="") + thoughtspot_liveboard: Optional[ThoughtspotLiveboard] = Field(default=None, description="") # relationship attributes: ThoughtspotDashlet.Attributes = Field( default_factory=lambda: ThoughtspotDashlet.Attributes(), diff --git a/pyatlan/model/assets/thoughtspot_liveboard.py b/pyatlan/model/assets/thoughtspot_liveboard.py index 07ec3537a..bcf560a09 100644 --- a/pyatlan/model/assets/thoughtspot_liveboard.py +++ b/pyatlan/model/assets/thoughtspot_liveboard.py @@ -43,17 +43,13 @@ def thoughtspot_dashlets(self) -> Optional[List[ThoughtspotDashlet]]: return None if self.attributes is None else self.attributes.thoughtspot_dashlets @thoughtspot_dashlets.setter - def thoughtspot_dashlets( - self, thoughtspot_dashlets: Optional[List[ThoughtspotDashlet]] - ): + def thoughtspot_dashlets(self, thoughtspot_dashlets: Optional[List[ThoughtspotDashlet]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_dashlets = thoughtspot_dashlets class Attributes(Thoughtspot.Attributes): - thoughtspot_dashlets: Optional[List[ThoughtspotDashlet]] = Field( - default=None, description="" - ) # relationship + thoughtspot_dashlets: Optional[List[ThoughtspotDashlet]] = Field(default=None, description="") # relationship attributes: ThoughtspotLiveboard.Attributes = Field( default_factory=lambda: ThoughtspotLiveboard.Attributes(), diff --git a/pyatlan/model/assets/thoughtspot_table.py b/pyatlan/model/assets/thoughtspot_table.py index b2bf33d25..60794b277 100644 --- a/pyatlan/model/assets/thoughtspot_table.py +++ b/pyatlan/model/assets/thoughtspot_table.py @@ -43,17 +43,13 @@ def thoughtspot_columns(self) -> Optional[List[ThoughtspotColumn]]: return None if self.attributes is None else self.attributes.thoughtspot_columns @thoughtspot_columns.setter - def thoughtspot_columns( - self, thoughtspot_columns: Optional[List[ThoughtspotColumn]] - ): + def thoughtspot_columns(self, thoughtspot_columns: Optional[List[ThoughtspotColumn]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_columns = thoughtspot_columns class Attributes(Thoughtspot.Attributes): - thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field( - default=None, description="" - ) # relationship + thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field(default=None, description="") # relationship attributes: ThoughtspotTable.Attributes = Field( default_factory=lambda: ThoughtspotTable.Attributes(), diff --git a/pyatlan/model/assets/thoughtspot_view.py b/pyatlan/model/assets/thoughtspot_view.py index d38eba813..c38ff55fe 100644 --- a/pyatlan/model/assets/thoughtspot_view.py +++ b/pyatlan/model/assets/thoughtspot_view.py @@ -43,17 +43,13 @@ def thoughtspot_columns(self) -> Optional[List[ThoughtspotColumn]]: return None if self.attributes is None else self.attributes.thoughtspot_columns @thoughtspot_columns.setter - def thoughtspot_columns( - self, thoughtspot_columns: Optional[List[ThoughtspotColumn]] - ): + def thoughtspot_columns(self, thoughtspot_columns: Optional[List[ThoughtspotColumn]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_columns = thoughtspot_columns class Attributes(Thoughtspot.Attributes): - thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field( - default=None, description="" - ) # relationship + thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field(default=None, description="") # relationship attributes: ThoughtspotView.Attributes = Field( default_factory=lambda: ThoughtspotView.Attributes(), diff --git a/pyatlan/model/assets/thoughtspot_worksheet.py b/pyatlan/model/assets/thoughtspot_worksheet.py index f4a8f1399..49ee15f37 100644 --- a/pyatlan/model/assets/thoughtspot_worksheet.py +++ b/pyatlan/model/assets/thoughtspot_worksheet.py @@ -43,17 +43,13 @@ def thoughtspot_columns(self) -> Optional[List[ThoughtspotColumn]]: return None if self.attributes is None else self.attributes.thoughtspot_columns @thoughtspot_columns.setter - def thoughtspot_columns( - self, thoughtspot_columns: Optional[List[ThoughtspotColumn]] - ): + def thoughtspot_columns(self, thoughtspot_columns: Optional[List[ThoughtspotColumn]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_columns = thoughtspot_columns class Attributes(Thoughtspot.Attributes): - thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field( - default=None, description="" - ) # relationship + thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field(default=None, description="") # relationship attributes: ThoughtspotWorksheet.Attributes = Field( default_factory=lambda: ThoughtspotWorksheet.Attributes(), diff --git a/pyatlan/model/assets/workflow.py b/pyatlan/model/assets/workflow.py index 3e116a4bd..3a3f770dd 100644 --- a/pyatlan/model/assets/workflow.py +++ b/pyatlan/model/assets/workflow.py @@ -31,9 +31,7 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - WORKFLOW_TEMPLATE_GUID: ClassVar[KeywordField] = KeywordField( - "workflowTemplateGuid", "workflowTemplateGuid" - ) + WORKFLOW_TEMPLATE_GUID: ClassVar[KeywordField] = KeywordField("workflowTemplateGuid", "workflowTemplateGuid") """ GUID of the workflow template from which this workflow was created. """ @@ -41,9 +39,7 @@ def __setattr__(self, name, value): """ Type of the workflow. """ - WORKFLOW_ACTION_CHOICES: ClassVar[KeywordField] = KeywordField( - "workflowActionChoices", "workflowActionChoices" - ) + WORKFLOW_ACTION_CHOICES: ClassVar[KeywordField] = KeywordField("workflowActionChoices", "workflowActionChoices") """ List of workflow action choices. """ @@ -51,33 +47,23 @@ def __setattr__(self, name, value): """ Details of the workflow. """ - WORKFLOW_STATUS: ClassVar[KeywordField] = KeywordField( - "workflowStatus", "workflowStatus" - ) + WORKFLOW_STATUS: ClassVar[KeywordField] = KeywordField("workflowStatus", "workflowStatus") """ Status of the workflow. """ - WORKFLOW_RUN_EXPIRES_IN: ClassVar[TextField] = TextField( - "workflowRunExpiresIn", "workflowRunExpiresIn" - ) + WORKFLOW_RUN_EXPIRES_IN: ClassVar[TextField] = TextField("workflowRunExpiresIn", "workflowRunExpiresIn") """ Time duration after which a run of this workflow will expire. """ - WORKFLOW_CREATED_BY: ClassVar[KeywordField] = KeywordField( - "workflowCreatedBy", "workflowCreatedBy" - ) + WORKFLOW_CREATED_BY: ClassVar[KeywordField] = KeywordField("workflowCreatedBy", "workflowCreatedBy") """ Username of the user who created this workflow. """ - WORKFLOW_UPDATED_BY: ClassVar[KeywordField] = KeywordField( - "workflowUpdatedBy", "workflowUpdatedBy" - ) + WORKFLOW_UPDATED_BY: ClassVar[KeywordField] = KeywordField("workflowUpdatedBy", "workflowUpdatedBy") """ Username of the user who updated this workflow. """ - WORKFLOW_DELETED_AT: ClassVar[NumericField] = NumericField( - "workflowDeletedAt", "workflowDeletedAt" - ) + WORKFLOW_DELETED_AT: ClassVar[NumericField] = NumericField("workflowDeletedAt", "workflowDeletedAt") """ Deletion time of this workflow. """ @@ -96,9 +82,7 @@ def __setattr__(self, name, value): @property def workflow_template_guid(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.workflow_template_guid - ) + return None if self.attributes is None else self.attributes.workflow_template_guid @workflow_template_guid.setter def workflow_template_guid(self, workflow_template_guid: Optional[str]): @@ -118,9 +102,7 @@ def workflow_type(self, workflow_type: Optional[WorkflowType]): @property def workflow_action_choices(self) -> Optional[Set[str]]: - return ( - None if self.attributes is None else self.attributes.workflow_action_choices - ) + return None if self.attributes is None else self.attributes.workflow_action_choices @workflow_action_choices.setter def workflow_action_choices(self, workflow_action_choices: Optional[Set[str]]): @@ -150,9 +132,7 @@ def workflow_status(self, workflow_status: Optional[WorkflowStatus]): @property def workflow_run_expires_in(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.workflow_run_expires_in - ) + return None if self.attributes is None else self.attributes.workflow_run_expires_in @workflow_run_expires_in.setter def workflow_run_expires_in(self, workflow_run_expires_in: Optional[str]): @@ -193,9 +173,7 @@ def workflow_deleted_at(self, workflow_deleted_at: Optional[datetime]): class Attributes(Asset.Attributes): workflow_template_guid: Optional[str] = Field(default=None, description="") workflow_type: Optional[WorkflowType] = Field(default=None, description="") - workflow_action_choices: Optional[Set[str]] = Field( - default=None, description="" - ) + workflow_action_choices: Optional[Set[str]] = Field(default=None, description="") workflow_config: Optional[str] = Field(default=None, description="") workflow_status: Optional[WorkflowStatus] = Field(default=None, description="") workflow_run_expires_in: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/workflow_run.py b/pyatlan/model/assets/workflow_run.py index 29768cebf..e23647d73 100644 --- a/pyatlan/model/assets/workflow_run.py +++ b/pyatlan/model/assets/workflow_run.py @@ -37,9 +37,7 @@ def __setattr__(self, name, value): """ GUID of the workflow from which this run was created. """ - WORKFLOW_RUN_TYPE: ClassVar[KeywordField] = KeywordField( - "workflowRunType", "workflowRunType" - ) + WORKFLOW_RUN_TYPE: ClassVar[KeywordField] = KeywordField("workflowRunType", "workflowRunType") """ Type of the workflow from which this run was created. """ @@ -55,45 +53,31 @@ def __setattr__(self, name, value): """ The asset for which this run was created. """ - WORKFLOW_RUN_COMMENT: ClassVar[TextField] = TextField( - "workflowRunComment", "workflowRunComment" - ) + WORKFLOW_RUN_COMMENT: ClassVar[TextField] = TextField("workflowRunComment", "workflowRunComment") """ The comment added by the requester """ - WORKFLOW_RUN_CONFIG: ClassVar[TextField] = TextField( - "workflowRunConfig", "workflowRunConfig" - ) + WORKFLOW_RUN_CONFIG: ClassVar[TextField] = TextField("workflowRunConfig", "workflowRunConfig") """ Details of the approval workflow run. """ - WORKFLOW_RUN_STATUS: ClassVar[KeywordField] = KeywordField( - "workflowRunStatus", "workflowRunStatus" - ) + WORKFLOW_RUN_STATUS: ClassVar[KeywordField] = KeywordField("workflowRunStatus", "workflowRunStatus") """ Status of the run. """ - WORKFLOW_RUN_EXPIRES_AT: ClassVar[NumericField] = NumericField( - "workflowRunExpiresAt", "workflowRunExpiresAt" - ) + WORKFLOW_RUN_EXPIRES_AT: ClassVar[NumericField] = NumericField("workflowRunExpiresAt", "workflowRunExpiresAt") """ Time at which this run will expire. """ - WORKFLOW_RUN_CREATED_BY: ClassVar[KeywordField] = KeywordField( - "workflowRunCreatedBy", "workflowRunCreatedBy" - ) + WORKFLOW_RUN_CREATED_BY: ClassVar[KeywordField] = KeywordField("workflowRunCreatedBy", "workflowRunCreatedBy") """ Username of the user who created this workflow run. """ - WORKFLOW_RUN_UPDATED_BY: ClassVar[KeywordField] = KeywordField( - "workflowRunUpdatedBy", "workflowRunUpdatedBy" - ) + WORKFLOW_RUN_UPDATED_BY: ClassVar[KeywordField] = KeywordField("workflowRunUpdatedBy", "workflowRunUpdatedBy") """ Username of the user who updated this workflow run. """ - WORKFLOW_RUN_DELETED_AT: ClassVar[NumericField] = NumericField( - "workflowRunDeletedAt", "workflowRunDeletedAt" - ) + WORKFLOW_RUN_DELETED_AT: ClassVar[NumericField] = NumericField("workflowRunDeletedAt", "workflowRunDeletedAt") """ Deletion time of this workflow run. """ @@ -114,11 +98,7 @@ def __setattr__(self, name, value): @property def workflow_run_workflow_guid(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.workflow_run_workflow_guid - ) + return None if self.attributes is None else self.attributes.workflow_run_workflow_guid @workflow_run_workflow_guid.setter def workflow_run_workflow_guid(self, workflow_run_workflow_guid: Optional[str]): @@ -138,27 +118,17 @@ def workflow_run_type(self, workflow_run_type: Optional[WorkflowRunType]): @property def workflow_run_action_choices(self) -> Optional[Set[str]]: - return ( - None - if self.attributes is None - else self.attributes.workflow_run_action_choices - ) + return None if self.attributes is None else self.attributes.workflow_run_action_choices @workflow_run_action_choices.setter - def workflow_run_action_choices( - self, workflow_run_action_choices: Optional[Set[str]] - ): + def workflow_run_action_choices(self, workflow_run_action_choices: Optional[Set[str]]): if self.attributes is None: self.attributes = self.Attributes() self.attributes.workflow_run_action_choices = workflow_run_action_choices @property def workflow_run_on_asset_guid(self) -> Optional[str]: - return ( - None - if self.attributes is None - else self.attributes.workflow_run_on_asset_guid - ) + return None if self.attributes is None else self.attributes.workflow_run_on_asset_guid @workflow_run_on_asset_guid.setter def workflow_run_on_asset_guid(self, workflow_run_on_asset_guid: Optional[str]): @@ -198,9 +168,7 @@ def workflow_run_status(self, workflow_run_status: Optional[WorkflowRunStatus]): @property def workflow_run_expires_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.workflow_run_expires_at - ) + return None if self.attributes is None else self.attributes.workflow_run_expires_at @workflow_run_expires_at.setter def workflow_run_expires_at(self, workflow_run_expires_at: Optional[datetime]): @@ -210,9 +178,7 @@ def workflow_run_expires_at(self, workflow_run_expires_at: Optional[datetime]): @property def workflow_run_created_by(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.workflow_run_created_by - ) + return None if self.attributes is None else self.attributes.workflow_run_created_by @workflow_run_created_by.setter def workflow_run_created_by(self, workflow_run_created_by: Optional[str]): @@ -222,9 +188,7 @@ def workflow_run_created_by(self, workflow_run_created_by: Optional[str]): @property def workflow_run_updated_by(self) -> Optional[str]: - return ( - None if self.attributes is None else self.attributes.workflow_run_updated_by - ) + return None if self.attributes is None else self.attributes.workflow_run_updated_by @workflow_run_updated_by.setter def workflow_run_updated_by(self, workflow_run_updated_by: Optional[str]): @@ -234,9 +198,7 @@ def workflow_run_updated_by(self, workflow_run_updated_by: Optional[str]): @property def workflow_run_deleted_at(self) -> Optional[datetime]: - return ( - None if self.attributes is None else self.attributes.workflow_run_deleted_at - ) + return None if self.attributes is None else self.attributes.workflow_run_deleted_at @workflow_run_deleted_at.setter def workflow_run_deleted_at(self, workflow_run_deleted_at: Optional[datetime]): @@ -246,26 +208,16 @@ def workflow_run_deleted_at(self, workflow_run_deleted_at: Optional[datetime]): class Attributes(Asset.Attributes): workflow_run_workflow_guid: Optional[str] = Field(default=None, description="") - workflow_run_type: Optional[WorkflowRunType] = Field( - default=None, description="" - ) - workflow_run_action_choices: Optional[Set[str]] = Field( - default=None, description="" - ) + workflow_run_type: Optional[WorkflowRunType] = Field(default=None, description="") + workflow_run_action_choices: Optional[Set[str]] = Field(default=None, description="") workflow_run_on_asset_guid: Optional[str] = Field(default=None, description="") workflow_run_comment: Optional[str] = Field(default=None, description="") workflow_run_config: Optional[str] = Field(default=None, description="") - workflow_run_status: Optional[WorkflowRunStatus] = Field( - default=None, description="" - ) - workflow_run_expires_at: Optional[datetime] = Field( - default=None, description="" - ) + workflow_run_status: Optional[WorkflowRunStatus] = Field(default=None, description="") + workflow_run_expires_at: Optional[datetime] = Field(default=None, description="") workflow_run_created_by: Optional[str] = Field(default=None, description="") workflow_run_updated_by: Optional[str] = Field(default=None, description="") - workflow_run_deleted_at: Optional[datetime] = Field( - default=None, description="" - ) + workflow_run_deleted_at: Optional[datetime] = Field(default=None, description="") attributes: WorkflowRun.Attributes = Field( default_factory=lambda: WorkflowRun.Attributes(), diff --git a/pyatlan/model/atlan_image.py b/pyatlan/model/atlan_image.py index 0276769e6..74802a838 100644 --- a/pyatlan/model/atlan_image.py +++ b/pyatlan/model/atlan_image.py @@ -10,37 +10,17 @@ class AtlanImage(AtlanObject): - id: Optional[str] = Field( - default=None, description="Unique identifier (GUID) of the image." - ) + id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the image.") version: Optional[str] = Field(default=None, description="TBC") - created_at: Optional[int] = Field( - description="Time at which the image was uploaded (epoch), in milliseconds." - ) - updated_at: Optional[int] = Field( - description="Time at which the image was last modified (epoch), in milliseconds." - ) - file_name: Optional[str] = Field( - default=None, description="Generated name of the image that was uploaded." - ) - raw_name: Optional[str] = Field( - default=None, description="Generated name of the image that was uploaded." - ) - key: Optional[str] = Field( - default=None, description="Generated name of the image that was uploaded." - ) - extension: Optional[str] = Field( - default=None, description="Filename extension for the image that was uploaded." - ) - content_type: Optional[str] = Field( - default=None, description="MIME type for the image that was uploaded." - ) - file_size: Optional[str] = Field( - default=None, description="Size of the image that was uploaded, in bytes." - ) - is_encrypted: Optional[bool] = Field( - description="Whether the image is encrypted (true) or not (false)." - ) + created_at: Optional[int] = Field(description="Time at which the image was uploaded (epoch), in milliseconds.") + updated_at: Optional[int] = Field(description="Time at which the image was last modified (epoch), in milliseconds.") + file_name: Optional[str] = Field(default=None, description="Generated name of the image that was uploaded.") + raw_name: Optional[str] = Field(default=None, description="Generated name of the image that was uploaded.") + key: Optional[str] = Field(default=None, description="Generated name of the image that was uploaded.") + extension: Optional[str] = Field(default=None, description="Filename extension for the image that was uploaded.") + content_type: Optional[str] = Field(default=None, description="MIME type for the image that was uploaded.") + file_size: Optional[str] = Field(default=None, description="Size of the image that was uploaded, in bytes.") + is_encrypted: Optional[bool] = Field(description="Whether the image is encrypted (true) or not (false).") redirect_url: Optional[str] = Field(default=None, description="TBC") is_uploaded: Optional[bool] = Field(default=None, description="TBC") uploaded_at: Optional[str] = Field(default=None, description="TBC") diff --git a/pyatlan/model/audit.py b/pyatlan/model/audit.py index ae9930e8b..062dc9f21 100644 --- a/pyatlan/model/audit.py +++ b/pyatlan/model/audit.py @@ -175,9 +175,7 @@ def convert(cls, values): CustomMetadataCache.get_attr_name_for_id(cm_id, attr_id): properties for attr_id, properties in values[ATTRIBUTES].items() } - archived_attributes = { - key: value for key, value in attributes.items() if "-archived-" in key - } + archived_attributes = {key: value for key, value in attributes.items() if "-archived-" in key} for key in archived_attributes: del attributes[key] values[ATTRIBUTES] = attributes @@ -196,12 +194,8 @@ class EntityAudit(AtlanObject): entity_qualified_name: str = Field(description="Unique name of the asset.") type_name: str = Field(description="Type of the asset.") entity_id: str = Field(description="Unique identifier (GUID) of the asset.") - timestamp: datetime = Field( - description="Time (epoch) at which the activity started, in milliseconds." - ) - created: datetime = Field( - description="Time (epoch) at which the activity completed, in milliseconds." - ) + timestamp: datetime = Field(description="Time (epoch) at which the activity started, in milliseconds.") + created: datetime = Field(description="Time (epoch) at which the activity completed, in milliseconds.") user: str = Field(description="User who carried out the activity.") action: AuditActionType = Field(description="The type of activity that was done.") details: Optional[Any] = Field(default=None, description="Unused.") @@ -277,9 +271,7 @@ def next_page(self, start=None, size=None) -> bool: :returns: True if there is a next page of results, otherwise False """ self._start = start or self._start + self._size - is_bulk_search = ( - self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD - ) + is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD if size: self._size = size @@ -289,9 +281,7 @@ def next_page(self, start=None, size=None) -> bool: # in a previous page of results. # If it has,then exclude it from the current results; # otherwise, we may encounter duplicate audit entity records. - self._processed_entity_keys.update( - entity.event_key for entity in self._entity_audits - ) + self._processed_entity_keys.update(entity.event_key for entity in self._entity_audits) return self._get_next_page() if self._entity_audits else False def _get_next_page(self): @@ -303,9 +293,7 @@ def _get_next_page(self): query = self._criteria.dsl.query self._criteria.dsl.size = self._size self._criteria.dsl.from_ = self._start - is_bulk_search = ( - self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD - ) + is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD if is_bulk_search: self._prepare_query_for_timestamp_paging(query) @@ -330,17 +318,13 @@ def _get_next_page_json(self, is_bulk_search: bool = False): return None try: - self._entity_audits = parse_obj_as( - List[EntityAudit], raw_json[ENTITY_AUDITS] - ) + self._entity_audits = parse_obj_as(List[EntityAudit], raw_json[ENTITY_AUDITS]) if is_bulk_search: self._update_first_last_record_creation_times() self._filter_processed_entities() return raw_json except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err def _prepare_query_for_timestamp_paging(self, query: Query): """ @@ -354,9 +338,7 @@ def _prepare_query_for_timestamp_paging(self, query: Query): rewritten_filters.append(filter_) if self._first_record_creation_time != self._last_record_creation_time: - rewritten_filters.append( - self._get_paging_timestamp_query(self._last_record_creation_time) - ) + rewritten_filters.append(self._get_paging_timestamp_query(self._last_record_creation_time)) if isinstance(query, Bool): rewritten_query = Bool( filter=rewritten_filters, @@ -395,11 +377,7 @@ def _get_paging_timestamp_query(last_timestamp: int) -> Query: @staticmethod def _is_paging_timestamp_query(filter_: Query) -> bool: - return ( - isinstance(filter_, Range) - and filter_.field == "created" - and filter_.gte is not None - ) + return isinstance(filter_, Range) and filter_.field == "created" and filter_.gte is not None def _update_first_last_record_creation_times(self): self._first_record_creation_time = self._last_record_creation_time = -2 @@ -422,8 +400,7 @@ def _filter_processed_entities(self): self._entity_audits = [ entity for entity in self._entity_audits - if entity is not None - and entity.event_key not in self._processed_entity_keys + if entity is not None and entity.event_key not in self._processed_entity_keys ] @staticmethod @@ -456,9 +433,7 @@ def sort_by_timestamp_first(sorts: List[SortItem]) -> List[SortItem]: return creation_asc_sort rewritten_sorts = [ - sort - for sort in sorts - if (not sort.field) or (sort.field != Asset.CREATE_TIME.internal_field_name) + sort for sort in sorts if (not sort.field) or (sort.field != Asset.CREATE_TIME.internal_field_name) ] return creation_asc_sort + rewritten_sorts diff --git a/pyatlan/model/contract.py b/pyatlan/model/contract.py index 4f9761d84..870e21216 100644 --- a/pyatlan/model/contract.py +++ b/pyatlan/model/contract.py @@ -25,18 +25,14 @@ class DataContractSpec(AtlanYamlModel): description="Controls the specification as one for a data contract.", ) status: Union[DataContractStatus, str] = Field(description="State of the contract.") - template_version: str = Field( - default="0.0.2", description="Version of the template for the data contract." - ) + template_version: str = Field(default="0.0.2", description="Version of the template for the data contract.") type: str = Field(description="Type of the dataset in Atlan.") dataset: str = Field(description="Name of the asset as it exists inside Atlan.") data_source: Optional[str] = Field( default=None, description="Name that must match a data source defined in your config file.", ) - description: Optional[str] = Field( - default=None, description="Description of this dataset." - ) + description: Optional[str] = Field(default=None, description="Description of this dataset.") owners: Optional[DataContractSpec.Owners] = Field( default=None, description=( @@ -49,9 +45,7 @@ class DataContractSpec(AtlanYamlModel): announcement: Optional[DataContractSpec.Announcement] = Field( default=None, description="Announcement to apply to the dataset." ) - terms: Optional[List[str]] = Field( - default_factory=list, description="Glossary terms to assign to the dataset." - ) + terms: Optional[List[str]] = Field(default_factory=list, description="Glossary terms to assign to the dataset.") tags: Optional[List[DataContractSpec.DCTag]] = Field( default_factory=list, description="Atlan tags for the dataset." ) @@ -78,51 +72,33 @@ class Owners(AtlanYamlModel): Owners of the dataset. """ - users: Optional[List[str]] = Field( - default_factory=list, description="Individual users who own the dataset." - ) - groups: Optional[List[str]] = Field( - default_factory=list, description="Groups that own the dataset." - ) + users: Optional[List[str]] = Field(default_factory=list, description="Individual users who own the dataset.") + groups: Optional[List[str]] = Field(default_factory=list, description="Groups that own the dataset.") class Certification(AtlanYamlModel): """ Certification information for the dataset. """ - status: Optional[Union[CertificateStatus, str]] = Field( - default=None, description="State of the certification." - ) - message: Optional[str] = Field( - default=None, description="Message to accompany the certification." - ) + status: Optional[Union[CertificateStatus, str]] = Field(default=None, description="State of the certification.") + message: Optional[str] = Field(default=None, description="Message to accompany the certification.") class Announcement(AtlanYamlModel): """ Announcement details for the dataset. """ - type: Optional[Union[CertificateStatus, str]] = Field( - default=None, description="Type of announcement." - ) - title: Optional[str] = Field( - default=None, description="Title to use for the announcement." - ) - description: Optional[str] = Field( - default=None, description="Message to accompany the announcement." - ) + type: Optional[Union[CertificateStatus, str]] = Field(default=None, description="Type of announcement.") + title: Optional[str] = Field(default=None, description="Title to use for the announcement.") + description: Optional[str] = Field(default=None, description="Message to accompany the announcement.") class DCTag(AtlanYamlModel): """ Tagging details for the dataset. """ - name: Optional[str] = Field( - default=None, description="Human-readable name of the Atlan tag." - ) - propagate: Optional[str] = Field( - default=None, description="Whether to propagate the tag or not." - ) + name: Optional[str] = Field(default=None, description="Human-readable name of the Atlan tag.") + propagate: Optional[str] = Field(default=None, description="Whether to propagate the tag or not.") propagate_through_lineage: Optional[bool] = Field( default=None, alias="restrict_propagation_through_lineage", @@ -164,18 +140,10 @@ class DCColumn(AtlanYamlModel): default=None, description="Logical data type of values in this column (e.g. string).", ) - invalid_type: Optional[str] = Field( - default=None, description="Format of data to consider invalid." - ) - invalid_format: Optional[str] = Field( - default=None, description="Format of data to consider valid." - ) - valid_regex: Optional[str] = Field( - default=None, description="Regular expression to match valid values." - ) - missing_regex: Optional[str] = Field( - default=None, description="Regular expression to match missing values." - ) + invalid_type: Optional[str] = Field(default=None, description="Format of data to consider invalid.") + invalid_format: Optional[str] = Field(default=None, description="Format of data to consider valid.") + valid_regex: Optional[str] = Field(default=None, description="Regular expression to match valid values.") + missing_regex: Optional[str] = Field(default=None, description="Regular expression to match missing values.") invalid_values: Optional[List[str]] = Field( default_factory=list, description="Enumeration of values that should be considered invalid.", @@ -188,23 +156,15 @@ class DCColumn(AtlanYamlModel): default_factory=list, description="Enumeration of values that should be considered missing.", ) - not_null: Optional[bool] = Field( - default=None, description="When true, this column cannot be empty." - ) + not_null: Optional[bool] = Field(default=None, description="When true, this column cannot be empty.") valid_length: Optional[int] = Field( default=None, description="Fixed length for a string to be considered valid.", ) - valid_min: Optional[int] = Field( - default=None, description="Minimum numeric value considered valid." - ) - valid_max: Optional[int] = Field( - default=None, description="Maximum numeric value considered valid." - ) + valid_min: Optional[int] = Field(default=None, description="Minimum numeric value considered valid.") + valid_max: Optional[int] = Field(default=None, description="Maximum numeric value considered valid.") valid_min_length: Optional[int] = Field( default=None, description="Minimum length for a string to be considered valid.", ) - unique: Optional[bool] = Field( - default=None, description="When true, this column must have unique values." - ) + unique: Optional[bool] = Field(default=None, description="When true, this column must have unique values.") diff --git a/pyatlan/model/core.py b/pyatlan/model/core.py index d2110f0d9..188ade767 100644 --- a/pyatlan/model/core.py +++ b/pyatlan/model/core.py @@ -70,10 +70,7 @@ def __hash__(self): return self._display_text.__hash__() def __eq__(self, other): - return ( - isinstance(other, AtlanTagName) - and self._display_text == other._display_text - ) + return isinstance(other, AtlanTagName) and self._display_text == other._display_text @classmethod def _convert_to_display_text(cls, data): @@ -140,9 +137,7 @@ class Config: validate_assignment = True allow_population_by_field_name = True - def to_yaml( - self, by_alias: bool = True, exclude_unset: bool = True, sort_keys: bool = False - ) -> str: + def to_yaml(self, by_alias: bool = True, exclude_unset: bool = True, sort_keys: bool = False) -> str: """ Serialize the Pydantic model instance to a YAML string. """ @@ -171,12 +166,8 @@ class SearchRequest(AtlanObject, ABC): default_factory=list, description="List of attributes to be returned for each result.", ) - offset: Optional[int] = Field( - default=None, description="Starting point for pagination.", alias="from" - ) - size: Optional[int] = Field( - default=None, description="How many results to include in each page of results." - ) + offset: Optional[int] = Field(default=None, description="Starting point for pagination.", alias="from") + size: Optional[int] = Field(default=None, description="How many results to include in each page of results.") @dataclass @@ -223,9 +214,7 @@ class Config: alias="restrictPropagationThroughHierarchy", ) validity_periods: Optional[List[str]] = Field(default=None, alias="validityPeriods") - _source_tag_attachements: List[SourceTagAttachment] = PrivateAttr( - default_factory=list - ) + _source_tag_attachements: List[SourceTagAttachment] = PrivateAttr(default_factory=list) attributes: Optional[Dict[str, Any]] = None @@ -280,18 +269,14 @@ def of( tag.entity_guid = entity_guid tag.entity_status = EntityStatus.ACTIVE if source_tag_attachment: - source_tag_attr_id = ( - AtlanTagCache.get_source_tags_attr_id(atlan_tag_name.id) or "" - ) + source_tag_attr_id = AtlanTagCache.get_source_tags_attr_id(atlan_tag_name.id) or "" tag.attributes = {source_tag_attr_id: [source_tag_attachment]} tag._source_tag_attachements.append(source_tag_attachment) return tag class AtlanTags(AtlanObject): - __root__: List[AtlanTag] = Field( - default_factory=list, description="classifications" - ) + __root__: List[AtlanTag] = Field(default_factory=list, description="classifications") class Meaning(AtlanObject): @@ -355,9 +340,7 @@ def process_attributes_and_flush_cm(cls, asset): asset.append_relationship_attributes = {} # Process relationship attributes set by the user and update exclusion set for attribute in asset.attributes.__fields_set__: - exclude_attributes.update( - cls.process_relationship_attributes(asset, attribute) - ) + exclude_attributes.update(cls.process_relationship_attributes(asset, attribute)) # Determine relationship attributes to exclude # https://docs.pydantic.dev/1.10/usage/exporting_models/#advanced-include-and-exclude exclude_relationship_attributes = { @@ -393,9 +376,7 @@ def process_relationship_attributes(cls, asset, attribute): # Updated to use `asset.attribute` instead of `asset` to align with the API. # This change ensures the correct value is retrieved regardless of the naming conventions. - attribute_name, attribute_value = attribute, getattr( - asset.attributes, attribute, None - ) + attribute_name, attribute_value = attribute, getattr(asset.attributes, attribute, None) # Process list of relationship attributes if attribute_value and isinstance(attribute_value, list): @@ -410,13 +391,9 @@ def process_relationship_attributes(cls, asset, attribute): # Update asset based on processed relationship attributes if remove_attributes: - asset.remove_relationship_attributes.update( - {to_camel_case(attribute_name): remove_attributes} - ) + asset.remove_relationship_attributes.update({to_camel_case(attribute_name): remove_attributes}) if append_attributes: - asset.append_relationship_attributes.update( - {to_camel_case(attribute_name): append_attributes} - ) + asset.append_relationship_attributes.update({to_camel_case(attribute_name): append_attributes}) if replace_attributes: # Updated to use `asset.attribute` instead of `asset` to align with the API. # This change ensures the correct value is retrieved regardless of the naming conventions. @@ -436,16 +413,12 @@ def process_relationship_attributes(cls, asset, attribute): # We only want to include this attribute under # "remove_relationship_attributes", not both. exclude_attributes.add(attribute_name) - asset.remove_relationship_attributes = { - to_camel_case(attribute_name): attribute_value - } + asset.remove_relationship_attributes = {to_camel_case(attribute_name): attribute_value} elif attribute_value.semantic == SaveSemantic.APPEND: # Add the replace attribute to the set to exclude it # from the "attributes" property in the request payload. # We only want to include this attribute under # "append_relationship_attributes", not both. exclude_attributes.add(attribute_name) - asset.append_relationship_attributes = { - to_camel_case(attribute_name): attribute_value - } + asset.append_relationship_attributes = {to_camel_case(attribute_name): attribute_value} return exclude_attributes diff --git a/pyatlan/model/credential.py b/pyatlan/model/credential.py index bfcf641df..d3beaff1d 100644 --- a/pyatlan/model/credential.py +++ b/pyatlan/model/credential.py @@ -6,20 +6,14 @@ class Credential(AtlanObject): - id: Optional[str] = Field( - default=None, description="Unique identifier (GUID) of the credential." - ) + id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the credential.") name: Optional[str] = Field(default=None, description="Name of the credential.") - description: Optional[str] = Field( - default=None, description="Description of the credential." - ) + description: Optional[str] = Field(default=None, description="Description of the credential.") host: Optional[str] = Field( default=None, description="Hostname for which connectivity is defined by the credential.", ) - port: Optional[int] = Field( - default=None, description="Port number on which connectivity should be done." - ) + port: Optional[int] = Field(default=None, description="Port number on which connectivity should be done.") auth_type: Optional[str] = Field( default=None, description="Authentication mechanism represented by the credential.", diff --git a/pyatlan/model/custom_metadata.py b/pyatlan/model/custom_metadata.py index 3bd87d224..f1eee8374 100644 --- a/pyatlan/model/custom_metadata.py +++ b/pyatlan/model/custom_metadata.py @@ -38,9 +38,7 @@ def __init__(self, name: str): _id = CustomMetadataCache.get_id_for_name(name) self._names = { value - for key, value in CustomMetadataCache.get_cache() - .map_attr_id_to_name[_id] - .items() + for key, value in CustomMetadataCache.get_cache().map_attr_id_to_name[_id].items() if not CustomMetadataCache.is_attr_archived(attr_id=key) } @@ -49,9 +47,7 @@ def get_deleted_sentinel(cls) -> "CustomMetadataDict": """Will return an CustomMetadataDict that is a sentinel object to represent deleted custom meta data.""" if cls._sentinel is not None: return cls._sentinel - return cls.__new__( - cls, DELETED_SENTINEL - ) # Because __new__ is being invoked directly __init__ won't be invoked + return cls.__new__(cls, DELETED_SENTINEL) # Because __new__ is being invoked directly __init__ won't be invoked @property def modified(self): @@ -99,10 +95,7 @@ def is_set(self, key: str): def business_attributes(self) -> Dict[str, Any]: """Returns a dict containing the metadata set with the human-readable set name and property names resolved to their internal values""" - return { - CustomMetadataCache.get_attr_id_for_name(self._name, key): value - for (key, value) in self.data.items() - } + return {CustomMetadataCache.get_attr_id_for_name(self._name, key): value for (key, value) in self.data.items()} class CustomMetadataProxy: @@ -167,9 +160,7 @@ class CustomMetadataRequest(AtlanObject): @classmethod def create(cls, custom_metadata_dict: CustomMetadataDict): ret_val = cls(__root__=custom_metadata_dict.business_attributes) - ret_val._set_id = CustomMetadataCache.get_id_for_name( - custom_metadata_dict._name - ) + ret_val._set_id = CustomMetadataCache.get_id_for_name(custom_metadata_dict._name) return ret_val @property diff --git a/pyatlan/model/data_mesh.py b/pyatlan/model/data_mesh.py index cea541666..4838bbf35 100644 --- a/pyatlan/model/data_mesh.py +++ b/pyatlan/model/data_mesh.py @@ -12,9 +12,7 @@ class DataProductsAssetsDSL(AtlanObject): query: IndexSearchRequest = Field(description="Parameters for the search itself.") - filter_scrubbed: bool = Field( - default=True, description="Whether or not to filter scrubbed records." - ) + filter_scrubbed: bool = Field(default=True, description="Whether or not to filter scrubbed records.") _ATTR_LIST = [ "__traitNames", "connectorName", @@ -77,20 +75,14 @@ class DataProductsAssetsDSL(AtlanObject): ] def _exclude_nulls(self, dict_: Dict[str, Any]) -> Dict[str, Any]: - return { - key: value for key, value in dict_.items() if value not in (None, [], {}) - } + return {key: value for key, value in dict_.items() if value not in (None, [], {})} def _contruct_dsl_str(self, asset_selection_dsl: Dict[str, Any]) -> str: try: # For data products -- these require a `filter` as a nested dict construct within # an outer bool, not a list (which is all the default Elastic client will serialize) - filter_condition = asset_selection_dsl["query"]["dsl"]["query"]["bool"].pop( - "filter" - ) - asset_selection_dsl["query"]["dsl"]["query"]["bool"]["filter"] = { - "bool": {"filter": filter_condition} - } + filter_condition = asset_selection_dsl["query"]["dsl"]["query"]["bool"].pop("filter") + asset_selection_dsl["query"]["dsl"]["query"]["bool"]["filter"] = {"bool": {"filter": filter_condition}} except KeyError: raise ErrorCode.UNABLE_TO_TRANSLATE_ASSETS_DSL.exception_with_parameters() from None return dumps(asset_selection_dsl) diff --git a/pyatlan/model/enums.py b/pyatlan/model/enums.py index 25478bf1c..aef7b0f18 100644 --- a/pyatlan/model/enums.py +++ b/pyatlan/model/enums.py @@ -144,14 +144,10 @@ class AtlanConnectorType(str, Enum): category: AtlanConnectionCategory @classmethod - def _get_connector_type_from_qualified_name( - cls, qualified_name: str - ) -> "AtlanConnectorType": + def _get_connector_type_from_qualified_name(cls, qualified_name: str) -> "AtlanConnectorType": tokens = qualified_name.split("/") if len(tokens) < 2: - raise ValueError( - f"Qualified name '{qualified_name}' does not contain enough segments." - ) + raise ValueError(f"Qualified name '{qualified_name}' does not contain enough segments.") connector_type_key = tokens[1].upper() # Check if the connector_type_key exists in AtlanConnectorType if connector_type_key not in AtlanConnectorType.__members__: @@ -161,9 +157,7 @@ def _get_connector_type_from_qualified_name( ) return AtlanConnectorType[connector_type_key] - def __new__( - cls, value: str, category: AtlanConnectionCategory - ) -> "AtlanConnectorType": + def __new__(cls, value: str, category: AtlanConnectionCategory) -> "AtlanConnectorType": obj = str.__new__(cls, value) obj._value_ = value obj.category = category @@ -2024,9 +2018,7 @@ class KeycloakEventType(str, Enum): IDENTITY_PROVIDER_RESPONSE = "IDENTITY_PROVIDER_RESPONSE" IDENTITY_PROVIDER_RESPONSE_ERROR = "IDENTITY_PROVIDER_RESPONSE_ERROR" IDENTITY_PROVIDER_RETRIEVE_TOKEN = "IDENTITY_PROVIDER_RETRIEVE_TOKEN" # noqa: S105 - IDENTITY_PROVIDER_RETRIEVE_TOKEN_ERROR = ( - "IDENTITY_PROVIDER_RETRIEVE_TOKEN_ERROR" # noqa: S105 - ) + IDENTITY_PROVIDER_RETRIEVE_TOKEN_ERROR = "IDENTITY_PROVIDER_RETRIEVE_TOKEN_ERROR" # noqa: S105 IMPERSONATE = "IMPERSONATE" IMPERSONATE_ERROR = "IMPERSONATE_ERROR" CUSTOM_REQUIRED_ACTION = "CUSTOM_REQUIRED_ACTION" @@ -2052,9 +2044,7 @@ class KeycloakEventType(str, Enum): OAUTH2_DEVICE_VERIFY_USER_CODE = "OAUTH2_DEVICE_VERIFY_USER_CODE" OAUTH2_DEVICE_VERIFY_USER_CODE_ERROR = "OAUTH2_DEVICE_VERIFY_USER_CODE_ERROR" OAUTH2_DEVICE_CODE_TO_TOKEN = "OAUTH2_DEVICE_CODE_TO_TOKEN" # noqa: S105 - OAUTH2_DEVICE_CODE_TO_TOKEN_ERROR = ( - "OAUTH2_DEVICE_CODE_TO_TOKEN_ERROR" # noqa: S105 - ) + OAUTH2_DEVICE_CODE_TO_TOKEN_ERROR = "OAUTH2_DEVICE_CODE_TO_TOKEN_ERROR" # noqa: S105 AUTHREQID_TO_TOKEN = "AUTHREQID_TO_TOKEN" # noqa: S105 AUTHREQID_TO_TOKEN_ERROR = "AUTHREQID_TO_TOKEN_ERROR" # noqa: S105 PERMISSION_TOKEN = "PERMISSION_TOKEN" # noqa: S105 @@ -2109,9 +2099,7 @@ class PersonaDomainAction(str, Enum): UPDATE_PRODUCTS = "persona-domain-product-update" DELETE_PRODUCTS = "persona-domain-product-delete" UPDATE_DOMAIN_CUSTOM_METADATA = "persona-domain-business-update-metadata" - UPDATE_SUBDOMAIN_CUSTOM_METADATA = ( - "persona-domain-sub-domain-business-update-metadata" - ) + UPDATE_SUBDOMAIN_CUSTOM_METADATA = "persona-domain-sub-domain-business-update-metadata" UPDATE_PRODUCT_CUSTOM_METADATA = "persona-domain-product-business-update-metadata" @@ -2353,20 +2341,12 @@ class AtlanTaskType(str, Enum): CLASSIFICATION_PROPAGATION_ADD = "CLASSIFICATION_PROPAGATION_ADD" CLASSIFICATION_PROPAGATION_DELETE = "CLASSIFICATION_PROPAGATION_DELETE" CLASSIFICATION_ONLY_PROPAGATION_DELETE = "CLASSIFICATION_ONLY_PROPAGATION_DELETE" - CLASSIFICATION_ONLY_PROPAGATION_DELETE_ON_HARD_DELETE = ( - "CLASSIFICATION_ONLY_PROPAGATION_DELETE_ON_HARD_DELETE" - ) + CLASSIFICATION_ONLY_PROPAGATION_DELETE_ON_HARD_DELETE = "CLASSIFICATION_ONLY_PROPAGATION_DELETE_ON_HARD_DELETE" CLASSIFICATION_REFRESH_PROPAGATION = "CLASSIFICATION_REFRESH_PROPAGATION" - CLASSIFICATION_PROPAGATION_RELATIONSHIP_UPDATE = ( - "CLASSIFICATION_PROPAGATION_RELATIONSHIP_UPDATE" - ) + CLASSIFICATION_PROPAGATION_RELATIONSHIP_UPDATE = "CLASSIFICATION_PROPAGATION_RELATIONSHIP_UPDATE" UPDATE_ENTITY_MEANINGS_ON_TERM_UPDATE = "UPDATE_ENTITY_MEANINGS_ON_TERM_UPDATE" - UPDATE_ENTITY_MEANINGS_ON_TERM_SOFT_DELETE = ( - "UPDATE_ENTITY_MEANINGS_ON_TERM_SOFT_DELETE" - ) - UPDATE_ENTITY_MEANINGS_ON_TERM_HARD_DELETE = ( - "UPDATE_ENTITY_MEANINGS_ON_TERM_HARD_DELETE" - ) + UPDATE_ENTITY_MEANINGS_ON_TERM_SOFT_DELETE = "UPDATE_ENTITY_MEANINGS_ON_TERM_SOFT_DELETE" + UPDATE_ENTITY_MEANINGS_ON_TERM_HARD_DELETE = "UPDATE_ENTITY_MEANINGS_ON_TERM_HARD_DELETE" class AtlanMeshColor(str, Enum): diff --git a/pyatlan/model/events.py b/pyatlan/model/events.py index e8a41336a..e230af19b 100644 --- a/pyatlan/model/events.py +++ b/pyatlan/model/events.py @@ -11,18 +11,14 @@ class AtlanEventPayload(AtlanObject): _subtypes_: Dict[str, type] = dict() - def __init_subclass__( - cls, event_type="ENTITY_NOTIFICATION_V2", operation_type=None - ): + def __init_subclass__(cls, event_type="ENTITY_NOTIFICATION_V2", operation_type=None): cls._subtypes_[operation_type or cls.__name__.lower()] = cls def __init__(__pydantic_self__, **data: Any) -> None: super().__init__(**data) __pydantic_self__.__fields_set__.update(["type", "operation_type"]) - event_type: Optional[str] = Field( - default=None, description="Type of the event payload.", alias="type" - ) + event_type: Optional[str] = Field(default=None, description="Type of the event payload.", alias="type") operation_type: Literal[ "ENTITY_CREATE", "ENTITY_UPDATE", @@ -52,9 +48,7 @@ class AssetUpdatePayload(AtlanEventPayload): operation_type: Literal["ENTITY_UPDATE"] = Field( description="Type of the operation the event contains a payload for." ) - mutated_details: Optional[Asset] = Field( - description="Details of what was updated on the asset." - ) + mutated_details: Optional[Asset] = Field(description="Details of what was updated on the asset.") class AssetDeletePayload(AtlanEventPayload): @@ -106,9 +100,7 @@ class AtlanEvent(AtlanObject): msg_compression_kind: Optional[str] = Field(default=None, description="TBC") msg_split_idx: Optional[int] = Field(description="TBC") msg_split_count: Optional[int] = Field(description="TBC") - msg_source_ip: Optional[str] = Field( - default=None, description="Originating IP address for the event." - ) + msg_source_ip: Optional[str] = Field(default=None, description="Originating IP address for the event.") msg_created_by: Optional[str] = Field(default=None, description="TBC") msg_creation_time: Optional[int] = Field( description="Timestamp (epoch) for when the event was created, in milliseconds." @@ -131,9 +123,7 @@ class AtlanEvent(AtlanObject): class AwsRequestContext(AtlanObject): - account_id: Optional[str] = Field( - default=None, description="Account from which the request originated." - ) + account_id: Optional[str] = Field(default=None, description="Account from which the request originated.") api_id: Optional[str] = Field(default=None, description="TBC") domain_name: Optional[str] = Field(default=None, description="TBC") domain_prefix: Optional[str] = Field(default=None, description="TBC") @@ -145,9 +135,7 @@ class AwsRequestContext(AtlanObject): default=None, description="Time at which the event was received, as a formatted string.", ) - time_epoch: Optional[int] = Field( - description="Time at which the event was received, epoch-based, in milliseconds." - ) + time_epoch: Optional[int] = Field(description="Time at which the event was received, epoch-based, in milliseconds.") class AwsEventWrapper(AtlanObject): @@ -159,9 +147,7 @@ class AwsEventWrapper(AtlanObject): description="Headers that were used when sending the event through to the Lambda URL." ) request_context: Optional[AwsRequestContext] = Field(description="TBC") - body: Optional[str] = Field( - default=None, description="Actual contents of the event that was sent by Atlan." - ) + body: Optional[str] = Field(default=None, description="Actual contents of the event that was sent by Atlan.") is_base_64_encoded: Optional[bool] = Field( description="Whether the contents are base64-encoded (True) or plain text (False)." ) diff --git a/pyatlan/model/fields/atlan_fields.py b/pyatlan/model/fields/atlan_fields.py index 34175c9ba..3edde7a69 100644 --- a/pyatlan/model/fields/atlan_fields.py +++ b/pyatlan/model/fields/atlan_fields.py @@ -622,20 +622,12 @@ def __init__(self, set_name: str, attribute_name: str): from pyatlan.cache.custom_metadata_cache import CustomMetadataCache super().__init__( - StrictStr( - CustomMetadataCache.get_attribute_for_search_results( - set_name, attribute_name - ) - ), - StrictStr( - CustomMetadataCache.get_attr_id_for_name(set_name, attribute_name) - ), + StrictStr(CustomMetadataCache.get_attribute_for_search_results(set_name, attribute_name)), + StrictStr(CustomMetadataCache.get_attr_id_for_name(set_name, attribute_name)), ) self.set_name = set_name self.attribute_name = attribute_name - self.attribute_def = CustomMetadataCache.get_attribute_def( - self.elastic_field_name - ) + self.attribute_def = CustomMetadataCache.get_attribute_def(self.elastic_field_name) def eq(self, value: SearchFieldType, case_insensitive: bool = False) -> Query: """ @@ -783,9 +775,7 @@ def has_any_value(self) -> LineageFilter: :returns: a filter that will match all assets whose provided field has any value at all (non-null). """ - return LineageFilter( - field=self._field, operator=AtlanComparisonOperator.NOT_NULL, value="" - ) + return LineageFilter(field=self._field, operator=AtlanComparisonOperator.NOT_NULL, value="") def has_no_value(self) -> LineageFilter: """ @@ -793,9 +783,7 @@ def has_no_value(self) -> LineageFilter: :returns: a filter that will only match assets that have no value at all for the field (null). """ - return LineageFilter( - field=self._field, operator=AtlanComparisonOperator.IS_NULL, value="" - ) + return LineageFilter(field=self._field, operator=AtlanComparisonOperator.IS_NULL, value="") class LineageFilterFieldBoolean(LineageFilterField): @@ -810,9 +798,7 @@ def eq(self, value: bool) -> LineageFilter: :param value: the value to check the field's value equals :returns: a filter that will only match assets whose value for the field is exactly the value provided """ - return LineageFilter( - field=self._field, operator=AtlanComparisonOperator.EQ, value=str(value) - ) + return LineageFilter(field=self._field, operator=AtlanComparisonOperator.EQ, value=str(value)) def neq(self, value: bool) -> LineageFilter: """ @@ -822,9 +808,7 @@ def neq(self, value: bool) -> LineageFilter: :param value: the value to check the field's value does not equal :returns: a filter that will only match assets whose value for the field is not exactly the value provided """ - return LineageFilter( - field=self._field, operator=AtlanComparisonOperator.NEQ, value=str(value) - ) + return LineageFilter(field=self._field, operator=AtlanComparisonOperator.NEQ, value=str(value)) class LineageFilterFieldCM(LineageFilterField): @@ -895,20 +879,14 @@ def eq(self, value: Union[str, Enum, int, float, date]): value=value.value, ) if isinstance(value, str): - return LineageFilter( - field=self._field, operator=AtlanComparisonOperator.EQ, value=value - ) + return LineageFilter(field=self._field, operator=AtlanComparisonOperator.EQ, value=value) if isinstance(value, bool): - if not is_comparable_type( - self._cm_field.attribute_def.type_name or "", ComparisonCategory.BOOLEAN - ): + if not is_comparable_type(self._cm_field.attribute_def.type_name or "", ComparisonCategory.BOOLEAN): raise ErrorCode.INVALID_QUERY.exception_with_parameters( AtlanComparisonOperator.EQ.value, f"{self._cm_field.set_name}.{self._cm_field.attribute_name}", ) - return LineageFilter( - field=self._field, operator=AtlanComparisonOperator.EQ, value=str(value) - ) + return LineageFilter(field=self._field, operator=AtlanComparisonOperator.EQ, value=str(value)) return self._with_numeric_comparison( value=value, comparison_operator=AtlanComparisonOperator.EQ, @@ -969,13 +947,9 @@ def neq(self, value: Union[str, Enum, int, float, date]): value=value.value, ) if isinstance(value, str): - return LineageFilter( - field=self._field, operator=AtlanComparisonOperator.NEQ, value=value - ) + return LineageFilter(field=self._field, operator=AtlanComparisonOperator.NEQ, value=value) if isinstance(value, bool): - if not is_comparable_type( - self._cm_field.attribute_def.type_name or "", ComparisonCategory.BOOLEAN - ): + if not is_comparable_type(self._cm_field.attribute_def.type_name or "", ComparisonCategory.BOOLEAN): raise ErrorCode.INVALID_QUERY.exception_with_parameters( AtlanComparisonOperator.NEQ.value, f"{self._cm_field.set_name}.{self._cm_field.attribute_name}", @@ -999,9 +973,7 @@ def starts_with(self, value: str) -> LineageFilter: :param value: the value (prefix) to check the field's value starts with (case-sensitive) :return: a filter that will only match assets whose value for the field starts with the value provided """ - return self._with_string_comparison( - value=value, comparison_operator=AtlanComparisonOperator.STARTS_WITH - ) + return self._with_string_comparison(value=value, comparison_operator=AtlanComparisonOperator.STARTS_WITH) def ends_with(self, value: str) -> LineageFilter: """ @@ -1011,9 +983,7 @@ def ends_with(self, value: str) -> LineageFilter: :param value: the value (suffix) to check the field's value starts with (case-sensitive) :return: a filter that will only match assets whose value for the field ends with the value provided """ - return self._with_string_comparison( - value=value, comparison_operator=AtlanComparisonOperator.ENDS_WITH - ) + return self._with_string_comparison(value=value, comparison_operator=AtlanComparisonOperator.ENDS_WITH) def contains(self, value: str) -> LineageFilter: """ @@ -1023,9 +993,7 @@ def contains(self, value: str) -> LineageFilter: :param value: the value (suffix) to check the field's value contains (case-sensitive) :return: a filter that will only match assets whose value for the field contains the value provided """ - return self._with_string_comparison( - value=value, comparison_operator=AtlanComparisonOperator.CONTAINS - ) + return self._with_string_comparison(value=value, comparison_operator=AtlanComparisonOperator.CONTAINS) def does_not_contain(self, value: str) -> LineageFilter: """ @@ -1035,9 +1003,7 @@ def does_not_contain(self, value: str) -> LineageFilter: :param value: the value (suffix) to check the field's value does not contain (case-sensitive) :return: a filter that will only match assets whose value for the field does not contain the value provided """ - return self._with_string_comparison( - value=value, comparison_operator=AtlanComparisonOperator.NOT_CONTAINS - ) + return self._with_string_comparison(value=value, comparison_operator=AtlanComparisonOperator.NOT_CONTAINS) @overload def lt(self, value: int) -> LineageFilter: @@ -1077,9 +1043,7 @@ def lt(self, value: Union[int, float, date]) -> LineageFilter: :return value: a filter that will only match assets whose value for the field is strictly less than the value provided """ - return self._with_numeric_comparison( - value=value, comparison_operator=AtlanComparisonOperator.LT - ) + return self._with_numeric_comparison(value=value, comparison_operator=AtlanComparisonOperator.LT) @overload def gt(self, value: int) -> LineageFilter: @@ -1119,9 +1083,7 @@ def gt(self, value: Union[int, float, date]) -> LineageFilter: :return value: a filter that will only match assets whose value for the field is strictly greater than the value provided """ - return self._with_numeric_comparison( - value=value, comparison_operator=AtlanComparisonOperator.GT - ) + return self._with_numeric_comparison(value=value, comparison_operator=AtlanComparisonOperator.GT) @overload def lte(self, value: int) -> LineageFilter: @@ -1161,9 +1123,7 @@ def lte(self, value: Union[int, float, date]) -> LineageFilter: :return value: a filter that will only match assets whose value for the field is strictly less than or equal to the value provided """ - return self._with_numeric_comparison( - value=value, comparison_operator=AtlanComparisonOperator.LTE - ) + return self._with_numeric_comparison(value=value, comparison_operator=AtlanComparisonOperator.LTE) @overload def gte(self, value: int) -> LineageFilter: @@ -1203,9 +1163,7 @@ def gte(self, value: Union[int, float, date]) -> LineageFilter: :return value: a filter that will only match assets whose value for the field is strictly greater than or equal to the value provided """ - return self._with_numeric_comparison( - value=value, comparison_operator=AtlanComparisonOperator.GTE - ) + return self._with_numeric_comparison(value=value, comparison_operator=AtlanComparisonOperator.GTE) def _with_numeric_comparison( self, @@ -1216,42 +1174,24 @@ def _with_numeric_comparison( if isinstance( value, bool, # needed because isinstance(value, int) evaluates to true when value is bool - ) or ( - not isinstance(value, int) - and not isinstance(value, float) - and not isinstance(value, date) - ): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - type(value).__name__, expected_types - ) - if not is_comparable_type( - self._cm_field.attribute_def.type_name or "", ComparisonCategory.NUMBER - ): + ) or (not isinstance(value, int) and not isinstance(value, float) and not isinstance(value, date)): + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters(type(value).__name__, expected_types) + if not is_comparable_type(self._cm_field.attribute_def.type_name or "", ComparisonCategory.NUMBER): raise ErrorCode.INVALID_QUERY.exception_with_parameters( comparison_operator.value, f"{self._cm_field.set_name}.{self._cm_field.attribute_name}", ) - return LineageFilter( - field=self._field, operator=comparison_operator, value=str(value) - ) + return LineageFilter(field=self._field, operator=comparison_operator, value=str(value)) - def _with_string_comparison( - self, value: str, comparison_operator: AtlanComparisonOperator - ): + def _with_string_comparison(self, value: str, comparison_operator: AtlanComparisonOperator): if not isinstance(value, str): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - type(value).__name__, "str" - ) - if not is_comparable_type( - self._cm_field.attribute_def.type_name or "", ComparisonCategory.STRING - ): + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters(type(value).__name__, "str") + if not is_comparable_type(self._cm_field.attribute_def.type_name or "", ComparisonCategory.STRING): raise ErrorCode.INVALID_QUERY.exception_with_parameters( comparison_operator.value, f"{self._cm_field.set_name}.{self._cm_field.attribute_name}", ) - return LineageFilter( - field=self._field, operator=comparison_operator, value=value - ) + return LineageFilter(field=self._field, operator=comparison_operator, value=value) class LineageFilterFieldNumeric(LineageFilterField): @@ -1478,20 +1418,12 @@ def gte(self, value: Union[int, float, date]) -> LineageFilter: """ return self._get_filter(value=value, operator=AtlanComparisonOperator.GTE) - def _get_filter( - self, value: Union[int, float, date], operator: AtlanComparisonOperator - ): + def _get_filter(self, value: Union[int, float, date], operator: AtlanComparisonOperator): if isinstance( value, bool, # needed because isinstance(value, int) evaluates to true when value is bool - ) or ( - not isinstance(value, int) - and not isinstance(value, float) - and not isinstance(value, date) - ): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - type(value).__name__, "int, float or date" - ) + ) or (not isinstance(value, int) and not isinstance(value, float) and not isinstance(value, date)): + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters(type(value).__name__, "int, float or date") return LineageFilter(field=self._field, operator=operator, value=str(value)) @@ -1560,9 +1492,7 @@ def starts_with(self, value: Union[str, Enum]) -> LineageFilter: value. Note that this is a case-sensitive match. :param value: the value to check the field's value equals (case-sensitive)""" - return self._get_filter( - value=value, operator=AtlanComparisonOperator.STARTS_WITH - ) + return self._get_filter(value=value, operator=AtlanComparisonOperator.STARTS_WITH) @overload def ends_with(self, value: str) -> LineageFilter: @@ -1625,17 +1555,11 @@ def does_not_contain(self, value: Union[str, Enum]) -> LineageFilter: provided value. Note that this is a case-sensitive match. :param value: the value to check the field's value equals (case-sensitive)""" - return self._get_filter( - value=value, operator=AtlanComparisonOperator.NOT_CONTAINS - ) + return self._get_filter(value=value, operator=AtlanComparisonOperator.NOT_CONTAINS) def _get_filter(self, value: Union[str, Enum], operator: AtlanComparisonOperator): if isinstance(value, Enum): - return LineageFilter( - field=self._field, operator=operator, value=value.value - ) + return LineageFilter(field=self._field, operator=operator, value=value.value) if isinstance(value, str): return LineageFilter(field=self._field, operator=operator, value=value) - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - type(value).__name__, "int, float or date" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters(type(value).__name__, "int, float or date") diff --git a/pyatlan/model/fluent_search.py b/pyatlan/model/fluent_search.py index 4c4f38d63..fcc02bfae 100644 --- a/pyatlan/model/fluent_search.py +++ b/pyatlan/model/fluent_search.py @@ -88,15 +88,11 @@ def super_types(one_of: Union[type, List[type]]) -> Query: :returns: a query that will only match assets of a subtype of the types provided """ if isinstance(one_of, list): - return Referenceable.SUPER_TYPE_NAMES.within( - list(map(lambda x: x.__name__, one_of)) - ) + return Referenceable.SUPER_TYPE_NAMES.within(list(map(lambda x: x.__name__, one_of))) return Referenceable.SUPER_TYPE_NAMES.eq(one_of.__name__) @staticmethod - def tagged( - with_one_of: Optional[List[str]] = None, directly: bool = False - ) -> Query: + def tagged(with_one_of: Optional[List[str]] = None, directly: bool = False) -> Query: """ Returns a query that will only match assets that have at least one of the Atlan tags provided. This will match irrespective of the Atlan tag being directly applied to the @@ -115,17 +111,11 @@ def tagged( if tag_id := AtlanTagCache.get_id_for_name(name): values.append(tag_id) else: - raise ErrorCode.ATLAN_TAG_NOT_FOUND_BY_NAME.exception_with_parameters( - name - ) + raise ErrorCode.ATLAN_TAG_NOT_FOUND_BY_NAME.exception_with_parameters(name) if directly: if values: - return FluentSearch( - wheres=[Referenceable.ATLAN_TAGS.within(values)] - ).to_query() - return FluentSearch( - wheres=[Referenceable.ATLAN_TAGS.has_any_value()] - ).to_query() + return FluentSearch(wheres=[Referenceable.ATLAN_TAGS.within(values)]).to_query() + return FluentSearch(wheres=[Referenceable.ATLAN_TAGS.has_any_value()]).to_query() if values: return FluentSearch( where_somes=[ @@ -143,9 +133,7 @@ def tagged( ).to_query() @staticmethod - def tagged_with_value( - atlan_tag_name: str, value: str, directly: bool = False - ) -> Query: + def tagged_with_value(atlan_tag_name: str, value: str, directly: bool = False) -> Query: """ Returns a query that will match assets that have a specific value for the specified tag (for source-synced tags). @@ -166,20 +154,12 @@ def tagged_with_value( client = AtlanClient.get_default_client() synced_tags = [ tag - for tag in ( - FluentSearch() - .select() - .where(Tag.MAPPED_CLASSIFICATION_NAME.eq(tag_id)) - .execute(client=client) - ) + for tag in (FluentSearch().select().where(Tag.MAPPED_CLASSIFICATION_NAME.eq(tag_id)).execute(client=client)) ] if len(synced_tags) > 1: synced_tag_qn = synced_tags[0].qualified_name or "" LOGGER.warning( - ( - "Multiple mapped source-synced tags " - "found for tag %s -- using only the first: %s", - ), + ("Multiple mapped source-synced tags found for tag %s -- using only the first: %s",), atlan_tag_name, synced_tag_qn, ) @@ -189,22 +169,14 @@ def tagged_with_value( synced_tag_qn = "NON_EXISTENT" # Contruct little spans - little_spans.append( - SpanTerm(field="__classificationsText.text", value="tagAttachmentValue") - ) + little_spans.append(SpanTerm(field="__classificationsText.text", value="tagAttachmentValue")) for token in value.split(" "): - little_spans.append( - SpanTerm(field="__classificationsText.text", value=token) - ) - little_spans.append( - SpanTerm(field="__classificationsText.text", value="tagAttachmentKey") - ) + little_spans.append(SpanTerm(field="__classificationsText.text", value=token)) + little_spans.append(SpanTerm(field="__classificationsText.text", value="tagAttachmentKey")) # Contruct big spans big_spans.append(SpanTerm(field="__classificationsText.text", value=tag_id)) - big_spans.append( - SpanTerm(field="__classificationsText.text", value=synced_tag_qn) - ) + big_spans.append(SpanTerm(field="__classificationsText.text", value=synced_tag_qn)) # Contruct final span query span = SpanWithin( @@ -214,12 +186,7 @@ def tagged_with_value( # Without atlan tag propagation if directly: - return ( - FluentSearch() - .where(Referenceable.ATLAN_TAGS.eq(tag_id)) - .where(span) - .to_query() - ) + return FluentSearch().where(Referenceable.ATLAN_TAGS.eq(tag_id)).where(span).to_query() # With atlan tag propagation return ( FluentSearch() diff --git a/pyatlan/model/group.py b/pyatlan/model/group.py index 724dc58ab..ae7a25f22 100644 --- a/pyatlan/model/group.py +++ b/pyatlan/model/group.py @@ -14,58 +14,34 @@ class AtlanGroup(AtlanObject): class Attributes(AtlanObject): - alias: Optional[List[str]] = Field( - default=None, description="Name of the group as it appears in the UI." - ) + alias: Optional[List[str]] = Field(default=None, description="Name of the group as it appears in the UI.") created_at: Optional[List[str]] = Field( default=None, description="Time (epoch) at which the group was created, in milliseconds.", ) - created_by: Optional[List[str]] = Field( - default=None, description="User who created the group." - ) + created_by: Optional[List[str]] = Field(default=None, description="User who created the group.") updated_at: Optional[List[str]] = Field( default=None, description="Time (epoch) at which the group was last updated, in milliseconds.", ) - updated_by: Optional[List[str]] = Field( - default=None, description="User who last updated the group." - ) - description: Optional[List[str]] = Field( - default=None, description="Description of the group." - ) + updated_by: Optional[List[str]] = Field(default=None, description="User who last updated the group.") + description: Optional[List[str]] = Field(default=None, description="Description of the group.") is_default: Optional[List[str]] = Field( default=None, description="Whether this group should be auto-assigned to all new users or not.", ) - channels: Optional[List[str]] = Field( - default=None, description="Slack channels for this group." - ) + channels: Optional[List[str]] = Field(default=None, description="Slack channels for this group.") - alias: Optional[str] = Field( - default=None, description="Name of the group as it appears in the UI." - ) - attributes: Optional[AtlanGroup.Attributes] = Field( - default=None, description="Detailed attributes of the group." - ) + alias: Optional[str] = Field(default=None, description="Name of the group as it appears in the UI.") + attributes: Optional[AtlanGroup.Attributes] = Field(default=None, description="Detailed attributes of the group.") roles: Optional[List[str]] = Field(default=None, description="TBC") decentralized_roles: Optional[List[Any]] = Field(default=None, description="TBC") - id: Optional[str] = Field( - default=None, description="Unique identifier for the group (GUID)." - ) - name: Optional[str] = Field( - default=None, description="Unique (internal) name for the group." - ) + id: Optional[str] = Field(default=None, description="Unique identifier for the group (GUID).") + name: Optional[str] = Field(default=None, description="Unique (internal) name for the group.") path: Optional[str] = Field(default=None, description="TBC") - personas: Optional[List[Any]] = Field( - default=None, description="Personas the group is associated with." - ) - purposes: Optional[List[Any]] = Field( - default=None, description="Purposes the group is associated with." - ) - user_count: Optional[int] = Field( - default=None, description="Number of users in the group." - ) + personas: Optional[List[Any]] = Field(default=None, description="Personas the group is associated with.") + purposes: Optional[List[Any]] = Field(default=None, description="Purposes the group is associated with.") + user_count: Optional[int] = Field(default=None, description="Number of users in the group.") def is_default(self) -> bool: return ( @@ -126,9 +102,7 @@ class GroupResponse(AtlanObject): filter_record: Optional[int] = Field( description="Number of groups in the filtered response.", ) - records: Optional[List[AtlanGroup]] = Field( - description="Details of each group included in the response." - ) + records: Optional[List[AtlanGroup]] = Field(description="Details of each group included in the response.") def __init__(self, **data: Any): super().__init__(**data) @@ -160,9 +134,7 @@ def _get_next_page(self): try: self.records = parse_obj_as(List[AtlanGroup], raw_json.get("records")) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err return True def __iter__(self) -> Generator[AtlanGroup, None, None]: # type: ignore[override] @@ -244,9 +216,7 @@ def was_successful(self) -> bool: self.status_message is not None and self.status_message == "success" ) - group: str = Field( - description="Unique identifier (GUID) of the group that was created." - ) + group: str = Field(description="Unique identifier (GUID) of the group that was created.") users: Optional[Dict[str, CreateGroupResponse.UserStatus]] = Field( default=None, description="Map of user association statuses, keyed by unique identifier (GUID) of the user.", diff --git a/pyatlan/model/keycloak_events.py b/pyatlan/model/keycloak_events.py index 297753353..2ee40d5f2 100644 --- a/pyatlan/model/keycloak_events.py +++ b/pyatlan/model/keycloak_events.py @@ -15,9 +15,7 @@ class AuthDetails(AtlanObject): default=None, description="Unique identifier (GUID) of the client that carried out the operation.", ) - ip_address: Optional[str] = Field( - default=None, description="IP address from which the operation was carried out." - ) + ip_address: Optional[str] = Field(default=None, description="IP address from which the operation was carried out.") realm_id: Optional[str] = Field( default=None, description="Unique name of the realm from which the operation was carried out.", @@ -29,27 +27,17 @@ class AuthDetails(AtlanObject): class KeycloakEvent(AtlanObject): - client_id: Optional[str] = Field( - default=None, description="Where the login occurred (usually 'atlan-frontend')." - ) + client_id: Optional[str] = Field(default=None, description="Where the login occurred (usually 'atlan-frontend').") details: Any = Field(description="TBC") - ip_address: Optional[str] = Field( - default=None, description="IP address from which the user logged in." - ) + ip_address: Optional[str] = Field(default=None, description="IP address from which the user logged in.") realm_id: Optional[str] = Field(default=None, description="TBC") session_id: Optional[str] = Field( default=None, description="Unique identifier (GUID) of the session for the login.", ) - time: Optional[int] = Field( - description="Time (epoch) when the login occurred, in milliseconds." - ) - type: Optional[KeycloakEventType] = Field( - description="Type of login event that occurred (usually 'LOGIN')." - ) - user_id: Optional[str] = Field( - default=None, description="Unique identifier (GUID) of the user that logged in." - ) + time: Optional[int] = Field(description="Time (epoch) when the login occurred, in milliseconds.") + type: Optional[KeycloakEventType] = Field(description="Type of login event that occurred (usually 'LOGIN').") + user_id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the user that logged in.") class AdminEvent(AtlanObject): @@ -72,21 +60,13 @@ class AdminEvent(AtlanObject): default=None, description="Type of resource for the admin operation that occurred.", ) - time: Optional[int] = Field( - description="Time (epoch) when the admin operation occurred, in milliseconds." - ) - auth_details: Optional[AuthDetails] = Field( - default=None, description="Details of who carried out the operation." - ) + time: Optional[int] = Field(description="Time (epoch) when the admin operation occurred, in milliseconds.") + auth_details: Optional[AuthDetails] = Field(default=None, description="Details of who carried out the operation.") class KeycloakEventRequest(AtlanObject): - client: Optional[str] = Field( - default=None, description="Application or OAuth client name." - ) - ip_address: Optional[str] = Field( - default=None, description="IP address from which the event was triggered." - ) + client: Optional[str] = Field(default=None, description="Application or OAuth client name.") + ip_address: Optional[str] = Field(default=None, description="IP address from which the event was triggered.") date_from: Optional[str] = Field( default=None, description="Earliest date from which to include events (format: yyyy-MM-dd).", @@ -95,12 +75,8 @@ class KeycloakEventRequest(AtlanObject): default=None, description="Latest date up to which to include events (format: yyyy-MM-dd).", ) - offset: Optional[int] = Field( - default=None, description="Starting point for the events (for paging)." - ) - size: Optional[int] = Field( - default=None, description="Maximum number of events to retrieve (per page)." - ) + offset: Optional[int] = Field(default=None, description="Starting point for the events (for paging).") + size: Optional[int] = Field(default=None, description="Maximum number of events to retrieve (per page).") types: Optional[List[KeycloakEventType]] = Field( default=None, description="Include events only of the supplied types." ) @@ -178,9 +154,7 @@ class AdminEventRequest(AtlanObject): default=None, description="Unique identifier (GUID) of the client that carried out the operation.", ) - ip_address: Optional[str] = Field( - default=None, description="IP address from which the operation was carried out." - ) + ip_address: Optional[str] = Field(default=None, description="IP address from which the operation was carried out.") realm_id: Optional[str] = Field( default=None, description="Unique name of the realm from which the operation was carried out.", @@ -197,19 +171,13 @@ class AdminEventRequest(AtlanObject): default=None, description="Latest date up to which to include events (format: yyyy-MM-dd).", ) - offset: Optional[int] = Field( - default=None, description="Starting point for the events (for paging)." - ) - size: Optional[int] = Field( - default=None, description="Maximum number of events to retrieve (per page)." - ) + offset: Optional[int] = Field(default=None, description="Starting point for the events (for paging).") + size: Optional[int] = Field(default=None, description="Maximum number of events to retrieve (per page).") operation_types: Optional[List[AdminOperationType]] = Field( default=None, description="Include events only with the supplied types of operations.", ) - resource_path: Optional[str] = Field( - default=None, description="Include events only against the supplied resource." - ) + resource_path: Optional[str] = Field(default=None, description="Include events only against the supplied resource.") resource_types: Optional[List[AdminResourceType]] = Field( default=None, description="Include events only against the supplied types of resources.", diff --git a/pyatlan/model/lineage.py b/pyatlan/model/lineage.py index faf2a7578..732d4c128 100644 --- a/pyatlan/model/lineage.py +++ b/pyatlan/model/lineage.py @@ -50,11 +50,7 @@ def create(cls, relations: List[LineageRelation]) -> "LineageGraph": upstream_list: Dict[str, Dict[DirectedPair, None]] = {} def add_relation(_relation: LineageRelation): - if ( - _relation.from_entity_id - and _relation.process_id - and _relation.to_entity_id - ): + if _relation.from_entity_id and _relation.process_id and _relation.to_entity_id: add_edges( _relation.from_entity_id, _relation.process_id, @@ -66,12 +62,8 @@ def add_edges(source_guid: str, process_guid: str, target_guid: str): downstream_list[source_guid] = {} if target_guid not in upstream_list: upstream_list[target_guid] = {} - downstream_list[source_guid][ - DirectedPair(process_guid=process_guid, target_guid=target_guid) - ] = None - upstream_list[target_guid][ - DirectedPair(process_guid=process_guid, target_guid=source_guid) - ] = None + downstream_list[source_guid][DirectedPair(process_guid=process_guid, target_guid=target_guid)] = None + upstream_list[target_guid][DirectedPair(process_guid=process_guid, target_guid=source_guid)] = None for relation in relations: if relation.is_full_link: @@ -81,17 +73,13 @@ def add_edges(source_guid: str, process_guid: str, target_guid: str): return cls(downstream_list=downstream_list, upstream_list=upstream_list) @staticmethod - def get_asset_guids( - guid: str, guids: Dict[str, Dict[DirectedPair, None]] - ) -> List[str]: + def get_asset_guids(guid: str, guids: Dict[str, Dict[DirectedPair, None]]) -> List[str]: if guid in guids: return list({pair.target_guid: None for pair in guids[guid].keys()}.keys()) return [] @staticmethod - def get_process_guids( - guid: str, guids: Dict[str, Dict[DirectedPair, None]] - ) -> List[str]: + def get_process_guids(guid: str, guids: Dict[str, Dict[DirectedPair, None]]) -> List[str]: if guid in guids: return list({pair.process_guid: None for pair in guids[guid].keys()}.keys()) return [] @@ -153,51 +141,35 @@ def get_graph(self): self.graph = LineageGraph.create(self.relations) return self.graph - def get_all_downstream_asset_guids_dfs( - self, guid: Optional[str] = None - ) -> List[str]: - return self.get_graph().get_all_downstream_asset_guids_dfs( - guid or self.base_entity_guid - ) + def get_all_downstream_asset_guids_dfs(self, guid: Optional[str] = None) -> List[str]: + return self.get_graph().get_all_downstream_asset_guids_dfs(guid or self.base_entity_guid) def get_all_downstream_assets_dfs(self, guid: Optional[str] = None) -> List[Asset]: return [ self.guid_entity_map[guid] - for guid in self.get_graph().get_all_downstream_asset_guids_dfs( - guid or self.base_entity_guid - ) + for guid in self.get_graph().get_all_downstream_asset_guids_dfs(guid or self.base_entity_guid) ] def get_all_upstream_asset_guids_dfs(self, guid: Optional[str] = None) -> List[str]: - return self.get_graph().get_all_upstream_asset_guids_dfs( - guid or self.base_entity_guid - ) + return self.get_graph().get_all_upstream_asset_guids_dfs(guid or self.base_entity_guid) def get_all_upstream_assets_dfs(self, guid: Optional[str] = None) -> List[Asset]: return [ self.guid_entity_map[guid] - for guid in self.get_graph().get_all_upstream_asset_guids_dfs( - guid or self.base_entity_guid - ) + for guid in self.get_graph().get_all_upstream_asset_guids_dfs(guid or self.base_entity_guid) ] def get_downstream_asset_guids(self, guid: Optional[str] = None) -> List[str]: - return self.get_graph().get_downstream_asset_guids( - guid or self.base_entity_guid - ) + return self.get_graph().get_downstream_asset_guids(guid or self.base_entity_guid) def get_downstream_assets(self, guid: Optional[str] = None) -> List[Asset]: return [ self.guid_entity_map[guid] - for guid in self.get_graph().get_downstream_asset_guids( - guid or self.base_entity_guid - ) + for guid in self.get_graph().get_downstream_asset_guids(guid or self.base_entity_guid) ] def get_downstream_process_guids(self, guid: Optional[str] = None) -> List[str]: - return self.get_graph().get_downstream_process_guids( - guid or self.base_entity_guid - ) + return self.get_graph().get_downstream_process_guids(guid or self.base_entity_guid) def get_upstream_asset_guids(self, guid: Optional[str] = None) -> List[str]: return self.get_graph().get_upstream_asset_guids(guid or self.base_entity_guid) @@ -205,15 +177,11 @@ def get_upstream_asset_guids(self, guid: Optional[str] = None) -> List[str]: def get_upstream_assets(self, guid: Optional[str] = None) -> List[Asset]: return [ self.guid_entity_map[guid] - for guid in self.get_graph().get_upstream_asset_guids( - guid or self.base_entity_guid - ) + for guid in self.get_graph().get_upstream_asset_guids(guid or self.base_entity_guid) ] def get_upstream_process_guids(self, guid: Optional[str] = None) -> List[str]: - return self.get_graph().get_upstream_process_guids( - guid or self.base_entity_guid - ) + return self.get_graph().get_upstream_process_guids(guid or self.base_entity_guid) class LineageRequest(AtlanObject): @@ -225,16 +193,11 @@ class LineageRequest(AtlanObject): class EntityFilter(AtlanObject): - attribute_name: str = Field( - description="Name of the attribute on which filtering should be applied." - ) + attribute_name: str = Field(description="Name of the attribute on which filtering should be applied.") operator: AtlanComparisonOperator = Field( - description="Comparison that should be used when checking attribute_name" - " against the provided attribute_value." - ) - attribute_value: str = Field( - description="Value that attribute_name should be compared against." + description="Comparison that should be used when checking attribute_name against the provided attribute_value." ) + attribute_value: str = Field(description="Value that attribute_name should be compared against.") class FilterList(AtlanObject): @@ -253,9 +216,7 @@ class Condition(str, Enum): class LineageListRequest(SearchRequest): - guid: str = Field( - description="Unique identifier of the asset for which to retrieve lineage." - ) + guid: str = Field(description="Unique identifier of the asset for which to retrieve lineage.") depth: int = Field( description="Number of degrees of separation (hops) across which lineage should be fetched." "A depth of 1 will fetch the immediate upstream or downstream assets, while 2" @@ -268,9 +229,7 @@ class LineageListRequest(SearchRequest): description="Indicates whether to fetch upstream lineage only, or downstream lineage only. " "Note that you cannot fetch both upstream and downstream at the same time." ) - entity_filters: Optional[FilterList] = Field( - default=None, description="Filters to apply on entities." - ) + entity_filters: Optional[FilterList] = Field(default=None, description="Filters to apply on entities.") entity_traversal_filters: Optional[FilterList] = Field( default=None, description="Filters to apply for skipping traversal based on entities." @@ -287,12 +246,8 @@ class LineageListRequest(SearchRequest): "Any sub-graphs beyond the relationships filtered out by these filters will not be included" "in the lineage result.", ) - offset: Optional[int] = Field( - default=None, description="Starting point for pagination.", alias="from" - ) - size: Optional[int] = Field( - default=None, description="How many results to include in each page of results." - ) + offset: Optional[int] = Field(default=None, description="Starting point for pagination.", alias="from") + size: Optional[int] = Field(default=None, description="How many results to include in each page of results.") exclude_meanings: Optional[bool] = Field( default=None, description="Whether to include assigned terms for assets (false) or not (true).", @@ -346,13 +301,9 @@ def __init__( exclude_meanings: StrictBool = True, exclude_atlan_tags: StrictBool = True, immediate_neighbors: StrictBool = False, - includes_on_results: Optional[ - Union[List[str], str, List[AtlanField], AtlanField] - ] = None, + includes_on_results: Optional[Union[List[str], str, List[AtlanField], AtlanField]] = None, includes_in_results: Optional[Union[List[LineageFilter], LineageFilter]] = None, - includes_on_relations: Optional[ - Union[List[str], str, List[AtlanField], AtlanField] - ] = None, + includes_on_relations: Optional[Union[List[str], str, List[AtlanField], AtlanField]] = None, includes_condition: FilterList.Condition = FilterList.Condition.AND, where_assets: Optional[Union[List[LineageFilter], LineageFilter]] = None, assets_condition: FilterList.Condition = FilterList.Condition.AND, @@ -394,23 +345,15 @@ def __init__( self._exclude_atlan_tags: bool = exclude_atlan_tags self._exclude_meanings: bool = exclude_meanings self._immediate_neighbors: bool = immediate_neighbors - self._includes_on_results: List[Union[str, AtlanField]] = self._to_list( - includes_on_results - ) - self._includes_in_results: List[LineageFilter] = self._to_list( - includes_in_results - ) - self._includes_on_relations: List[Union[str, AtlanField]] = self._to_list( - includes_on_relations - ) + self._includes_on_results: List[Union[str, AtlanField]] = self._to_list(includes_on_results) + self._includes_in_results: List[LineageFilter] = self._to_list(includes_in_results) + self._includes_on_relations: List[Union[str, AtlanField]] = self._to_list(includes_on_relations) self._includes_condition: FilterList.Condition = includes_condition self._size: int = size self._starting_guid = starting_guid self._where_assets: List[LineageFilter] = self._to_list(where_assets) self._assets_condition: FilterList.Condition = assets_condition - self._where_relationships: List[LineageFilter] = self._to_list( - where_relationships - ) + self._where_relationships: List[LineageFilter] = self._to_list(where_relationships) self._relationships_condition: FilterList.Condition = relationships_condition @staticmethod @@ -539,9 +482,7 @@ def include_on_relations(self, field: Union[str, AtlanField]) -> "FluentLineage" clone._includes_on_relations.append(field) return clone - def includes_condition( - self, includes_condition: FilterList.Condition - ) -> "FluentLineage": + def includes_condition(self, includes_condition: FilterList.Condition) -> "FluentLineage": """ Adds the filter condition to `include_on_results`. @@ -571,9 +512,7 @@ def where_assets(self, lineage_filter: LineageFilter) -> "FluentLineage": clone._where_assets.append(lineage_filter) return clone - def assets_condition( - self, assets_condition: FilterList.Condition - ) -> "FluentLineage": + def assets_condition(self, assets_condition: FilterList.Condition) -> "FluentLineage": """ Adds the filter condition to `where_assets`. @@ -603,9 +542,7 @@ def where_relationships(self, lineage_filter: LineageFilter) -> "FluentLineage": clone._where_relationships.append(lineage_filter) return clone - def relationships_condition( - self, relationships_condition: FilterList.Condition - ) -> "FluentLineage": + def relationships_condition(self, relationships_condition: FilterList.Condition) -> "FluentLineage": """ Adds the filter condition to `where_relationships`. @@ -670,9 +607,7 @@ def request(self) -> LineageListRequest: ) for _filter in self._where_assets ] - request.entity_traversal_filters = FilterList( - condition=self._assets_condition, criteria=criteria - ) # type: ignore[call-arg] + request.entity_traversal_filters = FilterList(condition=self._assets_condition, criteria=criteria) # type: ignore[call-arg] if self._where_relationships: criteria = [ EntityFilter( diff --git a/pyatlan/model/lineage_ref.py b/pyatlan/model/lineage_ref.py index 32579ad3f..54bf2a8a3 100644 --- a/pyatlan/model/lineage_ref.py +++ b/pyatlan/model/lineage_ref.py @@ -8,10 +8,6 @@ class LineageRef(AtlanObject): - qualified_name: str = Field( - default=None, description="Unique name of the asset being referenced." - ) - name: str = Field( - default=None, description="Simple name of the asset being referenced." - ) + qualified_name: str = Field(default=None, description="Unique name of the asset being referenced.") + name: str = Field(default=None, description="Simple name of the asset being referenced.") guid: str = Field(default=None, description="UUID of the asset being referenced.") diff --git a/pyatlan/model/open_lineage/base.py b/pyatlan/model/open_lineage/base.py index 0a83156ae..724302106 100644 --- a/pyatlan/model/open_lineage/base.py +++ b/pyatlan/model/open_lineage/base.py @@ -12,9 +12,7 @@ class OpenLineageBaseEvent(AtlanObject): Base model for OpenLineage events. """ - event_time: Optional[str] = Field( - default=None, description="time the event occurred at", alias="eventTime" - ) + event_time: Optional[str] = Field(default=None, description="time the event occurred at", alias="eventTime") producer: Optional[str] = Field(default=None, description="producer of the event") schema_url: Optional[str] = Field( default="https://openlineage.io/spec/2-0-2/OpenLineage.json#/$defs/RunEvent", diff --git a/pyatlan/model/open_lineage/column_lineage_dataset.py b/pyatlan/model/open_lineage/column_lineage_dataset.py index b1cb55495..e2fc7492e 100644 --- a/pyatlan/model/open_lineage/column_lineage_dataset.py +++ b/pyatlan/model/open_lineage/column_lineage_dataset.py @@ -10,21 +10,13 @@ class OpenLineageTransformation(AtlanObject): default=None, description="Type of the transformation. Allowed values are: DIRECT, INDIRECT", ) - subtype: Optional[str] = Field( - default=None, description="Subtype of the transformation" - ) - description: Optional[str] = Field( - default=None, description="String representation of the transformation applied" - ) - masking: Optional[bool] = Field( - default=None, description="Is the transformation masking the data or not" - ) + subtype: Optional[str] = Field(default=None, description="Subtype of the transformation") + description: Optional[str] = Field(default=None, description="String representation of the transformation applied") + masking: Optional[bool] = Field(default=None, description="Is the transformation masking the data or not") class OpenLineageInputField(AtlanObject): - namespace: Optional[str] = Field( - default=None, description="Input dataset namespace" - ) + namespace: Optional[str] = Field(default=None, description="Input dataset namespace") name: Optional[str] = Field(default=None, description="Input dataset name") field: Optional[str] = Field(default=None, description="Input field") transformations: Optional[List[OpenLineageTransformation]] = Field( diff --git a/pyatlan/model/open_lineage/dataset.py b/pyatlan/model/open_lineage/dataset.py index 827321563..099ab4161 100644 --- a/pyatlan/model/open_lineage/dataset.py +++ b/pyatlan/model/open_lineage/dataset.py @@ -13,9 +13,7 @@ class OpenLineageDataset(AtlanObject): Model for handling OpenLineage datasets. """ - name: Optional[str] = Field( - default=None, description="Unique name for that dataset within that namespace." - ) + name: Optional[str] = Field(default=None, description="Unique name for that dataset within that namespace.") namespace: Optional[str] = Field( default=None, description="Namespace containing that dataset.", diff --git a/pyatlan/model/open_lineage/event.py b/pyatlan/model/open_lineage/event.py index bb30dc95e..74ec1b080 100644 --- a/pyatlan/model/open_lineage/event.py +++ b/pyatlan/model/open_lineage/event.py @@ -54,9 +54,7 @@ def set_default_schema_url(cls, values): return values @classmethod - def creator( - self, run: OpenLineageRun, event_type: OpenLineageEventType - ) -> OpenLineageEvent: + def creator(self, run: OpenLineageRun, event_type: OpenLineageEventType) -> OpenLineageEvent: """ Builds the minimal object necessary to create an OpenLineage event. @@ -80,6 +78,4 @@ def emit(self, client: Optional[AtlanClient] = None) -> None: from pyatlan.client.atlan import AtlanClient client = client or AtlanClient.get_default_client() - return client.open_lineage.send( - request=self, connector_type=AtlanConnectorType.SPARK - ) + return client.open_lineage.send(request=self, connector_type=AtlanConnectorType.SPARK) diff --git a/pyatlan/model/open_lineage/facet.py b/pyatlan/model/open_lineage/facet.py index aa5106298..a31e7f2cc 100644 --- a/pyatlan/model/open_lineage/facet.py +++ b/pyatlan/model/open_lineage/facet.py @@ -15,9 +15,9 @@ class OpenLineageColumnLineageDatasetFacetFieldsAdditionalInputFields(AtlanObjec class OpenLineageColumnLineageDatasetFacetFieldsAdditional(AtlanObject): - input_fields: Optional[ - List[OpenLineageColumnLineageDatasetFacetFieldsAdditionalInputFields] - ] = Field(default_factory=list) + input_fields: Optional[List[OpenLineageColumnLineageDatasetFacetFieldsAdditionalInputFields]] = Field( + default_factory=list + ) transformation_description: Optional[str] = Field(default=None) transformation_type: Optional[str] = Field(default=None) @@ -43,15 +43,12 @@ class OpenLineageColumnLineageDatasetFacet(OpenLineageBaseFacet): This facet contains column lineage of a dataset. """ - fields: Dict[str, OpenLineageColumnLineageDatasetFacetFieldsAdditional] = Field( - default_factory=dict - ) + fields: Dict[str, OpenLineageColumnLineageDatasetFacetFieldsAdditional] = Field(default_factory=dict) @staticmethod def _get_schema() -> str: return ( - "https://openlineage.io/spec/facets/1-1-0/" - "ColumnLineageDatasetFacet.json#/$defs/ColumnLineageDatasetFacet" + "https://openlineage.io/spec/facets/1-1-0/ColumnLineageDatasetFacet.json#/$defs/ColumnLineageDatasetFacet" ) diff --git a/pyatlan/model/open_lineage/input_dataset.py b/pyatlan/model/open_lineage/input_dataset.py index 97a718e70..1efc02323 100644 --- a/pyatlan/model/open_lineage/input_dataset.py +++ b/pyatlan/model/open_lineage/input_dataset.py @@ -35,9 +35,7 @@ def creator(cls, namespace: str, asset_name: str) -> OpenLineageInputDataset: """ return OpenLineageInputDataset(namespace=namespace, name=asset_name, facets={}) - def from_field( - self, field_name: str - ) -> OpenLineageColumnLineageDatasetFacetFieldsAdditionalInputFields: + def from_field(self, field_name: str) -> OpenLineageColumnLineageDatasetFacetFieldsAdditionalInputFields: """ Create a new reference to a field within this input dataset. diff --git a/pyatlan/model/open_lineage/job.py b/pyatlan/model/open_lineage/job.py index ec33ebf35..7dd83686c 100644 --- a/pyatlan/model/open_lineage/job.py +++ b/pyatlan/model/open_lineage/job.py @@ -24,9 +24,7 @@ class OpenLineageJob(AtlanObject): https://openlineage.io/docs/spec/object-model#job """ - name: Optional[str] = Field( - default=None, description="Unique name for that job within that namespace." - ) + name: Optional[str] = Field(default=None, description="Unique name for that job within that namespace.") namespace: Optional[str] = Field( default=None, description="Namespace containing that job.", @@ -44,9 +42,7 @@ def _get_schema() -> str: return "https://openlineage.io/spec/2-0-2/OpenLineage.json#/$defs/Job" @classmethod - def creator( - cls, connection_name: str, job_name: str, producer: str - ) -> OpenLineageJob: + def creator(cls, connection_name: str, job_name: str, producer: str) -> OpenLineageJob: """ Builds the minimal object necessary to create an OpenLineage job. @@ -55,9 +51,7 @@ def creator( :param producer: URI indicating the code or software that implements this job :returns: the minimal request necessary to create the job """ - return OpenLineageJob( - namespace=connection_name, name=job_name, producer=producer, facets={} - ) + return OpenLineageJob(namespace=connection_name, name=job_name, producer=producer, facets={}) # TODO: provide some intuitive way to manage the facets of the job diff --git a/pyatlan/model/open_lineage/output_dataset.py b/pyatlan/model/open_lineage/output_dataset.py index 47fee5e7a..c55c6fefc 100644 --- a/pyatlan/model/open_lineage/output_dataset.py +++ b/pyatlan/model/open_lineage/output_dataset.py @@ -37,9 +37,7 @@ def _get_schema() -> str: return "https://openlineage.io/spec/2-0-2/OpenLineage.json#/$defs/OutputDataset" @classmethod - def creator( - cls, namespace: str, asset_name: str, producer: str - ) -> OpenLineageOutputDataset: + def creator(cls, namespace: str, asset_name: str, producer: str) -> OpenLineageOutputDataset: """ Builds the minimal object necessary to create an OpenLineage dataset use-able as a lineage target. @@ -51,9 +49,7 @@ def creator( :returns: the minimal request necessary to create the output dataset """ - return OpenLineageOutputDataset( - namespace=namespace, name=asset_name, producer=producer - ) + return OpenLineageOutputDataset(namespace=namespace, name=asset_name, producer=producer) @root_validator(pre=True) def transform_to_fields_into_facets(cls, values: dict) -> dict: @@ -69,11 +65,7 @@ def transform_to_fields_into_facets(cls, values: dict) -> dict: for entry in to_fields: for key, value in entry.items(): # Build the OpenLineageColumnLineageDatasetFacet with input_fields - fields_additional = ( - OpenLineageColumnLineageDatasetFacetFieldsAdditional( - input_fields=value - ) - ) + fields_additional = OpenLineageColumnLineageDatasetFacetFieldsAdditional(input_fields=value) # Add to the column lineage dict column_lineage_data[key] = fields_additional diff --git a/pyatlan/model/open_lineage/run.py b/pyatlan/model/open_lineage/run.py index 2c7df6c3f..a267a5451 100644 --- a/pyatlan/model/open_lineage/run.py +++ b/pyatlan/model/open_lineage/run.py @@ -29,9 +29,7 @@ class OpenLineageRun(AtlanObject): default=None, description="Globally unique ID of the run associated with the job.", ) - facets: Optional[Dict[str, Any]] = Field( - default_factory=dict, description="Run facets." - ) + facets: Optional[Dict[str, Any]] = Field(default_factory=dict, description="Run facets.") @staticmethod def _get_schema() -> str: diff --git a/pyatlan/model/open_lineage/utils.py b/pyatlan/model/open_lineage/utils.py index 1d2bc4cab..dc2f46cf6 100644 --- a/pyatlan/model/open_lineage/utils.py +++ b/pyatlan/model/open_lineage/utils.py @@ -43,8 +43,6 @@ def generate_new_uuid(instant: datetime | None = None) -> UUID: :return: UUID """ - timestamp_ms = ( - int(instant.timestamp() * 1000) if instant else time.time_ns() // 10**6 - ) + timestamp_ms = int(instant.timestamp() * 1000) if instant else time.time_ns() // 10**6 node = secrets.randbits(76) return _build_uuidv7(timestamp_ms, node) diff --git a/pyatlan/model/packages/api_token_connection_admin.py b/pyatlan/model/packages/api_token_connection_admin.py index 44dc861ce..c61e6e365 100644 --- a/pyatlan/model/packages/api_token_connection_admin.py +++ b/pyatlan/model/packages/api_token_connection_admin.py @@ -16,9 +16,7 @@ class APITokenConnectionAdmin(AbstractCustomPackage): _PACKAGE_ICON = "http://assets.atlan.com/assets/ph-key-light.svg" _PACKAGE_LOGO = "http://assets.atlan.com/assets/ph-key-light.svg" - def config( - self, connection_qualified_name: str, api_token_guid: str - ) -> APITokenConnectionAdmin: + def config(self, connection_qualified_name: str, api_token_guid: str) -> APITokenConnectionAdmin: """ Set up the API token connection admin with the specified configuration. @@ -28,9 +26,7 @@ def config( :returns: package, with the specified configuration. """ - self._parameters.append( - {"name": "connection_qualified_name", "value": connection_qualified_name} - ) + self._parameters.append({"name": "connection_qualified_name", "value": connection_qualified_name}) self._parameters.append({"name": "api_token_guid", "value": api_token_guid}) return self @@ -60,7 +56,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan CSA", "package.argoproj.io/description": "Assigns an API token as a connection admin for an existing connection.", # noqa "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"kotlin\",\"utility\"]", # fmt: skip + "package.argoproj.io/keywords": '["kotlin","utility"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/parent": ".", "package.argoproj.io/registry": "https://packages.atlan.com", diff --git a/pyatlan/model/packages/asset_export_basic.py b/pyatlan/model/packages/asset_export_basic.py index b0dfcc1da..d337497a1 100644 --- a/pyatlan/model/packages/asset_export_basic.py +++ b/pyatlan/model/packages/asset_export_basic.py @@ -27,9 +27,7 @@ def __init__( self._export_scope = None self._parameters = [] - def glossaries_only( - self, include_archived: Optional[bool] = None - ) -> AssetExportBasic: + def glossaries_only(self, include_archived: Optional[bool] = None) -> AssetExportBasic: """ Set up the package to export only glossaries. @@ -82,9 +80,7 @@ def enriched_only( self._add_optional_params(params) return self - def products_only( - self, include_archived: Optional[bool] = None - ) -> AssetExportBasic: + def products_only(self, include_archived: Optional[bool] = None) -> AssetExportBasic: """ Set up the package to export only data products. @@ -208,9 +204,7 @@ def s3( ) return self - def gcs( - self, project_id: str, service_account_json: str, bucket: str - ) -> AssetExportBasic: + def gcs(self, project_id: str, service_account_json: str, bucket: str) -> AssetExportBasic: """ Set up package to export to Google Cloud Storage. @@ -283,9 +277,7 @@ def _add_delivery_parameters(self): self._parameters.append( { "name": "email_addresses", - "value": ",".join( - self._email_addresses - ), # Join the email addresses if they are in a list + "value": ",".join(self._email_addresses), # Join the email addresses if they are in a list } ) @@ -316,7 +308,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/description": "Export assets with all enrichment that could be made against them " "via the Atlan UI.", "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"kotlin\",\"utility\"]", # fmt: skip + "package.argoproj.io/keywords": '["kotlin","utility"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/parent": ".", "package.argoproj.io/registry": "https://packages.atlan.com", diff --git a/pyatlan/model/packages/asset_import.py b/pyatlan/model/packages/asset_import.py index b312c83d4..8cdc1b6a5 100644 --- a/pyatlan/model/packages/asset_import.py +++ b/pyatlan/model/packages/asset_import.py @@ -68,9 +68,7 @@ def s3( self._credentials_body.update(local_creds) return self - def gcs( - self, project_id: str, service_account_json: str, bucket: str - ) -> AssetImport: + def gcs(self, project_id: str, service_account_json: str, bucket: str) -> AssetImport: """ Set up package to import metadata from GCS. @@ -148,9 +146,7 @@ def assets( """ self._parameters.append({"name": "assets_prefix", "value": prefix}) self._parameters.append({"name": "assets_key", "value": object_key}) - self._parameters.append( - {"name": "assets_upsert_semantic", "value": input_handling} - ) + self._parameters.append({"name": "assets_upsert_semantic", "value": input_handling}) return self def assets_advanced( @@ -184,9 +180,7 @@ def assets_advanced( :returns: package, configured to import assets with advanced configuration. """ - if isinstance(remove_attributes, list) and all( - isinstance(field, AtlanField) for field in remove_attributes - ): + if isinstance(remove_attributes, list) and all(isinstance(field, AtlanField) for field in remove_attributes): remove_attributes = [field.atlan_field_name for field in remove_attributes] # type: ignore params = { "assets_attr_to_overwrite": dumps(remove_attributes, separators=(",", ":")), @@ -221,9 +215,7 @@ def glossaries( """ self._parameters.append({"name": "glossaries_prefix", "value": prefix}) self._parameters.append({"name": "glossaries_key", "value": object_key}) - self._parameters.append( - {"name": "glossaries_upsert_semantic", "value": input_handling} - ) + self._parameters.append({"name": "glossaries_upsert_semantic", "value": input_handling}) return self def glossaries_advanced( @@ -249,14 +241,10 @@ def glossaries_advanced( :returns: package, configured to import glossaries with advanced configuration. """ - if isinstance(remove_attributes, list) and all( - isinstance(field, AtlanField) for field in remove_attributes - ): + if isinstance(remove_attributes, list) and all(isinstance(field, AtlanField) for field in remove_attributes): remove_attributes = [field.atlan_field_name for field in remove_attributes] # type: ignore params = { - "glossaries_attr_to_overwrite": dumps( - remove_attributes, separators=(",", ":") - ), + "glossaries_attr_to_overwrite": dumps(remove_attributes, separators=(",", ":")), "glossaries_fail_on_errors": fail_on_errors, "glossaries_field_separator": field_separator, "glossaries_batch_size": batch_size, @@ -285,9 +273,7 @@ def data_products( """ self._parameters.append({"name": "data_products_prefix", "value": prefix}) self._parameters.append({"name": "data_products_key", "value": object_key}) - self._parameters.append( - {"name": "data_products_upsert_semantic", "value": input_handling} - ) + self._parameters.append({"name": "data_products_upsert_semantic", "value": input_handling}) return self def data_product_advanced( @@ -314,14 +300,10 @@ def data_product_advanced( :returns: package, configured to import data domain and data products with advanced configuration. """ - if isinstance(remove_attributes, list) and all( - isinstance(field, AtlanField) for field in remove_attributes - ): + if isinstance(remove_attributes, list) and all(isinstance(field, AtlanField) for field in remove_attributes): remove_attributes = [field.atlan_field_name for field in remove_attributes] # type: ignore params = { - "data_products_attr_to_overwrite": dumps( - remove_attributes, separators=(",", ":") - ), + "data_products_attr_to_overwrite": dumps(remove_attributes, separators=(",", ":")), "data_products_fail_on_errors": fail_on_errors, "data_products_field_separator": field_separator, "data_products_batch_size": batch_size, @@ -377,7 +359,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan CSA", "package.argoproj.io/description": "Import assets from a CSV file.", "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"kotlin\",\"utility\"]", # fmt: skip + "package.argoproj.io/keywords": '["kotlin","utility"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/parent": ".", "package.argoproj.io/registry": "https://packages.atlan.com", diff --git a/pyatlan/model/packages/base/miner.py b/pyatlan/model/packages/base/miner.py index ffb2e993f..7bc517826 100644 --- a/pyatlan/model/packages/base/miner.py +++ b/pyatlan/model/packages/base/miner.py @@ -18,9 +18,7 @@ def __init__( ): super().__init__() self._epoch = int(utils.get_epoch_timestamp()) - self._parameters.append( - dict(name="connection-qualified-name", value=connection_qualified_name) - ) + self._parameters.append(dict(name="connection-qualified-name", value=connection_qualified_name)) def _add_optional_params(self, params: Dict[str, Optional[Any]]) -> None: """ diff --git a/pyatlan/model/packages/base/package.py b/pyatlan/model/packages/base/package.py index a0e8e28a2..cf2179e63 100644 --- a/pyatlan/model/packages/base/package.py +++ b/pyatlan/model/packages/base/package.py @@ -45,9 +45,7 @@ def to_workflow(self) -> Workflow: WorkflowTask( name="run", arguments=WorkflowParameters( - parameters=parse_obj_as( - List[NameValuePair], self._parameters - ) + parameters=parse_obj_as(List[NameValuePair], self._parameters) ), template_ref=WorkflowTemplateRef( name=self._PACKAGE_PREFIX, @@ -59,19 +57,13 @@ def to_workflow(self) -> Workflow: ), ) ], - workflow_metadata=WorkflowMetadata( - annotations={"package.argoproj.io/name": self._PACKAGE_NAME} - ), + workflow_metadata=WorkflowMetadata(annotations={"package.argoproj.io/name": self._PACKAGE_NAME}), ) payload = [ PackageParameter( parameter="credentialGuid", type="credential", - body=loads( - Credential(**self._credentials_body).json( - by_alias=True, exclude_none=True - ) - ), + body=loads(Credential(**self._credentials_body).json(by_alias=True, exclude_none=True)), ) ] return Workflow( diff --git a/pyatlan/model/packages/big_query_crawler.py b/pyatlan/model/packages/big_query_crawler.py index effea150d..bea620190 100644 --- a/pyatlan/model/packages/big_query_crawler.py +++ b/pyatlan/model/packages/big_query_crawler.py @@ -132,19 +132,13 @@ def custom_config(self, config: Dict) -> BigQueryCrawler: assets with case-sensitive identifiers. :returns: miner, set to include custom configuration """ - config and self._parameters.append( - dict(name="control-config", value=str(config)) - ) + config and self._parameters.append(dict(name="control-config", value=str(config))) self._advanced_config = True return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credentials-fetch-strategy", "value": "credential_guid"} - ) - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credentials-fetch-strategy", "value": "credential_guid"}) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append( dict( name="control-config-strategy", @@ -154,9 +148,7 @@ def _set_required_metadata_params(self): self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) self._parameters.append(dict(name="publish-mode", value="production")) @@ -190,7 +182,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan", "package.argoproj.io/description": "Package to crawl BigQuery assets and publish to Atlan for discovery", # noqa "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"bigquery\",\"connector\",\"crawler\",\"google\"]", # fmt: skip + "package.argoproj.io/keywords": '["bigquery","connector","crawler","google"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/registry": "https://packages.atlan.com", "package.argoproj.io/repository": "https://github.com/atlanhq/marketplace-packages.git", diff --git a/pyatlan/model/packages/confluent_kafka_crawler.py b/pyatlan/model/packages/confluent_kafka_crawler.py index 9bad856f7..2b0bcc025 100644 --- a/pyatlan/model/packages/confluent_kafka_crawler.py +++ b/pyatlan/model/packages/confluent_kafka_crawler.py @@ -64,9 +64,7 @@ def direct(self, bootstrap: str, encrypted: bool = True) -> ConfluentKafkaCrawle "name": f"default-{self._NAME}-{self._epoch}-0", "host": bootstrap, "port": 9092, - "extra": { - "security_protocol": "SASL_SSL" if encrypted else "SASL_PLAINTEXT" - }, + "extra": {"security_protocol": "SASL_SSL" if encrypted else "SASL_PLAINTEXT"}, "connector_config_name": "atlan-connectors-kafka-confluent-cloud", } self._credentials_body.update(local_creds) @@ -137,15 +135,11 @@ def skip_internal(self, enabled: bool = True) -> ConfluentKafkaCrawler: return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) self._parameters.append(dict(name="publish-mode", value="production")) diff --git a/pyatlan/model/packages/connection_delete.py b/pyatlan/model/packages/connection_delete.py index 3b9a787d6..ae2cb9cbe 100644 --- a/pyatlan/model/packages/connection_delete.py +++ b/pyatlan/model/packages/connection_delete.py @@ -28,9 +28,7 @@ def __init__( ): super().__init__(connection_qualified_name=qualified_name) self._parameters.append(dict(name="delete-assets", value="true")) - self._parameters.append( - dict(name="delete-type", value="PURGE" if purge else "SOFT") - ) + self._parameters.append(dict(name="delete-type", value="PURGE" if purge else "SOFT")) def _get_metadata(self) -> WorkflowMetadata: return WorkflowMetadata( diff --git a/pyatlan/model/packages/databricks_crawler.py b/pyatlan/model/packages/databricks_crawler.py index 2756f7187..913b951ba 100644 --- a/pyatlan/model/packages/databricks_crawler.py +++ b/pyatlan/model/packages/databricks_crawler.py @@ -93,20 +93,12 @@ def s3( :returns: crawler, set up to extract from S3 bucket """ self._parameters.append(dict(name="extraction-method", value="s3")) - self._parameters.append( - dict(name="offline-extraction-bucket", value=bucket_name) - ) - self._parameters.append( - dict(name="offline-extraction-prefix", value=bucket_prefix) - ) - self._parameters.append( - dict(name="offline-extraction-region", value=bucket_region) - ) + self._parameters.append(dict(name="offline-extraction-bucket", value=bucket_name)) + self._parameters.append(dict(name="offline-extraction-prefix", value=bucket_prefix)) + self._parameters.append(dict(name="offline-extraction-region", value=bucket_region)) return self - def basic_auth( - self, personal_access_token: str, http_path: str - ) -> DatabricksCrawler: + def basic_auth(self, personal_access_token: str, http_path: str) -> DatabricksCrawler: """ Set up the crawler to use basic authentication. @@ -143,9 +135,7 @@ def aws_service(self, client_id: str, client_secret: str) -> DatabricksCrawler: self._credentials_body.update(local_creds) return self - def azure_service( - self, client_id: str, client_secret: str, tenant_id: str - ) -> DatabricksCrawler: + def azure_service(self, client_id: str, client_secret: str, tenant_id: str) -> DatabricksCrawler: """ Set up the crawler to use Azure service principal. @@ -223,9 +213,7 @@ def include(self, assets: dict) -> DatabricksCrawler: """ include_assets = assets or {} to_include = self.build_hierarchical_filter(include_assets) - self._parameters.append( - dict(dict(name="include-filter", value=to_include or "{}")) - ) + self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) return self def exclude(self, assets: dict) -> DatabricksCrawler: @@ -254,9 +242,7 @@ def include_for_rest_api(self, assets: List[str]) -> DatabricksCrawler: """ include_assets = assets or [] to_include = self.build_flat_hierarchical_filter(include_assets) - self._parameters.append( - dict(dict(name="include-filter-rest", value=to_include or "{}")) - ) + self._parameters.append(dict(dict(name="include-filter-rest", value=to_include or "{}"))) return self def exclude_for_rest_api(self, assets: List[str]) -> DatabricksCrawler: @@ -271,9 +257,7 @@ def exclude_for_rest_api(self, assets: List[str]) -> DatabricksCrawler: """ exclude_assets = assets or [] to_exclude = self.build_flat_hierarchical_filter(exclude_assets) - self._parameters.append( - dict(name="exclude-filter-rest", value=to_exclude or "{}") - ) + self._parameters.append(dict(name="exclude-filter-rest", value=to_exclude or "{}")) return self def sql_warehouse(self, warehouse_ids: List[str]) -> DatabricksCrawler: @@ -317,12 +301,8 @@ def exclude_regex(self, regex: str) -> DatabricksCrawler: return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credentials-fetch-strategy", "value": "credential_guid"} - ) - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credentials-fetch-strategy", "value": "credential_guid"}) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append( dict( name="advanced-config-strategy", @@ -332,9 +312,7 @@ def _set_required_metadata_params(self): self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) @@ -366,7 +344,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan", "package.argoproj.io/description": f"Package to crawl databricks assets and publish to Atlan for discovery", # noqa "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"databricks\",\"lake\",\"connector\",\"crawler\"]", # fmt: skip # noqa + "package.argoproj.io/keywords": '["databricks","lake","connector","crawler"]', # fmt: skip # noqa "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/registry": "https://packages.atlan.com", "package.argoproj.io/repository": "git+https://github.com/atlanhq/marketplace-packages.git", diff --git a/pyatlan/model/packages/databricks_miner.py b/pyatlan/model/packages/databricks_miner.py index b01e0bc00..e1b71778a 100644 --- a/pyatlan/model/packages/databricks_miner.py +++ b/pyatlan/model/packages/databricks_miner.py @@ -49,9 +49,7 @@ def rest_api(self): :returns: miner, configured to use the REST API extraction method from Databricks. """ - self._parameters.append( - dict(name="extraction-method", value=self.ExtractionMethod.REST_API.value) - ) + self._parameters.append(dict(name="extraction-method", value=self.ExtractionMethod.REST_API.value)) return self def offline(self, bucket_name: str, bucket_prefix: str): @@ -66,12 +64,8 @@ def offline(self, bucket_name: str, bucket_prefix: str): :returns: miner, configured for offline extraction. """ self._parameters.append(dict(name="extraction-method", value="offline")) - self._parameters.append( - dict(name="offline-extraction-bucket", value=bucket_name) - ) - self._parameters.append( - dict(name="offline-extraction-prefix", value=bucket_prefix) - ) + self._parameters.append(dict(name="offline-extraction-bucket", value=bucket_name)) + self._parameters.append(dict(name="offline-extraction-prefix", value=bucket_prefix)) return self def system_table(self, warehouse_id: str): @@ -85,9 +79,7 @@ def system_table(self, warehouse_id: str): warehouse to be used for system table extraction. :returns: miner, configured for system table extraction. """ - self._parameters.append( - dict(name="extraction-method", value=self.ExtractionMethod.SYSTEM_TABLE) - ) + self._parameters.append(dict(name="extraction-method", value=self.ExtractionMethod.SYSTEM_TABLE)) self._parameters.append(dict(name="sql-warehouse", value=warehouse_id)) return self @@ -125,13 +117,9 @@ def popularity_configuration( for param in self._parameters: if param["name"] in config_map: param["value"] = config_map[param["name"]] - self._parameters.append( - dict(name="popularity-exclude-user-config", value=dumps(excluded_users)) - ) + self._parameters.append(dict(name="popularity-exclude-user-config", value=dumps(excluded_users))) if extraction_method == self.ExtractionMethod.SYSTEM_TABLE: - self._parameters.append( - dict(name="sql-warehouse-popularity", value=warehouse_id) - ) + self._parameters.append(dict(name="sql-warehouse-popularity", value=warehouse_id)) return self def _get_metadata(self) -> WorkflowMetadata: @@ -151,7 +139,7 @@ def _get_metadata(self) -> WorkflowMetadata: "orchestration.atlan.com/allowSchedule": "true", "orchestration.atlan.com/categories": "lake,miner", "orchestration.atlan.com/docsUrl": "https://ask.atlan.com/hc/en-us/articles/7034583224081", - "orchestration.atlan.com/emoji": "\uD83D\uDE80", + "orchestration.atlan.com/emoji": "\ud83d\ude80", "orchestration.atlan.com/icon": self._PACKAGE_ICON, "orchestration.atlan.com/logo": self._PACKAGE_LOGO, "orchestration.atlan.com/marketplaceLink": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", # noqa @@ -159,7 +147,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan", "package.argoproj.io/description": "Package to extract lineage information and usage metrics from Databricks.", # noqa "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"databricks\",\"lake\",\"connector\",\"miner\"]", # fmt: skip + "package.argoproj.io/keywords": '["databricks","lake","connector","miner"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/registry": "https://packages.atlan.com", "package.argoproj.io/repository": "git+https://github.com/atlanhq/marketplace-packages.git", diff --git a/pyatlan/model/packages/dbt_crawler.py b/pyatlan/model/packages/dbt_crawler.py index 13670ba98..b9b9d85a4 100644 --- a/pyatlan/model/packages/dbt_crawler.py +++ b/pyatlan/model/packages/dbt_crawler.py @@ -78,12 +78,8 @@ def cloud( } self._credentials_body.update(local_creds) self._parameters.append(dict(name="extraction-method", value="api")) - self._parameters.append( - dict(name="deployment-type", value="multi" if multi_tenant else "single") - ) - self._parameters.append( - {"name": "api-credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append(dict(name="deployment-type", value="multi" if multi_tenant else "single")) + self._parameters.append({"name": "api-credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append(dict(name="control-config-strategy", value="default")) return self @@ -164,12 +160,8 @@ def include(self, filter: str = "") -> DbtCrawler: expression and for dbt Cloud provide a string-encoded map :returns: crawler, set to include only those assets specified """ - self._parameters.append( - dict(name="include-filter", value=filter if filter else "{}") - ) - self._parameters.append( - dict(name="include-filter-core", value=filter if filter else "*") - ) + self._parameters.append(dict(name="include-filter", value=filter if filter else "{}")) + self._parameters.append(dict(name="include-filter-core", value=filter if filter else "*")) return self def exclude(self, filter: str = "") -> DbtCrawler: @@ -180,21 +172,15 @@ def exclude(self, filter: str = "") -> DbtCrawler: expression and for dbt Cloud provide a string-encoded map :return: the builder, set to exclude only those assets specified """ - self._parameters.append( - dict(name="exclude-filter", value=filter if filter else "{}") - ) - self._parameters.append( - dict(name="exclude-filter-core", value=filter if filter else "*") - ) + self._parameters.append(dict(name="exclude-filter", value=filter if filter else "{}")) + self._parameters.append(dict(name="exclude-filter-core", value=filter if filter else "*")) return self def _set_required_metadata_params(self): self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) @@ -226,7 +212,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan", "package.argoproj.io/description": f"Package to crawl {self._NAME} assets and publish to Atlan for discovery.", # noqa "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"connector\",\"crawler\",\"dbt\"]", # fmt: skip + "package.argoproj.io/keywords": '["connector","crawler","dbt"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/registry": "https://packages.atlan.com", "package.argoproj.io/repository": "git+https://github.com/atlanhq/marketplace-packages.git", diff --git a/pyatlan/model/packages/dynamo_d_b_crawler.py b/pyatlan/model/packages/dynamo_d_b_crawler.py index 44cef54d8..e2b2ee0a2 100644 --- a/pyatlan/model/packages/dynamo_d_b_crawler.py +++ b/pyatlan/model/packages/dynamo_d_b_crawler.py @@ -99,9 +99,7 @@ def iam_role_auth(self, arn: str, external_id: str) -> DynamoDBCrawler: "auth_type": "role", "connector_type": "sdk", } - self._credentials_body["extra"].update( - {"aws_role_arn": arn, "aws_external_id": external_id} - ) + self._credentials_body["extra"].update({"aws_role_arn": arn, "aws_external_id": external_id}) self._credentials_body.update(local_creds) return self @@ -131,18 +129,12 @@ def exclude_regex(self, regex: str) -> DynamoDBCrawler: return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credentials-fetch-strategy", "value": "credential_guid"} - ) - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credentials-fetch-strategy", "value": "credential_guid"}) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) self._parameters.append(dict(name="publish-mode", value="production")) diff --git a/pyatlan/model/packages/glue_crawler.py b/pyatlan/model/packages/glue_crawler.py index 427821834..59df41838 100644 --- a/pyatlan/model/packages/glue_crawler.py +++ b/pyatlan/model/packages/glue_crawler.py @@ -30,12 +30,8 @@ class GlueCrawler(AbstractCrawler): _PACKAGE_PREFIX = WorkflowPackage.GLUE.value _CONNECTOR_TYPE = AtlanConnectorType.GLUE _AWS_DATA_CATALOG = "AwsDataCatalog" - _PACKAGE_ICON = ( - "https://atlan-public.s3.eu-west-1.amazonaws.com/atlan/logos/aws-glue.png" - ) - _PACKAGE_LOGO = ( - "https://atlan-public.s3.eu-west-1.amazonaws.com/atlan/logos/aws-glue.png" - ) + _PACKAGE_ICON = "https://atlan-public.s3.eu-west-1.amazonaws.com/atlan/logos/aws-glue.png" + _PACKAGE_LOGO = "https://atlan-public.s3.eu-west-1.amazonaws.com/atlan/logos/aws-glue.png" def __init__( self, @@ -102,9 +98,7 @@ def _build_asset_filter(self, filter_type: str, filter_assets: List[str]) -> Non for asset in filter_assets: filter_dict[self._AWS_DATA_CATALOG][asset] = {} filter_values = dumps(filter_dict) - self._parameters.append( - {"name": f"{filter_type}-filter", "value": filter_values} - ) + self._parameters.append({"name": f"{filter_type}-filter", "value": filter_values}) except TypeError: raise ErrorCode.UNABLE_TO_TRANSLATE_FILTERS.exception_with_parameters() @@ -133,18 +127,12 @@ def exclude(self, assets: List[str]) -> GlueCrawler: return self def _set_required_metadata_params(self): - self._parameters.append( - dict(name="credentials-fetch-strategy", value="credential_guid") - ) - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append(dict(name="credentials-fetch-strategy", value="credential_guid")) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) self._parameters.append(dict(name="publish-mode", value="production")) diff --git a/pyatlan/model/packages/lineage_builder.py b/pyatlan/model/packages/lineage_builder.py index df0817f6e..b83547066 100644 --- a/pyatlan/model/packages/lineage_builder.py +++ b/pyatlan/model/packages/lineage_builder.py @@ -70,9 +70,7 @@ def s3( self._credentials_body.update(local_creds) return self - def gcs( - self, project_id: str, service_account_json: str, bucket: str - ) -> LineageBuilder: + def gcs(self, project_id: str, service_account_json: str, bucket: str) -> LineageBuilder: """ Set up package to import lineage details from GCS. @@ -193,7 +191,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan CSA", "package.argoproj.io/description": "Build lineage from a CSV file.", "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"kotlin\",\"utility\"]", # fmt: skip + "package.argoproj.io/keywords": '["kotlin","utility"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/parent": ".", "package.argoproj.io/registry": "https://packages.atlan.com", diff --git a/pyatlan/model/packages/lineage_generator_nt.py b/pyatlan/model/packages/lineage_generator_nt.py index 532479896..6a8a8e0e1 100644 --- a/pyatlan/model/packages/lineage_generator_nt.py +++ b/pyatlan/model/packages/lineage_generator_nt.py @@ -184,7 +184,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan CSA", "package.argoproj.io/description": "Package to generate lineage between two systems - no transformations involved.", # noqa "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"python\",\"utility\", \"custom-package\"]", # fmt: skip + "package.argoproj.io/keywords": '["python","utility", "custom-package"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/parent": ".", "package.argoproj.io/registry": "https://packages.atlan.com", diff --git a/pyatlan/model/packages/mongodb_crawler.py b/pyatlan/model/packages/mongodb_crawler.py index 7173cc181..67e25fcb3 100644 --- a/pyatlan/model/packages/mongodb_crawler.py +++ b/pyatlan/model/packages/mongodb_crawler.py @@ -116,9 +116,7 @@ def include(self, assets: List[str]) -> MongoDBCrawler: assets = assets or [] include_assets: Dict[str, List[str]] = {asset: [] for asset in assets} to_include = self.build_hierarchical_filter(include_assets) - self._parameters.append( - dict(dict(name="include-filter", value=to_include or "{}")) - ) + self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) return self def exclude(self, assets: List[str]) -> MongoDBCrawler: @@ -149,18 +147,12 @@ def exclude_regex(self, regex: str) -> MongoDBCrawler: return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credentials-fetch-strategy", "value": "credential_guid"} - ) - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credentials-fetch-strategy", "value": "credential_guid"}) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) self._parameters.append(dict(name="publish-mode", value="production")) @@ -194,7 +186,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan", "package.argoproj.io/description": f"Package to crawl MongoDB assets and publish to Atlan for discovery", # noqa "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"mongodb\",\"nosql\",\"document-database\",\"connector\",\"crawler\"]", # fmt: skip # noqa + "package.argoproj.io/keywords": '["mongodb","nosql","document-database","connector","crawler"]', # fmt: skip # noqa "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/registry": "https://packages.atlan.com", "package.argoproj.io/repository": "git+https://github.com/atlanhq/marketplace-packages.git", diff --git a/pyatlan/model/packages/oracle_crawler.py b/pyatlan/model/packages/oracle_crawler.py index e5f4dbbac..425d0da2e 100644 --- a/pyatlan/model/packages/oracle_crawler.py +++ b/pyatlan/model/packages/oracle_crawler.py @@ -27,12 +27,8 @@ class OracleCrawler(AbstractCrawler): _PACKAGE_NAME = "@atlan/oracle" _PACKAGE_PREFIX = WorkflowPackage.ORACLE.value _CONNECTOR_TYPE = AtlanConnectorType.ORACLE - _PACKAGE_ICON = ( - "https://docs.oracle.com/sp_common/book-template/ohc-common/img/favicon.ico" - ) - _PACKAGE_LOGO = ( - "https://docs.oracle.com/sp_common/book-template/ohc-common/img/favicon.ico" - ) + _PACKAGE_ICON = "https://docs.oracle.com/sp_common/book-template/ohc-common/img/favicon.ico" + _PACKAGE_LOGO = "https://docs.oracle.com/sp_common/book-template/ohc-common/img/favicon.ico" def __init__( self, @@ -132,9 +128,7 @@ def include(self, assets: dict) -> OracleCrawler: """ include_assets = assets or {} to_include = self.build_hierarchical_filter(include_assets) - self._parameters.append( - dict(dict(name="include-filter", value=to_include or "{}")) - ) + self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) return self def exclude(self, assets: dict) -> OracleCrawler: @@ -173,9 +167,7 @@ def jdbc_internal_methods(self, enable: bool) -> OracleCrawler: :returns: crawler, with jdbc internal methods for data extraction """ self._advanced_config = True - self._parameters.append( - dict(name="use-jdbc-internal-methods", value="true" if enable else "false") - ) + self._parameters.append(dict(name="use-jdbc-internal-methods", value="true" if enable else "false")) return self def source_level_filtering(self, enable: bool) -> OracleCrawler: @@ -188,20 +180,12 @@ def source_level_filtering(self, enable: bool) -> OracleCrawler: :returns: crawler, with schema level filtering on source """ self._advanced_config = True - self._parameters.append( - dict( - name="use-source-schema-filtering", value="true" if enable else "false" - ) - ) + self._parameters.append(dict(name="use-source-schema-filtering", value="true" if enable else "false")) return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credentials-fetch-strategy", "value": "credential_guid"} - ) - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credentials-fetch-strategy", "value": "credential_guid"}) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append(dict(name="publish-mode", value="production")) self._parameters.append(dict(name="atlas-auth-type", value="internal")) self._parameters.append( @@ -213,9 +197,7 @@ def _set_required_metadata_params(self): self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) @@ -247,7 +229,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan", "package.argoproj.io/description": "Package to crawl Oracle assets and publish to Atlan for discovery", "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"oracle\",\"warehouse\",\"connector\",\"crawler\"]", # fmt: skip + "package.argoproj.io/keywords": '["oracle","warehouse","connector","crawler"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/registry": "https://packages.atlan.com", "package.argoproj.io/repository": "git+https://github.com/atlanhq/marketplace-packages.git", diff --git a/pyatlan/model/packages/postgres_crawler.py b/pyatlan/model/packages/postgres_crawler.py index 591156614..f71bb3e1c 100644 --- a/pyatlan/model/packages/postgres_crawler.py +++ b/pyatlan/model/packages/postgres_crawler.py @@ -115,9 +115,7 @@ def basic_auth(self, username: str, password: str) -> PostgresCrawler: self._credentials_body.update(local_creds) return self - def iam_user_auth( - self, username: str, access_key: str, secret_key: str - ) -> PostgresCrawler: + def iam_user_auth(self, username: str, access_key: str, secret_key: str) -> PostgresCrawler: """ Set up the crawler to use IAM user-based authentication. @@ -136,9 +134,7 @@ def iam_user_auth( self._credentials_body.update(local_creds) return self - def iam_role_auth( - self, username: str, arn: str, external_id: str - ) -> PostgresCrawler: + def iam_role_auth(self, username: str, arn: str, external_id: str) -> PostgresCrawler: """ Set up the crawler to use IAM role-based authentication. @@ -222,15 +218,11 @@ def jdbc_internal_methods(self, enable: bool) -> PostgresCrawler: return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) self._parameters.append(dict(name="publish-mode", value="production")) diff --git a/pyatlan/model/packages/powerbi_crawler.py b/pyatlan/model/packages/powerbi_crawler.py index cf310fcdb..4cdb27b69 100644 --- a/pyatlan/model/packages/powerbi_crawler.py +++ b/pyatlan/model/packages/powerbi_crawler.py @@ -27,12 +27,8 @@ class PowerBICrawler(AbstractCrawler): _PACKAGE_NAME = "@atlan/powerbi" _PACKAGE_PREFIX = WorkflowPackage.POWERBI.value _CONNECTOR_TYPE = AtlanConnectorType.POWERBI - _PACKAGE_ICON = ( - "https://powerbi.microsoft.com/pictures/application-logos/svg/powerbi.svg" - ) - _PACKAGE_LOGO = ( - "https://powerbi.microsoft.com/pictures/application-logos/svg/powerbi.svg" - ) + _PACKAGE_ICON = "https://powerbi.microsoft.com/pictures/application-logos/svg/powerbi.svg" + _PACKAGE_LOGO = "https://powerbi.microsoft.com/pictures/application-logos/svg/powerbi.svg" def __init__( self, @@ -102,9 +98,7 @@ def delegated_user( self._credentials_body.update(local_creds) return self - def service_principal( - self, tenant_id: str, client_id: str, client_secret: str - ) -> PowerBICrawler: + def service_principal(self, tenant_id: str, client_id: str, client_secret: str) -> PowerBICrawler: """ Set up the crawler to use service principal authentication. @@ -136,9 +130,7 @@ def include(self, workspaces: List[str]) -> PowerBICrawler: """ include_workspaces = workspaces or [] to_include = self.build_flat_filter(include_workspaces) - self._parameters.append( - dict(dict(name="include-filter", value=to_include or "{}")) - ) + self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) return self def exclude(self, workspaces: List[str]) -> PowerBICrawler: @@ -173,15 +165,11 @@ def direct_endorsements(self, enabled: bool = True) -> PowerBICrawler: return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) self._parameters.append(dict(name="atlas-auth-type", value="internal")) @@ -215,7 +203,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan", "package.argoproj.io/description": "Package to crawl PowerBI assets and publish to Atlan for discovery.", # noqa "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"powerbi\",\"bi\",\"connector\",\"crawler\"]", # fmt: skip + "package.argoproj.io/keywords": '["powerbi","bi","connector","crawler"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/parent": ".", "package.argoproj.io/registry": "https://packages.atlan.com", diff --git a/pyatlan/model/packages/relational_assets_builder.py b/pyatlan/model/packages/relational_assets_builder.py index 2202774a0..dda7269a5 100644 --- a/pyatlan/model/packages/relational_assets_builder.py +++ b/pyatlan/model/packages/relational_assets_builder.py @@ -37,9 +37,7 @@ def direct(self) -> RelationalAssetsBuilder: self._parameters.append({"name": "import_type", "value": "DIRECT"}) return self - def object_store( - self, prefix: Optional[str] = None, object_key: Optional[str] = None - ) -> RelationalAssetsBuilder: + def object_store(self, prefix: Optional[str] = None, object_key: Optional[str] = None) -> RelationalAssetsBuilder: """ Set up the package to import metadata directly from the object store. @@ -87,9 +85,7 @@ def s3( self._credentials_body.update(local_creds) return self - def gcs( - self, project_id: str, service_account_json: str, bucket: str - ) -> RelationalAssetsBuilder: + def gcs(self, project_id: str, service_account_json: str, bucket: str) -> RelationalAssetsBuilder: """ Set up package to import metadata from GCS. @@ -165,18 +161,12 @@ def assets_semantics( :returns: package, set up to import metadata with semantics """ - self._parameters.append( - {"name": "assets_upsert_semantic", "value": input_handling} - ) + self._parameters.append({"name": "assets_upsert_semantic", "value": input_handling}) self._parameters.append({"name": "delta_semantic", "value": delta_handling}) if delta_handling == AssetDeltaHandling.FULL_REPLACEMENT: - self._parameters.append( - {"name": "delta_removal_type", "value": removal_type} - ) + self._parameters.append({"name": "delta_removal_type", "value": removal_type}) else: - self._parameters.append( - {"name": "delta_removal_type", "value": AssetRemovalType.ARCHIVE} - ) + self._parameters.append({"name": "delta_removal_type", "value": AssetRemovalType.ARCHIVE}) return self def options( @@ -202,9 +192,7 @@ def options( :returns: package, set up to import assets with advanced configuration """ - if isinstance(remove_attributes, list) and all( - isinstance(field, AtlanField) for field in remove_attributes - ): + if isinstance(remove_attributes, list) and all(isinstance(field, AtlanField) for field in remove_attributes): remove_attributes = [field.atlan_field_name for field in remove_attributes] # type: ignore params = { "assets_attr_to_overwrite": dumps(remove_attributes, separators=(",", ":")), @@ -241,7 +229,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan CSA", "package.argoproj.io/description": "Build (and update) relational assets managed through a CSV file.", "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"kotlin\",\"utility\"]", # fmt: skip + "package.argoproj.io/keywords": '["kotlin","utility"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/parent": ".", "package.argoproj.io/registry": "https://packages.atlan.com", diff --git a/pyatlan/model/packages/s_q_l_server_crawler.py b/pyatlan/model/packages/s_q_l_server_crawler.py index 792666638..9dbb79f05 100644 --- a/pyatlan/model/packages/s_q_l_server_crawler.py +++ b/pyatlan/model/packages/s_q_l_server_crawler.py @@ -27,8 +27,12 @@ class SQLServerCrawler(AbstractCrawler): _PACKAGE_NAME = "@atlan/mssql" _PACKAGE_PREFIX = WorkflowPackage.MSSQL.value _CONNECTOR_TYPE = AtlanConnectorType.MSSQL - _PACKAGE_ICON = "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa - _PACKAGE_LOGO = "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa + _PACKAGE_ICON = ( + "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa + ) + _PACKAGE_LOGO = ( + "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa + ) def __init__( self, @@ -52,9 +56,7 @@ def __init__( source_logo=self._PACKAGE_LOGO, ) - def direct( - self, hostname: str, database: str, port: int = 1433 - ) -> SQLServerCrawler: + def direct(self, hostname: str, database: str, port: int = 1433) -> SQLServerCrawler: """ Set up the crawler to extract directly from the database. @@ -120,23 +122,17 @@ def exclude(self, assets: dict) -> SQLServerCrawler: return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append(dict(name="publish-mode", value="production")) self._parameters.append(dict(name="extraction-method", value="direct")) self._parameters.append(dict(name="atlas-auth-type", value="internal")) self._parameters.append(dict(name="use-jdbc-internal-methods", value="true")) self._parameters.append(dict(name="use-source-schema-filtering", value="false")) - self._parameters.append( - dict(name="credentials-fetch-strategy", value="credential_guid") - ) + self._parameters.append(dict(name="credentials-fetch-strategy", value="credential_guid")) self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) diff --git a/pyatlan/model/packages/sigma_crawler.py b/pyatlan/model/packages/sigma_crawler.py index cbe5c8641..eb00133d5 100644 --- a/pyatlan/model/packages/sigma_crawler.py +++ b/pyatlan/model/packages/sigma_crawler.py @@ -110,9 +110,7 @@ def include(self, workbooks: List[str]) -> SigmaCrawler: """ include_workbooks = workbooks or [] to_include = self.build_flat_filter(include_workbooks) - self._parameters.append( - dict(dict(name="include-filter", value=to_include or "{}")) - ) + self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) return self def exclude(self, workbooks: List[str]) -> SigmaCrawler: @@ -131,15 +129,11 @@ def exclude(self, workbooks: List[str]) -> SigmaCrawler: return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) self._parameters.append(dict(name="publish-mode", value="production")) @@ -173,7 +167,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan", "package.argoproj.io/description": "Package to crawl Sigma assets and publish to Atlan for discovery", "package.argoproj.io/homepage": "", - "package.argoproj.io/keywords": '[\"sigma\",\"bi\",\"connector\",\"crawler\"]', # fmt: skip + "package.argoproj.io/keywords": '["sigma","bi","connector","crawler"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/parent": ".", "package.argoproj.io/registry": "https://packages.atlan.com", diff --git a/pyatlan/model/packages/snowflake_crawler.py b/pyatlan/model/packages/snowflake_crawler.py index 4235834d3..a7e3824b9 100644 --- a/pyatlan/model/packages/snowflake_crawler.py +++ b/pyatlan/model/packages/snowflake_crawler.py @@ -28,7 +28,9 @@ class SnowflakeCrawler(AbstractCrawler): _PACKAGE_PREFIX = WorkflowPackage.SNOWFLAKE.value _CONNECTOR_TYPE = AtlanConnectorType.SNOWFLAKE _PACKAGE_ICON = "https://docs.snowflake.com/en/_images/logo-snowflake-sans-text.png" - _PACKAGE_LOGO = "https://1amiydhcmj36tz3733v94f15-wpengine.netdna-ssl.com/wp-content/themes/snowflake/assets/img/logo-blue.svg" # noqa + _PACKAGE_LOGO = ( + "https://1amiydhcmj36tz3733v94f15-wpengine.netdna-ssl.com/wp-content/themes/snowflake/assets/img/logo-blue.svg" # noqa + ) def __init__( self, @@ -52,9 +54,7 @@ def __init__( source_logo=self._PACKAGE_LOGO, ) - def basic_auth( - self, username: str, password: str, role: str, warehouse: str - ) -> SnowflakeCrawler: + def basic_auth(self, username: str, password: str, role: str, warehouse: str) -> SnowflakeCrawler: """ Set up the crawler to use basic authentication. @@ -125,9 +125,7 @@ def information_schema(self, hostname: str) -> SnowflakeCrawler: self._parameters.append(parameters) return self - def account_usage( - self, hostname: str, database_name: str, schema_name: str - ) -> SnowflakeCrawler: + def account_usage(self, hostname: str, database_name: str, schema_name: str) -> SnowflakeCrawler: """ Set the crawler to extract using Snowflake's account usage database and schema. @@ -142,12 +140,8 @@ def account_usage( "connector_config_name": "atlan-connectors-snowflake", } self._credentials_body.update(local_creds) - self._parameters.append( - {"name": "account-usage-database-name", "value": database_name} - ) - self._parameters.append( - {"name": "account-usage-schema-name", "value": schema_name} - ) + self._parameters.append({"name": "account-usage-database-name", "value": database_name}) + self._parameters.append({"name": "account-usage-schema-name", "value": schema_name}) return self def lineage(self, include: bool = True) -> SnowflakeCrawler: @@ -157,9 +151,7 @@ def lineage(self, include: bool = True) -> SnowflakeCrawler: :param include: if True, lineage will be included while crawling Snowflake, default: True :returns: crawler, set to include or exclude lineage """ - self._parameters.append( - {"name": "enable-lineage", "value": "true" if include else "false"} - ) + self._parameters.append({"name": "enable-lineage", "value": "true" if include else "false"}) return self def tags(self, include: bool = False) -> SnowflakeCrawler: @@ -169,9 +161,7 @@ def tags(self, include: bool = False) -> SnowflakeCrawler: :param include: Whether true, tags in Snowflake will be included while crawling Snowflake :returns: crawler, set to include or exclude Snowflake tags """ - self._parameters.append( - {"name": "enable-snowflake-tag", "value": "true" if include else "false"} - ) + self._parameters.append({"name": "enable-snowflake-tag", "value": "true" if include else "false"}) return self def include(self, assets: dict) -> SnowflakeCrawler: @@ -185,9 +175,7 @@ def include(self, assets: dict) -> SnowflakeCrawler: """ include_assets = assets or {} to_include = self.build_hierarchical_filter(include_assets) - self._parameters.append( - dict(dict(name="include-filter", value=to_include or "{}")) - ) + self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) return self def exclude(self, assets: dict) -> SnowflakeCrawler: @@ -205,16 +193,12 @@ def exclude(self, assets: dict) -> SnowflakeCrawler: return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append(dict(name="control-config-strategy", value="default")) self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) @@ -246,7 +230,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan", "package.argoproj.io/description": f"Package to crawl {self._NAME.capitalize()} assets and publish to Atlan for discovery", # noqa "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"snowflake\",\"warehouse\",\"connector\",\"crawler\"]", # fmt: skip + "package.argoproj.io/keywords": '["snowflake","warehouse","connector","crawler"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/registry": "https://packages.atlan.com", "package.argoproj.io/repository": "git+https://github.com/atlanhq/marketplace-packages.git", diff --git a/pyatlan/model/packages/snowflake_miner.py b/pyatlan/model/packages/snowflake_miner.py index e2c96f6ff..203431400 100644 --- a/pyatlan/model/packages/snowflake_miner.py +++ b/pyatlan/model/packages/snowflake_miner.py @@ -20,7 +20,9 @@ class SnowflakeMiner(AbstractMiner): _PACKAGE_NAME = "@atlan/snowflake-miner" _PACKAGE_PREFIX = WorkflowPackage.SNOWFLAKE_MINER.value _PACKAGE_ICON = "https://docs.snowflake.com/en/_images/logo-snowflake-sans-text.png" - _PACKAGE_LOGO = "https://1amiydhcmj36tz3733v94f15-wpengine.netdna-ssl.com/wp-content/themes/snowflake/assets/img/logo-blue.svg" # noqa + _PACKAGE_LOGO = ( + "https://1amiydhcmj36tz3733v94f15-wpengine.netdna-ssl.com/wp-content/themes/snowflake/assets/img/logo-blue.svg" # noqa + ) def __init__( self, @@ -51,9 +53,7 @@ def direct( self._parameters.append(dict(name="database-name", value=database)) self._parameters.append(dict(name="schema-name", value=schema)) self._parameters.append(dict(name="extraction-method", value="query_history")) - self._parameters.append( - dict(name="miner-start-time-epoch", value=str(start_epoch)) - ) + self._parameters.append(dict(name="miner-start-time-epoch", value=str(start_epoch))) return self def s3( @@ -85,14 +85,10 @@ def s3( self._parameters.append(dict(name="extraction-s3-bucket", value=s3_bucket)) self._parameters.append(dict(name="extraction-s3-prefix", value=s3_prefix)) self._parameters.append(dict(name="sql-json-key", value=sql_query_key)) - self._parameters.append( - dict(name="catalog-json-key", value=default_database_key) - ) + self._parameters.append(dict(name="catalog-json-key", value=default_database_key)) self._parameters.append(dict(name="schema-json-key", value=default_schema_key)) self._parameters.append(dict(name="session-json-key", value=session_id_key)) - s3_bucket_region and self._parameters.append( - dict(name="extraction-s3-region", value=s3_bucket_region) - ) + s3_bucket_region and self._parameters.append(dict(name="extraction-s3-region", value=s3_bucket_region)) return self def exclude_users(self, users: List[str]) -> SnowflakeMiner: @@ -135,9 +131,7 @@ def native_lineage(self, enabled: bool) -> SnowflakeMiner: :returns: miner, set to include / exclude native lineage from Snowflake """ self._advanced_config = True - self._parameters.append( - dict(name="native-lineage-active", value="true" if enabled else "false") - ) + self._parameters.append(dict(name="native-lineage-active", value="true" if enabled else "false")) return self def custom_config(self, config: Dict) -> SnowflakeMiner: @@ -148,9 +142,7 @@ def custom_config(self, config: Dict) -> SnowflakeMiner: :param config: custom configuration dict :returns: miner, set to include custom configuration """ - config and self._parameters.append( - dict(name="control-config", value=dumps(config)) - ) + config and self._parameters.append(dict(name="control-config", value=dumps(config))) self._advanced_config = True return self @@ -181,7 +173,7 @@ def _get_metadata(self) -> WorkflowMetadata: "orchestration.atlan.com/allowSchedule": "true", "orchestration.atlan.com/categories": "warehouse,miner", "orchestration.atlan.com/docsUrl": "https://ask.atlan.com/hc/en-us/articles/6482067592337", - "orchestration.atlan.com/emoji": "\uD83D\uDE80", + "orchestration.atlan.com/emoji": "\ud83d\ude80", "orchestration.atlan.com/icon": self._PACKAGE_ICON, "orchestration.atlan.com/logo": self._PACKAGE_LOGO, "orchestration.atlan.com/marketplaceLink": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", # noqa @@ -189,7 +181,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan", "package.argoproj.io/description": "Package to mine query history data from Snowflake and store it for further processing. The data mined will be used for generating lineage and usage metrics.", # noqa "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"snowflake\",\"warehouse\",\"connector\",\"miner\"]", # fmt: skip + "package.argoproj.io/keywords": '["snowflake","warehouse","connector","miner"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/registry": "https://packages.atlan.com", "package.argoproj.io/repository": "git+https://github.com/atlanhq/marketplace-packages.git", diff --git a/pyatlan/model/packages/sql_server_crawler.py b/pyatlan/model/packages/sql_server_crawler.py index 33cf1bef1..75c186420 100644 --- a/pyatlan/model/packages/sql_server_crawler.py +++ b/pyatlan/model/packages/sql_server_crawler.py @@ -27,8 +27,12 @@ class SQLServerCrawler(AbstractCrawler): _PACKAGE_NAME = "@atlan/mssql" _PACKAGE_PREFIX = WorkflowPackage.MSSQL.value _CONNECTOR_TYPE = AtlanConnectorType.MSSQL - _PACKAGE_ICON = "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa - _PACKAGE_LOGO = "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa + _PACKAGE_ICON = ( + "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa + ) + _PACKAGE_LOGO = ( + "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa + ) def __init__( self, @@ -52,9 +56,7 @@ def __init__( source_logo=self._PACKAGE_LOGO, ) - def direct( - self, hostname: str, database: str, port: int = 1433 - ) -> SQLServerCrawler: + def direct(self, hostname: str, database: str, port: int = 1433) -> SQLServerCrawler: """ Set up the crawler to extract directly from the database. @@ -101,9 +103,7 @@ def include(self, assets: dict) -> SQLServerCrawler: """ include_assets = assets or {} to_include = self.build_hierarchical_filter(include_assets) - self._parameters.append( - dict(dict(name="include-filter", value=to_include or "{}")) - ) + self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) return self def exclude(self, assets: dict) -> SQLServerCrawler: @@ -122,23 +122,17 @@ def exclude(self, assets: dict) -> SQLServerCrawler: return self def _set_required_metadata_params(self): - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) self._parameters.append(dict(name="publish-mode", value="production")) self._parameters.append(dict(name="extraction-method", value="direct")) self._parameters.append(dict(name="atlas-auth-type", value="internal")) self._parameters.append(dict(name="use-jdbc-internal-methods", value="true")) self._parameters.append(dict(name="use-source-schema-filtering", value="false")) - self._parameters.append( - dict(name="credentials-fetch-strategy", value="credential_guid") - ) + self._parameters.append(dict(name="credentials-fetch-strategy", value="credential_guid")) self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) diff --git a/pyatlan/model/packages/tableau_crawler.py b/pyatlan/model/packages/tableau_crawler.py index 248168edd..10288c758 100644 --- a/pyatlan/model/packages/tableau_crawler.py +++ b/pyatlan/model/packages/tableau_crawler.py @@ -52,9 +52,7 @@ def __init__( source_logo=self._PACKAGE_LOGO, ) - def s3( - self, bucket_name: str, bucket_prefix: str, bucket_region: Optional[str] = None - ) -> TableauCrawler: + def s3(self, bucket_name: str, bucket_prefix: str, bucket_region: Optional[str] = None) -> TableauCrawler: """ Set up the crawler to fetch metadata directly from the S3 bucket. @@ -102,9 +100,7 @@ def direct( } self._credentials_body.update(local_creds) self._parameters.append({"name": "extraction-method", "value": "direct"}) - self._parameters.append( - {"name": "credential-guid", "value": "{{credentialGuid}}"} - ) + self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) return self def basic_auth(self, username: str, password: str) -> TableauCrawler: @@ -150,9 +146,7 @@ def include(self, projects: List[str]) -> TableauCrawler: """ include_projects = projects or [] to_include = self.build_flat_filter(include_projects) - self._parameters.append( - dict(dict(name="include-filter", value=to_include or "{}")) - ) + self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) return self def exclude(self, projects: List[str]) -> TableauCrawler: @@ -215,9 +209,7 @@ def _set_required_metadata_params(self): self._parameters.append( { "name": "connection", - "value": self._get_connection().json( - by_alias=True, exclude_unset=True, exclude_none=True - ), + "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), } ) self._parameters.append(dict(name="atlas-auth-type", value="internal")) @@ -251,7 +243,7 @@ def _get_metadata(self) -> WorkflowMetadata: "package.argoproj.io/author": "Atlan", "package.argoproj.io/description": f"Package to crawl {self._NAME.capitalize()} assets and publish to Atlan for discovery.", # noqa "package.argoproj.io/homepage": f"https://packages.atlan.com/-/web/detail/{self._PACKAGE_NAME}", - "package.argoproj.io/keywords": "[\"tableau\",\"bi\",\"connector\",\"crawler\"]", # fmt: skip + "package.argoproj.io/keywords": '["tableau","bi","connector","crawler"]', # fmt: skip "package.argoproj.io/name": self._PACKAGE_NAME, "package.argoproj.io/parent": ".", "package.argoproj.io/registry": "https://packages.atlan.com", diff --git a/pyatlan/model/query.py b/pyatlan/model/query.py index ba8cfe9ca..4d41a9564 100644 --- a/pyatlan/model/query.py +++ b/pyatlan/model/query.py @@ -17,12 +17,8 @@ class ParsedQuery(AtlanObject): class DatabaseColumn(AtlanObject): - id: Optional[str] = Field( - default=None, description="Numeric identifier for the column." - ) - name: Optional[str] = Field( - default=None, description="Name of the column (unqualified)." - ) + id: Optional[str] = Field(default=None, description="Numeric identifier for the column.") + name: Optional[str] = Field(default=None, description="Name of the column (unqualified).") source: Optional[str] = Field(default=None, description="TBC") class RelationshipEndpoint(AtlanObject): @@ -44,29 +40,19 @@ class RelationshipEndpoint(AtlanObject): ) class ParserError(AtlanObject): - error_message: Optional[str] = Field( - default=None, description="Description of the error." - ) - error_type: Optional[str] = Field( - default=None, description="Type of the error." - ) + error_message: Optional[str] = Field(default=None, description="Description of the error.") + error_type: Optional[str] = Field(default=None, description="Type of the error.") coordinates: Optional[List[Any]] = Field(description="TBC") class Relationship(AtlanObject): - id: Optional[str] = Field( - default=None, description="Numeric identifier for the relationship." - ) - type: Optional[str] = Field( - default=None, description="Type of the relationship." - ) + id: Optional[str] = Field(default=None, description="Numeric identifier for the relationship.") + type: Optional[str] = Field(default=None, description="Type of the relationship.") effect_type: Optional[str] = Field( default=None, description="Type of effect made by the query (for example, select vs insert).", ) target: Optional[ParsedQuery.RelationshipEndpoint] = Field(description="TBC") - sources: Optional[List[ParsedQuery.RelationshipEndpoint]] = Field( - description="TBC" - ) + sources: Optional[List[ParsedQuery.RelationshipEndpoint]] = Field(description="TBC") process_id: Optional[str] = Field( default=None, description="Numeric identifier for the procedure (if any) that manages this relationship.", @@ -81,16 +67,10 @@ class DatabaseObject(AtlanObject): default=None, description="Fully-qualified name of the SQL object. (Only present on non-process objects.)", ) - id: Optional[str] = Field( - default=None, description="Numeric identifier for the object." - ) - name: Optional[str] = Field( - default=None, description="Name of the object (unqualified)." - ) + id: Optional[str] = Field(default=None, description="Numeric identifier for the object.") + name: Optional[str] = Field(default=None, description="Name of the object (unqualified).") type: Optional[str] = Field(default=None, description="Type of the object.") - database: Optional[str] = Field( - default=None, description="Name of the database the object exists within." - ) + database: Optional[str] = Field(default=None, description="Name of the database the object exists within.") db_schema: Optional[str] = Field( default=None, description="Name of the schema the object exists within.", @@ -115,16 +95,12 @@ class DatabaseObject(AtlanObject): relationships: Optional[List[ParsedQuery.Relationship]] = Field( description="All the relationship objects detected in the query." ) - errors: Optional[List[ParsedQuery.ParserError]] = Field( - description="Any errors during parsing." - ) + errors: Optional[List[ParsedQuery.ParserError]] = Field(description="Any errors during parsing.") class QueryParserRequest(AtlanObject): sql: str = Field(description="SQL query to be parsed.") - source: QueryParserSourceType = Field( - description="Dialect to use when parsing the SQL." - ) + source: QueryParserSourceType = Field(description="Dialect to use when parsing the SQL.") default_database: Optional[str] = Field( default=None, description="Default database name to use for unqualified objects in the SQL.", @@ -166,12 +142,9 @@ def create( class QueryRequest(AtlanObject): sql: str = Field(description="SQL query to run.") - data_source_name: str = Field( - description="Unique name of the connection to use for the query." - ) + data_source_name: str = Field(description="Unique name of the connection to use for the query.") default_schema: str = Field( - description="Default schema name to use for unqualified objects " - "in the SQL, in the form `DB.SCHEMA`." + description="Default schema name to use for unqualified objects in the SQL, in the form `DB.SCHEMA`." ) @@ -209,15 +182,9 @@ def __init__(self, events: Optional[List[Dict[str, Any]]] = None): default=None, description="Unique identifier for the request, if there was any error.", ) - error_name: Optional[str] = Field( - default=None, description="Unique name for the error, if there was any error." - ) - error_message: Optional[str] = Field( - default=None, description="Explanation of the error, if there was any error." - ) - error_code: Optional[str] = Field( - default=None, description="Unique code for the error, if there was any error." - ) + error_name: Optional[str] = Field(default=None, description="Unique name for the error, if there was any error.") + error_message: Optional[str] = Field(default=None, description="Explanation of the error, if there was any error.") + error_code: Optional[str] = Field(default=None, description="Unique code for the error, if there was any error.") query_id: Optional[str] = Field( default=None, description="Unique identifier (GUID) for the specific run of the query.", @@ -229,12 +196,8 @@ def __init__(self, events: Optional[List[Dict[str, Any]]] = None): ) class ColumnType(AtlanObject): - id: Optional[int] = Field( - description="Unique identifier for the request, if there was any error." - ) - name: Optional[str] = Field( - default=None, description="SQL name of the data type for this column.." - ) + id: Optional[int] = Field(description="Unique identifier for the request, if there was any error.") + name: Optional[str] = Field(default=None, description="SQL name of the data type for this column..") rep: Optional[str] class ColumnDetails(AtlanObject): @@ -250,12 +213,8 @@ class ColumnDetails(AtlanObject): nullable: Optional[int] = Field(description="TBC") signed: Optional[bool] = Field(description="TBC") display_size: Optional[int] = Field(description="TBC") - label: Optional[str] = Field( - default=None, description="Display value for the column's name." - ) - column_name: Optional[str] = Field( - default=None, description="Name of the column (technical)." - ) + label: Optional[str] = Field(default=None, description="Display value for the column's name.") + column_name: Optional[str] = Field(default=None, description="Name of the column (technical).") schema_name: Optional[str] = Field( default=None, description="Name of the schema in which this column's table is contained.", @@ -277,9 +236,7 @@ class ColumnDetails(AtlanObject): default=None, description="Canonical name of the Java class representing this column's values.", ) - type: Optional[QueryResponse.ColumnType] = Field( - description="Details about the (SQL) data type of the column." - ) + type: Optional[QueryResponse.ColumnType] = Field(description="Details about the (SQL) data type of the column.") columns: Optional[List[QueryResponse.ColumnDetails]] = Field( description="Columns that are present in each row of the results. " @@ -288,47 +245,29 @@ class ColumnDetails(AtlanObject): ) class AssetDetails(AtlanObject): - connection_name: Optional[str] = Field( - default=None, description="Simple name of the connection." - ) - connection_qn: Optional[str] = Field( - default=None, description="Unique name of the connection." - ) - database: Optional[str] = Field( - default=None, description="Simple name of the database." - ) - schema_: Optional[str] = Field( - default=None, alias="schema", description="Simple name of the schema." - ) - table: Optional[str] = Field( - default=None, description="Simple name of the table." - ) + connection_name: Optional[str] = Field(default=None, description="Simple name of the connection.") + connection_qn: Optional[str] = Field(default=None, description="Unique name of the connection.") + database: Optional[str] = Field(default=None, description="Simple name of the database.") + schema_: Optional[str] = Field(default=None, alias="schema", description="Simple name of the schema.") + table: Optional[str] = Field(default=None, description="Simple name of the table.") class QueryDetails(AtlanObject): """ Details about a query that was run. """ - total_rows_streamed: Optional[int] = Field( - description="Total number of results returned by the query." - ) + total_rows_streamed: Optional[int] = Field(description="Total number of results returned by the query.") status: Optional[QueryStatus] = Field(description="Status of the query.") parsed_query: Optional[str] = Field(default=None, description="TBC") - pushdown_query: Optional[str] = Field( - default=None, description="Query that was sent to the data store." - ) - execution_time: Optional[int] = Field( - description="How long the query took to run, in milliseconds." - ) + pushdown_query: Optional[str] = Field(default=None, description="Query that was sent to the data store.") + execution_time: Optional[int] = Field(description="How long the query took to run, in milliseconds.") source_query_id: Optional[str] = Field(default=None, description="TBC") result_output_location: Optional[str] = Field(default=None, description="TBC") warnings: Optional[List[str]] = Field( default=None, description="List of any warnings produced when running the query.", ) - parsing_flow: Optional[ParsingFlow] = Field( - description="How the query was parsed prior to running." - ) + parsing_flow: Optional[ParsingFlow] = Field(description="How the query was parsed prior to running.") heka_flow: Optional[HekaFlow] = Field(description="How the query was run.") s3_upload_path: Optional[str] = Field(default=None, description="TBC") source_first_connection_time: Optional[int] = Field(description="TBC") @@ -368,20 +307,14 @@ class QueryDetails(AtlanObject): default=None, description="Detailed back-end error message that could be helpful for developers.", ) - line: Optional[int] = Field( - description="Line number of the query that had a validation error, if any." - ) - column: Optional[int] = Field( - description="Column position of the validation error, if any." - ) + line: Optional[int] = Field(description="Line number of the query that had a validation error, if any.") + column: Optional[int] = Field(description="Column position of the validation error, if any.") obj: Optional[str] = Field( default=None, description="Name of the object that caused the validation error, if any.", ) - details: Optional[QueryResponse.QueryDetails] = Field( - description="Details about the query." - ) + details: Optional[QueryResponse.QueryDetails] = Field(description="Details about the query.") QueryResponse.ColumnType.update_forward_refs() diff --git a/pyatlan/model/response.py b/pyatlan/model/response.py index ad548dce5..eac085211 100644 --- a/pyatlan/model/response.py +++ b/pyatlan/model/response.py @@ -44,47 +44,29 @@ class AssetMutationResponse(AtlanObject): default=None, description="Map of assigned unique identifiers for the changed assets.", ) - mutated_entities: Optional[MutatedEntities] = Field( - default=None, description="Assets that were changed." - ) + mutated_entities: Optional[MutatedEntities] = Field(default=None, description="Assets that were changed.") partial_updated_entities: Optional[List[Asset]] = Field( default=None, description="Assets that were partially updated" ) def assets_created(self, asset_type: Type[A]) -> List[A]: if self.mutated_entities and self.mutated_entities.CREATE: - return [ - asset - for asset in self.mutated_entities.CREATE - if isinstance(asset, asset_type) - ] + return [asset for asset in self.mutated_entities.CREATE if isinstance(asset, asset_type)] return [] def assets_updated(self, asset_type: Type[A]) -> List[A]: if self.mutated_entities and self.mutated_entities.UPDATE: - return [ - asset - for asset in self.mutated_entities.UPDATE - if isinstance(asset, asset_type) - ] + return [asset for asset in self.mutated_entities.UPDATE if isinstance(asset, asset_type)] return [] def assets_deleted(self, asset_type: Type[A]) -> List[A]: if self.mutated_entities and self.mutated_entities.DELETE: - return [ - asset - for asset in self.mutated_entities.DELETE - if isinstance(asset, asset_type) - ] + return [asset for asset in self.mutated_entities.DELETE if isinstance(asset, asset_type)] return [] def assets_partially_updated(self, asset_type: Type[A]) -> List[A]: if self.mutated_entities and self.mutated_entities.PARTIAL_UPDATE: - return [ - asset - for asset in self.mutated_entities.PARTIAL_UPDATE - if isinstance(asset, asset_type) - ] + return [asset for asset in self.mutated_entities.PARTIAL_UPDATE if isinstance(asset, asset_type)] return [] diff --git a/pyatlan/model/role.py b/pyatlan/model/role.py index 183ba599a..ad8e9094f 100644 --- a/pyatlan/model/role.py +++ b/pyatlan/model/role.py @@ -13,25 +13,17 @@ class AtlanRole(AtlanObject): id: str = Field(description="Unique identifier for the role (GUID).\n") """Unique identifier for the role (GUID).""" name: str = Field(description="Unique name for the role.\n") - description: Optional[str] = Field( - default=None, description="Description of the role.\n" - ) + description: Optional[str] = Field(default=None, description="Description of the role.\n") client_role: Optional[bool] = Field(default=None, description="TBC\n") level: Optional[str] = Field(default=None, description="TBC\n") - member_count: Optional[str] = Field( - default=None, description="Number of users with this role.\n" - ) + member_count: Optional[str] = Field(default=None, description="Number of users with this role.\n") user_count: Optional[str] = Field(default=None, description="TBC\n") class RoleResponse(AtlanObject): - total_record: Optional[int] = Field( - default=None, description="Total number of roles.\n" - ) + total_record: Optional[int] = Field(default=None, description="Total number of roles.\n") filter_record: Optional[int] = Field( None, description="Number of roles in the filtered response.\n", ) - records: List["AtlanRole"] = Field( - description="Details of each role included in the response.\n" - ) + records: List["AtlanRole"] = Field(description="Details of each role included in the response.\n") diff --git a/pyatlan/model/search.py b/pyatlan/model/search.py index d2ad24586..53372aa5e 100644 --- a/pyatlan/model/search.py +++ b/pyatlan/model/search.py @@ -183,14 +183,10 @@ class Exists(Query): def with_custom_metadata(cls, set_name: StrictStr, attr_name: StrictStr): from pyatlan.cache.custom_metadata_cache import CustomMetadataCache - if attr_id := CustomMetadataCache.get_attr_id_for_name( - set_name=set_name, attr_name=attr_name - ): + if attr_id := CustomMetadataCache.get_attr_id_for_name(set_name=set_name, attr_name=attr_name): return cls(field=attr_id) else: - raise ValueError( - f"No custom metadata with the name {set_name} or property {attr_name} exists" - ) + raise ValueError(f"No custom metadata with the name {set_name} or property {attr_name} exists") @classmethod @validate_arguments() @@ -365,19 +361,13 @@ class Term(Query): @classmethod @validate_arguments() - def with_custom_metadata( - cls, set_name: StrictStr, attr_name: StrictStr, value: SearchFieldType - ): + def with_custom_metadata(cls, set_name: StrictStr, attr_name: StrictStr, value: SearchFieldType): from pyatlan.cache.custom_metadata_cache import CustomMetadataCache - if attr_id := CustomMetadataCache.get_attr_id_for_name( - set_name=set_name, attr_name=attr_name - ): + if attr_id := CustomMetadataCache.get_attr_id_for_name(set_name=set_name, attr_name=attr_name): return cls(field=attr_id, value=value) else: - raise ValueError( - f"No custom metadata with the name {set_name} or property {attr_name} exists" - ) + raise ValueError(f"No custom metadata with the name {set_name} or property {attr_name} exists") @classmethod @validate_arguments() @@ -397,7 +387,8 @@ def with_created_by(cls, value: StrictStr): @classmethod @validate_arguments() def with_glossary( - cls, qualified_name: constr(strip_whitespace=True, min_length=1, strict=True) # type: ignore + cls, + qualified_name: constr(strip_whitespace=True, min_length=1, strict=True), # type: ignore ): return cls(field=TermAttributes.GLOSSARY.value, value=qualified_name) @@ -672,9 +663,7 @@ def __and__(self, other): q.should.extend(qx.should) # not all are required, add a should list to the must with proper min_should_match else: - q.must.append( - Bool(should=qx.should, minimum_should_match=min_should_match) - ) + q.must.append(Bool(should=qx.should, minimum_should_match=min_should_match)) else: if not q.must and not q.filter and q.should: q.minimum_should_match = 1 @@ -782,11 +771,7 @@ def with_type_name(cls, value: StrictStr): def to_dict(self) -> Dict[Any, Any]: parameters: Dict[str, Any] = { - "value": ( - int(self.value.timestamp() * 1000) - if isinstance(self.value, datetime) - else self.value - ) + "value": (int(self.value.timestamp() * 1000) if isinstance(self.value, datetime) else self.value) } if self.case_insensitive is not None: @@ -1818,9 +1803,7 @@ def to_dict(self): if self.analyzer is not None: parameters["analyzer"] = self.analyzer if self.auto_generate_synonyms_phrase_query is not None: - parameters["auto_generate_synonyms_phrase_query"] = ( - self.auto_generate_synonyms_phrase_query - ) + parameters["auto_generate_synonyms_phrase_query"] = self.auto_generate_synonyms_phrase_query if self.fuzziness is not None: parameters["fuzziness"] = self.fuzziness if self.fuzzy_transpositions is not None: @@ -1921,9 +1904,7 @@ def validate_sort(cls, sort, values): class IndexSearchRequest(SearchRequest): dsl: DSL - relation_attributes: Optional[List[str]] = Field( - default_factory=list, alias="relationAttributes" - ) + relation_attributes: Optional[List[str]] = Field(default_factory=list, alias="relationAttributes") suppress_logs: Optional[bool] = Field(default=None, alias="suppressLogs") show_search_score: Optional[bool] = Field( default=None, @@ -1958,9 +1939,7 @@ class IndexSearchRequest(SearchRequest): ) class Metadata(AtlanObject): - save_search_log: bool = Field( - default=True, description="Whether to log this search (True) or not (False)" - ) + save_search_log: bool = Field(default=True, description="Whether to log this search (True) or not (False)") utm_tags: List[str] = Field( default_factory=list, description="Tags to associate with the search request", @@ -1988,11 +1967,7 @@ def __init__(__pydantic_self__, **data: Any) -> None: def with_active_glossary(name: StrictStr) -> "Bool": - return ( - Term.with_state("ACTIVE") - + Term.with_type_name("AtlasGlossary") - + Term.with_name(name) - ) + return Term.with_state("ACTIVE") + Term.with_type_name("AtlasGlossary") + Term.with_name(name) def with_active_category( diff --git a/pyatlan/model/search_log.py b/pyatlan/model/search_log.py index 97c73f045..97929946e 100644 --- a/pyatlan/model/search_log.py +++ b/pyatlan/model/search_log.py @@ -98,15 +98,11 @@ def _get_recent_viewers_aggs(max_users: int) -> Dict[str, object]: }, "aggregations": {"latest_timestamp": {"max": {"field": "timestamp"}}}, }, - "totalDistinctUsers": { - "cardinality": {"field": "userName", "precision_threshold": 1000} - }, + "totalDistinctUsers": {"cardinality": {"field": "userName", "precision_threshold": 1000}}, } @staticmethod - def _get_most_viewed_assets_aggs( - max_assets: int, by_diff_user: bool - ) -> Dict[str, object]: + def _get_most_viewed_assets_aggs(max_assets: int, by_diff_user: bool) -> Dict[str, object]: aggs_terms = { "field": "entityGuidsAll", "size": max_assets, @@ -125,9 +121,7 @@ def _get_most_viewed_assets_aggs( }, "terms": aggs_terms, }, - "totalDistinctUsers": { - "cardinality": {"field": "userName", "precision_threshold": 1000} - }, + "totalDistinctUsers": {"cardinality": {"field": "userName", "precision_threshold": 1000}}, } @classmethod @@ -146,13 +140,9 @@ def most_recent_viewers( :returns: A SearchLogRequest that can be used to perform the search. """ - query_filter = [ - Term(field="entityGuidsAll", value=guid, case_insensitive=False) - ] + query_filter = [Term(field="entityGuidsAll", value=guid, case_insensitive=False)] dsl = DSL( - **cls._get_view_dsl_kwargs( - size=0, from_=0, query_filter=query_filter, exclude_users=exclude_users - ), + **cls._get_view_dsl_kwargs(size=0, from_=0, query_filter=query_filter, exclude_users=exclude_users), aggregations=cls._get_recent_viewers_aggs(max_users), ) return SearchLogRequest(dsl=dsl) @@ -176,9 +166,7 @@ def most_viewed_assets( """ dsl = DSL( **cls._get_view_dsl_kwargs(size=0, from_=0, exclude_users=exclude_users), - aggregations=cls._get_most_viewed_assets_aggs( - max_assets, by_different_user - ), + aggregations=cls._get_most_viewed_assets_aggs(max_assets, by_different_user), ) return SearchLogRequest(dsl=dsl) @@ -202,9 +190,7 @@ def views_by_guid( :returns: A SearchLogRequest that can be used to perform the search. """ - query_filter = [ - Term(field="entityGuidsAll", value=guid, case_insensitive=False) - ] + query_filter = [Term(field="entityGuidsAll", value=guid, case_insensitive=False)] dsl = DSL( **cls._get_view_dsl_kwargs( size=size, @@ -224,12 +210,8 @@ class AssetViews(AtlanObject): """ guid: str = Field(description="GUID of the asset that was viewed.") - total_views: int = Field( - description="Number of times the asset has been viewed (in total)." - ) - distinct_users: int = Field( - description="Number of distinct users that have viewed the asset." - ) + total_views: int = Field(description="Number of times the asset has been viewed (in total).") + distinct_users: int = Field(description="Number of distinct users that have viewed the asset.") class UserViews(AtlanObject): @@ -251,12 +233,8 @@ class SearchLogEntry(AtlanObject): Instances of this class should be treated as immutable. """ - user_agent: str = Field( - description="Details of the browser or other client used to make the request." - ) - host: str = Field( - description="Hostname of the tenant against which the search was run." - ) + user_agent: str = Field(description="Details of the browser or other client used to make the request.") + host: str = Field(description="Hostname of the tenant against which the search was run.") ip_address: str = Field(description="IP address from which the search was run.") user_name: str = Field(description="Username of the user who ran the search.") entity_guids_all: List[str] = Field( @@ -278,8 +256,7 @@ class SearchLogEntry(AtlanObject): default_factory=list, alias="entityQFNamesAllowed", description=( - "Unique name(s) of asset(s) that were in the " - "results of the search, that the user is permitted to see." + "Unique name(s) of asset(s) that were in the results of the search, that the user is permitted to see." ), ) entity_type_names_all: List[str] = Field( @@ -291,20 +268,15 @@ class SearchLogEntry(AtlanObject): default_factory=list, alias="entityTypeNamesAllowed", description=( - "Name(s) of the types of assets that were in " - "the results of the search, that the user is permitted to see." + "Name(s) of the types of assets that were in the results of the search, that the user is permitted to see." ), ) - utm_tags: List[str] = Field( - default_factory=list, description="Tag(s) that were sent in the search request." - ) + utm_tags: List[str] = Field(default_factory=list, description="Tag(s) that were sent in the search request.") has_result: bool = Field( alias="hasResult", description="Whether the search had any results (true) or not (false).", ) - results_count: int = Field( - alias="resultsCount", description="Number of results for the search." - ) + results_count: int = Field(alias="resultsCount", description="Number of results for the search.") response_time: int = Field( alias="responseTime", description="Elapsed time to produce the results for the search, in milliseconds.", @@ -313,15 +285,9 @@ class SearchLogEntry(AtlanObject): alias="createdAt", description="Time (epoch-style) at which the search was logged, in milliseconds.", ) - timestamp: datetime = Field( - description="Time (epoch-style) at which the search was run, in milliseconds." - ) - failed: bool = Field( - description="Whether the search was successful (false) or not (true)." - ) - request_dsl: dict = Field( - alias="request.dsl", description="DSL of the full search request that was made." - ) + timestamp: datetime = Field(description="Time (epoch-style) at which the search was run, in milliseconds.") + failed: bool = Field(description="Whether the search was successful (false) or not (true).") + request_dsl: dict = Field(alias="request.dsl", description="DSL of the full search request that was made.") request_dsl_text: str = Field( alias="request.dslText", description="DSL of the full search request that was made, as a string.", @@ -422,9 +388,7 @@ def next_page(self, start=None, size=None) -> bool: :returns: True if there is a next page of results, otherwise False """ self._start = start or self._start + self._size - is_bulk_search = ( - self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD - ) + is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD if size: self._size = size @@ -434,9 +398,7 @@ def next_page(self, start=None, size=None) -> bool: # has already been processed in a previous page of results. # If it has, then exclude it from the current results; # otherwise, we may encounter duplicate search log records. - self._processed_log_entries.update( - self._get_sl_unique_key(entity) for entity in self._log_entries - ) + self._processed_log_entries.update(self._get_sl_unique_key(entity) for entity in self._log_entries) return self._get_next_page() if self._log_entries else False def _get_next_page(self): @@ -448,9 +410,7 @@ def _get_next_page(self): query = self._criteria.dsl.query self._criteria.dsl.from_ = self._start self._criteria.dsl.size = self._size - is_bulk_search = ( - self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD - ) + is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD if is_bulk_search: self._prepare_query_for_timestamp_paging(query) @@ -480,9 +440,7 @@ def _get_next_page_json(self, is_bulk_search: bool = False): self._filter_processed_entities() return raw_json except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err def _prepare_query_for_timestamp_paging(self, query: Query): """ @@ -496,9 +454,7 @@ def _prepare_query_for_timestamp_paging(self, query: Query): rewritten_filters.append(filter_) if self._first_record_creation_time != self._last_record_creation_time: - rewritten_filters.append( - self._get_paging_timestamp_query(self._last_record_creation_time) - ) + rewritten_filters.append(self._get_paging_timestamp_query(self._last_record_creation_time)) if isinstance(query, Bool): rewritten_query = Bool( filter=rewritten_filters, @@ -537,11 +493,7 @@ def _get_paging_timestamp_query(last_timestamp: int) -> Query: @staticmethod def _is_paging_timestamp_query(filter_: Query) -> bool: - return ( - isinstance(filter_, Range) - and filter_.field == "createdAt" - and filter_.gte is not None - ) + return isinstance(filter_, Range) and filter_.field == "createdAt" and filter_.gte is not None def _filter_processed_entities(self): """ @@ -550,8 +502,7 @@ def _filter_processed_entities(self): self._log_entries = [ entity for entity in self._log_entries - if entity is not None - and self._get_sl_unique_key(entity) not in self._processed_log_entries + if entity is not None and self._get_sl_unique_key(entity) not in self._processed_log_entries ] def _update_first_last_record_creation_times(self): @@ -576,9 +527,7 @@ def presorted_by_timestamp(sorts: Optional[List[SortItem]]) -> bool: :returns: True if sorting is already prioritized by creation time, False otherwise. """ if sorts and isinstance(sorts[0], SortItem): - return ( - sorts[0].field == "createdAt" and sorts[0].order == SortOrder.ASCENDING - ) + return sorts[0].field == "createdAt" and sorts[0].order == SortOrder.ASCENDING return False @staticmethod @@ -603,10 +552,7 @@ def sort_by_timestamp_first(sorts: List[SortItem]) -> List[SortItem]: for sort in sorts # Added a condition to disable "timestamp" sorting when bulk search for logs is enabled, # as sorting is already handled based on "createdAt" in this case. - if ( - (not sort.field) - or (sort.field != Asset.CREATE_TIME.internal_field_name) - ) + if ((not sort.field) or (sort.field != Asset.CREATE_TIME.internal_field_name)) and (sort not in BY_TIMESTAMP) ] return creation_asc_sort + rewritten_sorts diff --git a/pyatlan/model/sso.py b/pyatlan/model/sso.py index 215add5e7..e405239fc 100644 --- a/pyatlan/model/sso.py +++ b/pyatlan/model/sso.py @@ -11,12 +11,8 @@ class SSOMapperConfig(AtlanObject): group_name: Optional[str] = Field(default=None, alias="group") attribute_name: Optional[str] = Field(default=None, alias="attribute.name") attribute_value: Optional[str] = Field(default=None, alias="attribute.value") - attribute_friendly_name: Optional[str] = Field( - default=None, alias="attribute.friendly.name" - ) - attribute_values_regex: Optional[str] = Field( - default=None, alias="are.attribute.values.regex" - ) + attribute_friendly_name: Optional[str] = Field(default=None, alias="attribute.friendly.name") + attribute_values_regex: Optional[str] = Field(default=None, alias="are.attribute.values.regex") class SSOMapper(AtlanObject): diff --git a/pyatlan/model/structs.py b/pyatlan/model/structs.py index 627d1ae69..a3e55cd1f 100644 --- a/pyatlan/model/structs.py +++ b/pyatlan/model/structs.py @@ -46,12 +46,8 @@ class MCRuleSchedule(AtlanObject): """Description""" mc_rule_schedule_type: Optional[str] = Field(default=None, description="") - mc_rule_schedule_interval_in_minutes: Optional[int] = Field( - default=None, description="" - ) - mc_rule_schedule_start_time: Optional[datetime] = Field( - default=None, description="" - ) + mc_rule_schedule_interval_in_minutes: Optional[int] = Field(default=None, description="") + mc_rule_schedule_start_time: Optional[datetime] = Field(default=None, description="") mc_rule_schedule_crontab: Optional[str] = Field(default=None, description="") @@ -124,9 +120,7 @@ class SourceTagAttachment(AtlanObject): source_tag_qualified_name: Optional[str] = Field(default=None, description="") source_tag_guid: Optional[str] = Field(default=None, description="") source_tag_connector_name: Optional[str] = Field(default=None, description="") - source_tag_value: Optional[List[SourceTagAttachmentValue]] = Field( - default=None, description="" - ) + source_tag_value: Optional[List[SourceTagAttachmentValue]] = Field(default=None, description="") is_source_tag_synced: Optional[bool] = Field(default=None, description="") source_tag_sync_timestamp: Optional[datetime] = Field(default=None, description="") source_tag_sync_error: Optional[str] = Field(default=None, description="") @@ -158,9 +152,7 @@ def by_name( :raises NotFoundError: if the source-synced tag cannot be resolved """ tag = SourceTagCache.get_by_name(name) - tag_connector_name = AtlanConnectorType._get_connector_type_from_qualified_name( - tag.qualified_name or "" - ) + tag_connector_name = AtlanConnectorType._get_connector_type_from_qualified_name(tag.qualified_name or "") return cls.of( source_tag_name=tag.name, source_tag_qualified_name=tag.qualified_name, @@ -202,9 +194,7 @@ def by_qualified_name( :raises NotFoundError: if the source-synced tag cannot be resolved """ tag = SourceTagCache.get_by_qualified_name(source_tag_qualified_name) - tag_connector_name = AtlanConnectorType._get_connector_type_from_qualified_name( - source_tag_qualified_name or "" - ) + tag_connector_name = AtlanConnectorType._get_connector_type_from_qualified_name(source_tag_qualified_name or "") return cls.of( source_tag_name=tag.name, source_tag_qualified_name=source_tag_qualified_name, @@ -326,9 +316,7 @@ class AwsTag(AtlanObject): class DbtMetricFilter(AtlanObject): """Description""" - dbt_metric_filter_column_qualified_name: Optional[str] = Field( - default=None, description="" - ) + dbt_metric_filter_column_qualified_name: Optional[str] = Field(default=None, description="") dbt_metric_filter_field: Optional[str] = Field(default=None, description="") dbt_metric_filter_operator: Optional[str] = Field(default=None, description="") dbt_metric_filter_value: Optional[str] = Field(default=None, description="") @@ -369,9 +357,7 @@ class MCRuleComparison(AtlanObject): mc_rule_comparison_metric: Optional[str] = Field(default=None, description="") mc_rule_comparison_operator: Optional[str] = Field(default=None, description="") mc_rule_comparison_threshold: Optional[float] = Field(default=None, description="") - mc_rule_comparison_is_threshold_relative: Optional[bool] = Field( - default=None, description="" - ) + mc_rule_comparison_is_threshold_relative: Optional[bool] = Field(default=None, description="") class GoogleLabel(AtlanObject): @@ -391,9 +377,7 @@ class PopularityInsights(AtlanObject): record_total_user_count: Optional[int] = Field(default=None, description="") record_compute_cost: Optional[float] = Field(default=None, description="") record_max_compute_cost: Optional[float] = Field(default=None, description="") - record_compute_cost_unit: Optional[SourceCostUnitType] = Field( - default=None, description="" - ) + record_compute_cost_unit: Optional[SourceCostUnitType] = Field(default=None, description="") record_last_timestamp: Optional[datetime] = Field(default=None, description="") record_warehouse: Optional[str] = Field(default=None, description="") @@ -403,9 +387,7 @@ class SourceTagAttribute(AtlanObject): tag_attribute_key: Optional[str] = Field(default=None, description="") tag_attribute_value: Optional[str] = Field(default=None, description="") - tag_attribute_properties: Optional[Dict[str, str]] = Field( - default=None, description="" - ) + tag_attribute_properties: Optional[Dict[str, str]] = Field(default=None, description="") MCRuleSchedule.update_forward_refs() diff --git a/pyatlan/model/suggestions.py b/pyatlan/model/suggestions.py index f3515aea7..3dd716430 100644 --- a/pyatlan/model/suggestions.py +++ b/pyatlan/model/suggestions.py @@ -20,24 +20,12 @@ class SuggestionResponse(AtlanObject): - system_descriptions: Optional[List[SuggestionResponse.SuggestedItem]] = Field( - default_factory=list - ) - user_descriptions: Optional[List[SuggestionResponse.SuggestedItem]] = Field( - default_factory=list - ) - owner_users: Optional[List[SuggestionResponse.SuggestedItem]] = Field( - default_factory=list - ) - owner_groups: Optional[List[SuggestionResponse.SuggestedItem]] = Field( - default_factory=list - ) - atlan_tags: Optional[List[SuggestionResponse.SuggestedItem]] = Field( - default_factory=list - ) - assigned_terms: Optional[List[SuggestionResponse.SuggestedTerm]] = Field( - default_factory=list - ) + system_descriptions: Optional[List[SuggestionResponse.SuggestedItem]] = Field(default_factory=list) + user_descriptions: Optional[List[SuggestionResponse.SuggestedItem]] = Field(default_factory=list) + owner_users: Optional[List[SuggestionResponse.SuggestedItem]] = Field(default_factory=list) + owner_groups: Optional[List[SuggestionResponse.SuggestedItem]] = Field(default_factory=list) + atlan_tags: Optional[List[SuggestionResponse.SuggestedItem]] = Field(default_factory=list) + assigned_terms: Optional[List[SuggestionResponse.SuggestedTerm]] = Field(default_factory=list) class SuggestedItem(AtlanObject): count: int @@ -60,9 +48,7 @@ class Suggestions(AtlanObject): AGG_ATLAN_TAGS: ClassVar[str] = "group_by_tags" AGG_TERMS: ClassVar[str] = "group_by_terms" - client: AtlanClient = Field( - default_factory=lambda: AtlanClient.get_default_client() - ) + client: AtlanClient = Field(default_factory=lambda: AtlanClient.get_default_client()) """Client through which to find suggestions.""" asset: Optional[Asset] = Field(default=None) """Asset for which to find suggestions.""" @@ -264,18 +250,12 @@ def get(self) -> SuggestionResponse: if include == Suggestions.TYPE.SYSTEM_DESCRIPTION: search = search.where_some(Asset.DESCRIPTION.has_any_value()).aggregate( Suggestions.AGG_DESCRIPTION, - Asset.DESCRIPTION.bucket_by( - size=self.max_suggestions, include_source_value=True - ), + Asset.DESCRIPTION.bucket_by(size=self.max_suggestions, include_source_value=True), ) elif include == Suggestions.TYPE.USER_DESCRIPTION: - search = search.where_some( - Asset.USER_DESCRIPTION.has_any_value() - ).aggregate( + search = search.where_some(Asset.USER_DESCRIPTION.has_any_value()).aggregate( Suggestions.AGG_USER_DESCRIPTION, - Asset.USER_DESCRIPTION.bucket_by( - size=self.max_suggestions, include_source_value=True - ), + Asset.USER_DESCRIPTION.bucket_by(size=self.max_suggestions, include_source_value=True), ) elif include == Suggestions.TYPE.INDIVIDUAL_OWNERS: search = search.where_some(Asset.OWNER_USERS.has_any_value()).aggregate( @@ -283,9 +263,7 @@ def get(self) -> SuggestionResponse: Asset.OWNER_USERS.bucket_by(self.max_suggestions), ) elif include == Suggestions.TYPE.GROUP_OWNERS: - search = search.where_some( - Asset.OWNER_GROUPS.has_any_value() - ).aggregate( + search = search.where_some(Asset.OWNER_GROUPS.has_any_value()).aggregate( Suggestions.AGG_OWNER_GROUPS, Asset.OWNER_GROUPS.bucket_by(self.max_suggestions), ) @@ -295,9 +273,7 @@ def get(self) -> SuggestionResponse: Asset.ATLAN_TAGS.bucket_by(self.max_suggestions), ) elif include == Suggestions.TYPE.TERMS: - search = search.where_some( - Asset.ASSIGNED_TERMS.has_any_value() - ).aggregate( + search = search.where_some(Asset.ASSIGNED_TERMS.has_any_value()).aggregate( Suggestions.AGG_TERMS, Asset.ASSIGNED_TERMS.bucket_by(self.max_suggestions), ) @@ -318,9 +294,7 @@ def _get_descriptions(self, result: Aggregations, field: AtlanField): count = bucket.doc_count value = bucket.get_source_value(field) if count and value: - results.append( - SuggestionResponse.SuggestedItem(count=count, value=value) - ) + results.append(SuggestionResponse.SuggestedItem(count=count, value=value)) return results def _get_terms(self, result: Aggregations): @@ -330,11 +304,7 @@ def _get_terms(self, result: Aggregations): count = bucket.doc_count value = bucket.key if count and value: - results.append( - SuggestionResponse.SuggestedTerm( - count=count, qualified_name=value - ) - ) + results.append(SuggestionResponse.SuggestedTerm(count=count, qualified_name=value)) return results def _get_tags(self, result: Aggregations): @@ -345,9 +315,7 @@ def _get_tags(self, result: Aggregations): value = bucket.key name = AtlanTagCache.get_name_for_id(value) if count and name: - results.append( - SuggestionResponse.SuggestedItem(count=count, value=name) - ) + results.append(SuggestionResponse.SuggestedItem(count=count, value=name)) return results def _get_others(self, result: Aggregations): @@ -357,9 +325,7 @@ def _get_others(self, result: Aggregations): count = bucket.doc_count value = bucket.key if count and value: - results.append( - SuggestionResponse.SuggestedItem(count=count, value=value) - ) + results.append(SuggestionResponse.SuggestedItem(count=count, value=value)) return results def _build_response(self, include, suggestion_response, aggregations): @@ -402,9 +368,7 @@ def _build_response(self, include, suggestion_response, aggregations): ) ) - def apply( - self, allow_multiple: bool = False, batch: Optional[Batch] = None - ) -> Optional[AssetMutationResponse]: + def apply(self, allow_multiple: bool = False, batch: Optional[Batch] = None) -> Optional[AssetMutationResponse]: """ Find the requested suggestions and apply the top suggestions as changes to the asset. @@ -449,8 +413,7 @@ def _apply(self, allow_multiple: bool): includes_tags = True if allow_multiple: asset.atlan_tags = [ - AtlanTag(type_name=AtlanTagName(tag.value), propagate=False) - for tag in response.atlan_tags + AtlanTag(type_name=AtlanTagName(tag.value), propagate=False) for tag in response.atlan_tags ] else: asset.atlan_tags = [ diff --git a/pyatlan/model/task.py b/pyatlan/model/task.py index 4c0ff7463..fd9b3db1d 100644 --- a/pyatlan/model/task.py +++ b/pyatlan/model/task.py @@ -24,14 +24,10 @@ class AtlanTask(AtlanObject): CREATED_BY: ClassVar[KeywordField] = KeywordField("createdBy", "__task_createdBy") """User who created the task.""" - CREATED_TIME: ClassVar[NumericField] = NumericField( - "createdTime", "__task_timestamp" - ) + CREATED_TIME: ClassVar[NumericField] = NumericField("createdTime", "__task_timestamp") """Time (epoch) at which the task was created, in milliseconds.""" - UPDATED_TIME: ClassVar[NumericField] = NumericField( - "updatedTime", "__task_modificationTimestamp" - ) + UPDATED_TIME: ClassVar[NumericField] = NumericField("updatedTime", "__task_modificationTimestamp") """Time (epoch) at which the task was last updated, in milliseconds.""" START_TIME: ClassVar[NumericField] = NumericField("startTime", "__task_startTime") @@ -40,27 +36,19 @@ class AtlanTask(AtlanObject): END_TIME: ClassVar[NumericField] = NumericField("endTime", "__task_endTime") """Time (epoch) at which the task was ended, in milliseconds.""" - TIME_TAKEN_IN_SECONDS: ClassVar[NumericField] = NumericField( - "timeTakenInSeconds", "__task_timeTakenInSeconds" - ) + TIME_TAKEN_IN_SECONDS: ClassVar[NumericField] = NumericField("timeTakenInSeconds", "__task_timeTakenInSeconds") """Total time taken to complete the task, in seconds.""" - ATTEMPT_COUNT: ClassVar[NumericField] = NumericField( - "attemptCount", "__task_attemptCount" - ) + ATTEMPT_COUNT: ClassVar[NumericField] = NumericField("attemptCount", "__task_attemptCount") """Number of times the task has been attempted.""" STATUS: ClassVar[TextField] = TextField("status", "__task_status") """Status of the task.""" - CLASSIFICATION_ID: ClassVar[KeywordField] = KeywordField( - "classificationId", "__task_classificationId" - ) + CLASSIFICATION_ID: ClassVar[KeywordField] = KeywordField("classificationId", "__task_classificationId") """TBC""" - ENTITY_GUID: ClassVar[KeywordField] = KeywordField( - "entityGuid", "__task_entityGuid" - ) + ENTITY_GUID: ClassVar[KeywordField] = KeywordField("entityGuid", "__task_entityGuid") """Unique identifier of the asset the task originated from.""" type: Optional[AtlanTaskType] = Field(None, description="Type of the task.") @@ -73,26 +61,14 @@ class AtlanTask(AtlanObject): None, description="Time (epoch) at which the task was last updated, in milliseconds.", ) - start_time: Optional[int] = Field( - None, description="Time (epoch) at which the task was started, in milliseconds." - ) - end_time: Optional[int] = Field( - None, description="Time (epoch) at which the task was ended, in milliseconds." - ) - time_taken_in_seconds: Optional[int] = Field( - None, description="Total time taken to complete the task, in seconds." - ) - parameters: Optional[Dict[str, Any]] = Field( - None, description="Parameters used for running the task." - ) - attempt_count: Optional[int] = Field( - None, description="Number of times the task has been attempted." - ) + start_time: Optional[int] = Field(None, description="Time (epoch) at which the task was started, in milliseconds.") + end_time: Optional[int] = Field(None, description="Time (epoch) at which the task was ended, in milliseconds.") + time_taken_in_seconds: Optional[int] = Field(None, description="Total time taken to complete the task, in seconds.") + parameters: Optional[Dict[str, Any]] = Field(None, description="Parameters used for running the task.") + attempt_count: Optional[int] = Field(None, description="Number of times the task has been attempted.") status: Optional[AtlanTaskStatus] = Field(None, description="Status of the task.") classification_id: Optional[str] = Field(None, description="To Be Confirmed (TBC).") - entity_guid: Optional[str] = Field( - None, description="Unique identifier of the asset the task originated from." - ) + entity_guid: Optional[str] = Field(None, description="Unique identifier of the asset the task originated from.") class TaskSearchRequest(SearchRequest): @@ -180,9 +156,7 @@ def _get_next_page_json(self): self._tasks = parse_obj_as(List[AtlanTask], raw_json["tasks"]) return raw_json except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err def __iter__(self) -> Generator[AtlanTask, None, None]: """ diff --git a/pyatlan/model/typedef.py b/pyatlan/model/typedef.py index b19260bf1..c452ec530 100644 --- a/pyatlan/model/typedef.py +++ b/pyatlan/model/typedef.py @@ -204,12 +204,8 @@ class TypeDef(AtlanObject): default=None, description="Time (epoch) at which this object was created, in milliseconds.", ) - created_by: Optional[str] = Field( - default=None, description="Username of the user who created the object." - ) - description: Optional[str] = Field( - default=None, description="Description of the type definition." - ) + created_by: Optional[str] = Field(default=None, description="Username of the user who created the object.") + description: Optional[str] = Field(default=None, description="Description of the type definition.") guid: Optional[str] = Field( default=None, description="Unique identifier that represents the type definition.", @@ -224,18 +220,14 @@ class TypeDef(AtlanObject): default=None, description="Username of the user who last assets_updated the object.", ) - version: Optional[int] = Field( - default=None, description="Version of this type definition." - ) + version: Optional[int] = Field(default=None, description="Version of this type definition.") class EnumDef(TypeDef): class ElementDef(AtlanObject): value: str = Field(description="One unique value within the enumeration.") description: Optional[str] = Field(default=None, description="Unused.") - ordinal: Optional[int] = Field( - default=None, description="Unique numeric identifier for the value." - ) + ordinal: Optional[int] = Field(default=None, description="Unique numeric identifier for the value.") @staticmethod def of(ordinal: int, value: str) -> EnumDef.ElementDef: @@ -256,10 +248,7 @@ def list_from(values: List[str]) -> List[EnumDef.ElementDef]: [values], ) elements: List[EnumDef.ElementDef] = [] - elements.extend( - EnumDef.ElementDef.of(ordinal=i, value=values[i]) - for i in range(len(values)) - ) + elements.extend(EnumDef.ElementDef.of(ordinal=i, value=values[i]) for i in range(len(values))) return elements @staticmethod @@ -282,12 +271,8 @@ def extend_elements(current: List[str], new: List[str]) -> List[str]: return extended_list category: AtlanTypeCategory = AtlanTypeCategory.ENUM - element_defs: List[EnumDef.ElementDef] = Field( - description="Valid values for the enumeration." - ) - options: Optional[Dict[str, Any]] = Field( - default=None, description="Optional properties of the type definition." - ) + element_defs: List[EnumDef.ElementDef] = Field(description="Valid values for the enumeration.") + options: Optional[Dict[str, Any]] = Field(default=None, description="Optional properties of the type definition.") service_type: Optional[str] = Field(default=None, description="Internal use only.") @staticmethod @@ -362,9 +347,7 @@ class Options(AtlanObject): "are available and used.", default="v2", ) - description: Optional[str] = Field( - default=None, description="Optional description of the attribute." - ) + description: Optional[str] = Field(default=None, description="Optional description of the attribute.") applicable_entity_types: Optional[str] = Field( default=None, description="Set of entities on which this attribute can be applied. " @@ -425,19 +408,11 @@ class Options(AtlanObject): default=None, description="Whether the attribute has been deleted (true) or is still active (false).", ) - archived_at: Optional[int] = Field( - default=None, description="When the attribute was deleted." - ) - archived_by: Optional[str] = Field( - default=None, description="User who deleted the attribute." - ) + archived_at: Optional[int] = Field(default=None, description="When the attribute was deleted.") + archived_by: Optional[str] = Field(default=None, description="User who deleted the attribute.") is_soft_reference: Optional[str] = Field(default=None, description="TBC") - is_append_on_partial_update: Optional[str] = Field( - default=None, description="TBC" - ) - primitive_type: Optional[str] = Field( - default=None, description="Type of the attribute." - ) + is_append_on_partial_update: Optional[str] = Field(default=None, description="TBC") + primitive_type: Optional[str] = Field(default=None, description="Type of the attribute.") applicable_connections: Optional[str] = Field( default=None, description="Qualified names of connections to which to restrict the attribute. " @@ -491,9 +466,7 @@ def __setattr__(self, name, value): super().__setattr__(name, value) if self._attr_def and name == "multi_value_select": self._attr_def.cardinality = Cardinality.SET - if self._attr_def.type_name and "array<" not in str( - self._attr_def.type_name - ): + if self._attr_def.type_name and "array<" not in str(self._attr_def.type_name): self._attr_def.type_name = f"array<{self._attr_def.type_name}>" @staticmethod @@ -541,18 +514,10 @@ def create( "`LIST` indicates they are ordered and duplicates are allowed, while `SET` indicates " "they are unique and unordered.", ) - constraints: Optional[List[Dict[str, Any]]] = Field( - default=None, description="Internal use only." - ) - enum_values: Optional[List[str]] = Field( - default=None, description="list of values for an enumeration." - ) - description: Optional[str] = Field( - default=None, description="Description of the attribute definition." - ) - default_value: Optional[str] = Field( - default=None, description="Default value for this attribute (if any)." - ) + constraints: Optional[List[Dict[str, Any]]] = Field(default=None, description="Internal use only.") + enum_values: Optional[List[str]] = Field(default=None, description="list of values for an enumeration.") + description: Optional[str] = Field(default=None, description="Description of the attribute definition.") + default_value: Optional[str] = Field(default=None, description="Default value for this attribute (if any).") display_name: Optional[str] = Field( default=None, description="Name to use within all user interactions through the user interface. Note that this may not " @@ -568,9 +533,7 @@ def create( "by the user without impacting existing instances of the attribute.)", ) include_in_notification: Optional[bool] = Field(default=None, description="TBC") - index_type: Optional[IndexType] = Field( - default=None, description="", example="DEFAULT" - ) + index_type: Optional[IndexType] = Field(default=None, description="", example="DEFAULT") is_indexable: Optional[bool] = Field( default=None, description="When true, values for this attribute will be indexed for searching.", @@ -587,16 +550,11 @@ def create( default_factory=Options, description="Extensible options for the attribute." ) search_weight: Optional[float] = Field(default=None, description="TBC") - skip_scrubbing: Optional[bool] = Field( - default=None, description="When true, scrubbing of data will be skipped." - ) - type_name: Optional[str] = Field( - default=None, description="Type of this attribute." - ) + skip_scrubbing: Optional[bool] = Field(default=None, description="When true, scrubbing of data will be skipped.") + type_name: Optional[str] = Field(default=None, description="Type of this attribute.") values_min_count: Optional[float] = Field( default=None, - description="Minimum number of values for this attribute. If greater than 0, this attribute " - "becomes required.", + description="Minimum number of values for this attribute. If greater than 0, this attribute becomes required.", ) values_max_count: Optional[float] = Field( default=None, @@ -643,9 +601,7 @@ def applicable_entity_types(self, entity_types: EntityTypes): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(entity_types, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "applicable_entity_types", EntityTypes - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_entity_types", EntityTypes) self.options.applicable_entity_types = json.dumps(list(entity_types)) @property @@ -664,9 +620,7 @@ def applicable_asset_types(self, asset_types: AssetTypes): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(asset_types, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "applicable_asset_types", AssetTypes - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_asset_types", AssetTypes) if not asset_types.issubset(_complete_type_list): raise ErrorCode.INVALID_PARAMETER_VALUE.exception_with_parameters( asset_types, "applicable_asset_types", _complete_type_list @@ -689,9 +643,7 @@ def applicable_glossary_types(self, glossary_types: GlossaryTypes): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(glossary_types, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "applicable_glossary_types", GlossaryTypes - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_glossary_types", GlossaryTypes) if not glossary_types.issubset(_all_glossary_types): raise ErrorCode.INVALID_PARAMETER_VALUE.exception_with_parameters( glossary_types, "applicable_glossary_types", _all_glossary_types @@ -714,9 +666,7 @@ def applicable_domain_types(self, domain_types: DomainTypes): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(domain_types, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "applicable_domain_types", DomainTypes - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_domain_types", DomainTypes) if not domain_types.issubset(_all_domain_types): raise ErrorCode.INVALID_PARAMETER_VALUE.exception_with_parameters( domain_types, "applicable_domain_types", _all_domain_types @@ -766,9 +716,7 @@ def applicable_connections(self, connections: Set[str]): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(connections, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "applicable_connections", "Set[str]" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_connections", "Set[str]") self.options.applicable_connections = json.dumps(list(connections)) @property @@ -787,9 +735,7 @@ def applicable_glossaries(self, glossaries: Set[str]): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(glossaries, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "applicable_glossaries", "Set[str]" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_glossaries", "Set[str]") self.options.applicable_glossaries = json.dumps(list(glossaries)) @property @@ -808,9 +754,7 @@ def applicable_domains(self, domains: Set[str]): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(domains, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( - "applicable_domains", "Set[str]" - ) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_domains", "Set[str]") self.options.applicable_domains = json.dumps(list(domains)) def __init__(self, **data): @@ -840,9 +784,7 @@ def create( # Explicitly set all defaults to ensure inclusion during pydantic serialization attr_def = AttributeDef( display_name=display_name, - options=AttributeDef.Options.create( - attribute_type=attribute_type, options_name=options_name - ), + options=AttributeDef.Options.create(attribute_type=attribute_type, options_name=options_name), is_new=True, cardinality=Cardinality.SINGLE, description="", @@ -880,19 +822,11 @@ def create( attr_def.enum_values = [] attr_def.applicable_asset_types = applicable_asset_types or _complete_type_list - attr_def.applicable_glossary_types = ( - applicable_glossary_types or _all_glossary_types - ) + attr_def.applicable_glossary_types = applicable_glossary_types or _all_glossary_types attr_def.applicable_domain_types = applicable_domain_types or _all_domain_types - attr_def.applicable_other_asset_types = ( - applicable_other_asset_types or _all_other_types - ) - attr_def.applicable_connections = ( - applicable_connections or _get_all_qualified_names("Connection") - ) - attr_def.applicable_glossaries = ( - applicable_glossaries or _get_all_qualified_names("AtlasGlossary") - ) + attr_def.applicable_other_asset_types = applicable_other_asset_types or _all_other_types + attr_def.applicable_connections = applicable_connections or _get_all_qualified_names("Connection") + attr_def.applicable_glossaries = applicable_glossaries or _get_all_qualified_names("AtlasGlossary") attr_def.applicable_domains = applicable_domains or _all_domains return attr_def @@ -911,9 +845,7 @@ def archive(self, by: str) -> AttributeDef: class RelationshipAttributeDef(AttributeDef): is_legacy_attribute: Optional[bool] = Field(default=None, description="Unused.") - relationship_type_name: Optional[str] = Field( - default=None, description="Name of the relationship type." - ) + relationship_type_name: Optional[str] = Field(default=None, description="Name of the relationship type.") class StructDef(TypeDef): @@ -922,27 +854,19 @@ class StructDef(TypeDef): default=None, description="list of attributes that should be available in the type_ definition.", ) - service_type: Optional[str] = Field( - default=None, description="Internal use only.", example="atlan" - ) + service_type: Optional[str] = Field(default=None, description="Internal use only.", example="atlan") class AtlanTagDef(TypeDef): - attribute_defs: Optional[List[AttributeDef]] = Field( - default=None, description="Unused." - ) + attribute_defs: Optional[List[AttributeDef]] = Field(default=None, description="Unused.") category: AtlanTypeCategory = AtlanTypeCategory.CLASSIFICATION - display_name: str = Field( - default=None, description="Name used for display purposes (in user interfaces)." - ) + display_name: str = Field(default=None, description="Name used for display purposes (in user interfaces).") entity_types: Optional[List[str]] = Field( default=None, description="A list of the entity types that this classification can be used against." " (This should be `Asset` to allow classification of any asset in Atlan.)", ) - options: Optional[Dict[str, Any]] = Field( - default=None, description="Optional properties of the type_ definition." - ) + options: Optional[Dict[str, Any]] = Field(default=None, description="Optional properties of the type_ definition.") sub_types: Optional[List[str]] = Field( default=None, description="list of the sub-types that extend from this type_ definition. Generally this is not specified " @@ -957,9 +881,7 @@ class AtlanTagDef(TypeDef): service_type: Optional[str] = Field( default=None, description="Name used for display purposes (in user interfaces)." ) - skip_display_name_uniqueness_check: Optional[bool] = Field( - default=None, description="TBC" - ) + skip_display_name_uniqueness_check: Optional[bool] = Field(default=None, description="TBC") @staticmethod def create( @@ -1003,9 +925,7 @@ def create( class EntityDef(TypeDef): - attribute_defs: Optional[List[Dict[str, Any]]] = Field( - default_factory=list, description="Unused.", example=[] - ) + attribute_defs: Optional[List[Dict[str, Any]]] = Field(default_factory=list, description="Unused.", example=[]) business_attribute_defs: Optional[Dict[str, List[Dict[str, Any]]]] = Field( default_factory=cast(Callable[[], Dict[str, List[Dict[str, Any]]]], dict), description="Unused.", @@ -1015,9 +935,7 @@ class EntityDef(TypeDef): relationship_attribute_defs: Optional[List[Dict[str, Any]]] = Field( default_factory=list, description="Unused.", example=[] ) - service_type: Optional[str] = Field( - default=None, description="Internal use only.", example="atlan" - ) + service_type: Optional[str] = Field(default=None, description="Internal use only.", example="atlan") sub_types: Optional[List[str]] = Field( default_factory=list, description="list of the sub-types that extend from this type_ definition. Generally this is not specified in " @@ -1038,30 +956,18 @@ def reserved_type(self) -> bool: class RelationshipDef(TypeDef): - attribute_defs: Optional[List[Dict[str, Any]]] = Field( - default_factory=list, description="Unused.", example=[] - ) + attribute_defs: Optional[List[Dict[str, Any]]] = Field(default_factory=list, description="Unused.", example=[]) category: AtlanTypeCategory = AtlanTypeCategory.RELATIONSHIP - end_def1: Optional[Dict[str, Any]] = Field( - default_factory=dict, description="Unused.", example={} - ) - end_def2: Optional[Dict[str, Any]] = Field( - default_factory=dict, description="Unused.", example={} - ) - propagate_tags: str = Field( - default="ONE_TO_TWO", description="Unused", example="ONE_TO_TWO" - ) - relationship_category: str = Field( - default="AGGREGATION", description="Unused", example="AGGREGATION" - ) + end_def1: Optional[Dict[str, Any]] = Field(default_factory=dict, description="Unused.", example={}) + end_def2: Optional[Dict[str, Any]] = Field(default_factory=dict, description="Unused.", example={}) + propagate_tags: str = Field(default="ONE_TO_TWO", description="Unused", example="ONE_TO_TWO") + relationship_category: str = Field(default="AGGREGATION", description="Unused", example="AGGREGATION") relationship_label: str = Field( default="__SalesforceOrganization.reports", description="Unused", example="__SalesforceOrganization.reports", ) - service_type: Optional[str] = Field( - default=None, description="Internal use only.", example="atlan" - ) + service_type: Optional[str] = Field(default=None, description="Internal use only.", example="atlan") class CustomMetadataDef(TypeDef): @@ -1070,53 +976,39 @@ class Options(AtlanObject): default=None, description="If the logoType is emoji, this should hold the emoji character.", ) - image_id: Optional[str] = Field( - default=None, description="The id of the image used for the logo." - ) + image_id: Optional[str] = Field(default=None, description="The id of the image used for the logo.") is_locked: Optional[bool] = Field( description="Indicates whether the custom metadata can be managed in the UI (false) or not (true)." ) - logo_type: Optional[str] = Field( - default=None, description="Type of logo used for the custom metadata." - ) + logo_type: Optional[str] = Field(default=None, description="Type of logo used for the custom metadata.") logo_url: Optional[str] = Field( default=None, description="If the logoType is image, this should hold a URL to the image.", ) - icon_color: Optional[AtlanTagColor] = Field( - default=None, description="Color to use for the icon." - ) + icon_color: Optional[AtlanTagColor] = Field(default=None, description="Color to use for the icon.") icon_name: Optional[AtlanIcon] = Field( default=None, description="Icon to use to represent the custom metadata." ) @staticmethod - def with_logo_as_emoji( - emoji: str, locked: bool = False - ) -> CustomMetadataDef.Options: + def with_logo_as_emoji(emoji: str, locked: bool = False) -> CustomMetadataDef.Options: from pyatlan.utils import validate_required_fields validate_required_fields( ["emoji"], [emoji], ) - return CustomMetadataDef.Options( - emoji=emoji, logo_type="emoji", is_locked=locked - ) + return CustomMetadataDef.Options(emoji=emoji, logo_type="emoji", is_locked=locked) @staticmethod - def with_logo_from_url( - url: str, locked: bool = False - ) -> CustomMetadataDef.Options: + def with_logo_from_url(url: str, locked: bool = False) -> CustomMetadataDef.Options: from pyatlan.utils import validate_required_fields validate_required_fields( ["url"], [url], ) - return CustomMetadataDef.Options( - logo_url=url, logo_type="image", is_locked=locked - ) + return CustomMetadataDef.Options(logo_url=url, logo_type="image", is_locked=locked) @staticmethod def with_logo_from_icon( @@ -1140,9 +1032,7 @@ def with_logo_from_icon( description="list of custom attributes defined within the custom metadata.", ) category: AtlanTypeCategory = AtlanTypeCategory.CUSTOM_METADATA - display_name: str = Field( - default=None, description="Name used for display purposes (in user interfaces)." - ) + display_name: str = Field(default=None, description="Name used for display purposes (in user interfaces).") options: Optional[CustomMetadataDef.Options] = Field( default=None, description="Optional properties of the type definition." ) @@ -1164,20 +1054,14 @@ def create(display_name: str) -> CustomMetadataDef: class TypeDefResponse(AtlanObject): - enum_defs: List[EnumDef] = Field( - default_factory=list, description="list of enumeration type definitions." - ) - struct_defs: List[StructDef] = Field( - default_factory=list, description="list of struct type definitions." - ) + enum_defs: List[EnumDef] = Field(default_factory=list, description="list of enumeration type definitions.") + struct_defs: List[StructDef] = Field(default_factory=list, description="list of struct type definitions.") atlan_tag_defs: List[AtlanTagDef] = Field( default_factory=list, description="list of classification type definitions.", alias="classificationDefs", ) - entity_defs: List[EntityDef] = Field( - default_factory=list, description="list of entity type_ definitions." - ) + entity_defs: List[EntityDef] = Field(default_factory=list, description="list of entity type_ definitions.") relationship_defs: List[RelationshipDef] = Field( default_factory=list, description="list of relationship type_ definitions." ) diff --git a/pyatlan/model/user.py b/pyatlan/model/user.py index 81ed0db82..9c127b12b 100644 --- a/pyatlan/model/user.py +++ b/pyatlan/model/user.py @@ -19,34 +19,20 @@ class Attributes(AtlanObject): default=None, description="Designation for the user, such as an honorific or title.", ) - skills: Optional[List[str]] = Field( - default=None, description="Skills the user possesses." - ) - slack: Optional[List[str]] = Field( - default=None, description="Unique Slack member identifier." - ) - jira: Optional[List[str]] = Field( - default=None, description="Unique JIRA user identifier." - ) + skills: Optional[List[str]] = Field(default=None, description="Skills the user possesses.") + slack: Optional[List[str]] = Field(default=None, description="Unique Slack member identifier.") + jira: Optional[List[str]] = Field(default=None, description="Unique JIRA user identifier.") invited_at: Optional[List[str]] = Field( default=None, description="Time at which the user was invited (as a formatted string).", ) - invited_by: Optional[List[str]] = Field( - default=None, description="User who invited this user." - ) + invited_by: Optional[List[str]] = Field(default=None, description="User who invited this user.") invited_by_name: Optional[List[str]] = Field(default=None, description="TBC") class Persona(AtlanObject): - id: Optional[str] = Field( - default=None, description="Unique identifier (GUID) of the persona." - ) - name: Optional[str] = Field( - default=None, description="Internal name of the persona." - ) - display_name: Optional[str] = Field( - default=None, description="Human-readable name of the persona." - ) + id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the persona.") + name: Optional[str] = Field(default=None, description="Internal name of the persona.") + display_name: Optional[str] = Field(default=None, description="Human-readable name of the persona.") class LoginEvent(AtlanObject): client_id: Optional[str] = Field( @@ -54,17 +40,13 @@ class LoginEvent(AtlanObject): description="Where the login occurred (usually `atlan-frontend`).", ) details: Optional[Any] = Field(default=None, description="TBC") - ip_address: Optional[str] = Field( - default=None, description="IP address from which the user logged in." - ) + ip_address: Optional[str] = Field(default=None, description="IP address from which the user logged in.") realm_id: Optional[str] = Field(default=None, description="TBC") session_id: Optional[str] = Field( default=None, description="Unique identifier (GUID) of the session for the login.", ) - time: Optional[int] = Field( - description="Time (epoch) when the login occurred, in milliseconds." - ) + time: Optional[int] = Field(description="Time (epoch) when the login occurred, in milliseconds.") type: Optional[str] = Field( default=None, description="Type of login event that occurred (usually `LOGIN`).", @@ -81,9 +63,7 @@ class AuthDetails(AtlanObject): user_id: Optional[str] = Field(default=None, description="TBC") class AdminEvent(AtlanObject): - operation_type: Optional[str] = Field( - default=None, description="Type of admin operation that occurred." - ) + operation_type: Optional[str] = Field(default=None, description="Type of admin operation that occurred.") realm_id: Optional[str] = Field(default=None, description="TBC") representation: Optional[str] = Field(default=None, description="TBC") resource_path: Optional[str] = Field(default=None, description="TBC") @@ -95,19 +75,11 @@ class AdminEvent(AtlanObject): default=None, description="Time (epoch) when the admin operation occurred, in milliseconds.", ) - auth_details: Optional[AtlanUser.AuthDetails] = Field( - default=None, description="TBC" - ) + auth_details: Optional[AtlanUser.AuthDetails] = Field(default=None, description="TBC") - username: Optional[str] = Field( - default=None, description="Username of the user within Atlan." - ) - id: Optional[str] = Field( - default=None, description="Unique identifier (GUID) of the user within Atlan." - ) - workspace_role: Optional[str] = Field( - default=None, description="Name of the role of the user within Atlan." - ) + username: Optional[str] = Field(default=None, description="Username of the user within Atlan.") + id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the user within Atlan.") + workspace_role: Optional[str] = Field(default=None, description="Name of the role of the user within Atlan.") email: Optional[str] = Field(default=None, description="Email address of the user.") email_verified: Optional[bool] = Field( default=None, @@ -117,15 +89,9 @@ class AdminEvent(AtlanObject): default=None, description="When true, the user is enabled. When false, the user has been deactivated.", ) - first_name: Optional[str] = Field( - default=None, description="First name of the user." - ) - last_name: Optional[str] = Field( - default=None, description="Last name (surname) of the user." - ) - attributes: Optional[AtlanUser.Attributes] = Field( - default=None, description="Detailed attributes of the user." - ) + first_name: Optional[str] = Field(default=None, description="First name of the user.") + last_name: Optional[str] = Field(default=None, description="Last name (surname) of the user.") + attributes: Optional[AtlanUser.Attributes] = Field(default=None, description="Detailed attributes of the user.") created_timestamp: Optional[int] = Field( default=None, description="Time (epoch) at which the user was created, in milliseconds.", @@ -134,18 +100,14 @@ class AdminEvent(AtlanObject): default=None, description="Time (epoch) at which the user last logged into Atlan.", ) - group_count: Optional[int] = Field( - default=None, description="Number of groups to which the user belongs." - ) + group_count: Optional[int] = Field(default=None, description="Number of groups to which the user belongs.") default_roles: Optional[List[str]] = Field(default=None, description="TBC") roles: Optional[List[str]] = Field(default=None, description="TBC") decentralized_roles: Optional[Any] = Field(default=None, description="TBC") personas: Optional[List[AtlanUser.Persona]] = Field( default=None, description="Personas the user is associated with." ) - purposes: Optional[List[Any]] = Field( - default=None, description="Purposes the user is associated with." - ) + purposes: Optional[List[Any]] = Field(default=None, description="Purposes the user is associated with.") admin_events: Optional[List[AtlanUser.AdminEvent]] = Field( default=None, description="List of administration-related events for this user." ) @@ -183,12 +145,8 @@ def create_for_modification( class UserMinimalResponse(AtlanObject): - username: Optional[str] = Field( - default=None, description="Username of the user within Atlan." - ) - id: Optional[str] = Field( - default=None, description="Unique identifier (GUID) of the user within Atlan." - ) + username: Optional[str] = Field(default=None, description="Username of the user within Atlan.") + id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the user within Atlan.") email: Optional[str] = Field(default=None, description="Email address of the user.") email_verified: Optional[bool] = Field( default=None, @@ -198,15 +156,9 @@ class UserMinimalResponse(AtlanObject): default=None, description="When true, the user is enabled. When false, the user has been deactivated.", ) - first_name: Optional[str] = Field( - default=None, description="First name of the user." - ) - last_name: Optional[str] = Field( - default=None, description="Last name (surname) of the user." - ) - attributes: Optional[AtlanUser.Attributes] = Field( - default=None, description="Detailed attributes of the user." - ) + first_name: Optional[str] = Field(default=None, description="First name of the user.") + last_name: Optional[str] = Field(default=None, description="Last name (surname) of the user.") + attributes: Optional[AtlanUser.Attributes] = Field(default=None, description="Detailed attributes of the user.") created_timestamp: Optional[int] = Field( default=None, description="Time (epoch) at which the use was created, in milliseconds.", @@ -223,9 +175,7 @@ class UserResponse(AtlanObject): _endpoint: API = PrivateAttr() _client: ApiCaller = PrivateAttr() _criteria: UserRequest = PrivateAttr() - total_record: Optional[int] = Field( - default=None, description="Total number of users." - ) + total_record: Optional[int] = Field(default=None, description="Total number of users.") filter_record: Optional[int] = Field( default=None, description="Number of users in the filtered response.", @@ -264,9 +214,7 @@ def _get_next_page(self): try: self.records = parse_obj_as(List[AtlanUser], raw_json.get("records")) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters( - raw_json, 200, str(err) - ) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err return True def __iter__(self) -> Generator[AtlanUser, None, None]: # type: ignore[override] @@ -326,25 +274,17 @@ class CreateUserRequest(AtlanObject): class CreateUser(AtlanObject): email: str = Field(description="Email address of the user.") role_name: str = Field(description="Name of the workspace role for the user.") - role_id: str = Field( - description="Unique identifier (GUID) of the workspace role for the user." - ) + role_id: str = Field(description="Unique identifier (GUID) of the workspace role for the user.") - users: List[CreateUserRequest.CreateUser] = Field( - description="List of users to create." - ) + users: List[CreateUserRequest.CreateUser] = Field(description="List of users to create.") class AddToGroupsRequest(AtlanObject): - groups: Optional[List[str]] = Field( - description="List of groups (their GUIDs) to add the user to." - ) + groups: Optional[List[str]] = Field(description="List of groups (their GUIDs) to add the user to.") class ChangeRoleRequest(AtlanObject): - role_id: str = Field( - description="Unique identifier (GUID) of the new workspace role for the user." - ) + role_id: str = Field(description="Unique identifier (GUID) of the new workspace role for the user.") class UserProvider(Protocol): diff --git a/pyatlan/model/utils.py b/pyatlan/model/utils.py index 302ebd8b1..0a9a7bc04 100644 --- a/pyatlan/model/utils.py +++ b/pyatlan/model/utils.py @@ -46,9 +46,7 @@ def to_snake_case(value): elif value == "mappedClassificationName": return "mapped_atlan_tag_name" res = [value[0].lower()] - for c in ( - value.replace("URL", "Url").replace("DBT", "Dbt").replace("GDPR", "Gdpr")[1:] - ): + for c in value.replace("URL", "Url").replace("DBT", "Dbt").replace("GDPR", "Gdpr")[1:]: if c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": res.append("_") res.append(c.lower()) diff --git a/pyatlan/model/workflow.py b/pyatlan/model/workflow.py index 11c3de094..9b6641e0b 100644 --- a/pyatlan/model/workflow.py +++ b/pyatlan/model/workflow.py @@ -76,9 +76,7 @@ class Workflow(AtlanObject): class WorkflowSearchResultStatus(AtlanObject): - artifact_gc_Status: Optional[Dict[str, Any]] = Field( - default=None, alias="artifactGCStatus" - ) + artifact_gc_Status: Optional[Dict[str, Any]] = Field(default=None, alias="artifactGCStatus") artifact_repository_ref: Optional[Any] = Field(default=None) compressed_nodes: Optional[str] = Field(default=None) estimated_duration: Optional[int] = Field(default=None) @@ -213,6 +211,4 @@ class Config: def __init__(__pydantic_self__, **data: Any) -> None: super().__init__(**data) - __pydantic_self__.__fields_set__.update( - ["from_", "size", "track_total_hits", "sort"] - ) + __pydantic_self__.__fields_set__.update(["from_", "size", "track_total_hits", "sort"]) diff --git a/pyatlan/multipart_data_generator.py b/pyatlan/multipart_data_generator.py index 8ddcd4283..02528f280 100644 --- a/pyatlan/multipart_data_generator.py +++ b/pyatlan/multipart_data_generator.py @@ -41,14 +41,13 @@ def add_file(self, file, filename): # Write the file part with the correct 'name="file"' self._write(self.param_header()) self._write(self.line_break) - self._write( - f'Content-Disposition: form-data; name="file"; filename="{filename}"' - ) + self._write(f'Content-Disposition: form-data; name="file"; filename="{filename}"') self._write(self.line_break) # Get content type from dictionary, default to 'application/octet-stream' content_type = self._CONTENT_TYPES.get( - filename[filename.rfind(".") :], "application/octet-stream" # noqa: E203 + filename[filename.rfind(".") :], + "application/octet-stream", # noqa: E203 ) self._write(f"Content-Type: {content_type}") self._write(self.line_break) @@ -72,9 +71,7 @@ def _write(self, value): elif isinstance(value, str): array = bytearray(value, encoding="utf-8") else: - raise TypeError( - "unexpected type: {value_type}".format(value_type=type(value)) - ) + raise TypeError("unexpected type: {value_type}".format(value_type=type(value))) self.data.write(array) diff --git a/pyatlan/pkg/create_package_files.py b/pyatlan/pkg/create_package_files.py index 0463c787c..b192b04d6 100644 --- a/pyatlan/pkg/create_package_files.py +++ b/pyatlan/pkg/create_package_files.py @@ -168,8 +168,6 @@ def main(package_name: str): print("Please specify the python package name for the package") exit(1) if not re.fullmatch(r"\w+", sys.argv[1], re.ASCII): - print( - "The package name can only consist of alphanumeric characters and the underscore" - ) + print("The package name can only consist of alphanumeric characters and the underscore") main(sys.argv[1]) diff --git a/pyatlan/pkg/models.py b/pyatlan/pkg/models.py index 9f75f4c1c..0c0c9fb61 100644 --- a/pyatlan/pkg/models.py +++ b/pyatlan/pkg/models.py @@ -79,9 +79,7 @@ class PackageDefinition(BaseModel): def __init__(self, **data): super().__init__(**data) source = self.connector_type.value if self.connector_type else "atlan" - source_category = ( - self.connector_type.category.value if self.connector_type else "utility" - ) + source_category = self.connector_type.category.value if self.connector_type else "utility" self._package_definition = _PackageDefinition( name=self.package_id, version=VERSION, @@ -115,9 +113,7 @@ def __init__(self, **data): }, annotations={ "orchestration.atlan.com/name": self.package_name, - "orchestration.atlan.com/allowSchedule": str( - self.allow_schedule - ).lower(), + "orchestration.atlan.com/allowSchedule": str(self.allow_schedule).lower(), "orchestration.atlan.com/dependentPackage": "", "orchestration.atlan.com/emoji": "🚀", "orchestration.atlan.com/categories": ",".join(self.keywords), @@ -275,7 +271,7 @@ def create_configmaps(self): def create_config_class(self): template = self._env.get_template("package_config.jinja2") content = template.render({"pkg": self.pkg}) - file_name = f'{self.pkg.package_id[5:].replace("-", "_")}_cfg.py' + file_name = f"{self.pkg.package_id[5:].replace('-', '_')}_cfg.py" with (self.path / file_name).open("w") as script: script.write(content) diff --git a/pyatlan/pkg/ui.py b/pyatlan/pkg/ui.py index e143728dd..b5e607664 100644 --- a/pyatlan/pkg/ui.py +++ b/pyatlan/pkg/ui.py @@ -101,9 +101,7 @@ class UIRule: properties: Dict[str, Dict[str, str]] = field(default_factory=dict) @validate_arguments() - def __init__( - self, when_inputs: Dict[StrictStr, StrictStr], required: List[StrictStr] - ): + def __init__(self, when_inputs: Dict[StrictStr, StrictStr], required: List[StrictStr]): """ Configure basic UI rules that when the specified inputs have specified values, certain other fields become required. diff --git a/pyatlan/pkg/utils.py b/pyatlan/pkg/utils.py index 711f85285..86325a47b 100644 --- a/pyatlan/pkg/utils.py +++ b/pyatlan/pkg/utils.py @@ -53,10 +53,7 @@ def _is_valid_type(self, value: Any) -> bool: if isinstance(value, Sequence): return all(self._is_valid_type(v) for v in value) elif isinstance(value, Mapping): - return all( - self._is_valid_type(k) & self._is_valid_type(v) - for k, v in value.items() - ) + return all(self._is_valid_type(k) & self._is_valid_type(v) for k, v in value.items()) return False OTEL_IMPORTS_AVAILABLE = True @@ -85,9 +82,7 @@ def get_client(impersonate_user_id: str) -> AtlanClient: client = AtlanClient(base_url=base_url, api_key="") api_key = client.impersonate.user(user_id=user_id) else: - LOGGER.info( - "No API token or impersonation user, attempting short-lived escalation." - ) + LOGGER.info("No API token or impersonation user, attempting short-lived escalation.") client = AtlanClient(base_url=base_url, api_key="") api_key = client.impersonate.escalate() @@ -118,18 +113,12 @@ def set_package_headers(client: AtlanClient) -> AtlanClient: :returns: updated AtlanClient instance. """ - if (agent := os.environ.get("X_ATLAN_AGENT")) and ( - agent_id := os.environ.get("X_ATLAN_AGENT_ID") - ): + if (agent := os.environ.get("X_ATLAN_AGENT")) and (agent_id := os.environ.get("X_ATLAN_AGENT_ID")): headers: Dict[str, str] = { "x-atlan-agent": agent, "x-atlan-agent-id": agent_id, - "x-atlan-agent-package-name": os.environ.get( - "X_ATLAN_AGENT_PACKAGE_NAME", "" - ), - "x-atlan-agent-workflow-id": os.environ.get( - "X_ATLAN_AGENT_WORKFLOW_ID", "" - ), + "x-atlan-agent-package-name": os.environ.get("X_ATLAN_AGENT_PACKAGE_NAME", ""), + "x-atlan-agent-workflow-id": os.environ.get("X_ATLAN_AGENT_WORKFLOW_ID", ""), } client.update_headers(headers) return client @@ -194,9 +183,7 @@ def has_handler(logger: logging.Logger, handler_class) -> bool: return False -def add_otel_handler( - logger: logging.Logger, level: Union[int, str], resource: dict -) -> Optional[logging.Handler]: +def add_otel_handler(logger: logging.Logger, level: Union[int, str], resource: dict) -> Optional[logging.Handler]: """ Adds an OpenTelemetry logging handler to the provided logger if the necessary OpenTelemetry imports are available and the handler is not already present. @@ -223,18 +210,12 @@ def add_otel_handler( if workflow_node_name := os.getenv("OTEL_WF_NODE_NAME", ""): resource["k8s.workflow.node.name"] = workflow_node_name logger_provider = LoggerProvider(Resource.create(resource)) - otel_log_exporter = OTLPLogExporter( - endpoint=os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT"), insecure=True - ) - logger_provider.add_log_record_processor( - CustomBatchLogRecordProcessor(otel_log_exporter) - ) + otel_log_exporter = OTLPLogExporter(endpoint=os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT"), insecure=True) + logger_provider.add_log_record_processor(CustomBatchLogRecordProcessor(otel_log_exporter)) otel_handler = LoggingHandler(level=level, logger_provider=logger_provider) otel_handler.setLevel(level) - formatter = logging.Formatter( - "%(asctime)s - %(name)s - %(levelname)s - %(message)s" - ) + formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") otel_handler.setFormatter(formatter) logger.addHandler(otel_handler) logger.info("OpenTelemetry handler with formatter added to the logger.") diff --git a/pyatlan/pkg/widgets.py b/pyatlan/pkg/widgets.py index feb39e6c2..0b400e363 100644 --- a/pyatlan/pkg/widgets.py +++ b/pyatlan/pkg/widgets.py @@ -135,9 +135,7 @@ def __init__( :param help: informational text to place in a hover-over to describe the use of the input :param grid: sizing of the input on the UI (8 is full-width, 4 is half-width) """ - widget = APITokenSelectorWidget( - label=label, hidden=hidden, help=help, grid=grid - ) + widget = APITokenSelectorWidget(label=label, hidden=hidden, help=help, grid=grid) super().__init__(type_="string", required=required, ui=widget) @@ -197,9 +195,7 @@ def __init__( @dataclasses.dataclass class ConnectionCreatorWidget(AbstractWidget): - def __init__( - self, label: str, hidden: bool = False, help: str = "", placeholder: str = "" - ): + def __init__(self, label: str, hidden: bool = False, help: str = "", placeholder: str = ""): super().__init__( widget="connection", label=label, @@ -236,9 +232,7 @@ def __init__( :param help: informational text to place in a hover-over to describe the use of the input :param placeholder: example text to place within the widget to exemplify its use """ - widget = ConnectionCreatorWidget( - label=label, hidden=hidden, help=help, placeholder=placeholder - ) + widget = ConnectionCreatorWidget(label=label, hidden=hidden, help=help, placeholder=placeholder) super().__init__(type_="string", required=required, ui=widget) @@ -425,9 +419,7 @@ def __init__( start: int = 1, grid: int = 4, ): - super().__init__( - widget="date", label=label, hidden=hidden, help=help, grid=grid - ) + super().__init__(widget="date", label=label, hidden=hidden, help=help, grid=grid) self.start = start self.max = max self.min = min diff --git a/pyatlan/samples/custom_metadata/deploy_branded_cm.py b/pyatlan/samples/custom_metadata/deploy_branded_cm.py index 3a2aed7e4..94e92d499 100644 --- a/pyatlan/samples/custom_metadata/deploy_branded_cm.py +++ b/pyatlan/samples/custom_metadata/deploy_branded_cm.py @@ -41,10 +41,7 @@ def create_custom_metadata_structure(): """ try: CustomMetadataCache.get_id_for_name(CUSTOM_METADATA_NAME) - logger.info( - f"{CUSTOM_METADATA_NAME} custom metadata structure has " - f"already been created." - ) + logger.info(f"{CUSTOM_METADATA_NAME} custom metadata structure has already been created.") except NotFoundError: cm_def = CustomMetadataDef.create(display_name=CUSTOM_METADATA_NAME) cm_def.attribute_defs = [ diff --git a/pyatlan/samples/custom_metadata/update_cm_on_assets.py b/pyatlan/samples/custom_metadata/update_cm_on_assets.py index 82f6f0f04..5872c673e 100644 --- a/pyatlan/samples/custom_metadata/update_cm_on_assets.py +++ b/pyatlan/samples/custom_metadata/update_cm_on_assets.py @@ -33,16 +33,10 @@ def find_asset( :returns: the asset, if found """ - connections = client.asset.find_connections_by_name( - name=connection_name, connector_type=connector_type - ) - qualified_names = [ - f"{connection.qualified_name}/{asset_name}" for connection in connections - ] + connections = client.asset.find_connections_by_name(name=connection_name, connector_type=connector_type) + qualified_names = [f"{connection.qualified_name}/{asset_name}" for connection in connections] search_request = ( - FluentSearch(_includes_on_results=attributes).where( - Asset.QUALIFIED_NAME.within(qualified_names) - ) + FluentSearch(_includes_on_results=attributes).where(Asset.QUALIFIED_NAME.within(qualified_names)) ).to_request() if results := client.asset.search(search_request): return results.current_page()[0] @@ -84,9 +78,7 @@ def main(): connector_type=AtlanConnectorType.SNOWFLAKE, connection_name="development", asset_name="RAW/WIDEWORLDIMPORTERS_PURCHASING/SUPPLIERS", - attributes=CustomMetadataCache.get_attributes_for_search_results( - CUSTOM_METADATA_NAME - ), + attributes=CustomMetadataCache.get_attributes_for_search_results(CUSTOM_METADATA_NAME), ): logger.info("Found asset: %s", asset) updated = update_custom_metadata( @@ -99,14 +91,10 @@ def main(): # Note that the updated asset will NOT show the custom metadata, if you want # to see the custom metadata you need to re-retrieve the asset itself assert updated # noqa: S101 - result = client.asset.get_by_guid( - guid=updated.guid, asset_type=type(updated), ignore_relationships=True - ) + result = client.asset.get_by_guid(guid=updated.guid, asset_type=type(updated), ignore_relationships=True) logger.info("Asset's custom metadata was updated: %s", result) else: - logger.warning( - "Unable to find asset: (development)/RAW/WIDEWORLDIMPORTERS_PURCHASING/SUPPLIERS" - ) + logger.warning("Unable to find asset: (development)/RAW/WIDEWORLDIMPORTERS_PURCHASING/SUPPLIERS") if __name__ == "__main__": diff --git a/pyatlan/samples/events/lambda_enforcer.py b/pyatlan/samples/events/lambda_enforcer.py index 04a2e26d2..1d6511266 100644 --- a/pyatlan/samples/events/lambda_enforcer.py +++ b/pyatlan/samples/events/lambda_enforcer.py @@ -25,10 +25,7 @@ "outputFromProcesses", "certificateStatus", ] -ENFORCEMENT_MESSAGE = ( - "To be verified, an asset must have a description, at least one owner, " - "and lineage." -) +ENFORCEMENT_MESSAGE = "To be verified, an asset must have a description, at least one owner, and lineage." logger = logging.getLogger(__name__) client = AtlanClient() @@ -59,24 +56,19 @@ def calculate_changes(self, asset: Asset) -> List[Asset]: """ if asset.certificate_status == CertificateStatus.VERIFIED: - if ( - not has_description(asset) - or not has_owner(asset) - or not has_lineage(asset) - ): + if not has_description(asset) or not has_owner(asset) or not has_lineage(asset): trimmed = asset.trim_to_required() trimmed.certificate_status = CertificateStatus.DRAFT trimmed.certificate_status_message = ENFORCEMENT_MESSAGE return [trimmed] else: logger.info( - "Asset has all required information present to be " - "verified, no enforcement required: %s", + "Asset has all required information present to be verified, no enforcement required: %s", asset.qualified_name, ) else: logger.info( - "Asset is no longer verified, no enforcement action to " "consider: %s", + "Asset is no longer verified, no enforcement action to consider: %s", asset.qualified_name, ) return [] diff --git a/pyatlan/samples/events/lambda_scorer.py b/pyatlan/samples/events/lambda_scorer.py index 0a270b818..9420ef662 100644 --- a/pyatlan/samples/events/lambda_scorer.py +++ b/pyatlan/samples/events/lambda_scorer.py @@ -106,10 +106,7 @@ def _create_cm_if_not_exists() -> Optional[str]: try: return CustomMetadataCache.get_id_for_name(CM_DAAP) except NotFoundError: - logger.error( - "Unable to look up DaaP custom metadata, even though it" - "should already exist." - ) + logger.error("Unable to look up DaaP custom metadata, even though itshould already exist.") except AtlanError: logger.error("Unable to create DaaP custom metadata structure.") except AtlanError: @@ -144,9 +141,7 @@ def get_current_state(self, from_event: Asset) -> Optional[Asset]: """ search_attrs = SCORED_ATTRS - custom_metadata_attrs = CustomMetadataCache.get_attributes_for_search_results( - CM_DAAP - ) + custom_metadata_attrs = CustomMetadataCache.get_attributes_for_search_results(CM_DAAP) if custom_metadata_attrs is not None: search_attrs.extend(custom_metadata_attrs) @@ -177,9 +172,7 @@ def has_changes(self, original: Asset, modified: Asset) -> bool: score_original = cm_original.get(CM_ATTR_DAAP_SCORE) if cm_modified := modified.get_custom_metadata(CM_DAAP): score_modified = cm_modified.get(CM_ATTR_DAAP_SCORE) - logger.info( - "Existing score = %s, new score = %s", score_original, score_modified - ) + logger.info("Existing score = %s, new score = %s", score_original, score_modified) return score_original != score_modified def calculate_changes(self, asset: Asset) -> List[Asset]: @@ -209,9 +202,7 @@ def calculate_changes(self, asset: Asset) -> List[Asset]: s_readme = 0 readme = asset.readme if readme and readme.guid: - readme = client.asset.get_by_guid( - readme.guid, asset_type=Readme, ignore_relationships=False - ) + readme = client.asset.get_by_guid(readme.guid, asset_type=Readme, ignore_relationships=False) if description := readme.description: if len(description) > 1000: s_readme = 20 @@ -219,14 +210,7 @@ def calculate_changes(self, asset: Asset) -> List[Asset]: s_readme = 10 elif len(description) > 100: s_readme = 5 - score = ( - s_description - + s_related_term - + s_links - + s_related_asset - + s_certificate - + s_readme - ) + score = s_description + s_related_term + s_links + s_related_asset + s_certificate + s_readme elif not asset.type_name.startswith("AtlasGlossary"): # We will not score glossaries or categories s_description = 15 if has_description(asset) else 0 diff --git a/pyatlan/samples/search/and_star_assets.py b/pyatlan/samples/search/and_star_assets.py index 6bec5f245..0f82f6a8a 100644 --- a/pyatlan/samples/search/and_star_assets.py +++ b/pyatlan/samples/search/and_star_assets.py @@ -46,15 +46,9 @@ def list_users_in_group(name: str) -> List[str]: """ usernames: List[str] = [] if groups := client.group.get_by_name(alias=name): - if groups[0].id is not None and ( - response := client.group.get_members(guid=groups[0].id) - ): + if groups[0].id is not None and (response := client.group.get_members(guid=groups[0].id)): if response.records and len(response.records) > 0: - usernames.extend( - str(user.username) - for user in response.records - if user.username is not None - ) + usernames.extend(str(user.username) for user in response.records if user.username is not None) return usernames @@ -74,16 +68,12 @@ def star_asset(asset: Asset, usernames: List[str]) -> None: if user not in starred_by: starred_by.add(user) starred_count += 1 - starred_details_list.append( - StarredDetails(asset_starred_by=user, asset_starred_at=datetime.now()) - ) + starred_details_list.append(StarredDetails(asset_starred_by=user, asset_starred_at=datetime.now())) to_update = asset.trim_to_required() to_update.starred_details_list = starred_details_list to_update.starred_count = starred_count to_update.starred_by = starred_by - logger.info( - "Updating '%s' (%s) with total stars: %s", asset.name, asset.guid, starred_count - ) + logger.info("Updating '%s' (%s) with total stars: %s", asset.name, asset.guid, starred_count) client.asset.save(to_update) diff --git a/pyatlan/samples/search/and_traverse_lineage.py b/pyatlan/samples/search/and_traverse_lineage.py index 9297f640a..c189f02ef 100644 --- a/pyatlan/samples/search/and_traverse_lineage.py +++ b/pyatlan/samples/search/and_traverse_lineage.py @@ -27,10 +27,7 @@ def find_all(asset_type: type) -> IndexSearchResults: :returns: results of the search """ search_request = ( - FluentSearch() - .where(FluentSearch.asset_type(asset_type)) - .where(FluentSearch.active_assets()) - .page_size(100) + FluentSearch().where(FluentSearch.asset_type(asset_type)).where(FluentSearch.active_assets()).page_size(100) ).to_request() return client.asset.search(search_request) @@ -66,9 +63,7 @@ def upstream_certified_sources(guid: str) -> List[Asset]: ) # type: ignore[call-arg] response = client.asset.get_lineage_list(request) verified_assets: List[Asset] = [ - asset - for asset in response - if asset.type_name in {"Table", "View", "MaterialisedView"} + asset for asset in response if asset.type_name in {"Table", "View", "MaterialisedView"} ] return verified_assets diff --git a/pyatlan/test_utils/__init__.py b/pyatlan/test_utils/__init__.py index f040d858d..d8351772b 100644 --- a/pyatlan/test_utils/__init__.py +++ b/pyatlan/test_utils/__init__.py @@ -55,11 +55,7 @@ def delete_token(client: AtlanClient, token: Optional[ApiToken] = None): if not token: tokens = client.token.get().records assert tokens # noqa: S101 - delete_tokens = [ - token - for token in tokens - if token.display_name and "psdk_Requests" in token.display_name - ] + delete_tokens = [token for token in tokens if token.display_name and "psdk_Requests" in token.display_name] for token in delete_tokens: assert token and token.guid # noqa: S101 client.token.purge(token.guid) @@ -73,11 +69,7 @@ def save_with_purge(client: AtlanClient): def _save(asset: Asset) -> AssetMutationResponse: _response = client.asset.save(asset) - if ( - _response - and _response.mutated_entities - and _response.mutated_entities.CREATE - ): + if _response and _response.mutated_entities and _response.mutated_entities.CREATE: guids.append(_response.mutated_entities.CREATE[0].guid) return _response @@ -85,11 +77,7 @@ def _save(asset: Asset) -> AssetMutationResponse: for guid in reversed(guids): response = client.asset.purge_by_guid(guid) - if ( - not response - or not response.mutated_entities - or not response.mutated_entities.DELETE - ): + if not response or not response.mutated_entities or not response.mutated_entities.DELETE: LOGGER.error(f"Failed to remove asset with GUID {guid}.") @@ -103,18 +91,12 @@ def delete_asset(client: AtlanClient, asset_type: Type[A], guid: str) -> None: LOGGER.error(f"Failed to remove {asset_type} with GUID {guid}.") -def create_connection( - client: AtlanClient, name: str, connector_type: AtlanConnectorType -) -> Connection: +def create_connection(client: AtlanClient, name: str, connector_type: AtlanConnectorType) -> Connection: admin_role_guid = str(RoleCache.get_id_for_name("$admin")) - to_create = Connection.create( - name=name, connector_type=connector_type, admin_roles=[admin_role_guid] - ) + to_create = Connection.create(name=name, connector_type=connector_type, admin_roles=[admin_role_guid]) response = client.asset.save(to_create) result = response.assets_created(asset_type=Connection)[0] - return client.asset.get_by_guid( - result.guid, asset_type=Connection, ignore_relationships=False - ) + return client.asset.get_by_guid(result.guid, asset_type=Connection, ignore_relationships=False) def create_group(client: AtlanClient, name: str) -> CreateGroupResponse: @@ -135,9 +117,7 @@ def create_category( glossary: AtlasGlossary, parent: Optional[AtlasGlossaryCategory] = None, ) -> AtlasGlossaryCategory: - c = AtlasGlossaryCategory.create( - name=name, anchor=glossary, parent_category=parent or None - ) + c = AtlasGlossaryCategory.create(name=name, anchor=glossary, parent_category=parent or None) return client.asset.save(c).assets_created(AtlasGlossaryCategory)[0] @@ -157,25 +137,19 @@ def create_term( def create_database(client: AtlanClient, database_name: str, connection: Connection): - to_create = Database.create( - name=database_name, connection_qualified_name=connection.qualified_name - ) + to_create = Database.create(name=database_name, connection_qualified_name=connection.qualified_name) result = client.asset.save(to_create) return result.assets_created(asset_type=Database)[0] def create_schema(client: AtlanClient, schema_name: str, database: Database): - to_create = Schema.create( - name=schema_name, connection_qualified_name=database.qualified_name - ) + to_create = Schema.create(name=schema_name, connection_qualified_name=database.qualified_name) result = client.asset.save(to_create) return result.assets_created(asset_type=Schema)[0] def create_table(client: AtlanClient, table_name: str, schema: Schema): - to_create = Table.create( - name=table_name, schema_qualified_name=schema.qualified_name - ) + to_create = Table.create(name=table_name, schema_qualified_name=schema.qualified_name) result = client.asset.save(to_create) return result.assets_created(asset_type=Table)[0] @@ -187,16 +161,12 @@ def create_view(client: AtlanClient, view_name: str, schema: Schema): def create_mview(client: AtlanClient, mview_name: str, schema: Schema): - to_create = MaterialisedView.create( - name=mview_name, schema_qualified_name=schema.qualified_name - ) + to_create = MaterialisedView.create(name=mview_name, schema_qualified_name=schema.qualified_name) result = client.asset.save(to_create) return result.assets_created(asset_type=MaterialisedView)[0] -def create_column( - client: AtlanClient, column_name: str, parent_type: type, parent: Asset, order: int -): +def create_column(client: AtlanClient, column_name: str, parent_type: type, parent: Asset, order: int): to_create = Column.create( name=column_name, parent_type=parent_type, @@ -219,17 +189,13 @@ def create_custom_metadata( cm_def = CustomMetadataDef.create(display_name=name) cm_def.attribute_defs = attribute_defs if icon and color: - cm_def.options = CustomMetadataDef.Options.with_logo_from_icon( - icon, color, locked - ) + cm_def.options = CustomMetadataDef.Options.with_logo_from_icon(icon, color, locked) elif logo and logo.startswith("http"): cm_def.options = CustomMetadataDef.Options.with_logo_from_url(logo, locked) elif logo: cm_def.options = CustomMetadataDef.Options.with_logo_as_emoji(logo, locked) else: - raise ValueError( - "Invalid configuration for the visual to use for the custom metadata." - ) + raise ValueError("Invalid configuration for the visual to use for the custom metadata.") r = client.typedef.create(cm_def) return r.custom_metadata_defs[0] diff --git a/pyatlan/utils.py b/pyatlan/utils.py index 2c5df5853..f08cf9c57 100644 --- a/pyatlan/utils.py +++ b/pyatlan/utils.py @@ -58,9 +58,7 @@ def get_parent_qualified_name(qualified_name: str) -> str: return "/".join(qn[:-1]) -def list_attributes_to_params( - attributes_list: list, query_params: Optional[dict] = None -) -> dict: +def list_attributes_to_params(attributes_list: list, query_params: Optional[dict] = None) -> dict: if query_params is None: query_params = {} @@ -72,9 +70,7 @@ def list_attributes_to_params( return query_params -def attributes_to_params( - attributes: List[tuple[str, object]], query_params: Optional[dict] = None -) -> dict: +def attributes_to_params(attributes: List[tuple[str, object]], query_params: Optional[dict] = None) -> dict: if query_params is None: query_params = {} @@ -112,27 +108,15 @@ def type_coerce(obj, obj_type): def type_coerce_list(obj, obj_type): - return ( - [type_coerce(entry, obj_type) for entry in obj] - if isinstance(obj, list) - else None - ) + return [type_coerce(entry, obj_type) for entry in obj] if isinstance(obj, list) else None def type_coerce_dict(obj, obj_type): - return ( - {k: type_coerce(v, obj_type) for k, v in obj.items()} - if isinstance(obj, dict) - else None - ) + return {k: type_coerce(v, obj_type) for k, v in obj.items()} if isinstance(obj, dict) else None def type_coerce_dict_list(obj, obj_type): - return ( - {k: type_coerce_list(v, obj_type) for k, v in obj.items()} - if isinstance(obj, dict) - else None - ) + return {k: type_coerce_list(v, obj_type) for k, v in obj.items()} if isinstance(obj, dict) else None def validate_required_fields(field_names: List[str], values: List[Any]): @@ -245,12 +229,8 @@ def unflatten_custom_metadata( return retval -def unflatten_custom_metadata_for_entity( - entity: Dict[str, Any], attributes: Optional[List[str]] -): - if custom_metadata := unflatten_custom_metadata( - attributes=attributes, asset_attributes=entity.get("attributes") - ): +def unflatten_custom_metadata_for_entity(entity: Dict[str, Any], attributes: Optional[List[str]]): + if custom_metadata := unflatten_custom_metadata(attributes=attributes, asset_attributes=entity.get("attributes")): entity["businessAttributes"] = custom_metadata @@ -277,16 +257,16 @@ class ComparisonCategory(str, Enum): def _get_embedded_type(attribute_type: str): return attribute_type[ - attribute_type.index("<") + 1 : attribute_type.index(">") # noqa: E203 + attribute_type.index("<") + 1 : attribute_type.index( + ">" + ) # noqa: E203 ] def get_base_type(attribute_type: str): base_type = attribute_type if "<" in attribute_type: - if attribute_type.startswith("array<") and attribute_type.startswith( - "array 1 - else type_names[0] - ) + type_name = ", ".join(type_names[:-1]) + f" or {type_names[-1]}" if len(type_names) > 1 else type_names[0] else: type_name = _type.__name__ if _type is not None else "None" @@ -348,11 +324,7 @@ def filter(self, record: logging.LogRecord) -> bool: record.args["access_token"] = "***REDACTED***" # noqa: S105 elif record.args and hasattr(record.args, "__iter__"): for arg in record.args: - if ( - isinstance(arg, dict) - and "headers" in arg - and "authorization" in arg["headers"] - ): + if isinstance(arg, dict) and "headers" in arg and "authorization" in arg["headers"]: arg["headers"]["authorization"] = "***REDACTED***" return True @@ -374,9 +346,7 @@ def format(self, record: logging.LogRecord) -> str: "asctime": self.formatTime(record, self.datefmt), "name": record.name, "levelname": record.levelname, - "message": ( - record.msg if isinstance(record.msg, dict) else record.getMessage() - ), + "message": (record.msg if isinstance(record.msg, dict) else record.getMessage()), } return json.dumps(log_record, ensure_ascii=False) @@ -437,9 +407,7 @@ def __init__(self, logger: logging.Logger, contextvar: ContextVar): :param contextvar: the ContextVar from which to obtain the value to be used for 'requestid' """ - super().__init__( - logger, ContextVarWrapper(contextvar=contextvar, key_name=REQUESTID) - ) + super().__init__(logger, ContextVarWrapper(contextvar=contextvar, key_name=REQUESTID)) def process(self, msg, kwargs): return f"[{self.extra['requestid']}] {msg}", kwargs @@ -448,11 +416,7 @@ def process(self, msg, kwargs): def validate_single_required_field(field_names: List[str], values: List[Any]): indexes = [idx for idx, value in enumerate(values) if value is not None] if not indexes: - raise ValueError( - f"One of the following parameters are required: {', '.join(field_names)}" - ) + raise ValueError(f"One of the following parameters are required: {', '.join(field_names)}") if len(indexes) > 1: names = [field_names[idx] for idx in indexes] - raise ValueError( - f"Only one of the following parameters are allowed: {', '.join(names)}" - ) + raise ValueError(f"Only one of the following parameters are allowed: {', '.join(names)}") diff --git a/qa-checks b/qa-checks index 01465b29b..13cbc4fe4 100755 --- a/qa-checks +++ b/qa-checks @@ -7,7 +7,7 @@ perform_check() { OUTPUT=$($cmd 2>&1) if [ $? -eq 0 ]; then - echo "$tool_name ✅" + echo -e "$tool_name ✅ \n" else echo -e "$tool_name ❌ \nsuggestion: run - $suggestion\n" FAILURE=1 @@ -17,17 +17,17 @@ perform_check() { # Formatter ruff-formatter-check() { - perform_check "ruff" "ruff format --check ." "ruff format ." + perform_check "ruff format 🧹" "ruff format --check ." "ruff format ." } # Linter ruff-linter-check() { - perform_check "ruff" " ruff check ." " ruff check ." + perform_check "ruff check 🕵️" "ruff check ." " ruff check ." } # Static type checker mypy-check() { - perform_check "mypy" "mypy pyatlan tests" "mypy pyatlan tests" + perform_check "mypy 🐍" "mypy pyatlan tests" "mypy pyatlan tests" } ruff-formatter-check diff --git a/setup.py b/setup.py index 8b1397616..286edfc44 100644 --- a/setup.py +++ b/setup.py @@ -34,9 +34,7 @@ def read(file_name): """Read a text file and return the content as a string.""" - with io.open( - os.path.join(os.path.dirname(__file__), file_name), encoding="utf-8" - ) as f: + with io.open(os.path.join(os.path.dirname(__file__), file_name), encoding="utf-8") as f: return f.read() diff --git a/tests/integration/adls_asset_test.py b/tests/integration/adls_asset_test.py index 1644946f1..c62920319 100644 --- a/tests/integration/adls_asset_test.py +++ b/tests/integration/adls_asset_test.py @@ -33,21 +33,15 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def adls_account( - client: AtlanClient, connection: Connection -) -> Generator[ADLSAccount, None, None]: +def adls_account(client: AtlanClient, connection: Connection) -> Generator[ADLSAccount, None, None]: assert connection.qualified_name - to_create = ADLSAccount.create( - name=ADLS_ACCOUNT_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = ADLSAccount.create(name=ADLS_ACCOUNT_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=ADLSAccount)[0] yield result @@ -68,13 +62,9 @@ def test_adls_account( @pytest.fixture(scope="module") -def adls_container( - client: AtlanClient, adls_account: ADLSAccount -) -> Generator[ADLSContainer, None, None]: +def adls_container(client: AtlanClient, adls_account: ADLSAccount) -> Generator[ADLSContainer, None, None]: assert adls_account.qualified_name - to_create = ADLSContainer.create( - name=CONTAINER_NAME, adls_account_qualified_name=adls_account.qualified_name - ) + to_create = ADLSContainer.create(name=CONTAINER_NAME, adls_account_qualified_name=adls_account.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=ADLSContainer)[0] yield result @@ -120,19 +110,14 @@ def test_overload_adls_container( assert adls_container_overload assert adls_container_overload.guid assert adls_container_overload.qualified_name - assert ( - adls_container_overload.adls_account_qualified_name - == adls_account.qualified_name - ) + assert adls_container_overload.adls_account_qualified_name == adls_account.qualified_name assert adls_container_overload.adls_account_name == adls_account.name assert adls_container_overload.name == CONTAINER_NAME_OVERLOAD assert adls_container_overload.connector_name == AtlanConnectorType.ADLS.value @pytest.fixture(scope="module") -def adls_object( - client: AtlanClient, adls_container: ADLSContainer -) -> Generator[ADLSObject, None, None]: +def adls_object(client: AtlanClient, adls_container: ADLSContainer) -> Generator[ADLSObject, None, None]: assert adls_container.qualified_name to_create = ADLSObject.create( name=OBJECT_NAME, @@ -177,17 +162,13 @@ def test_overload_adls_object( assert adls_object_overload assert adls_object_overload.guid assert adls_object_overload.qualified_name - assert ( - adls_object_overload.adls_container_qualified_name - == adls_container_overload.qualified_name - ) + assert adls_object_overload.adls_container_qualified_name == adls_container_overload.qualified_name assert adls_object_overload.adls_container_name == adls_container_overload.name assert adls_object_overload.name == OBJECT_NAME_OVERLOAD assert adls_object_overload.connector_name == AtlanConnectorType.ADLS.value assert adls_container_overload.qualified_name - assert ( - adls_object_overload.adls_account_qualified_name - == get_parent_qualified_name(adls_container_overload.qualified_name) + assert adls_object_overload.adls_account_qualified_name == get_parent_qualified_name( + adls_container_overload.qualified_name ) assert adls_object_overload.adls_account_name == adls_account.name @@ -206,9 +187,7 @@ def test_adls_object( assert adls_object.name == OBJECT_NAME assert adls_object.connector_name == AtlanConnectorType.ADLS.value assert adls_container.qualified_name - assert adls_object.adls_account_qualified_name == get_parent_qualified_name( - adls_container.qualified_name - ) + assert adls_object.adls_account_qualified_name == get_parent_qualified_name(adls_container.qualified_name) assert adls_object.adls_account_name == adls_account.name @@ -254,9 +233,7 @@ def test_retrieve_adls_object( adls_container: ADLSContainer, adls_object: ADLSObject, ): - b = client.asset.get_by_guid( - adls_object.guid, asset_type=ADLSObject, ignore_relationships=False - ) + b = client.asset.get_by_guid(adls_object.guid, asset_type=ADLSObject, ignore_relationships=False) assert b assert not b.is_incomplete assert b.guid == adls_object.guid @@ -326,9 +303,7 @@ def test_read_deleted_adls_object( adls_container: ADLSContainer, adls_object: ADLSObject, ): - deleted = client.asset.get_by_guid( - adls_object.guid, asset_type=ADLSObject, ignore_relationships=False - ) + deleted = client.asset.get_by_guid(adls_object.guid, asset_type=ADLSObject, ignore_relationships=False) assert deleted assert deleted.guid == adls_object.guid assert deleted.qualified_name == adls_object.qualified_name @@ -343,9 +318,7 @@ def test_restore_object( adls_object: ADLSObject, ): assert adls_object.qualified_name - assert client.asset.restore( - asset_type=ADLSObject, qualified_name=adls_object.qualified_name - ) + assert client.asset.restore(asset_type=ADLSObject, qualified_name=adls_object.qualified_name) assert adls_object.qualified_name restored = client.asset.get_by_qualified_name( asset_type=ADLSObject, diff --git a/tests/integration/admin_test.py b/tests/integration/admin_test.py index 8f83e6eed..c93f106b8 100644 --- a/tests/integration/admin_test.py +++ b/tests/integration/admin_test.py @@ -260,11 +260,7 @@ def test_final_user_state( assert fixed_user assert fixed_user.id response = client.user.get_groups(fixed_user.id) - assert ( - response.records is None - or len(response.records) == 0 - or len(response.records) == _default_group_count - ) + assert response.records is None or len(response.records) == 0 or len(response.records) == _default_group_count @pytest.mark.order(after="test_final_user_state") diff --git a/tests/integration/airflow_asset_test.py b/tests/integration/airflow_asset_test.py index 7dae854cf..35f82c397 100644 --- a/tests/integration/airflow_asset_test.py +++ b/tests/integration/airflow_asset_test.py @@ -31,21 +31,15 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.AIRFLOW - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.AIRFLOW) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def airflow_dag( - client: AtlanClient, connection: Connection -) -> Generator[AirflowDag, None, None]: +def airflow_dag(client: AtlanClient, connection: Connection) -> Generator[AirflowDag, None, None]: assert connection.qualified_name - to_create = AirflowDag.creator( - name=AIRFLOW_DAG_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = AirflowDag.creator(name=AIRFLOW_DAG_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=AirflowDag)[0] yield result @@ -66,13 +60,9 @@ def test_airflow_dag( @pytest.fixture(scope="module") -def airflow_task( - client: AtlanClient, airflow_dag: AirflowDag -) -> Generator[AirflowTask, None, None]: +def airflow_task(client: AtlanClient, airflow_dag: AirflowDag) -> Generator[AirflowTask, None, None]: assert airflow_dag.qualified_name - to_create = AirflowTask.creator( - name=AIRFLOW_TASK_NAME, airflow_dag_qualified_name=airflow_dag.qualified_name - ) + to_create = AirflowTask.creator(name=AIRFLOW_TASK_NAME, airflow_dag_qualified_name=airflow_dag.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=AirflowTask)[0] yield result @@ -119,9 +109,7 @@ def test_overload_airflow_task( assert airflow_task_overload.qualified_name assert airflow_task_overload.name == AIRFLOW_TASK_NAME_OVERLOAD assert airflow_task_overload.connector_name == AtlanConnectorType.AIRFLOW - assert ( - airflow_task_overload.airflow_dag_qualified_name == airflow_dag.qualified_name - ) + assert airflow_task_overload.airflow_dag_qualified_name == airflow_dag.qualified_name def _update_cert_and_annoucement(client, asset, asset_type): @@ -165,9 +153,7 @@ def test_update_airflow_assets( def _retrieve_airflow_assets(client, asset, asset_type): - retrieved = client.asset.get_by_guid( - asset.guid, asset_type=asset_type, ignore_relationships=False - ) + retrieved = client.asset.get_by_guid(asset.guid, asset_type=asset_type, ignore_relationships=False) assert retrieved assert not retrieved.is_incomplete assert retrieved.guid == asset.guid @@ -212,9 +198,7 @@ def test_read_deleted_airflow_task( client: AtlanClient, airflow_task: AirflowTask, ): - deleted = client.asset.get_by_guid( - airflow_task.guid, asset_type=AirflowTask, ignore_relationships=False - ) + deleted = client.asset.get_by_guid(airflow_task.guid, asset_type=AirflowTask, ignore_relationships=False) assert deleted assert deleted.status == EntityStatus.DELETED assert deleted.guid == airflow_task.guid @@ -227,9 +211,7 @@ def test_restore_airflow_task( airflow_task: AirflowTask, ): assert airflow_task.qualified_name - assert client.asset.restore( - asset_type=AirflowTask, qualified_name=airflow_task.qualified_name - ) + assert client.asset.restore(asset_type=AirflowTask, qualified_name=airflow_task.qualified_name) assert airflow_task.qualified_name restored = client.asset.get_by_qualified_name( asset_type=AirflowTask, diff --git a/tests/integration/anaplan_asset_test.py b/tests/integration/anaplan_asset_test.py index ff4689626..0cd357ba4 100644 --- a/tests/integration/anaplan_asset_test.py +++ b/tests/integration/anaplan_asset_test.py @@ -56,17 +56,13 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def anaplan_workspace( - client: AtlanClient, connection: Connection -) -> Generator[AnaplanWorkspace, None, None]: +def anaplan_workspace(client: AtlanClient, connection: Connection) -> Generator[AnaplanWorkspace, None, None]: assert connection.qualified_name to_create = AnaplanWorkspace.creator( name=ANAPLAN_WORKSPACE_NAME, connection_qualified_name=connection.qualified_name @@ -77,9 +73,7 @@ def anaplan_workspace( delete_asset(client, guid=result.guid, asset_type=AnaplanWorkspace) -def test_anaplan_workspace( - client: AtlanClient, connection: Connection, anaplan_workspace: AnaplanWorkspace -): +def test_anaplan_workspace(client: AtlanClient, connection: Connection, anaplan_workspace: AnaplanWorkspace): assert anaplan_workspace assert anaplan_workspace.guid assert anaplan_workspace.qualified_name @@ -112,29 +106,21 @@ def test_anaplan_system_dimension( assert anaplan_system_dimension.guid assert anaplan_system_dimension.qualified_name assert anaplan_system_dimension.name == ANAPLAN_SYSTEM_DIMENSION_NAME - assert ( - anaplan_system_dimension.connection_qualified_name == connection.qualified_name - ) + assert anaplan_system_dimension.connection_qualified_name == connection.qualified_name assert anaplan_system_dimension.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_app( - client: AtlanClient, connection: Connection -) -> Generator[AnaplanApp, None, None]: +def anaplan_app(client: AtlanClient, connection: Connection) -> Generator[AnaplanApp, None, None]: assert connection.qualified_name - to_create = AnaplanApp.creator( - name=ANAPLAN_APP_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = AnaplanApp.creator(name=ANAPLAN_APP_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanApp)[0] yield result delete_asset(client, guid=result.guid, asset_type=AnaplanApp) -def test_anaplan_app( - client: AtlanClient, connection: Connection, anaplan_app: AnaplanApp -): +def test_anaplan_app(client: AtlanClient, connection: Connection, anaplan_app: AnaplanApp): assert anaplan_app assert anaplan_app.guid assert anaplan_app.qualified_name @@ -144,29 +130,21 @@ def test_anaplan_app( @pytest.fixture(scope="module") -def anaplan_page( - client: AtlanClient, anaplan_app: AnaplanApp -) -> Generator[AnaplanPage, None, None]: +def anaplan_page(client: AtlanClient, anaplan_app: AnaplanApp) -> Generator[AnaplanPage, None, None]: assert anaplan_app.qualified_name - to_create = AnaplanPage.creator( - name=ANAPLAN_PAGE_NAME, app_qualified_name=anaplan_app.qualified_name - ) + to_create = AnaplanPage.creator(name=ANAPLAN_PAGE_NAME, app_qualified_name=anaplan_app.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanPage)[0] yield result delete_asset(client, guid=result.guid, asset_type=AnaplanPage) -def test_anaplan_page( - client: AtlanClient, anaplan_app: AnaplanApp, anaplan_page: AnaplanPage -): +def test_anaplan_page(client: AtlanClient, anaplan_app: AnaplanApp, anaplan_page: AnaplanPage): assert anaplan_page assert anaplan_page.guid assert anaplan_page.qualified_name assert anaplan_page.name == ANAPLAN_PAGE_NAME - assert ( - anaplan_page.connection_qualified_name == anaplan_app.connection_qualified_name - ) + assert anaplan_page.connection_qualified_name == anaplan_app.connection_qualified_name assert anaplan_page.connector_name == AtlanConnectorType.ANAPLAN.value @@ -187,24 +165,17 @@ def anaplan_page_overload( delete_asset(client, guid=result.guid, asset_type=AnaplanPage) -def test_overload_anaplan_page( - client: AtlanClient, anaplan_app: AnaplanApp, anaplan_page_overload: AnaplanPage -): +def test_overload_anaplan_page(client: AtlanClient, anaplan_app: AnaplanApp, anaplan_page_overload: AnaplanPage): assert anaplan_page_overload assert anaplan_page_overload.guid assert anaplan_page_overload.qualified_name assert anaplan_page_overload.name == ANAPLAN_PAGE_NAME_OVERLOAD - assert ( - anaplan_page_overload.connection_qualified_name - == anaplan_app.connection_qualified_name - ) + assert anaplan_page_overload.connection_qualified_name == anaplan_app.connection_qualified_name assert anaplan_page_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_model( - client: AtlanClient, anaplan_workspace: AnaplanWorkspace -) -> Generator[AnaplanModel, None, None]: +def anaplan_model(client: AtlanClient, anaplan_workspace: AnaplanWorkspace) -> Generator[AnaplanModel, None, None]: assert anaplan_workspace.qualified_name to_create = AnaplanModel.creator( name=ANAPLAN_MODEL_NAME, @@ -225,10 +196,7 @@ def test_anaplan_model( assert anaplan_model.guid assert anaplan_model.qualified_name assert anaplan_model.name == ANAPLAN_MODEL_NAME - assert ( - anaplan_model.connection_qualified_name - == anaplan_workspace.connection_qualified_name - ) + assert anaplan_model.connection_qualified_name == anaplan_workspace.connection_qualified_name assert anaplan_model.connector_name == AtlanConnectorType.ANAPLAN.value @@ -258,38 +226,26 @@ def test_overload_anaplan_model( assert anaplan_model_overload.guid assert anaplan_model_overload.qualified_name assert anaplan_model_overload.name == ANAPLAN_MODEL_NAME_OVERLOAD - assert ( - anaplan_model_overload.connection_qualified_name - == anaplan_workspace.connection_qualified_name - ) + assert anaplan_model_overload.connection_qualified_name == anaplan_workspace.connection_qualified_name assert anaplan_model_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_module( - client: AtlanClient, anaplan_model: AnaplanModel -) -> Generator[AnaplanModule, None, None]: +def anaplan_module(client: AtlanClient, anaplan_model: AnaplanModel) -> Generator[AnaplanModule, None, None]: assert anaplan_model.qualified_name - to_create = AnaplanModule.creator( - name=ANAPLAN_MODULE_NAME, model_qualified_name=anaplan_model.qualified_name - ) + to_create = AnaplanModule.creator(name=ANAPLAN_MODULE_NAME, model_qualified_name=anaplan_model.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanModule)[0] yield result delete_asset(client, guid=result.guid, asset_type=AnaplanModule) -def test_anaplan_module( - client: AtlanClient, anaplan_model: AnaplanModel, anaplan_module: AnaplanModule -): +def test_anaplan_module(client: AtlanClient, anaplan_model: AnaplanModel, anaplan_module: AnaplanModule): assert anaplan_module assert anaplan_module.guid assert anaplan_module.qualified_name assert anaplan_module.name == ANAPLAN_MODULE_NAME - assert ( - anaplan_module.connection_qualified_name - == anaplan_model.connection_qualified_name - ) + assert anaplan_module.connection_qualified_name == anaplan_model.connection_qualified_name assert anaplan_module.connector_name == AtlanConnectorType.ANAPLAN.value @@ -319,38 +275,26 @@ def test_overload_anaplan_module( assert anaplan_module_overload.guid assert anaplan_module_overload.qualified_name assert anaplan_module_overload.name == ANAPLAN_MODULE_NAME_OVERLOAD - assert ( - anaplan_module_overload.connection_qualified_name - == anaplan_model.connection_qualified_name - ) + assert anaplan_module_overload.connection_qualified_name == anaplan_model.connection_qualified_name assert anaplan_module_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_list( - client: AtlanClient, anaplan_model: AnaplanModel -) -> Generator[AnaplanList, None, None]: +def anaplan_list(client: AtlanClient, anaplan_model: AnaplanModel) -> Generator[AnaplanList, None, None]: assert anaplan_model.qualified_name - to_create = AnaplanList.creator( - name=ANAPLAN_LIST_NAME, model_qualified_name=anaplan_model.qualified_name - ) + to_create = AnaplanList.creator(name=ANAPLAN_LIST_NAME, model_qualified_name=anaplan_model.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanList)[0] yield result delete_asset(client, guid=result.guid, asset_type=AnaplanList) -def test_anaplan_list( - client: AtlanClient, anaplan_model: AnaplanModel, anaplan_list: AnaplanList -): +def test_anaplan_list(client: AtlanClient, anaplan_model: AnaplanModel, anaplan_list: AnaplanList): assert anaplan_list assert anaplan_list.guid assert anaplan_list.qualified_name assert anaplan_list.name == ANAPLAN_LIST_NAME - assert ( - anaplan_list.connection_qualified_name - == anaplan_model.connection_qualified_name - ) + assert anaplan_list.connection_qualified_name == anaplan_model.connection_qualified_name assert anaplan_list.connector_name == AtlanConnectorType.ANAPLAN.value @@ -371,28 +315,19 @@ def anaplan_list_overload( delete_asset(client, guid=result.guid, asset_type=AnaplanList) -def test_overload_anaplan_list( - client: AtlanClient, anaplan_model: AnaplanModel, anaplan_list_overload: AnaplanList -): +def test_overload_anaplan_list(client: AtlanClient, anaplan_model: AnaplanModel, anaplan_list_overload: AnaplanList): assert anaplan_list_overload assert anaplan_list_overload.guid assert anaplan_list_overload.qualified_name assert anaplan_list_overload.name == ANAPLAN_LIST_NAME_OVERLOAD - assert ( - anaplan_list_overload.connection_qualified_name - == anaplan_model.connection_qualified_name - ) + assert anaplan_list_overload.connection_qualified_name == anaplan_model.connection_qualified_name assert anaplan_list_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_dimension( - client: AtlanClient, anaplan_model: AnaplanModel -) -> Generator[AnaplanDimension, None, None]: +def anaplan_dimension(client: AtlanClient, anaplan_model: AnaplanModel) -> Generator[AnaplanDimension, None, None]: assert anaplan_model.qualified_name - to_create = AnaplanDimension.creator( - name=ANAPLAN_DIMENSION_NAME, model_qualified_name=anaplan_model.qualified_name - ) + to_create = AnaplanDimension.creator(name=ANAPLAN_DIMENSION_NAME, model_qualified_name=anaplan_model.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanDimension)[0] yield result @@ -408,10 +343,7 @@ def test_anaplan_dimension( assert anaplan_dimension.guid assert anaplan_dimension.qualified_name assert anaplan_dimension.name == ANAPLAN_DIMENSION_NAME - assert ( - anaplan_dimension.connection_qualified_name - == anaplan_model.connection_qualified_name - ) + assert anaplan_dimension.connection_qualified_name == anaplan_model.connection_qualified_name assert anaplan_dimension.connector_name == AtlanConnectorType.ANAPLAN.value @@ -441,21 +373,14 @@ def test_overload_anaplan_dimension( assert anaplan_dimension_overload.guid assert anaplan_dimension_overload.qualified_name assert anaplan_dimension_overload.name == ANAPLAN_DIMENSION_NAME_OVERLOAD - assert ( - anaplan_dimension_overload.connection_qualified_name - == anaplan_model.connection_qualified_name - ) + assert anaplan_dimension_overload.connection_qualified_name == anaplan_model.connection_qualified_name assert anaplan_dimension_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_lineitem( - client: AtlanClient, anaplan_module: AnaplanModule -) -> Generator[AnaplanLineItem, None, None]: +def anaplan_lineitem(client: AtlanClient, anaplan_module: AnaplanModule) -> Generator[AnaplanLineItem, None, None]: assert anaplan_module.qualified_name - to_create = AnaplanLineItem.creator( - name=ANAPLAN_LINEITEM_NAME, module_qualified_name=anaplan_module.qualified_name - ) + to_create = AnaplanLineItem.creator(name=ANAPLAN_LINEITEM_NAME, module_qualified_name=anaplan_module.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanLineItem)[0] yield result @@ -471,10 +396,7 @@ def test_anaplan_lineitem( assert anaplan_lineitem.guid assert anaplan_lineitem.qualified_name assert anaplan_lineitem.name == ANAPLAN_LINEITEM_NAME - assert ( - anaplan_lineitem.connection_qualified_name - == anaplan_module.connection_qualified_name - ) + assert anaplan_lineitem.connection_qualified_name == anaplan_module.connection_qualified_name assert anaplan_lineitem.connector_name == AtlanConnectorType.ANAPLAN.value @@ -504,38 +426,26 @@ def test_overload_anaplan_lineitem( assert anaplan_lineitem_overload.guid assert anaplan_lineitem_overload.qualified_name assert anaplan_lineitem_overload.name == ANAPLAN_LINEITEM_NAME_OVERLOAD - assert ( - anaplan_lineitem_overload.connection_qualified_name - == anaplan_module.connection_qualified_name - ) + assert anaplan_lineitem_overload.connection_qualified_name == anaplan_module.connection_qualified_name assert anaplan_lineitem_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_view( - client: AtlanClient, anaplan_module: AnaplanModule -) -> Generator[AnaplanView, None, None]: +def anaplan_view(client: AtlanClient, anaplan_module: AnaplanModule) -> Generator[AnaplanView, None, None]: assert anaplan_module.qualified_name - to_create = AnaplanView.creator( - name=ANAPLAN_VIEW_NAME, module_qualified_name=anaplan_module.qualified_name - ) + to_create = AnaplanView.creator(name=ANAPLAN_VIEW_NAME, module_qualified_name=anaplan_module.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanView)[0] yield result delete_asset(client, guid=result.guid, asset_type=AnaplanView) -def test_anaplan_view( - client: AtlanClient, anaplan_module: AnaplanModule, anaplan_view: AnaplanView -): +def test_anaplan_view(client: AtlanClient, anaplan_module: AnaplanModule, anaplan_view: AnaplanView): assert anaplan_view assert anaplan_view.guid assert anaplan_view.qualified_name assert anaplan_view.name == ANAPLAN_VIEW_NAME - assert ( - anaplan_view.connection_qualified_name - == anaplan_module.connection_qualified_name - ) + assert anaplan_view.connection_qualified_name == anaplan_module.connection_qualified_name assert anaplan_view.connector_name == AtlanConnectorType.ANAPLAN.value @@ -565,10 +475,7 @@ def test_overload_anaplan_view( assert anaplan_view_overload.guid assert anaplan_view_overload.qualified_name assert anaplan_view_overload.name == ANAPLAN_VIEW_NAME_OVERLOAD - assert ( - anaplan_view_overload.connection_qualified_name - == anaplan_module.connection_qualified_name - ) + assert anaplan_view_overload.connection_qualified_name == anaplan_module.connection_qualified_name assert anaplan_view_overload.connector_name == AtlanConnectorType.ANAPLAN.value @@ -701,13 +608,9 @@ def test_restore_anaplan_view( anaplan_view: AnaplanView, ): assert anaplan_view.qualified_name - assert client.asset.restore( - asset_type=AnaplanView, qualified_name=anaplan_view.qualified_name - ) + assert client.asset.restore(asset_type=AnaplanView, qualified_name=anaplan_view.qualified_name) assert anaplan_view.qualified_name - restored = client.asset.get_by_qualified_name( - asset_type=AnaplanView, qualified_name=anaplan_view.qualified_name - ) + restored = client.asset.get_by_qualified_name(asset_type=AnaplanView, qualified_name=anaplan_view.qualified_name) assert restored assert restored.guid == anaplan_view.guid assert restored.qualified_name == anaplan_view.qualified_name diff --git a/tests/integration/api_asset_test.py b/tests/integration/api_asset_test.py index b5471c5f4..cd449d4a6 100644 --- a/tests/integration/api_asset_test.py +++ b/tests/integration/api_asset_test.py @@ -60,21 +60,15 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def api_spec( - client: AtlanClient, connection: Connection -) -> Generator[APISpec, None, None]: +def api_spec(client: AtlanClient, connection: Connection) -> Generator[APISpec, None, None]: assert connection.qualified_name - to_create = APISpec.create( - name=API_SPEC_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = APISpec.create(name=API_SPEC_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=APISpec)[0] yield result @@ -115,9 +109,7 @@ def test_api_path(client: AtlanClient, api_spec: APISpec, api_path: APIPath): @pytest.fixture(scope="module") -def api_path_overload( - client: AtlanClient, api_spec: APISpec -) -> Generator[APIPath, None, None]: +def api_path_overload(client: AtlanClient, api_spec: APISpec) -> Generator[APIPath, None, None]: assert api_spec.qualified_name to_create = APIPath.creator( path_raw_uri=API_PATH_RAW_URI_OVERLOAD, @@ -129,26 +121,19 @@ def api_path_overload( delete_asset(client, guid=result.guid, asset_type=APIPath) -def test_overload_api_path( - client: AtlanClient, api_spec: APISpec, api_path_overload: APIPath -): +def test_overload_api_path(client: AtlanClient, api_spec: APISpec, api_path_overload: APIPath): assert api_path_overload assert api_path_overload.guid assert api_path_overload.qualified_name assert api_path_overload.api_spec_qualified_name assert api_path_overload.api_path_raw_u_r_i == API_PATH_RAW_URI_OVERLOAD assert api_path_overload.name == API_PATH_NAME_OVERLOAD - assert ( - api_path_overload.connection_qualified_name - == api_spec.connection_qualified_name - ) + assert api_path_overload.connection_qualified_name == api_spec.connection_qualified_name assert api_path_overload.connector_name == AtlanConnectorType.API.value # here -def test_update_api_path( - client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath -): +def test_update_api_path(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): assert api_path.qualified_name assert api_path.name updated = client.asset.update_certificate( @@ -179,12 +164,8 @@ def test_update_api_path( @pytest.mark.order(after="test_update_api_path") -def test_retrieve_api_path( - client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath -): - b = client.asset.get_by_guid( - api_path.guid, asset_type=APIPath, ignore_relationships=False - ) +def test_retrieve_api_path(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): + b = client.asset.get_by_guid(api_path.guid, asset_type=APIPath, ignore_relationships=False) assert b assert not b.is_incomplete assert b.guid == api_path.guid @@ -198,9 +179,7 @@ def test_retrieve_api_path( @pytest.mark.order(after="test_retrieve_api_path") -def test_update_api_path_again( - client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath -): +def test_update_api_path_again(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): assert api_path.qualified_name assert api_path.name updated = client.asset.remove_certificate( @@ -227,9 +206,7 @@ def test_update_api_path_again( @pytest.mark.order(after="test_update_api_path_again") -def test_delete_api_path( - client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath -): +def test_delete_api_path(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): response = client.asset.delete_by_guid(api_path.guid) assert response assert not response.assets_created(asset_type=APIPath) @@ -244,12 +221,8 @@ def test_delete_api_path( @pytest.mark.order(after="test_delete_api_path") -def test_read_deleted_api_path( - client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath -): - deleted = client.asset.get_by_guid( - api_path.guid, asset_type=APIPath, ignore_relationships=False - ) +def test_read_deleted_api_path(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): + deleted = client.asset.get_by_guid(api_path.guid, asset_type=APIPath, ignore_relationships=False) assert deleted assert deleted.guid == api_path.guid assert deleted.qualified_name == api_path.qualified_name @@ -257,13 +230,9 @@ def test_read_deleted_api_path( @pytest.mark.order(after="test_read_deleted_api_path") -def test_restore_path( - client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath -): +def test_restore_path(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): assert api_path.qualified_name - assert client.asset.restore( - asset_type=APIPath, qualified_name=api_path.qualified_name - ) + assert client.asset.restore(asset_type=APIPath, qualified_name=api_path.qualified_name) assert api_path.qualified_name restored = client.asset.get_by_qualified_name( asset_type=APIPath, @@ -277,13 +246,9 @@ def test_restore_path( @pytest.fixture(scope="module") -def api_object( - client: AtlanClient, connection: Connection -) -> Generator[APIObject, None, None]: +def api_object(client: AtlanClient, connection: Connection) -> Generator[APIObject, None, None]: assert connection.qualified_name - to_create = APIObject.creator( - name=API_OBJECT_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = APIObject.creator(name=API_OBJECT_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=APIObject)[0] yield result @@ -300,9 +265,7 @@ def test_api_object(client: AtlanClient, connection: Connection, api_object: API @pytest.fixture(scope="module") -def api_object_overload( - client: AtlanClient, connection: Connection -) -> Generator[APIObject, None, None]: +def api_object_overload(client: AtlanClient, connection: Connection) -> Generator[APIObject, None, None]: assert connection.qualified_name to_create = APIObject.creator( name=API_OBJECT_OVERLOAD_NAME, @@ -315,24 +278,17 @@ def api_object_overload( delete_asset(client, guid=result.guid, asset_type=APIObject) -def test_api_object_overload( - client: AtlanClient, connection: Connection, api_object_overload: APIObject -): +def test_api_object_overload(client: AtlanClient, connection: Connection, api_object_overload: APIObject): assert api_object_overload assert api_object_overload.guid - assert ( - api_object_overload.qualified_name - == f"{connection.qualified_name}/{API_OBJECT_OVERLOAD_NAME}" - ) + assert api_object_overload.qualified_name == f"{connection.qualified_name}/{API_OBJECT_OVERLOAD_NAME}" assert api_object_overload.name == API_OBJECT_OVERLOAD_NAME assert api_object_overload.connection_qualified_name == connection.qualified_name assert api_object_overload.api_field_count == API_OBJECT_FIELD_COUNT assert api_object_overload.connector_name == AtlanConnectorType.API.value -def test_update_api_object( - client: AtlanClient, connection: Connection, api_object_overload: APIObject -): +def test_update_api_object(client: AtlanClient, connection: Connection, api_object_overload: APIObject): assert api_object_overload.qualified_name assert api_object_overload.name updated = client.asset.update_certificate( @@ -363,12 +319,8 @@ def test_update_api_object( @pytest.mark.order(after="test_update_api_object") -def test_retrieve_api_object( - client: AtlanClient, connection: Connection, api_object_overload: APIObject -): - b = client.asset.get_by_guid( - api_object_overload.guid, asset_type=APIObject, ignore_relationships=False - ) +def test_retrieve_api_object(client: AtlanClient, connection: Connection, api_object_overload: APIObject): + b = client.asset.get_by_guid(api_object_overload.guid, asset_type=APIObject, ignore_relationships=False) assert b assert not b.is_incomplete assert b.guid == api_object_overload.guid @@ -381,9 +333,7 @@ def test_retrieve_api_object( @pytest.mark.order(after="test_retrieve_api_object") -def test_delete_api_object( - client: AtlanClient, connection: Connection, api_object_overload: APIObject -): +def test_delete_api_object(client: AtlanClient, connection: Connection, api_object_overload: APIObject): response = client.asset.delete_by_guid(api_object_overload.guid) assert response assert not response.assets_created(asset_type=APIObject) @@ -398,12 +348,8 @@ def test_delete_api_object( @pytest.mark.order(after="test_delete_api_object") -def test_read_deleted_api_object( - client: AtlanClient, connection: Connection, api_object_overload: APIObject -): - deleted = client.asset.get_by_guid( - api_object_overload.guid, asset_type=APIObject, ignore_relationships=False - ) +def test_read_deleted_api_object(client: AtlanClient, connection: Connection, api_object_overload: APIObject): + deleted = client.asset.get_by_guid(api_object_overload.guid, asset_type=APIObject, ignore_relationships=False) assert deleted assert deleted.guid == api_object_overload.guid assert deleted.qualified_name == api_object_overload.qualified_name @@ -411,13 +357,9 @@ def test_read_deleted_api_object( @pytest.mark.order(after="test_read_deleted_api_object") -def test_restore_object( - client: AtlanClient, connection: Connection, api_object_overload: APIObject -): +def test_restore_object(client: AtlanClient, connection: Connection, api_object_overload: APIObject): assert api_object_overload.qualified_name - assert client.asset.restore( - asset_type=APIObject, qualified_name=api_object_overload.qualified_name - ) + assert client.asset.restore(asset_type=APIObject, qualified_name=api_object_overload.qualified_name) assert api_object_overload.qualified_name restored = client.asset.get_by_qualified_name( asset_type=APIObject, @@ -431,13 +373,9 @@ def test_restore_object( @pytest.fixture(scope="module") -def api_query( - client: AtlanClient, connection: Connection -) -> Generator[APIQuery, None, None]: +def api_query(client: AtlanClient, connection: Connection) -> Generator[APIQuery, None, None]: assert connection.qualified_name - to_create = APIQuery.creator( - name=API_QUERY_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = APIQuery.creator(name=API_QUERY_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=APIQuery)[0] yield result @@ -454,9 +392,7 @@ def test_api_query(client: AtlanClient, connection: Connection, api_query: APIQu @pytest.fixture(scope="module") -def api_query_overload_1( - client: AtlanClient, connection: Connection -) -> Generator[APIQuery, None, None]: +def api_query_overload_1(client: AtlanClient, connection: Connection) -> Generator[APIQuery, None, None]: assert connection.qualified_name to_create = APIQuery.creator( name=API_QUERY_OVERLOAD_1_NAME, @@ -469,15 +405,10 @@ def api_query_overload_1( delete_asset(client, guid=result.guid, asset_type=APIQuery) -def test_api_query_overload_1( - client: AtlanClient, connection: Connection, api_query_overload_1: APIQuery -): +def test_api_query_overload_1(client: AtlanClient, connection: Connection, api_query_overload_1: APIQuery): assert api_query_overload_1 assert api_query_overload_1.guid - assert ( - api_query_overload_1.qualified_name - == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_1_NAME}" - ) + assert api_query_overload_1.qualified_name == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_1_NAME}" assert api_query_overload_1.name == API_QUERY_OVERLOAD_1_NAME assert api_query_overload_1.connection_qualified_name == connection.qualified_name assert api_query_overload_1.api_input_field_count == API_QUERY_INPUT_FIELD_COUNT @@ -485,9 +416,7 @@ def test_api_query_overload_1( @pytest.fixture(scope="module") -def api_query_overload_2( - client: AtlanClient, connection: Connection -) -> Generator[APIQuery, None, None]: +def api_query_overload_2(client: AtlanClient, connection: Connection) -> Generator[APIQuery, None, None]: assert connection.qualified_name to_create = APIQuery.creator( name=API_QUERY_OVERLOAD_2_NAME, @@ -502,23 +431,15 @@ def api_query_overload_2( delete_asset(client, guid=result.guid, asset_type=APIQuery) -def test_api_query_overload_2( - client: AtlanClient, connection: Connection, api_query_overload_2: APIQuery -): +def test_api_query_overload_2(client: AtlanClient, connection: Connection, api_query_overload_2: APIQuery): assert api_query_overload_2 assert api_query_overload_2.guid - assert ( - api_query_overload_2.qualified_name - == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_2_NAME}" - ) + assert api_query_overload_2.qualified_name == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_2_NAME}" assert api_query_overload_2.name == API_QUERY_OVERLOAD_2_NAME assert api_query_overload_2.connection_qualified_name == connection.qualified_name assert api_query_overload_2.api_input_field_count == API_QUERY_INPUT_FIELD_COUNT assert api_query_overload_2.api_query_output_type == API_QUERY_OUTPUT_TYPE - assert ( - api_query_overload_2.api_query_output_type_secondary - == API_QUERY_OUTPUT_TYPE_SECONDARY - ) + assert api_query_overload_2.api_query_output_type_secondary == API_QUERY_OUTPUT_TYPE_SECONDARY assert api_query_overload_2.connector_name == AtlanConnectorType.API.value @@ -551,26 +472,18 @@ def test_api_query_overload_3( ): assert api_query_overload_3 assert api_query_overload_3.guid - assert ( - api_query_overload_3.qualified_name - == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_3_NAME}" - ) + assert api_query_overload_3.qualified_name == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_3_NAME}" assert api_query_overload_3.name == API_QUERY_OVERLOAD_3_NAME assert api_query_overload_3.connection_qualified_name == connection.qualified_name assert api_query_overload_3.api_input_field_count == API_QUERY_INPUT_FIELD_COUNT assert api_query_overload_3.api_query_output_type == API_QUERY_OUTPUT_TYPE - assert ( - api_query_overload_3.api_query_output_type_secondary - == API_QUERY_OUTPUT_TYPE_SECONDARY - ) + assert api_query_overload_3.api_query_output_type_secondary == API_QUERY_OUTPUT_TYPE_SECONDARY assert api_query_overload_3.api_is_object_reference == API_QUERY_IS_OBJECT_REFERENCE assert api_query_overload_3.api_object_qualified_name == api_object.qualified_name assert api_query_overload_3.connector_name == AtlanConnectorType.API.value -def test_update_api_query( - client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery -): +def test_update_api_query(client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery): assert api_query_overload_3.qualified_name assert api_query_overload_3.name updated = client.asset.update_certificate( @@ -601,12 +514,8 @@ def test_update_api_query( @pytest.mark.order(after="test_update_api_query") -def test_retrieve_api_query( - client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery -): - b = client.asset.get_by_guid( - api_query_overload_3.guid, asset_type=APIQuery, ignore_relationships=False - ) +def test_retrieve_api_query(client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery): + b = client.asset.get_by_guid(api_query_overload_3.guid, asset_type=APIQuery, ignore_relationships=False) assert b assert not b.is_incomplete assert b.guid == api_query_overload_3.guid @@ -619,9 +528,7 @@ def test_retrieve_api_query( @pytest.mark.order(after="test_retrieve_api_query") -def test_delete_api_query( - client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery -): +def test_delete_api_query(client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery): response = client.asset.delete_by_guid(api_query_overload_3.guid) assert response assert not response.assets_created(asset_type=APIQuery) @@ -636,12 +543,8 @@ def test_delete_api_query( @pytest.mark.order(after="test_delete_api_query") -def test_read_deleted_api_query( - client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery -): - deleted = client.asset.get_by_guid( - api_query_overload_3.guid, asset_type=APIQuery, ignore_relationships=False - ) +def test_read_deleted_api_query(client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery): + deleted = client.asset.get_by_guid(api_query_overload_3.guid, asset_type=APIQuery, ignore_relationships=False) assert deleted assert deleted.guid == api_query_overload_3.guid assert deleted.qualified_name == api_query_overload_3.qualified_name @@ -649,13 +552,9 @@ def test_read_deleted_api_query( @pytest.mark.order(after="test_read_deleted_api_query") -def test_restore_query( - client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery -): +def test_restore_query(client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery): assert api_query_overload_3.qualified_name - assert client.asset.restore( - asset_type=APIQuery, qualified_name=api_query_overload_3.qualified_name - ) + assert client.asset.restore(asset_type=APIQuery, qualified_name=api_query_overload_3.qualified_name) assert api_query_overload_3.qualified_name restored = client.asset.get_by_qualified_name( asset_type=APIQuery, @@ -692,14 +591,9 @@ def test_api_field_parent_object( ): assert api_field_parent_object assert api_field_parent_object.guid - assert ( - api_field_parent_object.qualified_name - == f"{api_object.qualified_name}/{API_FIELD_NAME}" - ) + assert api_field_parent_object.qualified_name == f"{api_object.qualified_name}/{API_FIELD_NAME}" assert api_field_parent_object.name == API_FIELD_NAME - assert ( - api_field_parent_object.connection_qualified_name == connection.qualified_name - ) + assert api_field_parent_object.connection_qualified_name == connection.qualified_name assert api_field_parent_object.connector_name == AtlanConnectorType.API.value @@ -729,18 +623,11 @@ def test_api_field_parent_object_overload_1( assert api_field_parent_object_overload_1 assert api_field_parent_object_overload_1.guid assert ( - api_field_parent_object_overload_1.qualified_name - == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_1_NAME}" + api_field_parent_object_overload_1.qualified_name == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_1_NAME}" ) assert api_field_parent_object_overload_1.name == API_FIELD_OVERLOAD_1_NAME - assert ( - api_field_parent_object_overload_1.connection_qualified_name - == connection.qualified_name - ) - assert ( - api_field_parent_object_overload_1.connector_name - == AtlanConnectorType.API.value - ) + assert api_field_parent_object_overload_1.connection_qualified_name == connection.qualified_name + assert api_field_parent_object_overload_1.connector_name == AtlanConnectorType.API.value @pytest.fixture(scope="module") @@ -769,22 +656,12 @@ def test_api_field_parent_object_overload_2( assert api_field_parent_object_overload_2 assert api_field_parent_object_overload_2.guid assert ( - api_field_parent_object_overload_2.qualified_name - == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_2_NAME}" + api_field_parent_object_overload_2.qualified_name == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_2_NAME}" ) assert api_field_parent_object_overload_2.name == API_FIELD_OVERLOAD_2_NAME - assert ( - api_field_parent_object_overload_2.connection_qualified_name - == connection.qualified_name - ) - assert ( - api_field_parent_object_overload_2.api_query_param_type - == APIQueryParamTypeEnum.INPUT.value - ) - assert ( - api_field_parent_object_overload_2.connector_name - == AtlanConnectorType.API.value - ) + assert api_field_parent_object_overload_2.connection_qualified_name == connection.qualified_name + assert api_field_parent_object_overload_2.api_query_param_type == APIQueryParamTypeEnum.INPUT.value + assert api_field_parent_object_overload_2.connector_name == AtlanConnectorType.API.value @pytest.fixture(scope="module") @@ -815,27 +692,14 @@ def test_api_field_parent_object_overload_3( assert api_field_parent_object_overload_3 assert api_field_parent_object_overload_3.guid assert ( - api_field_parent_object_overload_3.qualified_name - == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_3_NAME}" + api_field_parent_object_overload_3.qualified_name == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_3_NAME}" ) assert api_field_parent_object_overload_3.name == API_FIELD_OVERLOAD_3_NAME - assert ( - api_field_parent_object_overload_3.connection_qualified_name - == connection.qualified_name - ) + assert api_field_parent_object_overload_3.connection_qualified_name == connection.qualified_name assert api_field_parent_object_overload_3.api_field_type == API_FIELD_TYPE - assert ( - api_field_parent_object_overload_3.api_field_type_secondary - == API_FIELD_TYPE_SECONDARY - ) - assert ( - api_field_parent_object_overload_3.api_query_param_type - == APIQueryParamTypeEnum.INPUT.value - ) - assert ( - api_field_parent_object_overload_3.connector_name - == AtlanConnectorType.API.value - ) + assert api_field_parent_object_overload_3.api_field_type_secondary == API_FIELD_TYPE_SECONDARY + assert api_field_parent_object_overload_3.api_query_param_type == APIQueryParamTypeEnum.INPUT.value + assert api_field_parent_object_overload_3.connector_name == AtlanConnectorType.API.value @pytest.fixture(scope="module") @@ -869,35 +733,19 @@ def test_api_field_parent_object_overload_4( assert api_field_parent_object_overload_4 assert api_field_parent_object_overload_4.guid assert ( - api_field_parent_object_overload_4.qualified_name - == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_4_NAME}" + api_field_parent_object_overload_4.qualified_name == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_4_NAME}" ) assert api_field_parent_object_overload_4.name == API_FIELD_OVERLOAD_4_NAME - assert ( - api_field_parent_object_overload_4.connection_qualified_name - == connection.qualified_name - ) + assert api_field_parent_object_overload_4.connection_qualified_name == connection.qualified_name assert api_field_parent_object_overload_4.api_field_type == API_FIELD_TYPE - assert ( - api_field_parent_object_overload_4.api_field_type_secondary - == API_FIELD_TYPE_SECONDARY - ) - assert ( - api_field_parent_object_overload_4.api_is_object_reference - == API_FIELD_IS_OBJECT_REFERENCE - ) + assert api_field_parent_object_overload_4.api_field_type_secondary == API_FIELD_TYPE_SECONDARY + assert api_field_parent_object_overload_4.api_is_object_reference == API_FIELD_IS_OBJECT_REFERENCE assert ( api_field_parent_object_overload_4.api_object_qualified_name == f"{connection.qualified_name}/{API_FIELD_REFERENCE_OBJECT_NAME}" ) - assert ( - api_field_parent_object_overload_4.api_query_param_type - == APIQueryParamTypeEnum.INPUT.value - ) - assert ( - api_field_parent_object_overload_4.connector_name - == AtlanConnectorType.API.value - ) + assert api_field_parent_object_overload_4.api_query_param_type == APIQueryParamTypeEnum.INPUT.value + assert api_field_parent_object_overload_4.connector_name == AtlanConnectorType.API.value @pytest.fixture(scope="module") @@ -930,35 +778,18 @@ def test_api_field_parent_query_overload( ): assert api_field_parent_query_overload assert api_field_parent_query_overload.guid - assert ( - api_field_parent_query_overload.qualified_name - == f"{api_query.qualified_name}/{API_FIELD_PARENT_QUERY_NAME}" - ) + assert api_field_parent_query_overload.qualified_name == f"{api_query.qualified_name}/{API_FIELD_PARENT_QUERY_NAME}" assert api_field_parent_query_overload.name == API_FIELD_PARENT_QUERY_NAME - assert ( - api_field_parent_query_overload.connection_qualified_name - == connection.qualified_name - ) + assert api_field_parent_query_overload.connection_qualified_name == connection.qualified_name assert api_field_parent_query_overload.api_field_type == API_FIELD_TYPE - assert ( - api_field_parent_query_overload.api_field_type_secondary - == API_FIELD_TYPE_SECONDARY - ) - assert ( - api_field_parent_query_overload.api_is_object_reference - == API_FIELD_IS_OBJECT_REFERENCE - ) + assert api_field_parent_query_overload.api_field_type_secondary == API_FIELD_TYPE_SECONDARY + assert api_field_parent_query_overload.api_is_object_reference == API_FIELD_IS_OBJECT_REFERENCE assert ( api_field_parent_query_overload.api_object_qualified_name == f"{connection.qualified_name}/{API_FIELD_REFERENCE_OBJECT_NAME}" ) - assert ( - api_field_parent_query_overload.api_query_param_type - == APIQueryParamTypeEnum.INPUT.value - ) - assert ( - api_field_parent_query_overload.connector_name == AtlanConnectorType.API.value - ) + assert api_field_parent_query_overload.api_query_param_type == APIQueryParamTypeEnum.INPUT.value + assert api_field_parent_query_overload.connector_name == AtlanConnectorType.API.value def test_update_api_field( @@ -1012,10 +843,7 @@ def test_retrieve_api_field( assert b.qualified_name == api_field_parent_query_overload.qualified_name assert b.name == api_field_parent_query_overload.name assert b.connector_name == api_field_parent_query_overload.connector_name - assert ( - b.connection_qualified_name - == api_field_parent_query_overload.connection_qualified_name - ) + assert b.connection_qualified_name == api_field_parent_query_overload.connection_qualified_name assert b.certificate_status == CERTIFICATE_STATUS assert b.certificate_status_message == CERTIFICATE_MESSAGE diff --git a/tests/integration/app_asset_test.py b/tests/integration/app_asset_test.py index 1e722c6f4..b16446ec5 100644 --- a/tests/integration/app_asset_test.py +++ b/tests/integration/app_asset_test.py @@ -29,17 +29,13 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def application( - client: AtlanClient, connection: Connection -) -> Generator[Application, None, None]: +def application(client: AtlanClient, connection: Connection) -> Generator[Application, None, None]: assert connection.qualified_name to_create = Application.create( name=APPLICATION_NAME, @@ -105,9 +101,7 @@ def test_retrieve_application( connection: Connection, application: Application, ): - b = client.asset.get_by_guid( - application.guid, asset_type=Application, ignore_relationships=False - ) + b = client.asset.get_by_guid(application.guid, asset_type=Application, ignore_relationships=False) assert b assert not b.is_incomplete assert b.guid == application.guid @@ -175,9 +169,7 @@ def test_read_deleted_application( connection: Connection, application: Application, ): - deleted = client.asset.get_by_guid( - application.guid, asset_type=Application, ignore_relationships=False - ) + deleted = client.asset.get_by_guid(application.guid, asset_type=Application, ignore_relationships=False) assert deleted assert deleted.guid == application.guid assert deleted.qualified_name == application.qualified_name @@ -208,9 +200,7 @@ def test_restore_application( @pytest.fixture(scope="module") -def application_field( - client: AtlanClient, application: ApplicationField -) -> Generator[ApplicationField, None, None]: +def application_field(client: AtlanClient, application: ApplicationField) -> Generator[ApplicationField, None, None]: assert application.qualified_name to_create = ApplicationField.creator( name=APPLICATION_FIELD_NAME, @@ -222,22 +212,14 @@ def application_field( delete_asset(client, guid=result.guid, asset_type=ApplicationField) -def test_application_field( - client: AtlanClient, application: Application, application_field: ApplicationField -): +def test_application_field(client: AtlanClient, application: Application, application_field: ApplicationField): assert application_field assert application_field.guid assert application_field.qualified_name assert application_field.name == APPLICATION_FIELD_NAME - assert ( - application_field.connection_qualified_name - == application.connection_qualified_name - ) + assert application_field.connection_qualified_name == application.connection_qualified_name assert application_field.connector_name == AtlanConnectorType.APP.value - assert ( - application_field.application_parent_qualified_name - == application.qualified_name - ) + assert application_field.application_parent_qualified_name == application.qualified_name @pytest.fixture(scope="module") @@ -267,12 +249,6 @@ def test_overload_application_field( assert application_field_overload.guid assert application_field_overload.qualified_name assert application_field_overload.name == APPLICATION_FIELD_OVERLOAD_NAME - assert ( - application_field_overload.connection_qualified_name - == connection.qualified_name - ) + assert application_field_overload.connection_qualified_name == connection.qualified_name assert application_field_overload.connector_name == AtlanConnectorType.APP.value - assert ( - application_field_overload.application_parent_qualified_name - == application.qualified_name - ) + assert application_field_overload.application_parent_qualified_name == application.qualified_name diff --git a/tests/integration/azure_event_hub_asset_test.py b/tests/integration/azure_event_hub_asset_test.py index 152d62181..37ae80797 100644 --- a/tests/integration/azure_event_hub_asset_test.py +++ b/tests/integration/azure_event_hub_asset_test.py @@ -41,13 +41,9 @@ def connection(client: AtlanClient) -> Generator[Connection, None, None]: @pytest.fixture(scope="module") -def event_hub( - client: AtlanClient, connection: Connection -) -> Generator[AzureEventHub, None, None]: +def event_hub(client: AtlanClient, connection: Connection) -> Generator[AzureEventHub, None, None]: assert connection.qualified_name - to_create = AzureEventHub.creator( - name=EVENT_HUB_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = AzureEventHub.creator(name=EVENT_HUB_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=AzureEventHub)[0] yield result @@ -68,9 +64,7 @@ def test_event_hub( @pytest.fixture(scope="module") -def consumer_group( - client: AtlanClient, event_hub: AzureEventHub -) -> Generator[AzureEventHubConsumerGroup, None, None]: +def consumer_group(client: AtlanClient, event_hub: AzureEventHub) -> Generator[AzureEventHubConsumerGroup, None, None]: assert event_hub.qualified_name to_create = AzureEventHubConsumerGroup.creator( name=EVENT_HUB_CONSUMER_GROUP_NAME, @@ -140,9 +134,7 @@ def test_update_event_hub_assets( def _retrieve_event_hub_assets(client, asset, asset_type): - retrieved = client.asset.get_by_guid( - asset.guid, asset_type=asset_type, ignore_relationships=False - ) + retrieved = client.asset.get_by_guid(asset.guid, asset_type=asset_type, ignore_relationships=False) assert retrieved assert not retrieved.is_incomplete assert retrieved.guid == asset.guid diff --git a/tests/integration/connection_test.py b/tests/integration/connection_test.py index ea79e1e5e..61f7b5721 100644 --- a/tests/integration/connection_test.py +++ b/tests/integration/connection_test.py @@ -11,33 +11,23 @@ MODULE_NAME = TestId.make_unique("CONN") -def create_connection( - client: AtlanClient, name: str, connector_type: AtlanConnectorType -) -> Connection: +def create_connection(client: AtlanClient, name: str, connector_type: AtlanConnectorType) -> Connection: admin_role_guid = str(RoleCache.get_id_for_name("$admin")) - to_create = Connection.create( - name=name, connector_type=connector_type, admin_roles=[admin_role_guid] - ) + to_create = Connection.create(name=name, connector_type=connector_type, admin_roles=[admin_role_guid]) response = client.asset.save(to_create) result = response.assets_created(asset_type=Connection)[0] - return client.asset.get_by_guid( - result.guid, asset_type=Connection, ignore_relationships=False - ) + return client.asset.get_by_guid(result.guid, asset_type=Connection, ignore_relationships=False) def test_invalid_connection(client: AtlanClient): - with pytest.raises( - ValueError, match="One of admin_user, admin_groups or admin_roles is required" - ): + with pytest.raises(ValueError, match="One of admin_user, admin_groups or admin_roles is required"): Connection.create(name=MODULE_NAME, connector_type=AtlanConnectorType.POSTGRES) def test_invalid_connection_admin_role( client: AtlanClient, ): - with pytest.raises( - ValueError, match="Provided role ID abc123 was not found in Atlan." - ): + with pytest.raises(ValueError, match="Provided role ID abc123 was not found in Atlan."): Connection.create( name=MODULE_NAME, connector_type=AtlanConnectorType.SAPHANA, @@ -48,9 +38,7 @@ def test_invalid_connection_admin_role( def test_invalid_connection_admin_group( client: AtlanClient, ): - with pytest.raises( - ValueError, match="Provided group name abc123 was not found in Atlan." - ): + with pytest.raises(ValueError, match="Provided group name abc123 was not found in Atlan."): Connection.create( name=MODULE_NAME, connector_type=AtlanConnectorType.SAPHANA, @@ -61,9 +49,7 @@ def test_invalid_connection_admin_group( def test_invalid_connection_admin_user( client: AtlanClient, ): - with pytest.raises( - ValueError, match="Provided username abc123 was not found in Atlan." - ): + with pytest.raises(ValueError, match="Provided username abc123 was not found in Atlan."): Connection.create( name=MODULE_NAME, connector_type=AtlanConnectorType.SAPHANA, diff --git a/tests/integration/custom_asset_test.py b/tests/integration/custom_asset_test.py index 2d47e3bab..3bfe9502d 100644 --- a/tests/integration/custom_asset_test.py +++ b/tests/integration/custom_asset_test.py @@ -28,30 +28,22 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def custom_entity( - client: AtlanClient, connection: Connection -) -> Generator[CustomEntity, None, None]: +def custom_entity(client: AtlanClient, connection: Connection) -> Generator[CustomEntity, None, None]: assert connection.qualified_name - to_create = CustomEntity.creator( - name=CUSTOM_ENTITY_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = CustomEntity.creator(name=CUSTOM_ENTITY_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=CustomEntity)[0] yield result delete_asset(client, guid=result.guid, asset_type=CustomEntity) -def test_custom_entity( - client: AtlanClient, connection: Connection, custom_entity: CustomEntity -): +def test_custom_entity(client: AtlanClient, connection: Connection, custom_entity: CustomEntity): assert custom_entity assert custom_entity.guid assert custom_entity.qualified_name @@ -86,13 +78,9 @@ def test_restore_custom_entity( custom_entity: CustomEntity, ): assert custom_entity.qualified_name - assert client.asset.restore( - asset_type=CustomEntity, qualified_name=custom_entity.qualified_name - ) + assert client.asset.restore(asset_type=CustomEntity, qualified_name=custom_entity.qualified_name) assert custom_entity.qualified_name - restored = client.asset.get_by_qualified_name( - asset_type=CustomEntity, qualified_name=custom_entity.qualified_name - ) + restored = client.asset.get_by_qualified_name(asset_type=CustomEntity, qualified_name=custom_entity.qualified_name) assert restored assert restored.guid == custom_entity.guid assert restored.qualified_name == custom_entity.qualified_name @@ -138,9 +126,7 @@ def test_update_custom_assets( def _retrieve_custom_assets(client, asset, asset_type): - retrieved = client.asset.get_by_guid( - asset.guid, asset_type=asset_type, ignore_relationships=False - ) + retrieved = client.asset.get_by_guid(asset.guid, asset_type=asset_type, ignore_relationships=False) assert retrieved assert not retrieved.is_incomplete assert retrieved.guid == asset.guid diff --git a/tests/integration/custom_metadata_test.py b/tests/integration/custom_metadata_test.py index ce9322f07..f6add5ab4 100644 --- a/tests/integration/custom_metadata_test.py +++ b/tests/integration/custom_metadata_test.py @@ -92,17 +92,13 @@ def create_custom_metadata( cm_def = CustomMetadataDef.create(display_name=name) cm_def.attribute_defs = attribute_defs if icon and color: - cm_def.options = CustomMetadataDef.Options.with_logo_from_icon( - icon, color, locked - ) + cm_def.options = CustomMetadataDef.Options.with_logo_from_icon(icon, color, locked) elif logo and logo.startswith("http"): cm_def.options = CustomMetadataDef.Options.with_logo_from_url(logo, locked) elif logo: cm_def.options = CustomMetadataDef.Options.with_logo_as_emoji(logo, locked) else: - raise ValueError( - "Invalid configuration for the visual to use for the custom metadata." - ) + raise ValueError("Invalid configuration for the visual to use for the custom metadata.") r = client.typedef.create(cm_def) return r.custom_metadata_defs[0] @@ -113,20 +109,14 @@ def create_enum(client: AtlanClient, name: str, values: List[str]) -> EnumDef: return r.enum_defs[0] -def update_enum( - client: AtlanClient, name: str, values: List[str], replace_existing: bool = False -) -> EnumDef: - enum_def = EnumDef.update( - name=name, values=values, replace_existing=replace_existing - ) +def update_enum(client: AtlanClient, name: str, values: List[str], replace_existing: bool = False) -> EnumDef: + enum_def = EnumDef.update(name=name, values=values, replace_existing=replace_existing) r = client.typedef.update(enum_def) return r.enum_defs[0] @pytest.fixture(scope="module") -def limit_attribute_applicability_kwargs( - glossary: AtlasGlossary, connection: Connection -): +def limit_attribute_applicability_kwargs(glossary: AtlasGlossary, connection: Connection): return dict( applicable_asset_types={"Link"}, applicable_other_asset_types={"File"}, @@ -137,9 +127,7 @@ def limit_attribute_applicability_kwargs( @pytest.fixture(scope="module") -def cm_ipr( - client: AtlanClient, limit_attribute_applicability_kwargs -) -> Generator[CustomMetadataDef, None, None]: +def cm_ipr(client: AtlanClient, limit_attribute_applicability_kwargs) -> Generator[CustomMetadataDef, None, None]: attribute_defs = [ AttributeDef.create( display_name=CM_ATTR_IPR_LICENSE, @@ -163,9 +151,7 @@ def cm_ipr( attribute_type=AtlanCustomAttributePrimitiveType.URL, ), ] - cm = create_custom_metadata( - client, name=CM_IPR, attribute_defs=attribute_defs, logo="⚖️", locked=True - ) + cm = create_custom_metadata(client, name=CM_IPR, attribute_defs=attribute_defs, logo="⚖️", locked=True) yield cm wait_for_successful_custometadatadef_purge(CM_IPR, client=client) @@ -189,12 +175,8 @@ def test_cm_ipr(cm_ipr: CustomMetadataDef, limit_attribute_applicability_kwargs) assert not one_with_limited.options.multi_value_select options = one_with_limited.options for attribute in limit_attribute_applicability_kwargs.keys(): - assert getattr( - one_with_limited, attribute - ) == limit_attribute_applicability_kwargs.get(attribute) - assert getattr(options, attribute) == json.dumps( - list(limit_attribute_applicability_kwargs.get(attribute)) - ) + assert getattr(one_with_limited, attribute) == limit_attribute_applicability_kwargs.get(attribute) + assert getattr(options, attribute) == json.dumps(list(limit_attribute_applicability_kwargs.get(attribute))) one = attributes[1] assert one.display_name == CM_ATTR_IPR_VERSION assert one.name != CM_ATTR_IPR_VERSION @@ -356,9 +338,7 @@ def cm_enum_update( def cm_enum_update_with_replace( client: AtlanClient, ) -> Generator[EnumDef, None, None]: - enum_def = update_enum( - client, name=DQ_ENUM, values=DQ_TYPE_LIST, replace_existing=True - ) + enum_def = update_enum(client, name=DQ_ENUM, values=DQ_TYPE_LIST, replace_existing=True) yield enum_def @@ -623,9 +603,7 @@ def test_search_by_any_accountable( term: AtlasGlossaryTerm, ): attributes = ["name", "anchor"] - cm_attributes = CustomMetadataCache.get_attributes_for_search_results( - set_name=CM_RACI - ) + cm_attributes = CustomMetadataCache.get_attributes_for_search_results(set_name=CM_RACI) assert cm_attributes attributes.extend(cm_attributes) request = ( @@ -651,9 +629,7 @@ def test_search_by_any_accountable( anchor = t.attributes.anchor assert anchor assert anchor.name == glossary.name - _validate_raci_attributes_replacement( - client, t.get_custom_metadata(name=CM_RACI) - ) + _validate_raci_attributes_replacement(client, t.get_custom_metadata(name=CM_RACI)) @pytest.mark.order(after="test_replace_term_cm_ipr") @@ -690,9 +666,7 @@ def test_search_by_specific_accountable( assert anchor.name == glossary.name -@pytest.mark.order( - after=["test_search_by_any_accountable", "test_search_by_specific_accountable"] -) +@pytest.mark.order(after=["test_search_by_any_accountable", "test_search_by_specific_accountable"]) def test_remove_term_cm_raci( client: AtlanClient, cm_raci: CustomMetadataDef, @@ -746,9 +720,7 @@ def test_remove_attribute(client: AtlanClient, cm_raci: CustomMetadataDef): attributes = updated.attribute_defs archived = _validate_raci_structure(attributes, 5) assert archived - assert ( - archived.display_name == f"{CM_ATTR_RACI_EXTRA}-archived-{str(_removal_epoch)}" - ) + assert archived.display_name == f"{CM_ATTR_RACI_EXTRA}-archived-{str(_removal_epoch)}" assert archived.name != CM_ATTR_RACI_EXTRA assert archived.type_name == AtlanCustomAttributePrimitiveType.STRING.value assert not archived.options.multi_value_select @@ -766,9 +738,7 @@ def test_retrieve_structures(client: AtlanClient, cm_raci: CustomMetadataDef): assert CM_QUALITY in custom_attributes.keys() extra = _validate_raci_structure(custom_attributes.get(CM_RACI), 4) assert not extra - custom_attributes = CustomMetadataCache.get_all_custom_attributes( - include_deleted=True - ) + custom_attributes = CustomMetadataCache.get_all_custom_attributes(include_deleted=True) assert custom_attributes assert CM_RACI in custom_attributes.keys() assert CM_IPR in custom_attributes.keys() @@ -816,9 +786,7 @@ def test_recreate_attribute(client: AtlanClient, cm_raci: CustomMetadataDef): @pytest.mark.order(after="test_recreate_attribute") -def test_retrieve_structure_without_archived( - client: AtlanClient, cm_raci: CustomMetadataDef -): +def test_retrieve_structure_without_archived(client: AtlanClient, cm_raci: CustomMetadataDef): custom_attributes = CustomMetadataCache.get_all_custom_attributes() assert custom_attributes assert len(custom_attributes) >= 3 @@ -835,12 +803,8 @@ def test_retrieve_structure_without_archived( @pytest.mark.order(after="test_recreate_attribute") -def test_retrieve_structure_with_archived( - client: AtlanClient, cm_raci: CustomMetadataDef -): - custom_attributes = CustomMetadataCache.get_all_custom_attributes( - include_deleted=True - ) +def test_retrieve_structure_with_archived(client: AtlanClient, cm_raci: CustomMetadataDef): + custom_attributes = CustomMetadataCache.get_all_custom_attributes(include_deleted=True) assert custom_attributes assert len(custom_attributes) >= 3 assert CM_RACI in custom_attributes.keys() @@ -1010,9 +974,7 @@ def _validate_dq_empty(dq_attrs: CustomMetadataDict): assert dq_attrs[CM_ATTR_QUALITY_TYPE] is None -def _validate_raci_structure( - attributes: Optional[List[AttributeDef]], total_expected: int -): +def _validate_raci_structure(attributes: Optional[List[AttributeDef]], total_expected: int): global _removal_epoch assert attributes assert len(attributes) == total_expected @@ -1058,9 +1020,7 @@ def _validate_raci_structure( if total_expected > 5: # If we're expecting more than 5, then the penultimate must be an archived CM_ATTR_EXTRA one = attributes[4] - assert ( - one.display_name == f"{CM_ATTR_RACI_EXTRA}-archived-{str(_removal_epoch)}" - ) + assert one.display_name == f"{CM_ATTR_RACI_EXTRA}-archived-{str(_removal_epoch)}" assert one.name != CM_ATTR_RACI_EXTRA assert one.type_name == AtlanCustomAttributePrimitiveType.STRING.value assert one.options diff --git a/tests/integration/data_mesh_test.py b/tests/integration/data_mesh_test.py index 33de2e708..85fa7ff06 100644 --- a/tests/integration/data_mesh_test.py +++ b/tests/integration/data_mesh_test.py @@ -30,9 +30,7 @@ from tests.integration.custom_metadata_test import create_custom_metadata from tests.integration.utils import wait_for_successful_custometadatadef_purge -DATA_PRODUCT_ASSETS_PLAYBOOK_FILTER = ( - '{"condition":"AND","isGroupLocked":false,"rules":[]}' -) +DATA_PRODUCT_ASSETS_PLAYBOOK_FILTER = '{"condition":"AND","isGroupLocked":false,"rules":[]}' MODULE_NAME = TestId.make_unique("DM") @@ -40,14 +38,10 @@ DATA_DOMAIN_QUALIFIED_NAME = f"default/domain/{DATA_DOMAIN_NAME}/super" DATA_DOMAIN_QN_REGEX = r"default/domain/[a-zA-Z0-9-]+/super" DATA_SUB_DOMAIN_NAME = f"{MODULE_NAME}-data-sub-domain" -DATA_SUB_DOMAIN_QUALIFIED_NAME = ( - f"{DATA_DOMAIN_QUALIFIED_NAME}/domain/{DATA_SUB_DOMAIN_NAME}" -) +DATA_SUB_DOMAIN_QUALIFIED_NAME = f"{DATA_DOMAIN_QUALIFIED_NAME}/domain/{DATA_SUB_DOMAIN_NAME}" DATA_SUB_DOMAIN_QN_REGEX = r"default/domain/[a-zA-Z0-9-]+/super/domain/[a-zA-Z0-9-]+" DATA_PRODUCT_NAME = f"{MODULE_NAME}-data-product" -DATA_PRODUCT_QUALIFIED_NAME = ( - f"{DATA_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" -) +DATA_PRODUCT_QUALIFIED_NAME = f"{DATA_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" DATA_PRODUCT_QN_REGEX = r"default/domain/[a-zA-Z0-9-]+/super/product/[a-zA-Z0-9-]+" DD_CM = f"{MODULE_NAME}_CM" DD_ATTR = f"{MODULE_NAME}_ATTRIBUTE" @@ -138,9 +132,7 @@ def test_update_domain(client: AtlanClient, domain: DataDomain): @pytest.mark.order(after="test_update_domain") def test_retrieve_domain(client: AtlanClient, domain: DataDomain): - test_domain = client.asset.get_by_guid( - domain.guid, asset_type=DataDomain, ignore_relationships=False - ) + test_domain = client.asset.get_by_guid(domain.guid, asset_type=DataDomain, ignore_relationships=False) assert test_domain assert test_domain.guid == domain.guid assert test_domain.qualified_name == domain.qualified_name @@ -151,9 +143,7 @@ def test_retrieve_domain(client: AtlanClient, domain: DataDomain): @pytest.mark.order(after="test_retrieve_domain") def test_find_domain_by_name(client: AtlanClient, domain: DataDomain): - response = client.asset.find_domain_by_name( - name=domain.name, attributes=["certificateStatus"] - ) + response = client.asset.find_domain_by_name(name=domain.name, attributes=["certificateStatus"]) assert response assert response.guid == domain.guid @@ -192,9 +182,7 @@ def test_update_sub_domain(client: AtlanClient, sub_domain: DataDomain): @pytest.mark.order(after="test_update_sub_domain") def test_retrieve_sub_domain(client: AtlanClient, sub_domain: DataDomain): - test_sub_domain = client.asset.get_by_guid( - sub_domain.guid, asset_type=DataDomain, ignore_relationships=False - ) + test_sub_domain = client.asset.get_by_guid(sub_domain.guid, asset_type=DataDomain, ignore_relationships=False) assert test_sub_domain assert test_sub_domain.guid == sub_domain.guid assert test_sub_domain.qualified_name == sub_domain.qualified_name @@ -205,9 +193,7 @@ def test_retrieve_sub_domain(client: AtlanClient, sub_domain: DataDomain): @pytest.mark.order(after="test_retrieve_sub_domain") def test_find_sub_domain_by_name(client: AtlanClient, sub_domain: DataDomain): - response = client.asset.find_domain_by_name( - name=sub_domain.name, attributes=["certificateStatus"] - ) + response = client.asset.find_domain_by_name(name=sub_domain.name, attributes=["certificateStatus"]) assert response assert response.guid == sub_domain.guid @@ -215,9 +201,7 @@ def test_find_sub_domain_by_name(client: AtlanClient, sub_domain: DataDomain): @pytest.fixture(scope="module") -def data_domain_cm( - client: AtlanClient, domain: DataDomain -) -> Generator[CustomMetadataDef, None, None]: +def data_domain_cm(client: AtlanClient, domain: DataDomain) -> Generator[CustomMetadataDef, None, None]: assert domain.qualified_name attribute_defs = [ AttributeDef.create( @@ -227,9 +211,7 @@ def data_domain_cm( applicable_domains={domain.qualified_name}, ) ] - dd_cm = create_custom_metadata( - client, name=DD_CM, attribute_defs=attribute_defs, logo="📦", locked=True - ) + dd_cm = create_custom_metadata(client, name=DD_CM, attribute_defs=attribute_defs, logo="📦", locked=True) yield dd_cm wait_for_successful_custometadatadef_purge(DD_CM, client=client) @@ -277,10 +259,7 @@ def test_product(client: AtlanClient, product: DataProduct): assert product.parent_domain_qualified_name assert product.super_domain_qualified_name assert product.name == DATA_PRODUCT_NAME - assert ( - product.data_product_assets_playbook_filter - == DATA_PRODUCT_ASSETS_PLAYBOOK_FILTER - ) + assert product.data_product_assets_playbook_filter == DATA_PRODUCT_ASSETS_PLAYBOOK_FILTER assert re.search(DATA_PRODUCT_QN_REGEX, product.qualified_name) assert re.search(DATA_DOMAIN_QN_REGEX, product.parent_domain_qualified_name) assert re.search(DATA_DOMAIN_QN_REGEX, product.super_domain_qualified_name) @@ -336,20 +315,14 @@ def updated_contract( delete_asset(client, guid=result.guid, asset_type=DataContract) -def test_contract( - client: AtlanClient, table: Table, product: DataProduct, contract: DataContract -): +def test_contract(client: AtlanClient, table: Table, product: DataProduct, contract: DataContract): assert product and product.guid - product = client.asset.get_by_guid( - guid=product.guid, asset_type=DataProduct, ignore_relationships=False - ) + product = client.asset.get_by_guid(guid=product.guid, asset_type=DataProduct, ignore_relationships=False) assert product and product.output_ports and len(product.output_ports) table_asset = product.output_ports[0] assert table and table.guid assert table.guid == table_asset.guid - table = client.asset.get_by_guid( - guid=table_asset.guid, asset_type=Table, ignore_relationships=False - ) + table = client.asset.get_by_guid(guid=table_asset.guid, asset_type=Table, ignore_relationships=False) assert table.has_contract assert table.data_contract_latest table_data_contract = table.data_contract_latest @@ -361,13 +334,9 @@ def test_contract( assert contract.data_contract_asset_guid == table.guid -def test_update_contract( - client: AtlanClient, table: Table, updated_contract: DataContract -): +def test_update_contract(client: AtlanClient, table: Table, updated_contract: DataContract): assert table and table.guid - table = client.asset.get_by_guid( - guid=table.guid, asset_type=Table, ignore_relationships=False - ) + table = client.asset.get_by_guid(guid=table.guid, asset_type=Table, ignore_relationships=False) assert table.has_contract assert table.data_contract_latest table_data_contract = table.data_contract_latest @@ -380,9 +349,7 @@ def test_update_contract( assert "(UPDATED)" in updated_contract.data_contract_json -def test_update_product( - client: AtlanClient, product: DataProduct, glossary: AtlasGlossary -): +def test_update_product(client: AtlanClient, product: DataProduct, glossary: AtlasGlossary): assert product.qualified_name assert product.name updated = client.asset.update_certificate( @@ -415,11 +382,7 @@ def test_update_product( # Test the product.updater() method with assets assert glossary.qualified_name - assets = ( - FluentSearch() - .where(Asset.QUALIFIED_NAME.eq(glossary.qualified_name)) - .to_request() - ) + assets = FluentSearch().where(Asset.QUALIFIED_NAME.eq(glossary.qualified_name)).to_request() to_update = DataProduct.updater( name=DATA_PRODUCT_NAME, qualified_name=product.qualified_name, @@ -428,24 +391,18 @@ def test_update_product( response = client.asset.save(to_update) assert (products := response.assets_updated(asset_type=DataProduct)) assert len(products) == 1 - assert products[ - 0 - ].data_product_assets_d_s_l == DataProductsAssetsDSL.get_asset_selection(assets) + assert products[0].data_product_assets_d_s_l == DataProductsAssetsDSL.get_asset_selection(assets) # Test the product.updater() method without assets # (ensure asset selection remains unchanged) - product = DataProduct.updater( - name=DATA_PRODUCT_NAME, qualified_name=product.qualified_name - ) + product = DataProduct.updater(name=DATA_PRODUCT_NAME, qualified_name=product.qualified_name) response = client.asset.save(product) assert response.assets_updated(asset_type=DataProduct) == [] @pytest.mark.order(after="test_update_product") def test_retrieve_product(client: AtlanClient, product: DataProduct): - test_product = client.asset.get_by_guid( - product.guid, asset_type=DataProduct, ignore_relationships=False - ) + test_product = client.asset.get_by_guid(product.guid, asset_type=DataProduct, ignore_relationships=False) assert test_product assert test_product.guid == product.guid assert test_product.qualified_name == product.qualified_name @@ -455,12 +412,8 @@ def test_retrieve_product(client: AtlanClient, product: DataProduct): @pytest.mark.order(after="test_update_contract") -def test_retrieve_contract( - client: AtlanClient, table: Table, updated_contract: DataContract -): - test_contract = client.asset.get_by_guid( - updated_contract.guid, asset_type=DataContract, ignore_relationships=False - ) +def test_retrieve_contract(client: AtlanClient, table: Table, updated_contract: DataContract): + test_contract = client.asset.get_by_guid(updated_contract.guid, asset_type=DataContract, ignore_relationships=False) assert test_contract assert test_contract.name == updated_contract.name assert table.name and updated_contract.name and table.name in updated_contract.name @@ -474,9 +427,7 @@ def test_retrieve_contract( @pytest.mark.order(after="test_retrieve_product") def test_find_product_by_name(client: AtlanClient, product: DataProduct): - response = client.asset.find_product_by_name( - name=product.name, attributes=["daapStatus"] - ) + response = client.asset.find_product_by_name(name=product.name, attributes=["daapStatus"]) assert response assert response.guid == product.guid diff --git a/tests/integration/data_studio_asset_test.py b/tests/integration/data_studio_asset_test.py index 9e01a267d..2a637b2b4 100644 --- a/tests/integration/data_studio_asset_test.py +++ b/tests/integration/data_studio_asset_test.py @@ -29,17 +29,13 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def data_studio_asset_report( - client: AtlanClient, connection: Connection -) -> Generator[DataStudioAsset, None, None]: +def data_studio_asset_report(client: AtlanClient, connection: Connection) -> Generator[DataStudioAsset, None, None]: assert connection.qualified_name to_create = DataStudioAsset.create( name=REPORT_NAME, @@ -60,17 +56,10 @@ def test_data_studio_asset_report( assert data_studio_asset_report assert data_studio_asset_report.guid assert data_studio_asset_report.qualified_name - assert ( - data_studio_asset_report.connection_qualified_name == connection.qualified_name - ) + assert data_studio_asset_report.connection_qualified_name == connection.qualified_name assert data_studio_asset_report.name == REPORT_NAME - assert ( - data_studio_asset_report.connector_name == AtlanConnectorType.DATASTUDIO.value - ) - assert ( - data_studio_asset_report.data_studio_asset_type - == GoogleDatastudioAssetType.REPORT - ) + assert data_studio_asset_report.connector_name == AtlanConnectorType.DATASTUDIO.value + assert data_studio_asset_report.data_studio_asset_type == GoogleDatastudioAssetType.REPORT def test_update_data_studio_asset_report( @@ -131,19 +120,10 @@ def test_data_studio_asset_data_source( assert data_studio_asset_data_source assert data_studio_asset_data_source.guid assert data_studio_asset_data_source.qualified_name - assert ( - data_studio_asset_data_source.connection_qualified_name - == connection.qualified_name - ) + assert data_studio_asset_data_source.connection_qualified_name == connection.qualified_name assert data_studio_asset_data_source.name == SOURCE_NAME - assert ( - data_studio_asset_data_source.connector_name - == AtlanConnectorType.DATASTUDIO.value - ) - assert ( - data_studio_asset_data_source.data_studio_asset_type - == GoogleDatastudioAssetType.DATA_SOURCE - ) + assert data_studio_asset_data_source.connector_name == AtlanConnectorType.DATASTUDIO.value + assert data_studio_asset_data_source.data_studio_asset_type == GoogleDatastudioAssetType.DATA_SOURCE def test_update_data_studio_asset_data_source( diff --git a/tests/integration/dataverse_asset_test.py b/tests/integration/dataverse_asset_test.py index a2a1be61b..a6a1504f5 100644 --- a/tests/integration/dataverse_asset_test.py +++ b/tests/integration/dataverse_asset_test.py @@ -31,30 +31,22 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def dataverse_entity( - client: AtlanClient, connection: Connection -) -> Generator[DataverseEntity, None, None]: +def dataverse_entity(client: AtlanClient, connection: Connection) -> Generator[DataverseEntity, None, None]: assert connection.qualified_name - to_create = DataverseEntity.creator( - name=DATAVERSE_ENTITY_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = DataverseEntity.creator(name=DATAVERSE_ENTITY_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=DataverseEntity)[0] yield result delete_asset(client, guid=result.guid, asset_type=DataverseEntity) -def test_dataverse_entity( - client: AtlanClient, connection: Connection, dataverse_entity: DataverseEntity -): +def test_dataverse_entity(client: AtlanClient, connection: Connection, dataverse_entity: DataverseEntity): assert dataverse_entity assert dataverse_entity.guid assert dataverse_entity.qualified_name @@ -87,10 +79,7 @@ def test_dataverse_attribute( assert dataverse_attribute.guid assert dataverse_attribute.qualified_name assert dataverse_attribute.name == DATAVERSE_ATTRIBUTE_NAME - assert ( - dataverse_attribute.connection_qualified_name - == dataverse_entity.connection_qualified_name - ) + assert dataverse_attribute.connection_qualified_name == dataverse_entity.connection_qualified_name assert dataverse_attribute.connector_name == AtlanConnectorType.DATAVERSE.value @@ -120,14 +109,8 @@ def test_overload_dataverse_attribute( assert dataverse_attribute_overload.guid assert dataverse_attribute_overload.qualified_name assert dataverse_attribute_overload.name == DATAVERSE_ATTRIBUTE_NAME_OVERLOAD - assert ( - dataverse_attribute_overload.connection_qualified_name - == dataverse_entity.connection_qualified_name - ) - assert ( - dataverse_attribute_overload.connector_name - == AtlanConnectorType.DATAVERSE.value - ) + assert dataverse_attribute_overload.connection_qualified_name == dataverse_entity.connection_qualified_name + assert dataverse_attribute_overload.connector_name == AtlanConnectorType.DATAVERSE.value def _update_cert_and_annoucement(client, asset, asset_type): @@ -171,9 +154,7 @@ def test_update_dataverse_assets( def _retrieve_dataverse_assets(client, asset, asset_type): - retrieved = client.asset.get_by_guid( - asset.guid, asset_type=asset_type, ignore_relationships=False - ) + retrieved = client.asset.get_by_guid(asset.guid, asset_type=asset_type, ignore_relationships=False) assert retrieved assert not retrieved.is_incomplete assert retrieved.guid == asset.guid @@ -235,9 +216,7 @@ def test_restore_dataverse_attribute( dataverse_attribute: DataverseAttribute, ): assert dataverse_attribute.qualified_name - assert client.asset.restore( - asset_type=DataverseAttribute, qualified_name=dataverse_attribute.qualified_name - ) + assert client.asset.restore(asset_type=DataverseAttribute, qualified_name=dataverse_attribute.qualified_name) assert dataverse_attribute.qualified_name restored = client.asset.get_by_qualified_name( asset_type=DataverseAttribute, diff --git a/tests/integration/file_test.py b/tests/integration/file_test.py index 637cca66b..78a39c77a 100644 --- a/tests/integration/file_test.py +++ b/tests/integration/file_test.py @@ -29,9 +29,7 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result # TODO: proper connection delete workflow delete_asset(client, guid=result.guid, asset_type=Connection) @@ -65,9 +63,7 @@ def test_file( assert file.file_type == FileType.PDF assert file.file_path == "https://www.example.com" assert connection.qualified_name - assert file.connector_name == AtlanConnectorType.get_connector_name( - connection.qualified_name - ) + assert file.connector_name == AtlanConnectorType.get_connector_name(connection.qualified_name) @pytest.mark.order(after="test_file") diff --git a/tests/integration/gcs_asset_test.py b/tests/integration/gcs_asset_test.py index d248820f9..49f42206f 100644 --- a/tests/integration/gcs_asset_test.py +++ b/tests/integration/gcs_asset_test.py @@ -29,21 +29,15 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def gcs_bucket( - client: AtlanClient, connection: Connection -) -> Generator[GCSBucket, None, None]: +def gcs_bucket(client: AtlanClient, connection: Connection) -> Generator[GCSBucket, None, None]: assert connection.qualified_name - to_create = GCSBucket.create( - name=GCS_BUCKET_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = GCSBucket.create(name=GCS_BUCKET_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=GCSBucket)[0] yield result @@ -60,13 +54,9 @@ def test_gcs_bucket(client: AtlanClient, connection: Connection, gcs_bucket: GCS @pytest.fixture(scope="module") -def gcs_object( - client: AtlanClient, connection: Connection, gcs_bucket: GCSBucket -) -> Generator[GCSObject, None, None]: +def gcs_object(client: AtlanClient, connection: Connection, gcs_bucket: GCSBucket) -> Generator[GCSObject, None, None]: assert gcs_bucket.qualified_name - to_create = GCSObject.create( - name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=gcs_bucket.qualified_name - ) + to_create = GCSObject.create(name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=gcs_bucket.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=GCSObject)[0] yield result @@ -160,9 +150,7 @@ def test_retrieve_gcs_object( gcs_bucket: GCSBucket, gcs_object: GCSObject, ): - b = client.asset.get_by_guid( - gcs_object.guid, asset_type=GCSObject, ignore_relationships=False - ) + b = client.asset.get_by_guid(gcs_object.guid, asset_type=GCSObject, ignore_relationships=False) assert b assert not b.is_incomplete assert b.guid == gcs_object.guid @@ -233,9 +221,7 @@ def test_read_deleted_gcs_object( gcs_bucket: GCSBucket, gcs_object: GCSObject, ): - deleted = client.asset.get_by_guid( - gcs_object.guid, asset_type=GCSObject, ignore_relationships=False - ) + deleted = client.asset.get_by_guid(gcs_object.guid, asset_type=GCSObject, ignore_relationships=False) assert deleted assert deleted.guid == gcs_object.guid assert deleted.qualified_name == gcs_object.qualified_name @@ -250,9 +236,7 @@ def test_restore_object( gcs_object: GCSObject, ): assert gcs_object.qualified_name - assert client.asset.restore( - asset_type=GCSObject, qualified_name=gcs_object.qualified_name - ) + assert client.asset.restore(asset_type=GCSObject, qualified_name=gcs_object.qualified_name) assert gcs_object.qualified_name restored = client.asset.get_by_qualified_name( asset_type=GCSObject, diff --git a/tests/integration/glossary_test.py b/tests/integration/glossary_test.py index 5a7932f9e..a22e9eb2d 100644 --- a/tests/integration/glossary_test.py +++ b/tests/integration/glossary_test.py @@ -40,9 +40,7 @@ def create_category( glossary: AtlasGlossary, parent: Optional[AtlasGlossaryCategory] = None, ) -> AtlasGlossaryCategory: - c = AtlasGlossaryCategory.create( - name=name, anchor=glossary, parent_category=parent or None - ) + c = AtlasGlossaryCategory.create(name=name, anchor=glossary, parent_category=parent or None) return client.asset.save(c).assets_created(AtlasGlossaryCategory)[0] @@ -80,9 +78,7 @@ def test_glossary( @pytest.fixture(scope="module") -def category( - client: AtlanClient, glossary: AtlasGlossary -) -> Generator[AtlasGlossaryCategory, None, None]: +def category(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryCategory, None, None]: c = create_category(client, MODULE_NAME, glossary) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -98,9 +94,7 @@ def hierarchy_glossary( @pytest.fixture(scope="module") -def top1_category( - client: AtlanClient, hierarchy_glossary -) -> Generator[AtlasGlossaryCategory, None, None]: +def top1_category(client: AtlanClient, hierarchy_glossary) -> Generator[AtlasGlossaryCategory, None, None]: c = create_category(client, TestId.make_unique("top1"), hierarchy_glossary) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -112,9 +106,7 @@ def mid1a_category( hierarchy_glossary: AtlasGlossary, top1_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category( - client, TestId.make_unique("mid1a"), hierarchy_glossary, parent=top1_category - ) + c = create_category(client, TestId.make_unique("mid1a"), hierarchy_glossary, parent=top1_category) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -130,9 +122,7 @@ def mid1a_term( client, name=f"mid1a_{TERM_NAME1}", glossary_guid=hierarchy_glossary.guid, - categories=[ - AtlasGlossaryCategory.ref_by_qualified_name(mid1a_category.qualified_name) - ], + categories=[AtlasGlossaryCategory.ref_by_qualified_name(mid1a_category.qualified_name)], ) yield t delete_asset(client, guid=t.guid, asset_type=AtlasGlossaryTerm) @@ -144,9 +134,7 @@ def leaf1aa_category( hierarchy_glossary: AtlasGlossary, mid1a_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category( - client, TestId.make_unique("leaf1aa"), hierarchy_glossary, parent=mid1a_category - ) + c = create_category(client, TestId.make_unique("leaf1aa"), hierarchy_glossary, parent=mid1a_category) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -157,9 +145,7 @@ def leaf1ab_category( hierarchy_glossary: AtlasGlossary, mid1a_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category( - client, TestId.make_unique("leaf1ab"), hierarchy_glossary, parent=mid1a_category - ) + c = create_category(client, TestId.make_unique("leaf1ab"), hierarchy_glossary, parent=mid1a_category) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -170,9 +156,7 @@ def mid1b_category( hierarchy_glossary: AtlasGlossary, top1_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category( - client, TestId.make_unique("mid1b"), hierarchy_glossary, parent=top1_category - ) + c = create_category(client, TestId.make_unique("mid1b"), hierarchy_glossary, parent=top1_category) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -183,9 +167,7 @@ def leaf1ba_category( hierarchy_glossary: AtlasGlossary, mid1b_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category( - client, TestId.make_unique("leaf1ba"), hierarchy_glossary, parent=mid1b_category - ) + c = create_category(client, TestId.make_unique("leaf1ba"), hierarchy_glossary, parent=mid1b_category) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -205,9 +187,7 @@ def mid2a_category( hierarchy_glossary: AtlasGlossary, top2_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category( - client, TestId.make_unique("mid2a"), hierarchy_glossary, parent=top2_category - ) + c = create_category(client, TestId.make_unique("mid2a"), hierarchy_glossary, parent=top2_category) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -218,9 +198,7 @@ def leaf2aa_category( hierarchy_glossary: AtlasGlossary, mid2a_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category( - client, TestId.make_unique("leaf2aa"), hierarchy_glossary, parent=mid2a_category - ) + c = create_category(client, TestId.make_unique("leaf2aa"), hierarchy_glossary, parent=mid2a_category) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -231,9 +209,7 @@ def leaf2ab_category( hierarchy_glossary: AtlasGlossary, mid2a_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category( - client, TestId.make_unique("leaf2ab"), hierarchy_glossary, parent=mid2a_category - ) + c = create_category(client, TestId.make_unique("leaf2ab"), hierarchy_glossary, parent=mid2a_category) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -244,9 +220,7 @@ def mid2b_category( hierarchy_glossary: AtlasGlossary, top2_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category( - client, TestId.make_unique("mid2b"), hierarchy_glossary, parent=top2_category - ) + c = create_category(client, TestId.make_unique("mid2b"), hierarchy_glossary, parent=top2_category) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -257,22 +231,16 @@ def leaf2ba_category( hierarchy_glossary: AtlasGlossary, mid2b_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category( - client, TestId.make_unique("leaf2ba"), hierarchy_glossary, parent=mid2b_category - ) + c = create_category(client, TestId.make_unique("leaf2ba"), hierarchy_glossary, parent=mid2b_category) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) -def test_category( - client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary -): +def test_category(client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary): assert category.guid assert category.name == MODULE_NAME assert category.qualified_name - c = client.asset.get_by_guid( - category.guid, AtlasGlossaryCategory, ignore_relationships=False - ) + c = client.asset.get_by_guid(category.guid, AtlasGlossaryCategory, ignore_relationships=False) assert c assert c.guid == category.guid assert c.anchor @@ -280,9 +248,7 @@ def test_category( @pytest.fixture(scope="module") -def term1( - client: AtlanClient, glossary: AtlasGlossary -) -> Generator[AtlasGlossaryTerm, None, None]: +def term1(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryTerm, None, None]: t = create_term(client, name=TERM_NAME1, glossary_guid=glossary.guid) yield t delete_asset(client, guid=t.guid, asset_type=AtlasGlossaryTerm) @@ -297,11 +263,7 @@ def test_term_failure( match="ATLAN-PYTHON-404-000 Server responded with a not found " "error ATLAS-404-00-009: Instance AtlasGlossaryTerm with unique attribute *", ): - client.asset.update_merging_cm( - AtlasGlossaryTerm.create( - name=f"{TERM_NAME1} X", glossary_guid=glossary.guid - ) - ) + client.asset.update_merging_cm(AtlasGlossaryTerm.create(name=f"{TERM_NAME1} X", glossary_guid=glossary.guid)) def test_term1( @@ -313,9 +275,7 @@ def test_term1( assert term1.name == TERM_NAME1 assert term1.qualified_name assert term1.qualified_name != TERM_NAME1 - t = client.asset.get_by_guid( - term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + t = client.asset.get_by_guid(term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) assert t assert t.guid == term1.guid assert t.attributes.anchor @@ -323,9 +283,7 @@ def test_term1( @pytest.fixture(scope="module") -def term2( - client: AtlanClient, glossary: AtlasGlossary -) -> Generator[AtlasGlossaryTerm, None, None]: +def term2(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryTerm, None, None]: t = create_term(client, name=TERM_NAME2, glossary_guid=glossary.guid) yield t delete_asset(client, guid=t.guid, asset_type=AtlasGlossaryTerm) @@ -340,9 +298,7 @@ def test_term2( assert term2.name == TERM_NAME2 assert term2.qualified_name assert term2.qualified_name != TERM_NAME2 - t = client.asset.get_by_guid( - term2.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + t = client.asset.get_by_guid(term2.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) assert t assert t.guid == term2.guid assert t.attributes.anchor @@ -350,9 +306,7 @@ def test_term2( @pytest.fixture(scope="module") -def term3( - client: AtlanClient, glossary: AtlasGlossary -) -> Generator[AtlasGlossaryTerm, None, None]: +def term3(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryTerm, None, None]: t = create_term(client, name=TERM_NAME3, glossary_guid=glossary.guid) yield t delete_asset(client, guid=t.guid, asset_type=AtlasGlossaryTerm) @@ -367,9 +321,7 @@ def test_term3( assert term3.name == TERM_NAME3 assert term3.qualified_name assert term3.qualified_name != TERM_NAME3 - t = client.asset.get_by_guid( - term3.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + t = client.asset.get_by_guid(term3.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) assert t assert t.guid == term3.guid assert t.attributes.anchor @@ -377,9 +329,7 @@ def test_term3( @pytest.fixture(scope="module") -def term4( - client: AtlanClient, glossary: AtlasGlossary -) -> Generator[AtlasGlossaryTerm, None, None]: +def term4(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryTerm, None, None]: t = create_term(client, name=TERM_NAME4, glossary_guid=glossary.guid) yield t delete_asset(client, guid=t.guid, asset_type=AtlasGlossaryTerm) @@ -394,9 +344,7 @@ def test_term4( assert term4.name == TERM_NAME4 assert term4.qualified_name assert term4.qualified_name != TERM_NAME4 - t = client.asset.get_by_guid( - term4.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + t = client.asset.get_by_guid(term4.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) assert t assert t.guid == term4.guid assert t.attributes.anchor @@ -411,9 +359,7 @@ def test_read_glossary( term3: AtlasGlossaryTerm, term4: AtlasGlossaryTerm, ): - g = client.asset.get_by_guid( - glossary.guid, asset_type=AtlasGlossary, ignore_relationships=False - ) + g = client.asset.get_by_guid(glossary.guid, asset_type=AtlasGlossary, ignore_relationships=False) assert g assert isinstance(g, AtlasGlossary) assert g.guid == glossary.guid @@ -552,9 +498,7 @@ def test_term_trim_to_required( client: AtlanClient, term1: AtlasGlossaryTerm, ): - term1 = client.asset.get_by_guid( - guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + term1 = client.asset.get_by_guid(guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) term1 = term1.trim_to_required() response = client.asset.save(term1) assert response.mutated_entities is None @@ -564,9 +508,7 @@ def test_find_glossary_by_name(client: AtlanClient, glossary: AtlasGlossary): assert glossary.guid == client.asset.find_glossary_by_name(name=glossary.name).guid -def test_find_category_fast_by_name( - client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary -): +def test_find_category_fast_by_name(client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary): @retry( wait=wait_fixed(2), retry=retry_if_exception_type(NotFoundError), @@ -583,15 +525,8 @@ def check_it(): check_it() -def test_find_category_by_name( - client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary -): - assert ( - category.guid - == client.asset.find_category_by_name( - name=category.name, glossary_name=glossary.name - )[0].guid - ) +def test_find_category_by_name(client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary): + assert category.guid == client.asset.find_category_by_name(name=category.name, glossary_name=glossary.name)[0].guid def test_find_category_by_name_qn_guid_correctly_populated( @@ -640,9 +575,7 @@ def test_category_delete_by_guid_raises_error_invalid_request_error( client.asset.delete_by_guid(guid=category.guid) -def test_find_term_fast_by_name( - client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary -): +def test_find_term_fast_by_name(client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary): @retry( wait=wait_fixed(2), retry=retry_if_exception_type(NotFoundError), @@ -659,15 +592,8 @@ def check_it(): check_it() -def test_find_term_by_name( - client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary -): - assert ( - term1.guid - == client.asset.find_term_by_name( - name=term1.name, glossary_name=glossary.name - ).guid - ) +def test_find_term_by_name(client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary): + assert term1.guid == client.asset.find_term_by_name(name=term1.name, glossary_name=glossary.name).guid @pytest.mark.parametrize( @@ -815,9 +741,7 @@ def test_create_relationship( response = client.asset.save(term) assert response - result = client.asset.get_by_guid( - guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + result = client.asset.get_by_guid(guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) assert result assert result.see_also assert len(result.see_also) == 2 @@ -852,9 +776,7 @@ def test_remove_relationship( response = client.asset.save(term) assert response - result = client.asset.get_by_guid( - guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + result = client.asset.get_by_guid(guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) assert result assert result.see_also active_relationships = [] @@ -889,9 +811,7 @@ def test_append_relationship( response = client.asset.save(term) assert response - result = client.asset.get_by_guid( - guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + result = client.asset.get_by_guid(guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) assert result assert result.see_also active_relationships = [] @@ -927,9 +847,7 @@ def test_append_relationship_again( response = client.asset.save(term) assert response - result = client.asset.get_by_guid( - guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + result = client.asset.get_by_guid(guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) assert result assert result.see_also active_relationships = [] diff --git a/tests/integration/insights_test.py b/tests/integration/insights_test.py index 1fffc8b3e..6e64edff6 100644 --- a/tests/integration/insights_test.py +++ b/tests/integration/insights_test.py @@ -35,21 +35,13 @@ def collection(client: AtlanClient) -> Generator[Collection, None, None]: @pytest.fixture(scope="module") -def folder( - client: AtlanClient, collection: Collection -) -> Generator[Folder, None, None]: +def folder(client: AtlanClient, collection: Collection) -> Generator[Folder, None, None]: assert collection and collection.qualified_name - folder = Folder.creator( - name=FOLDER_NAME, collection_qualified_name=collection.qualified_name - ) + folder = Folder.creator(name=FOLDER_NAME, collection_qualified_name=collection.qualified_name) response = client.asset.save(folder) result = response.assets_created(asset_type=Folder)[0] updated = response.assets_updated(asset_type=Collection)[0] - assert ( - updated - and updated.guid == collection.guid - and updated.qualified_name == collection.qualified_name - ) + assert updated and updated.guid == collection.guid and updated.qualified_name == collection.qualified_name yield result delete_asset(client, guid=result.guid, asset_type=Folder) @@ -57,26 +49,18 @@ def folder( @pytest.fixture(scope="module") def sub_folder(client: AtlanClient, folder: Folder) -> Generator[Folder, None, None]: assert folder and folder.qualified_name - sub = Folder.creator( - name=SUB_FOLDER_NAME, parent_folder_qualified_name=folder.qualified_name - ) + sub = Folder.creator(name=SUB_FOLDER_NAME, parent_folder_qualified_name=folder.qualified_name) response = client.asset.save(sub) result = response.assets_created(asset_type=Folder)[0] updated = response.assets_updated(asset_type=Folder)[0] - assert ( - updated - and updated.guid == folder.guid - and updated.qualified_name == folder.qualified_name - ) + assert updated and updated.guid == folder.guid and updated.qualified_name == folder.qualified_name yield result delete_asset(client, guid=result.guid, asset_type=Folder) @pytest.fixture(scope="module") def query(client: AtlanClient, folder: Folder) -> Generator[Query, None, None]: - connection = client.find_connections_by_name( - name=CONNECTION_NAME, connector_type=AtlanConnectorType.SNOWFLAKE - ) + connection = client.find_connections_by_name(name=CONNECTION_NAME, connector_type=AtlanConnectorType.SNOWFLAKE) assert connection and len(connection) == 1 and connection[0].qualified_name results = ( FluentSearch() @@ -90,20 +74,12 @@ def query(client: AtlanClient, folder: Folder) -> Generator[Query, None, None]: schema = results.current_page()[0] assert schema and schema.qualified_name assert folder and folder.qualified_name - to_create = Query.creator( - name=QUERY_NAME, parent_folder_qualified_name=folder.qualified_name - ) - to_create.with_raw_query( - schema_qualified_name=schema.qualified_name, query=RAW_QUERY - ) + to_create = Query.creator(name=QUERY_NAME, parent_folder_qualified_name=folder.qualified_name) + to_create.with_raw_query(schema_qualified_name=schema.qualified_name, query=RAW_QUERY) response = client.asset.save(to_create) result = response.assets_created(asset_type=Query)[0] updated = response.assets_updated(asset_type=Folder)[0] - assert ( - updated - and updated.guid == folder.guid - and updated.qualified_name == folder.qualified_name - ) + assert updated and updated.guid == folder.guid and updated.qualified_name == folder.qualified_name yield result delete_asset(client, guid=result.guid, asset_type=Folder) @@ -130,9 +106,7 @@ def test_create_sub_folder(sub_folder: Folder, folder: Folder, collection: Colle assert sub_folder.parent_qualified_name == folder.qualified_name -def test_create_query( - client: AtlanClient, query: Query, folder: Folder, collection: Collection -): +def test_create_query(client: AtlanClient, query: Query, folder: Folder, collection: Collection): assert query assert query.name == QUERY_NAME assert query.guid and query.qualified_name diff --git a/tests/integration/kafka_asset_test.py b/tests/integration/kafka_asset_test.py index ca3a0b87d..bd13f3984 100644 --- a/tests/integration/kafka_asset_test.py +++ b/tests/integration/kafka_asset_test.py @@ -31,21 +31,15 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.KAFKA - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.KAFKA) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def kafka_topic( - client: AtlanClient, connection: Connection -) -> Generator[KafkaTopic, None, None]: +def kafka_topic(client: AtlanClient, connection: Connection) -> Generator[KafkaTopic, None, None]: assert connection.qualified_name - to_create = KafkaTopic.creator( - name=KAKFA_TOPIC_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = KafkaTopic.creator(name=KAKFA_TOPIC_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=KafkaTopic)[0] yield result @@ -66,9 +60,7 @@ def test_kafka_topic( @pytest.fixture(scope="module") -def consumer_group( - client: AtlanClient, kafka_topic: KafkaTopic -) -> Generator[KafkaConsumerGroup, None, None]: +def consumer_group(client: AtlanClient, kafka_topic: KafkaTopic) -> Generator[KafkaConsumerGroup, None, None]: assert kafka_topic.qualified_name to_create = KafkaConsumerGroup.creator( name=KAKFA_CONSUMER_GROUP_NAME, @@ -138,9 +130,7 @@ def test_update_kafka_assets( def _retrieve_kafka_assets(client, asset, asset_type): - retrieved = client.asset.get_by_guid( - asset.guid, asset_type=asset_type, ignore_relationships=False - ) + retrieved = client.asset.get_by_guid(asset.guid, asset_type=asset_type, ignore_relationships=False) assert retrieved assert not retrieved.is_incomplete assert retrieved.guid == asset.guid @@ -185,9 +175,7 @@ def test_read_deleted_kafka_consumer_group( client: AtlanClient, consumer_group: KafkaConsumerGroup, ): - deleted = client.asset.get_by_guid( - consumer_group.guid, asset_type=KafkaConsumerGroup, ignore_relationships=False - ) + deleted = client.asset.get_by_guid(consumer_group.guid, asset_type=KafkaConsumerGroup, ignore_relationships=False) assert deleted assert deleted.status == EntityStatus.DELETED assert deleted.guid == consumer_group.guid @@ -200,9 +188,7 @@ def test_restore_kafka_consumer_group( consumer_group: KafkaConsumerGroup, ): assert consumer_group.qualified_name - assert client.asset.restore( - asset_type=KafkaConsumerGroup, qualified_name=consumer_group.qualified_name - ) + assert client.asset.restore(asset_type=KafkaConsumerGroup, qualified_name=consumer_group.qualified_name) assert consumer_group.qualified_name restored = client.asset.get_by_qualified_name( asset_type=KafkaConsumerGroup, diff --git a/tests/integration/lineage_test.py b/tests/integration/lineage_test.py index 91ec86281..e31cbc8f9 100644 --- a/tests/integration/lineage_test.py +++ b/tests/integration/lineage_test.py @@ -50,29 +50,21 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result # TODO: proper connection delete workflow delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def database( - client: AtlanClient, connection: Connection -) -> Generator[Database, None, None]: - db = create_database( - client=client, connection=connection, database_name=DATABASE_NAME - ) +def database(client: AtlanClient, connection: Connection) -> Generator[Database, None, None]: + db = create_database(client=client, connection=connection, database_name=DATABASE_NAME) yield db delete_asset(client, guid=db.guid, asset_type=Database) def create_database(client: AtlanClient, connection, database_name: str): - to_create = Database.create( - name=database_name, connection_qualified_name=connection.qualified_name - ) + to_create = Database.create(name=database_name, connection_qualified_name=connection.qualified_name) to_create.certificate_status = CERTIFICATE_STATUS to_create.certificate_status_message = CERTIFICATE_MESSAGE result = client.asset.save(to_create) @@ -86,9 +78,7 @@ def schema( database: Database, ) -> Generator[Schema, None, None]: assert database.qualified_name - to_create = Schema.create( - name=SCHEMA_NAME, database_qualified_name=database.qualified_name - ) + to_create = Schema.create(name=SCHEMA_NAME, database_qualified_name=database.qualified_name) result = client.asset.save(to_create) sch = result.assets_created(asset_type=Schema)[0] yield sch @@ -103,9 +93,7 @@ def table( schema: Schema, ) -> Generator[Table, None, None]: assert schema.qualified_name - to_create = Table.create( - name=TABLE_NAME, schema_qualified_name=schema.qualified_name - ) + to_create = Table.create(name=TABLE_NAME, schema_qualified_name=schema.qualified_name) result = client.asset.save(to_create) tbl = result.assets_created(asset_type=Table)[0] yield tbl @@ -120,9 +108,7 @@ def mview( schema: Schema, ) -> Generator[MaterialisedView, None, None]: assert schema.qualified_name - to_create = MaterialisedView.create( - name=MVIEW_NAME, schema_qualified_name=schema.qualified_name - ) + to_create = MaterialisedView.create(name=MVIEW_NAME, schema_qualified_name=schema.qualified_name) result = client.asset.save(to_create) mv = result.assets_created(asset_type=MaterialisedView)[0] yield mv @@ -442,9 +428,7 @@ def test_fetch_lineage_start_list( lineage_start: Process, lineage_end: Process, ): - lineage = FluentLineage( - starting_guid=table.guid, includes_on_results=Asset.NAME, size=1 - ).request + lineage = FluentLineage(starting_guid=table.guid, includes_on_results=Asset.NAME, size=1).request response = client.asset.get_lineage_list(lineage) assert response results = [] @@ -461,9 +445,7 @@ def test_fetch_lineage_start_list( assert isinstance(results[3], View) assert results[3].depth == 2 assert results[3].guid == view.guid - lineage = FluentLineage( - starting_guid=table.guid, direction=LineageDirection.UPSTREAM - ).request + lineage = FluentLineage(starting_guid=table.guid, direction=LineageDirection.UPSTREAM).request response = client.asset.get_lineage_list(lineage) assert response assert not response.has_more @@ -544,9 +526,7 @@ def test_fetch_lineage_middle_list( lineage_start: Process, lineage_end: Process, ): - lineage = FluentLineage( - starting_guid=mview.guid, includes_on_results=Asset.NAME, size=5 - ).request + lineage = FluentLineage(starting_guid=mview.guid, includes_on_results=Asset.NAME, size=5).request response = client.asset.get_lineage_list(lineage) assert response results = [] @@ -556,9 +536,7 @@ def test_fetch_lineage_middle_list( assert isinstance(results[0], Process) assert isinstance(results[1], View) assert results[1].guid == view.guid - lineage = FluentLineage( - starting_guid=mview.guid, direction=LineageDirection.UPSTREAM, size=5 - ).request + lineage = FluentLineage(starting_guid=mview.guid, direction=LineageDirection.UPSTREAM, size=5).request response = client.asset.get_lineage_list(lineage) assert response results = [] @@ -581,15 +559,11 @@ def test_fetch_lineage_end_list( lineage_start: Process, lineage_end: Process, ): - lineage = FluentLineage( - starting_guid=view.guid, includes_on_results=Asset.NAME, size=10 - ).request + lineage = FluentLineage(starting_guid=view.guid, includes_on_results=Asset.NAME, size=10).request response = client.asset.get_lineage_list(lineage) assert response assert not response.has_more - lineage = FluentLineage( - starting_guid=view.guid, direction=LineageDirection.UPSTREAM - ).request + lineage = FluentLineage(starting_guid=view.guid, direction=LineageDirection.UPSTREAM).request response = client.asset.get_lineage_list(lineage) assert response results = [] @@ -696,22 +670,16 @@ def test_restore_lineage( ): assert lineage_start.qualified_name assert lineage_start.name - to_restore = Process.create_for_modification( - lineage_start.qualified_name, lineage_start.name - ) + to_restore = Process.create_for_modification(lineage_start.qualified_name, lineage_start.name) to_restore.status = EntityStatus.ACTIVE client.asset.save(to_restore) - restored = client.asset.get_by_guid( - lineage_start.guid, asset_type=Process, ignore_relationships=False - ) + restored = client.asset.get_by_guid(lineage_start.guid, asset_type=Process, ignore_relationships=False) assert restored count = 0 # TODO: replace with exponential back-off and jitter while restored.status == EntityStatus.DELETED: time.sleep(2) - restored = client.asset.get_by_guid( - lineage_start.guid, asset_type=Process, ignore_relationships=False - ) + restored = client.asset.get_by_guid(lineage_start.guid, asset_type=Process, ignore_relationships=False) count += 1 assert restored.guid == lineage_start.guid assert restored.qualified_name == lineage_start.qualified_name diff --git a/tests/integration/persona_test.py b/tests/integration/persona_test.py index 9e51a8b96..2684763d3 100644 --- a/tests/integration/persona_test.py +++ b/tests/integration/persona_test.py @@ -26,9 +26,7 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result # TODO: proper connection delete workflow delete_asset(client, guid=result.guid, asset_type=Connection) @@ -79,9 +77,7 @@ def test_update_persona( ): assert persona.qualified_name assert persona.name - to_update = Persona.create_for_modification( - persona.qualified_name, persona.name, True - ) + to_update = Persona.create_for_modification(persona.qualified_name, persona.name, True) to_update.description = "Now with a description!" to_update.deny_asset_tabs = { AssetSidebarTab.LINEAGE.value, @@ -189,9 +185,7 @@ def test_retrieve_persona( for policy in policies: # Need to retrieve the full policy if we want to see any info about it # (what comes back on the Persona itself are just policy references) - full = client.asset.get_by_guid( - guid=policy.guid, asset_type=AuthPolicy, ignore_relationships=False - ) + full = client.asset.get_by_guid(guid=policy.guid, asset_type=AuthPolicy, ignore_relationships=False) assert full sub_cat = full.policy_sub_category assert sub_cat diff --git a/tests/integration/preset_asset_test.py b/tests/integration/preset_asset_test.py index cf66f00df..5b662b72a 100644 --- a/tests/integration/preset_asset_test.py +++ b/tests/integration/preset_asset_test.py @@ -39,21 +39,15 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def preset_workspace( - client: AtlanClient, connection: Connection -) -> Generator[PresetWorkspace, None, None]: +def preset_workspace(client: AtlanClient, connection: Connection) -> Generator[PresetWorkspace, None, None]: assert connection.qualified_name - to_create = PresetWorkspace.create( - name=PRESET_WORKSPACE_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = PresetWorkspace.create(name=PRESET_WORKSPACE_NAME, connection_qualified_name=connection.qualified_name) response = client.asset.save(to_create) result = response.assets_created(asset_type=PresetWorkspace)[0] yield result @@ -126,17 +120,13 @@ def test_overload_preset_dashboard( assert preset_dashboard_overload assert preset_dashboard_overload.guid assert preset_dashboard_overload.qualified_name - assert ( - preset_dashboard_overload.connection_qualified_name == connection.qualified_name - ) + assert preset_dashboard_overload.connection_qualified_name == connection.qualified_name assert preset_dashboard_overload.name == PRESET_DASHBOARD_NAME_OVERLOAD assert preset_dashboard_overload.connector_name == AtlanConnectorType.PRESET.value @pytest.fixture(scope="module") -def preset_chart( - client: AtlanClient, preset_dashboard: PresetDashboard -) -> Generator[PresetChart, None, None]: +def preset_chart(client: AtlanClient, preset_dashboard: PresetDashboard) -> Generator[PresetChart, None, None]: assert preset_dashboard.qualified_name to_create = PresetChart.create( name=PRESET_CHART_NAME, @@ -156,9 +146,7 @@ def test_preset_chart( assert preset_chart assert preset_chart.guid assert preset_chart.qualified_name - assert ( - preset_chart.preset_dashboard_qualified_name == preset_dashboard.qualified_name - ) + assert preset_chart.preset_dashboard_qualified_name == preset_dashboard.qualified_name assert preset_chart.name == PRESET_CHART_NAME assert preset_chart.connector_name == AtlanConnectorType.PRESET.value @@ -190,10 +178,7 @@ def test_overload_preset_chart( assert preset_chart_overload assert preset_chart_overload.guid assert preset_chart_overload.qualified_name - assert ( - preset_chart_overload.preset_dashboard_qualified_name - == preset_dashboard_overload.qualified_name - ) + assert preset_chart_overload.preset_dashboard_qualified_name == preset_dashboard_overload.qualified_name assert preset_chart_overload.name == PRESET_CHART_NAME_OVERLOAD assert preset_chart_overload.connector_name == AtlanConnectorType.PRESET.value @@ -253,9 +238,7 @@ def test_overload_preset_dataset( assert preset_dataset_overload assert preset_dataset_overload.guid assert preset_dataset_overload.qualified_name - assert ( - preset_dataset_overload.connection_qualified_name == connection.qualified_name - ) + assert preset_dataset_overload.connection_qualified_name == connection.qualified_name assert preset_dataset_overload.name == PRESET_DATASET_NAME_OVERLOAD assert preset_dataset_overload.connector_name == AtlanConnectorType.PRESET.value @@ -331,9 +314,7 @@ def test_retrieve_preset_dashboard( client: AtlanClient, preset_dashboard: PresetDashboard, ): - b = client.asset.get_by_guid( - preset_dashboard.guid, asset_type=PresetDashboard, ignore_relationships=False - ) + b = client.asset.get_by_guid(preset_dashboard.guid, asset_type=PresetDashboard, ignore_relationships=False) assert b assert not b.is_incomplete assert b.guid == preset_dashboard.guid @@ -375,9 +356,7 @@ def test_update_preset_dashboard_again( @pytest.mark.order(after="test_update_preset_dashboard_again") -def test_delete_preset_dashboard( - client: AtlanClient, preset_dashboard: PresetDashboard -): +def test_delete_preset_dashboard(client: AtlanClient, preset_dashboard: PresetDashboard): response = client.asset.delete_by_guid(preset_dashboard.guid) assert response assert not response.assets_created(asset_type=PresetDashboard) @@ -397,9 +376,7 @@ def test_restore_dashboard( preset_dashboard: PresetDashboard, ): assert preset_dashboard.qualified_name - assert client.asset.restore( - asset_type=PresetDashboard, qualified_name=preset_dashboard.qualified_name - ) + assert client.asset.restore(asset_type=PresetDashboard, qualified_name=preset_dashboard.qualified_name) assert preset_dashboard.qualified_name restored = client.asset.get_by_qualified_name( asset_type=PresetDashboard, diff --git a/tests/integration/purpose_test.py b/tests/integration/purpose_test.py index b12155bac..84712f92b 100644 --- a/tests/integration/purpose_test.py +++ b/tests/integration/purpose_test.py @@ -38,9 +38,7 @@ @pytest.fixture(scope="module") def snowflake_conn(client: AtlanClient): - return client.asset.find_connections_by_name( - "development", AtlanConnectorType.SNOWFLAKE - )[0] + return client.asset.find_connections_by_name("development", AtlanConnectorType.SNOWFLAKE)[0] @pytest.fixture(scope="module") @@ -133,9 +131,7 @@ def test_purpose(client: AtlanClient, purpose: Purpose, atlan_tag_name: AtlanTag assert purpose.name == MODULE_NAME assert purpose.display_name == MODULE_NAME assert purpose.qualified_name != MODULE_NAME - purpose = client.asset.get_by_guid( - guid=purpose.guid, asset_type=Purpose, ignore_relationships=False - ) + purpose = client.asset.get_by_guid(guid=purpose.guid, asset_type=Purpose, ignore_relationships=False) assert purpose.purpose_atlan_tags assert [atlan_tag_name] == purpose.purpose_atlan_tags @@ -147,9 +143,7 @@ def test_update_purpose( ): assert purpose.qualified_name assert purpose.name - to_update = Purpose.create_for_modification( - purpose.qualified_name, purpose.name, True - ) + to_update = Purpose.create_for_modification(purpose.qualified_name, purpose.name, True) to_update.description = "Now with a description!" to_update.deny_asset_tabs = { AssetSidebarTab.LINEAGE.value, @@ -175,9 +169,7 @@ def test_find_purpose_by_name( ): result = None with contextlib.suppress(NotFoundError): - result = client.asset.find_purposes_by_name( - MODULE_NAME, attributes=["purposeClassifications"] - ) + result = client.asset.find_purposes_by_name(MODULE_NAME, attributes=["purposeClassifications"]) count = 0 # TODO: replace with exponential back-off and jitter while not result and count < 10: @@ -248,9 +240,7 @@ def test_retrieve_purpose( for policy in policies: # Need to retrieve the full policy if we want to see any info about it # (what comes back on the Persona itself are just policy references) - full = client.asset.get_by_guid( - guid=policy.guid, asset_type=AuthPolicy, ignore_relationships=False - ) + full = client.asset.get_by_guid(guid=policy.guid, asset_type=AuthPolicy, ignore_relationships=False) assert full sub_cat = full.policy_sub_category assert sub_cat @@ -289,10 +279,7 @@ def test_token_permissions(client: AtlanClient, token): assert result.attributes assert result.attributes.persona_qualified_name assert len(result.attributes.persona_qualified_name) == 1 - assert ( - next(iter(result.attributes.persona_qualified_name)).persona_qualified_name - == persona.qualified_name - ) + assert next(iter(result.attributes.persona_qualified_name)).persona_qualified_name == persona.qualified_name @pytest.mark.skip(reason="Test failing with HekaException") diff --git a/tests/integration/quick_sight_asset_test.py b/tests/integration/quick_sight_asset_test.py index 6a04dfe55..430300f65 100644 --- a/tests/integration/quick_sight_asset_test.py +++ b/tests/integration/quick_sight_asset_test.py @@ -46,17 +46,13 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def quick_sight_folder( - client: AtlanClient, connection: Connection -) -> Generator[QuickSightFolder, None, None]: +def quick_sight_folder(client: AtlanClient, connection: Connection) -> Generator[QuickSightFolder, None, None]: assert connection.qualified_name to_create = QuickSightFolder.creator( name=QUICKSIGHT_FOLDER_NAME, @@ -187,9 +183,7 @@ def quick_sight_dashboard_visual( delete_asset(client, guid=result.guid, asset_type=QuickSightDashboardVisual) -def test_sight_folder( - client: AtlanClient, connection: Connection, quick_sight_folder: QuickSightFolder -): +def test_sight_folder(client: AtlanClient, connection: Connection, quick_sight_folder: QuickSightFolder): assert quick_sight_folder assert quick_sight_folder.guid assert quick_sight_folder.qualified_name @@ -215,9 +209,7 @@ def test_sight_folder( assert asset.qualified_name == quick_sight_folder.qualified_name -def test_sight_dataset( - client: AtlanClient, connection: Connection, quick_sight_dataset: QuickSightDataset -): +def test_sight_dataset(client: AtlanClient, connection: Connection, quick_sight_dataset: QuickSightDataset): assert quick_sight_dataset assert quick_sight_dataset.guid assert quick_sight_dataset.qualified_name @@ -225,10 +217,7 @@ def test_sight_dataset( assert quick_sight_dataset.quick_sight_id == QUICKSIGHT_DATASET_ID assert quick_sight_dataset.connection_qualified_name == connection.qualified_name assert quick_sight_dataset.connector_name == AtlanConnectorType.QUICKSIGHT.value - assert ( - quick_sight_dataset.quick_sight_dataset_import_mode - == QuickSightDatasetImportMode.SPICE - ) + assert quick_sight_dataset.quick_sight_dataset_import_mode == QuickSightDatasetImportMode.SPICE to_update = quick_sight_dataset.updater( name=quick_sight_dataset.name, qualified_name=quick_sight_dataset.qualified_name @@ -319,20 +308,10 @@ def test_sight_dataset_field( assert quick_sight_dataset_field.qualified_name assert quick_sight_dataset_field.name == QUICKSIGHT_DATASET_FIELD_NAME assert quick_sight_dataset_field.quick_sight_id == QUICKSIGHT_DATASET_FIELD_ID - assert ( - quick_sight_dataset_field.connection_qualified_name == connection.qualified_name - ) - assert ( - quick_sight_dataset_field.connector_name == AtlanConnectorType.QUICKSIGHT.value - ) - assert ( - quick_sight_dataset_field.quick_sight_dataset_qualified_name - == quick_sight_dataset.qualified_name - ) - assert ( - quick_sight_dataset_field.quick_sight_dataset_field_type - == QuickSightDatasetFieldType.STRING - ) + assert quick_sight_dataset_field.connection_qualified_name == connection.qualified_name + assert quick_sight_dataset_field.connector_name == AtlanConnectorType.QUICKSIGHT.value + assert quick_sight_dataset_field.quick_sight_dataset_qualified_name == quick_sight_dataset.qualified_name + assert quick_sight_dataset_field.quick_sight_dataset_field_type == QuickSightDatasetFieldType.STRING to_update = quick_sight_dataset_field.updater( name=quick_sight_dataset_field.name, @@ -363,18 +342,9 @@ def test_sight_analysis_visual( assert quick_sight_analysis_visual.qualified_name assert quick_sight_analysis_visual.name == QUICKSIGHT_ANALYSIS_VISUAL_NAME assert quick_sight_analysis_visual.quick_sight_id == QUICKSIGHT_ANALYSIS_VISUAL_ID - assert ( - quick_sight_analysis_visual.connection_qualified_name - == connection.qualified_name - ) - assert ( - quick_sight_analysis_visual.connector_name - == AtlanConnectorType.QUICKSIGHT.value - ) - assert ( - quick_sight_analysis_visual.quick_sight_analysis_qualified_name - == quick_sight_analysis.qualified_name - ) + assert quick_sight_analysis_visual.connection_qualified_name == connection.qualified_name + assert quick_sight_analysis_visual.connector_name == AtlanConnectorType.QUICKSIGHT.value + assert quick_sight_analysis_visual.quick_sight_analysis_qualified_name == quick_sight_analysis.qualified_name assert quick_sight_analysis_visual.quick_sight_sheet_id == QUICKSIGHT_SHEET_ID assert quick_sight_analysis_visual.quick_sight_sheet_name == QUICKSIGHT_SHEET_NAME @@ -407,18 +377,9 @@ def test_sight_dashboard_visual( assert quick_sight_dashboard_visual.qualified_name assert quick_sight_dashboard_visual.name == QUICKSIGHT_DASHBOARD_VISUAL_NAME assert quick_sight_dashboard_visual.quick_sight_id == QUICKSIGHT_DASHBOARD_VISUAL_ID - assert ( - quick_sight_dashboard_visual.connection_qualified_name - == connection.qualified_name - ) - assert ( - quick_sight_dashboard_visual.connector_name - == AtlanConnectorType.QUICKSIGHT.value - ) - assert ( - quick_sight_dashboard_visual.quick_sight_dashboard_qualified_name - == quick_sight_dashboard.qualified_name - ) + assert quick_sight_dashboard_visual.connection_qualified_name == connection.qualified_name + assert quick_sight_dashboard_visual.connector_name == AtlanConnectorType.QUICKSIGHT.value + assert quick_sight_dashboard_visual.quick_sight_dashboard_qualified_name == quick_sight_dashboard.qualified_name assert quick_sight_dashboard_visual.quick_sight_sheet_id == QUICKSIGHT_SHEET_ID assert quick_sight_dashboard_visual.quick_sight_sheet_name == QUICKSIGHT_SHEET_NAME diff --git a/tests/integration/requests_test.py b/tests/integration/requests_test.py index 16d62fe53..3f93473ce 100644 --- a/tests/integration/requests_test.py +++ b/tests/integration/requests_test.py @@ -23,11 +23,7 @@ def delete_token(client: AtlanClient, token: Optional[ApiToken] = None): if not token: tokens = client.token.get().records assert tokens - delete_tokens = [ - token - for token in tokens - if token.display_name and "psdk_Requests" in token.display_name - ] + delete_tokens = [token for token in tokens if token.display_name and "psdk_Requests" in token.display_name] for token in delete_tokens: assert token and token.guid client.token.purge(token.guid) diff --git a/tests/integration/s3_asset_test.py b/tests/integration/s3_asset_test.py index 662433723..55d37396b 100644 --- a/tests/integration/s3_asset_test.py +++ b/tests/integration/s3_asset_test.py @@ -34,18 +34,14 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result # TODO: proper connection delete workflow delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def bucket( - client: AtlanClient, connection: Connection -) -> Generator[S3Bucket, None, None]: +def bucket(client: AtlanClient, connection: Connection) -> Generator[S3Bucket, None, None]: assert connection.qualified_name to_create = S3Bucket.create( name=BUCKET_NAME, @@ -59,9 +55,7 @@ def bucket( @pytest.fixture(scope="module") -def bucket_with_name( - client: AtlanClient, connection: Connection -) -> Generator[S3Bucket, None, None]: +def bucket_with_name(client: AtlanClient, connection: Connection) -> Generator[S3Bucket, None, None]: assert connection.qualified_name to_create = S3Bucket.create( name=BUCKET_NAME, @@ -179,9 +173,7 @@ def _assert_update_bucket(client, bucket, with_name=False): def _assert_retrieve_bucket(client, bucket, s3object, with_name=False): - b = client.asset.get_by_guid( - bucket.guid, asset_type=S3Bucket, ignore_relationships=False - ) + b = client.asset.get_by_guid(bucket.guid, asset_type=S3Bucket, ignore_relationships=False) assert b assert not b.is_incomplete assert b.guid == bucket.guid @@ -244,9 +236,7 @@ def _assert_delete_object(client, s3object): def _assert_read_delete_object(client, s3object): - deleted = client.asset.get_by_guid( - s3object.guid, asset_type=S3Object, ignore_relationships=False - ) + deleted = client.asset.get_by_guid(s3object.guid, asset_type=S3Object, ignore_relationships=False) assert deleted assert deleted.guid == s3object.guid assert deleted.qualified_name == s3object.qualified_name @@ -255,9 +245,7 @@ def _assert_read_delete_object(client, s3object): def _assert_restore_object(client, s3object): assert s3object.qualified_name - assert client.asset.restore( - asset_type=S3Object, qualified_name=s3object.qualified_name - ) + assert client.asset.restore(asset_type=S3Object, qualified_name=s3object.qualified_name) assert s3object.qualified_name restored = client.asset.get_by_qualified_name( asset_type=S3Object, @@ -339,9 +327,7 @@ def test_retrieve_bucket_with_name( bucket_with_name: S3Bucket, s3object_with_name: S3Object, ): - _assert_retrieve_bucket( - client, bucket_with_name, s3object_with_name, with_name=True - ) + _assert_retrieve_bucket(client, bucket_with_name, s3object_with_name, with_name=True) @pytest.mark.order(after="test_retrieve_bucket") diff --git a/tests/integration/suggestions_test.py b/tests/integration/suggestions_test.py index ef1cffc8b..7a07fff91 100644 --- a/tests/integration/suggestions_test.py +++ b/tests/integration/suggestions_test.py @@ -57,9 +57,7 @@ def wait_for_consistency(): @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @@ -70,9 +68,7 @@ def database( connection: Connection, upsert: Callable[[Asset], AssetMutationResponse], ): - to_create = Database.creator( - name=DATABASE_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = Database.creator(name=DATABASE_NAME, connection_qualified_name=connection.qualified_name) result = upsert(to_create) assert result database = result.assets_created(asset_type=Database)[0] @@ -445,9 +441,7 @@ def owner_group( def test_connection(client: AtlanClient, connection: Connection): - results = client.asset.find_connections_by_name( - name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE - ) + results = client.asset.find_connections_by_name(name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE) assert results and len(results) == 1 assert results[0].guid == connection.guid assert results[0].qualified_name == connection.qualified_name @@ -541,7 +535,6 @@ def test_column1( schema2: Schema, database: Database, ): - # Table column 1 assert t1c1.connector_name == CONNECTOR_TYPE assert t1c1.table_name == TABLE_NAME @@ -609,9 +602,7 @@ def test_update_table1( response = client.asset.save(to_update, replace_atlan_tags=True) assert response and response.mutated_entities - assert ( - response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 - ) # table + 2x terms + assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 # table + 2x terms expected_types = {asset.type_name for asset in response.mutated_entities.UPDATE} assert expected_types == {Table.__name__, AtlasGlossaryTerm.__name__} assert (tables := response.assets_updated(asset_type=Table)) @@ -655,9 +646,7 @@ def test_update_table3( response = client.asset.save(to_update, replace_atlan_tags=True) assert response and response.mutated_entities - assert ( - response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 - ) # table + 2x terms + assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 # table + 2x terms expected_types = {asset.type_name for asset in response.mutated_entities.UPDATE} assert expected_types == {Table.__name__, AtlasGlossaryTerm.__name__} assert (tables := response.assets_updated(asset_type=Table)) @@ -699,9 +688,7 @@ def test_update_table1_column1( response = client.asset.save(to_update, replace_atlan_tags=True) assert response and response.mutated_entities - assert ( - response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 - ) # column + 2x terms + assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 # column + 2x terms expected_types = {asset.type_name for asset in response.mutated_entities.UPDATE} assert expected_types == {Column.__name__, AtlasGlossaryTerm.__name__} assert (columns := response.assets_updated(asset_type=Column)) @@ -738,9 +725,7 @@ def test_update_view1_column1( response = client.asset.save(to_update, replace_atlan_tags=True) assert response and response.mutated_entities - assert ( - response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 2 - ) # column + term + assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 2 # column + term expected_types = {asset.type_name for asset in response.mutated_entities.UPDATE} assert expected_types == {Column.__name__, AtlasGlossaryTerm.__name__} assert (columns := response.assets_updated(asset_type=Column)) @@ -777,13 +762,9 @@ def test_suggestions_default( assert response.atlan_tags[1].value == ATLAN_TAG_NAME1 assert response.assigned_terms and len(response.assigned_terms) == 2 assert response.assigned_terms[0].count == 2 - assert response.assigned_terms[0].value == AtlasGlossaryTerm.ref_by_qualified_name( - term2.qualified_name - ) + assert response.assigned_terms[0].value == AtlasGlossaryTerm.ref_by_qualified_name(term2.qualified_name) assert response.assigned_terms[1].count == 1 - assert response.assigned_terms[1].value == AtlasGlossaryTerm.ref_by_qualified_name( - term1.qualified_name - ) + assert response.assigned_terms[1].value == AtlasGlossaryTerm.ref_by_qualified_name(term1.qualified_name) def test_suggestions_accross_types( @@ -796,12 +777,7 @@ def test_suggestions_accross_types( assert term1 and term1.qualified_name assert term2 and term2.qualified_name assert owner_group and owner_group.name - response = ( - Suggestions(includes=Suggestions.TYPE.all()) - .finder(view1) - .with_other_type("Table") - .get() - ) + response = Suggestions(includes=Suggestions.TYPE.all()).finder(view1).with_other_type("Table").get() assert response assert response.owner_groups and len(response.owner_groups) == 1 @@ -873,9 +849,7 @@ def test_apply_t2c1( ) assert response and response.mutated_entities - assert ( - response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 2 - ) # column + term + assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 2 # column + term one = response.mutated_entities.UPDATE[0] assert one and one.owner_groups == {owner_group.name} # System description should be untouched (still empty) @@ -900,9 +874,7 @@ def test_apply_v2c1( ) assert response and response.mutated_entities - assert ( - response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 1 - ) + assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 1 one = response.mutated_entities.UPDATE[0] assert one and one.owner_groups == set() # System description should be untouched (still empty) diff --git a/tests/integration/superset_asset_test.py b/tests/integration/superset_asset_test.py index 987d32fde..4ba04db63 100644 --- a/tests/integration/superset_asset_test.py +++ b/tests/integration/superset_asset_test.py @@ -36,17 +36,13 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def superset_dashboard( - client: AtlanClient, connection: Connection -) -> Generator[SupersetDashboard, None, None]: +def superset_dashboard(client: AtlanClient, connection: Connection) -> Generator[SupersetDashboard, None, None]: assert connection.qualified_name to_create = SupersetDashboard.create( name=SUPERSET_DASHBOARD_NAME, @@ -72,9 +68,7 @@ def test_superset_dashboard( @pytest.fixture(scope="module") -def superset_chart( - client: AtlanClient, superset_dashboard: SupersetDashboard -) -> Generator[SupersetChart, None, None]: +def superset_chart(client: AtlanClient, superset_dashboard: SupersetDashboard) -> Generator[SupersetChart, None, None]: assert superset_dashboard.qualified_name to_create = SupersetChart.create( name=SUPERSET_CHART_NAME, @@ -94,10 +88,7 @@ def test_superset_chart( assert superset_chart assert superset_chart.guid assert superset_chart.qualified_name - assert ( - superset_chart.superset_dashboard_qualified_name - == superset_dashboard.qualified_name - ) + assert superset_chart.superset_dashboard_qualified_name == superset_dashboard.qualified_name assert superset_chart.name == SUPERSET_CHART_NAME assert superset_chart.connector_name == AtlanConnectorType.SUPERSET.value @@ -129,10 +120,7 @@ def test_overload_superset_chart( assert superset_chart_overload assert superset_chart_overload.guid assert superset_chart_overload.qualified_name - assert ( - superset_chart_overload.superset_dashboard_qualified_name - == superset_dashboard.qualified_name - ) + assert superset_chart_overload.superset_dashboard_qualified_name == superset_dashboard.qualified_name assert superset_chart_overload.name == SUPERSET_CHART_NAME_OVERLOAD assert superset_chart_overload.connector_name == AtlanConnectorType.SUPERSET.value @@ -192,9 +180,7 @@ def test_overload_superset_dataset( assert superset_dataset_overload assert superset_dataset_overload.guid assert superset_dataset_overload.qualified_name - assert ( - superset_dataset_overload.connection_qualified_name == connection.qualified_name - ) + assert superset_dataset_overload.connection_qualified_name == connection.qualified_name assert superset_dataset_overload.name == SUPERSET_DATASET_NAME_OVERLOAD assert superset_dataset_overload.connector_name == AtlanConnectorType.SUPERSET.value @@ -316,9 +302,7 @@ def test_update_superset_dashboard_again( @pytest.mark.order(after="test_update_superset_dashboard_again") -def test_delete_superset_dashboard( - client: AtlanClient, superset_dashboard: SupersetDashboard -): +def test_delete_superset_dashboard(client: AtlanClient, superset_dashboard: SupersetDashboard): response = client.asset.delete_by_guid(superset_dashboard.guid) assert response assert not response.assets_created(asset_type=SupersetDashboard) @@ -338,9 +322,7 @@ def test_restore_dashboard( superset_dashboard: SupersetDashboard, ): assert superset_dashboard.qualified_name - assert client.asset.restore( - asset_type=SupersetDashboard, qualified_name=superset_dashboard.qualified_name - ) + assert client.asset.restore(asset_type=SupersetDashboard, qualified_name=superset_dashboard.qualified_name) assert superset_dashboard.qualified_name restored = client.asset.get_by_qualified_name( asset_type=SupersetDashboard, diff --git a/tests/integration/test_asset_batch.py b/tests/integration/test_asset_batch.py index e444652d0..fdb580749 100644 --- a/tests/integration/test_asset_batch.py +++ b/tests/integration/test_asset_batch.py @@ -46,9 +46,7 @@ def wait_for_consistency(): @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection( - client=client, name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE - ) + result = create_connection(client=client, name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @@ -58,9 +56,7 @@ def database( connection: Connection, upsert: Callable[[Asset], AssetMutationResponse], ): - to_create = Database.creator( - name=DATABASE_NAME, connection_qualified_name=connection.qualified_name - ) + to_create = Database.creator(name=DATABASE_NAME, connection_qualified_name=connection.qualified_name) result = upsert(to_create) assert result database = result.assets_created(asset_type=Database)[0] @@ -86,9 +82,7 @@ def schema( @pytest.fixture(scope="module") -def batch_table_create( - client: AtlanClient, schema: Schema -) -> Generator[Batch, None, None]: +def batch_table_create(client: AtlanClient, schema: Schema) -> Generator[Batch, None, None]: assert schema and schema.qualified_name batch = Batch( client=client, @@ -132,18 +126,12 @@ def batch_table_create( ) assert created and created.guid response = client.asset.purge_by_guid(created.guid) - if ( - not response - or not response.mutated_entities - or not response.mutated_entities.DELETE - ): + if not response or not response.mutated_entities or not response.mutated_entities.DELETE: LOGGER.error(f"Failed to remove asset with GUID {asset.guid}.") @pytest.fixture(scope="module") -def batch_table_update( - client: AtlanClient, schema: Schema -) -> Generator[Batch, None, None]: +def batch_table_update(client: AtlanClient, schema: Schema) -> Generator[Batch, None, None]: assert schema and schema.qualified_name batch = Batch( client=client, @@ -171,10 +159,7 @@ def test_batch_create(batch_table_create: Batch, schema: Schema): # Verify that 5 assets (3 tables, 1 view, 1 materialized view) were created assert batch.created and len(batch.created) == 5 and batch.num_created == 5 - assert all( - asset.type_name in {Table.__name__, View.__name__, MaterialisedView.__name__} - for asset in batch.created - ) + assert all(asset.type_name in {Table.__name__, View.__name__, MaterialisedView.__name__} for asset in batch.created) # Ensure the schema was updated assert batch.updated and len(batch.updated) == 1 and batch.num_updated == 1 @@ -182,9 +167,7 @@ def test_batch_create(batch_table_create: Batch, schema: Schema): @pytest.mark.order(after="test_batch_create") -def test_batch_update( - wait_for_consistency, client: AtlanClient, batch_table_create: Batch -): +def test_batch_update(wait_for_consistency, client: AtlanClient, batch_table_create: Batch): # Table with view qn / mview qn # 1. table_view_agnostic and update only -- update -- table? -> view? -> mview # 2. not table_view_agnostic and update only -- skip -- table? -> view? -> mview? - not found @@ -338,11 +321,7 @@ def test_batch_update( assert results and results.count == 1 assert results.current_page() and len(results.current_page()) == 1 created_table = results.current_page()[0] - assert ( - created_table - and created_table.guid - and created_table.qualified_name == view.qualified_name - ) + assert created_table and created_table.guid and created_table.qualified_name == view.qualified_name # Verify the new table was created and has the updated user description assert created_table.user_description == SUB_TEST3_DESCRIPTION @@ -367,9 +346,7 @@ def test_batch_update( ) SUB_TEST4_DESCRIPTION = f"[sub-test4] {DESCRIPTION}" - table = Table.updater( - qualified_name=table1.qualified_name.lower(), name=table1.name - ) + table = Table.updater(qualified_name=table1.qualified_name.lower(), name=table1.name) table.user_description = SUB_TEST4_DESCRIPTION batch4.add(table) batch4.flush() @@ -393,11 +370,7 @@ def test_batch_update( assert results and results.count == 1 assert results.current_page() and len(results.current_page()) == 1 updated_table = results.current_page()[0] - assert ( - updated_table - and updated_table.guid - and updated_table.qualified_name == table1.qualified_name - ) + assert updated_table and updated_table.guid and updated_table.qualified_name == table1.qualified_name assert updated_table.user_description == SUB_TEST4_DESCRIPTION # [sub-test-5]: Table with table qn (case_insensitive=False, update_only=True) @@ -435,11 +408,7 @@ def test_batch_update( assert results and results.count == 1 assert results.current_page() and len(results.current_page()) == 1 updated_table = results.current_page()[0] - assert ( - updated_table - and updated_table.guid - and updated_table.qualified_name == table1.qualified_name - ) + assert updated_table and updated_table.guid and updated_table.qualified_name == table1.qualified_name assert updated_table.user_description == SUB_TEST5_DESCRIPTION # [sub-test-6]: (same operation as sub-test-5) @@ -478,9 +447,7 @@ def test_batch_update( ) SUB_TEST7_DESCRIPTION = f"[sub-test7] {DESCRIPTION}" - table = Table.updater( - qualified_name=table1.qualified_name.lower(), name=table1.name - ) + table = Table.updater(qualified_name=table1.qualified_name.lower(), name=table1.name) table.user_description = SUB_TEST7_DESCRIPTION batch7.add(table) batch7.flush() @@ -506,11 +473,7 @@ def test_batch_update( assert results.current_page() and len(results.current_page()) == 1 created_table = results.current_page()[0] - assert ( - created_table - and created_table.guid - and created_table.qualified_name == table.qualified_name - ) + assert created_table and created_table.guid and created_table.qualified_name == table.qualified_name assert created_table.is_partial assert created_table.user_description == SUB_TEST7_DESCRIPTION diff --git a/tests/integration/test_client.py b/tests/integration/test_client.py index bfe3301a0..6b9c45f19 100644 --- a/tests/integration/test_client.py +++ b/tests/integration/test_client.py @@ -45,9 +45,7 @@ CLASSIFICATION_NAME = "Issue" SL_SORT_BY_TIMESTAMP = SortItem(field="timestamp", order=SortOrder.ASCENDING) SL_SORT_BY_GUID = SortItem(field="entityGuidsAll", order=SortOrder.ASCENDING) -SL_SORT_BY_QUALIFIED_NAME = SortItem( - field="entityQFNamesAll", order=SortOrder.ASCENDING -) +SL_SORT_BY_QUALIFIED_NAME = SortItem(field="entityQFNamesAll", order=SortOrder.ASCENDING) AUDIT_SORT_BY_GUID = SortItem(field="entityId", order=SortOrder.ASCENDING) AUDIT_SORT_BY_LATEST = SortItem("created", order=SortOrder.DESCENDING) MODULE_NAME = TestId.make_unique("Client") @@ -80,7 +78,6 @@ def argo_fake_token(client: AtlanClient) -> Generator[ApiToken, None, None]: def glossary( client: AtlanClient, ) -> Generator[AtlasGlossary, None, None]: - g = AtlasGlossary.creator(name=StrictStr(MODULE_NAME)) g.description = TEST_SYSTEM_DESCRIPTION g.user_description = TEST_USER_DESCRIPTION @@ -92,9 +89,7 @@ def glossary( @pytest.fixture(scope="module") -def term( - client: AtlanClient, glossary: AtlasGlossary -) -> Generator[AtlasGlossaryTerm, None, None]: +def term(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryTerm, None, None]: t = AtlasGlossaryTerm.creator( name=StrictStr(MODULE_NAME), glossary_guid=StrictStr(glossary.guid), @@ -130,9 +125,7 @@ def announcement(): @pytest.fixture() -def database( - client: AtlanClient, connection: Connection -) -> Generator[Database, None, None]: +def database(client: AtlanClient, connection: Connection) -> Generator[Database, None, None]: """Get a database with function scope""" database_name = TestId.make_unique("my_db") db = create_database(client, connection, database_name) @@ -153,9 +146,7 @@ def create_glossary(client: AtlanClient, name: str) -> AtlasGlossary: @pytest.fixture(scope="module") def audit_glossary(client: AtlanClient) -> Generator[AtlasGlossary, None, None]: - created_glossary = create_glossary( - client, TestId.make_unique("test-audit-glossary") - ) + created_glossary = create_glossary(client, TestId.make_unique("test-audit-glossary")) yield created_glossary delete_asset(client, guid=created_glossary.guid, asset_type=AtlasGlossary) @@ -177,9 +168,7 @@ def _test_update_certificate( ): assert test_asset.qualified_name assert test_asset.name - test_asset = client.asset.get_by_guid( - guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False - ) + test_asset = client.asset.get_by_guid(guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False) assert test_asset.qualified_name assert test_asset.name assert test_asset.certificate_status is None @@ -193,9 +182,7 @@ def _test_update_certificate( message=message, glossary_guid=glossary_guid if glossary_guid else None, ) - test_asset = client.asset.get_by_guid( - guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False - ) + test_asset = client.asset.get_by_guid(guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False) assert test_asset.certificate_status == CertificateStatus.DRAFT assert test_asset.certificate_status_message == message @@ -214,9 +201,7 @@ def _test_remove_certificate( name=test_asset.name, glossary_guid=glossary_guid if glossary_guid else None, ) - test_asset = client.asset.get_by_guid( - guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False - ) + test_asset = client.asset.get_by_guid(guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False) assert test_asset.certificate_status is None assert test_asset.certificate_status_message is None @@ -237,9 +222,7 @@ def _test_update_announcement( announcement=test_announcement, glossary_guid=glossary_guid if glossary_guid else None, ) - test_asset = client.asset.get_by_guid( - guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False - ) + test_asset = client.asset.get_by_guid(guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False) assert test_asset.get_announcment() == test_announcement @@ -257,9 +240,7 @@ def _test_remove_announcement( name=test_asset.name, glossary_guid=glossary_guid if glossary_guid else None, ) - test_asset = client.asset.get_by_guid( - guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False - ) + test_asset = client.asset.get_by_guid(guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False) assert test_asset.get_announcment() is None @@ -269,14 +250,8 @@ def test_append_terms_with_guid( database: Database, ): time.sleep(5) - assert ( - database := client.asset.append_terms( - guid=database.guid, asset_type=Database, terms=[term1] - ) - ) - database = client.asset.get_by_guid( - guid=database.guid, asset_type=Database, ignore_relationships=False - ) + assert (database := client.asset.append_terms(guid=database.guid, asset_type=Database, terms=[term1])) + database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) assert database.assigned_terms assert len(database.assigned_terms) == 1 assert database.assigned_terms[0].guid == term1.guid @@ -293,9 +268,7 @@ def test_append_terms_with_qualified_name( qualified_name=database.qualified_name, asset_type=Database, terms=[term1] ) ) - database = client.asset.get_by_guid( - guid=database.guid, asset_type=Database, ignore_relationships=False - ) + database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) assert database.assigned_terms assert len(database.assigned_terms) == 1 assert database.assigned_terms[0].guid == term1.guid @@ -314,9 +287,7 @@ def test_append_terms_using_ref_by_guid_for_term( terms=[AtlasGlossaryTerm.ref_by_guid(guid=term1.guid)], ) ) - database = client.asset.get_by_guid( - guid=database.guid, asset_type=Database, ignore_relationships=False - ) + database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) assert database.assigned_terms assert len(database.assigned_terms) == 1 assert database.assigned_terms[0].guid == term1.guid @@ -337,15 +308,9 @@ def test_replace_a_term( ) ) - assert ( - database := client.asset.replace_terms( - guid=database.guid, asset_type=Database, terms=[term2] - ) - ) + assert (database := client.asset.replace_terms(guid=database.guid, asset_type=Database, terms=[term2])) - database = client.asset.get_by_guid( - guid=database.guid, asset_type=Database, ignore_relationships=False - ) + database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) assert database.assigned_terms assert len(database.assigned_terms) == 1 assert database.assigned_terms[0].guid == term2.guid @@ -365,15 +330,9 @@ def test_replace_all_term( ) ) - assert ( - database := client.asset.replace_terms( - guid=database.guid, asset_type=Database, terms=[] - ) - ) + assert (database := client.asset.replace_terms(guid=database.guid, asset_type=Database, terms=[])) - database = client.asset.get_by_guid( - guid=database.guid, asset_type=Database, ignore_relationships=False - ) + database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) assert database.assigned_terms == [] assert len(database.assigned_terms) == 0 @@ -404,9 +363,7 @@ def test_remove_term( ) ) - database = client.asset.get_by_guid( - guid=database.guid, asset_type=Database, ignore_relationships=False - ) + database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) assert database.assigned_terms assert len(database.assigned_terms) == 1 assert database.assigned_terms[0].guid == term2.guid @@ -423,22 +380,16 @@ def test_find_connections_by_name(client: AtlanClient): def test_get_asset_by_guid_good_guid(client: AtlanClient, glossary: AtlasGlossary): - glossary = client.asset.get_by_guid( - glossary.guid, AtlasGlossary, ignore_relationships=False - ) + glossary = client.asset.get_by_guid(glossary.guid, AtlasGlossary, ignore_relationships=False) assert isinstance(glossary, AtlasGlossary) -def test_get_asset_by_guid_without_asset_type( - client: AtlanClient, glossary: AtlasGlossary -): +def test_get_asset_by_guid_without_asset_type(client: AtlanClient, glossary: AtlasGlossary): glossary = client.asset.get_by_guid(glossary.guid, ignore_relationships=False) assert isinstance(glossary, AtlasGlossary) -def test_get_minimal_asset_without_asset_type( - client: AtlanClient, glossary: AtlasGlossary -): +def test_get_minimal_asset_without_asset_type(client: AtlanClient, glossary: AtlasGlossary): glossary = client.asset.retrieve_minimal(glossary.guid) assert isinstance(glossary, AtlasGlossary) @@ -469,9 +420,7 @@ def test_get_by_guid_with_fs(client: AtlanClient, term: AtlasGlossaryTerm): assert result.anchor is None # Should call `GET_ENTITY_BY_GUID` API with `ignore_relationships=False` - result = client.asset.get_by_guid( - guid=term.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + result = client.asset.get_by_guid(guid=term.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) assert isinstance(result, AtlasGlossaryTerm) assert result.guid == term.guid assert hasattr(result, "attributes") @@ -528,9 +477,7 @@ def test_get_by_qualified_name_with_fs(client: AtlanClient, term: AtlasGlossaryT time.sleep(5) # Default - should call `GET_ENTITY_BY_GUID` API assert term and term.qualified_name - result = client.asset.get_by_qualified_name( - qualified_name=term.qualified_name, asset_type=AtlasGlossaryTerm - ) + result = client.asset.get_by_qualified_name(qualified_name=term.qualified_name, asset_type=AtlasGlossaryTerm) assert isinstance(result, AtlasGlossaryTerm) assert result.guid == term.guid assert hasattr(result, "attributes") @@ -618,9 +565,7 @@ def test_upsert_when_no_changes(client: AtlanClient, glossary: AtlasGlossary): def test_get_by_qualified_name(client: AtlanClient, glossary: AtlasGlossary): qualified_name = glossary.qualified_name or "" - glossary = client.asset.get_by_qualified_name( - qualified_name=qualified_name, asset_type=AtlasGlossary - ) + glossary = client.asset.get_by_qualified_name(qualified_name=qualified_name, asset_type=AtlasGlossary) assert glossary.attributes.qualified_name == qualified_name @@ -632,19 +577,13 @@ def test_get_by_qualified_name_when_superclass_specified_raises_not_found_error( NotFoundError, match="ATLAN-PYTHON-404-014 The Asset asset could not be found by name: ", ): - client.asset.get_by_qualified_name( - qualified_name=qualified_name, asset_type=Asset - ) + client.asset.get_by_qualified_name(qualified_name=qualified_name, asset_type=Asset) def test_add_classification(client: AtlanClient, term1: AtlasGlossaryTerm): assert term1.qualified_name - client.asset.add_atlan_tags( - AtlasGlossaryTerm, term1.qualified_name, [CLASSIFICATION_NAME] - ) - glossary_term = client.asset.get_by_guid( - term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + client.asset.add_atlan_tags(AtlasGlossaryTerm, term1.qualified_name, [CLASSIFICATION_NAME]) + glossary_term = client.asset.get_by_guid(term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) assert glossary_term.atlan_tags assert len(glossary_term.atlan_tags) == 1 classification = glossary_term.atlan_tags[0] @@ -655,9 +594,7 @@ def test_add_classification(client: AtlanClient, term1: AtlasGlossaryTerm): def test_include_atlan_tag_names(client: AtlanClient, term1: AtlasGlossaryTerm): assert term1 and term1.qualified_name query = Term.with_type_name(term1.type_name) + Term.with_name(term1.name) - request = IndexSearchRequest( - dsl=DSL(query=query), exclude_atlan_tags=True, include_atlan_tag_names=False - ) + request = IndexSearchRequest(dsl=DSL(query=query), exclude_atlan_tags=True, include_atlan_tag_names=False) response = client.asset.search(criteria=request) # Ensure classification names are not present @@ -666,9 +603,7 @@ def test_include_atlan_tag_names(client: AtlanClient, term1: AtlasGlossaryTerm): assert response.current_page()[0].guid == term1.guid assert response.current_page()[0].classification_names is None - request = IndexSearchRequest( - dsl=DSL(query=query), exclude_atlan_tags=True, include_atlan_tag_names=True - ) + request = IndexSearchRequest(dsl=DSL(query=query), exclude_atlan_tags=True, include_atlan_tag_names=True) response = client.asset.search(criteria=request) # Ensure classification names are present @@ -682,12 +617,8 @@ def test_include_atlan_tag_names(client: AtlanClient, term1: AtlasGlossaryTerm): @pytest.mark.order(after="test_add_classification") def test_remove_classification(client: AtlanClient, term1: AtlasGlossaryTerm): assert term1.qualified_name - client.asset.remove_atlan_tag( - AtlasGlossaryTerm, term1.qualified_name, CLASSIFICATION_NAME - ) - glossary_term = client.asset.get_by_guid( - term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False - ) + client.asset.remove_atlan_tag(AtlasGlossaryTerm, term1.qualified_name, CLASSIFICATION_NAME) + glossary_term = client.asset.get_by_guid(term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) assert not glossary_term.atlan_tags @@ -695,9 +626,7 @@ def test_glossary_update_certificate(client: AtlanClient, glossary: AtlasGlossar _test_update_certificate(client, glossary, AtlasGlossary) -def test_glossary_term_update_certificate( - client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary -): +def test_glossary_term_update_certificate(client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary): _test_update_certificate(client, term1, AtlasGlossaryTerm, glossary.guid) @@ -713,9 +642,7 @@ def test_glossary_remove_certificate(client: AtlanClient, glossary: AtlasGlossar @pytest.mark.order(after="test_glossary_term_update_certificate") -def test_glossary_term_remove_certificate( - client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary -): +def test_glossary_term_remove_certificate(client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary): _test_remove_certificate(client, term1, AtlasGlossaryTerm, glossary.guid) @@ -726,9 +653,7 @@ def test_glossary_category_remove_certificate( _test_remove_certificate(client, category, AtlasGlossaryCategory, glossary.guid) -def test_glossary_update_announcement( - client: AtlanClient, glossary: AtlasGlossary, announcement: Announcement -): +def test_glossary_update_announcement(client: AtlanClient, glossary: AtlasGlossary, announcement: Announcement): _test_update_announcement(client, glossary, AtlasGlossary, announcement) @@ -759,9 +684,7 @@ def test_glossary_term_update_announcement( glossary: AtlasGlossary, announcement: Announcement, ): - _test_update_announcement( - client, term1, AtlasGlossaryTerm, announcement, glossary.guid - ) + _test_update_announcement(client, term1, AtlasGlossaryTerm, announcement, glossary.guid) def test_glossary_category_update_announcement( @@ -770,9 +693,7 @@ def test_glossary_category_update_announcement( glossary: AtlasGlossary, announcement: Announcement, ): - _test_update_announcement( - client, category, AtlasGlossaryCategory, announcement, glossary.guid - ) + _test_update_announcement(client, category, AtlasGlossaryCategory, announcement, glossary.guid) @pytest.mark.order(after="test_glossary_update_announcement") @@ -781,9 +702,7 @@ def test_glossary_remove_announcement(client: AtlanClient, glossary: AtlasGlossa @pytest.mark.order(after="test_glossary_term_update_announcement") -def test_glossary_term_remove_announcement( - client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary -): +def test_glossary_term_remove_announcement(client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary): _test_remove_announcement(client, term1, AtlasGlossaryTerm, glossary.guid) @@ -802,9 +721,7 @@ def test_audit_find_by_user( size = 10 assert current_user.username - results = client.audit.search( - AuditSearchRequest.by_user(current_user.username, size=size, sort=[]) - ) + results = client.audit.search(AuditSearchRequest.by_user(current_user.username, size=size, sort=[])) assert results.total_count > 0 assert size == len(results.current_page()) audit_entity = results.current_page()[0] @@ -826,20 +743,16 @@ def generate_audit_entries(client: AtlanClient, audit_glossary: AtlasGlossary): qualified_name=audit_glossary.qualified_name, name=audit_glossary.name, ) - updater.description = f"Updated description {i+1}" + updater.description = f"Updated description {i + 1}" client.asset.save(updater) time.sleep(1) request = AuditSearchRequest.by_guid(guid=audit_glossary.guid, size=log_count) response = client.audit.search(request) - assert ( - response.total_count >= log_count - ), f"Expected at least {log_count} logs, but got {response.total_count}." + assert response.total_count >= log_count, f"Expected at least {log_count} logs, but got {response.total_count}." -def _assert_audit_search_results( - results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, bulk=False -): +def _assert_audit_search_results(results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, bulk=False): assert results.total_count > size assert len(results.current_page()) == size counter = 0 @@ -872,9 +785,7 @@ def test_audit_search_pagination( results = client.audit.search(criteria=request, bulk=False) TOTAL_AUDIT_ENTRIES = results.total_count expected_sorts = [SortItem(field="entityId", order=SortOrder.ASCENDING)] - _assert_audit_search_results( - results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, False - ) + _assert_audit_search_results(results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, False) # Test audit search by guid with `bulk` option using timestamp-based pagination dsl = DSL( @@ -888,9 +799,7 @@ def test_audit_search_pagination( SortItem("created", order=SortOrder.ASCENDING), SortItem(field="entityId", order=SortOrder.ASCENDING), ] - _assert_audit_search_results( - results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, True - ) + _assert_audit_search_results(results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, True) assert mock_logger.call_count == 1 assert "Audit bulk search option is enabled." in mock_logger.call_args_list[0][0][0] mock_logger.reset_mock() @@ -909,14 +818,9 @@ def test_audit_search_pagination( SortItem("created", order=SortOrder.ASCENDING), SortItem(field="entityId", order=SortOrder.ASCENDING), ] - _assert_audit_search_results( - results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, True - ) + _assert_audit_search_results(results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, True) assert mock_logger.call_count < TOTAL_AUDIT_ENTRIES - assert ( - "Audit bulk search option is enabled." - in mock_logger.call_args_list[0][0][0] - ) + assert "Audit bulk search option is enabled." in mock_logger.call_args_list[0][0][0] mock_logger.reset_mock() # When the number of results exceeds the predefined threshold and bulk is `False` and no pre-defined sort. @@ -934,14 +838,9 @@ def test_audit_search_pagination( SortItem("created", order=SortOrder.ASCENDING), SortItem(field="entityId", order=SortOrder.ASCENDING), ] - _assert_audit_search_results( - results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, False - ) + _assert_audit_search_results(results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, False) assert mock_logger.call_count < TOTAL_AUDIT_ENTRIES - assert ( - "Result size (%s) exceeds threshold (%s)." - in mock_logger.call_args_list[0][0][0] - ) + assert "Result size (%s) exceeds threshold (%s)." in mock_logger.call_args_list[0][0][0] mock_logger.reset_mock() @@ -1041,13 +940,9 @@ def test_audit_search_default_sorting(client: AtlanClient, audit_info: AuditInfo assert sort_options[1].field == AUDIT_SORT_BY_LATEST.field -def _view_test_glossary_by_search( - client: AtlanClient, sl_glossary: AtlasGlossary -) -> None: +def _view_test_glossary_by_search(client: AtlanClient, sl_glossary: AtlasGlossary) -> None: time.sleep(2) - index = ( - FluentSearch().where(Asset.GUID.eq(sl_glossary.guid, case_insensitive=True)) - ).to_request() + index = (FluentSearch().where(Asset.GUID.eq(sl_glossary.guid, case_insensitive=True))).to_request() index.request_metadata = IndexSearchRequest.Metadata( utm_tags=[ UTMTags.ACTION_ASSET_VIEWED, @@ -1082,9 +977,7 @@ def test_search_log_most_recent_viewers( # Test exclude users assert current_user.username - request = SearchLogRequest.most_recent_viewers( - guid=sl_glossary.guid, exclude_users=[current_user.username] - ) + request = SearchLogRequest.most_recent_viewers(guid=sl_glossary.guid, exclude_users=[current_user.username]) response = client.search_log.search(request) if not isinstance(response, SearchLogViewResults): pytest.fail(f"Failed to retrieve most recent viewers of : {sl_glossary.name}") @@ -1128,9 +1021,7 @@ def _assert_most_viewed_assets( prev_count = response.count assert prev_count assert current_user.username - request = SearchLogRequest.most_viewed_assets( - max_assets=10, exclude_users=[current_user.username] - ) + request = SearchLogRequest.most_viewed_assets(max_assets=10, exclude_users=[current_user.username]) response = client.search_log.search(request) if not isinstance(response, SearchLogViewResults): pytest.fail("Failed to retrieve most viewed assets") @@ -1140,9 +1031,7 @@ def _assert_most_viewed_assets( @pytest.mark.order(after="test_search_log_most_viewed_assets") -def test_search_log_views_by_guid( - client: AtlanClient, current_user: UserMinimalResponse, sl_glossary: AtlasGlossary -): +def test_search_log_views_by_guid(client: AtlanClient, current_user: UserMinimalResponse, sl_glossary: AtlasGlossary): request = SearchLogRequest.views_by_guid(guid=sl_glossary.guid, size=10) response = client.search_log.search(request) if not isinstance(response, SearchLogResults): @@ -1173,9 +1062,7 @@ def test_search_log_views_by_guid( # Test exclude users assert current_user.username - request = SearchLogRequest.views_by_guid( - guid=sl_glossary.guid, size=10, exclude_users=[current_user.username] - ) + request = SearchLogRequest.views_by_guid(guid=sl_glossary.guid, size=10, exclude_users=[current_user.username]) response = client.search_log.search(request) if not isinstance(response, SearchLogResults): pytest.fail("Failed to retrieve asset detailed log entries") @@ -1193,14 +1080,10 @@ def generate_search_logs(client: AtlanClient, sl_glossary: AtlasGlossary): request = SearchLogRequest.views_by_guid(guid=sl_glossary.guid, size=20) response = client.search_log.search(request) - assert ( - response.count >= log_count - ), f"Expected at least {log_count} logs, but got {response.count}." + assert response.count >= log_count, f"Expected at least {log_count} logs, but got {response.count}." -def _assert_search_log_results( - results, expected_sorts, size, TOTAL_LOG_ENTRIES, bulk=False -): +def _assert_search_log_results(results, expected_sorts, size, TOTAL_LOG_ENTRIES, bulk=False): assert results.count > size assert len(results.current_page()) == size counter = 0 @@ -1214,9 +1097,7 @@ def _assert_search_log_results( @patch.object(SEARCH_LOG_LOGGER, "debug") -def test_search_log_pagination( - mock_logger, generate_search_logs, sl_glossary: AtlasGlossary, client: AtlanClient -): +def test_search_log_pagination(mock_logger, generate_search_logs, sl_glossary: AtlasGlossary, client: AtlanClient): size = 2 # Test search logs by GUID with default offset-based pagination search_log_request = SearchLogRequest.views_by_guid( @@ -1247,10 +1128,7 @@ def test_search_log_pagination( ] _assert_search_log_results(results, expected_sorts, size, TOTAL_LOG_ENTRIES, True) assert mock_logger.call_count == 1 - assert ( - "Search log bulk search option is enabled." - in mock_logger.call_args_list[0][0][0] - ) + assert "Search log bulk search option is enabled." in mock_logger.call_args_list[0][0][0] mock_logger.reset_mock() # When the number of results exceeds the predefined threshold and bulk=True @@ -1265,14 +1143,9 @@ def test_search_log_pagination( SortItem(field="createdAt", order=SortOrder.ASCENDING), SortItem(field="entityGuidsAll", order=SortOrder.ASCENDING), ] - _assert_search_log_results( - results, expected_sorts, size, TOTAL_LOG_ENTRIES, True - ) + _assert_search_log_results(results, expected_sorts, size, TOTAL_LOG_ENTRIES, True) assert mock_logger.call_count < TOTAL_LOG_ENTRIES - assert ( - "Search log bulk search option is enabled." - in mock_logger.call_args_list[0][0][0] - ) + assert "Search log bulk search option is enabled." in mock_logger.call_args_list[0][0][0] mock_logger.reset_mock() # When results exceed threshold and bulk=False, SDK auto-switches to bulk search @@ -1289,10 +1162,7 @@ def test_search_log_pagination( ] _assert_search_log_results(results, expected_sorts, size, TOTAL_LOG_ENTRIES) assert mock_logger.call_count < TOTAL_LOG_ENTRIES - assert ( - "Result size (%s) exceeds threshold (%s)." - in mock_logger.call_args_list[0][0][0] - ) + assert "Result size (%s) exceeds threshold (%s)." in mock_logger.call_args_list[0][0][0] mock_logger.reset_mock() @@ -1356,33 +1226,21 @@ def test_search_log_default_sorting(client: AtlanClient, sl_glossary: AtlasGloss assert sort_options[2].field == SL_SORT_BY_TIMESTAMP.field -def test_client_401_token_refresh( - client: AtlanClient, expired_token: ApiToken, argo_fake_token: ApiToken, monkeypatch -): +def test_client_401_token_refresh(client: AtlanClient, expired_token: ApiToken, argo_fake_token: ApiToken, monkeypatch): # Use a smaller retry count to speed up test execution DEFAULT_RETRY.total = 1 # Retrieve required client information before updating the client with invalid API tokens assert argo_fake_token and argo_fake_token.guid - argo_client_secret = client.impersonate.get_client_secret( - client_guid=argo_fake_token.guid - ) + argo_client_secret = client.impersonate.get_client_secret(client_guid=argo_fake_token.guid) # Retrieve the user ID associated with the expired token's username # Since user credentials for API tokens cannot be retrieved directly, use the existing username - expired_token_user_id = client.impersonate.get_user_id( - username=expired_token.username - ) + expired_token_user_id = client.impersonate.get_user_id(username=expired_token.username) # Initialize the client with an expired/invalid token (results in 401 Unauthorized errors) - assert ( - expired_token - and expired_token.attributes - and expired_token.attributes.access_token - ) - client = AtlanClient( - api_key=expired_token.attributes.access_token, retry=DEFAULT_RETRY - ) + assert expired_token and expired_token.attributes and expired_token.attributes.access_token + client = AtlanClient(api_key=expired_token.attributes.access_token, retry=DEFAULT_RETRY) expired_api_token = expired_token.attributes.access_token # Case 1: No user_id (default) @@ -1392,9 +1250,9 @@ def test_client_401_token_refresh( AuthenticationError, match="Server responded with an authentication error 401", ): - FluentSearch().where(CompoundQuery.active_assets()).where( - CompoundQuery.asset_type(AtlasGlossary) - ).page_size(100).execute(client=client) + FluentSearch().where(CompoundQuery.active_assets()).where(CompoundQuery.asset_type(AtlasGlossary)).page_size( + 100 + ).execute(client=client) # Case 2: Invalid user_id # Test that providing an invalid user ID results in the same authentication error @@ -1403,9 +1261,9 @@ def test_client_401_token_refresh( AuthenticationError, match="Server responded with an authentication error 401", ): - FluentSearch().where(CompoundQuery.active_assets()).where( - CompoundQuery.asset_type(AtlasGlossary) - ).page_size(100).execute(client=client) + FluentSearch().where(CompoundQuery.active_assets()).where(CompoundQuery.asset_type(AtlasGlossary)).page_size( + 100 + ).execute(client=client) # Case 3: Valid user_id associated with the expired token # This should trigger a retry, refresh the token diff --git a/tests/integration/test_file_client.py b/tests/integration/test_file_client.py index 90b3b023f..f5d9751f6 100644 --- a/tests/integration/test_file_client.py +++ b/tests/integration/test_file_client.py @@ -49,26 +49,18 @@ def s3_get_presigned_url(client: AtlanClient) -> str: ) -def test_file_client_presigned_url_upload( - client: AtlanClient, s3_put_presigned_url: str -): +def test_file_client_presigned_url_upload(client: AtlanClient, s3_put_presigned_url: str): assert s3_put_presigned_url assert os.path.exists(UPLOAD_FILE_PATH) - client.files.upload_file( - presigned_url=s3_put_presigned_url, file_path=UPLOAD_FILE_PATH - ) + client.files.upload_file(presigned_url=s3_put_presigned_url, file_path=UPLOAD_FILE_PATH) -def test_file_client_presigned_url_download( - client: AtlanClient, s3_get_presigned_url: str -): +def test_file_client_presigned_url_download(client: AtlanClient, s3_get_presigned_url: str): assert s3_get_presigned_url assert not os.path.exists(DOWNLOAD_FILE_PATH) - client.files.download_file( - presigned_url=s3_get_presigned_url, file_path=DOWNLOAD_FILE_PATH - ) + client.files.download_file(presigned_url=s3_get_presigned_url, file_path=DOWNLOAD_FILE_PATH) assert os.path.exists(DOWNLOAD_FILE_PATH) assert imghdr.what(DOWNLOAD_FILE_PATH) == "png" os.remove(DOWNLOAD_FILE_PATH) diff --git a/tests/integration/test_index_search.py b/tests/integration/test_index_search.py index 4f17b35dd..f1fa06683 100644 --- a/tests/integration/test_index_search.py +++ b/tests/integration/test_index_search.py @@ -96,9 +96,7 @@ @pytest.fixture(scope="module") def snowflake_conn(client: AtlanClient): - return client.asset.find_connections_by_name( - "development", AtlanConnectorType.SNOWFLAKE - )[0] + return client.asset.find_connections_by_name("development", AtlanConnectorType.SNOWFLAKE)[0] @pytest.fixture(scope="module") @@ -181,11 +179,7 @@ def test_search_source_synced_assets(client: AtlanClient): FluentSearch() .select() .where(CompoundQuery.asset_type(Table)) - .where( - CompoundQuery.tagged_with_value( - EXISTING_SOURCE_SYNCED_TAG, "Highly Restricted" - ) - ) + .where(CompoundQuery.tagged_with_value(EXISTING_SOURCE_SYNCED_TAG, "Highly Restricted")) .execute(client=client) ) if isinstance(table, Table) @@ -196,15 +190,11 @@ def test_search_source_synced_assets(client: AtlanClient): def test_source_tag_assign_with_value(client: AtlanClient, table: Table): # Make sure no tags are assigned initially assert table.guid - table = client.asset.get_by_guid( - guid=table.guid, asset_type=Table, ignore_relationships=False - ) + table = client.asset.get_by_guid(guid=table.guid, asset_type=Table, ignore_relationships=False) assert not table.atlan_tags assert table.name and table.qualified_name - source_tag_name = SourceTagName( - "snowflake/development@@ANALYTICS/WIDE_WORLD_IMPORTERS/CONFIDENTIAL" - ) + source_tag_name = SourceTagName("snowflake/development@@ANALYTICS/WIDE_WORLD_IMPORTERS/CONFIDENTIAL") to_update = table.updater(table.qualified_name, table.name) to_update.atlan_tags = [ AtlanTag.of(atlan_tag_name=AtlanTagName(EXISTING_TAG)), @@ -212,21 +202,14 @@ def test_source_tag_assign_with_value(client: AtlanClient, table: Table): atlan_tag_name=AtlanTagName(EXISTING_SOURCE_SYNCED_TAG), source_tag_attachment=SourceTagAttachment.by_name( name=source_tag_name, - source_tag_values=[ - SourceTagAttachmentValue(tag_attachment_value="Not Restricted") - ], + source_tag_values=[SourceTagAttachmentValue(tag_attachment_value="Not Restricted")], ), ), ] response = client.asset.save(to_update, replace_atlan_tags=True) assert (tables := response.assets_updated(asset_type=Table)) and len(tables) == 1 - assert ( - tables - and len(tables) == 1 - and tables[0].atlan_tags - and len(tables[0].atlan_tags) == 2 - ) + assert tables and len(tables) == 1 and tables[0].atlan_tags and len(tables[0].atlan_tags) == 2 for tag in tables[0].atlan_tags: assert str(tag.type_name) in (EXISTING_TAG, EXISTING_SOURCE_SYNCED_TAG) @@ -240,30 +223,19 @@ def test_source_tag_assign_with_value(client: AtlanClient, table: Table): .select() .where(CompoundQuery.asset_type(Table)) .where(Table.QUALIFIED_NAME.eq(table.qualified_name)) - .where( - CompoundQuery.tagged_with_value( - EXISTING_SOURCE_SYNCED_TAG, "Not Restricted" - ) - ) + .where(CompoundQuery.tagged_with_value(EXISTING_SOURCE_SYNCED_TAG, "Not Restricted")) .execute(client=client) ) if isinstance(table, Table) ] - assert ( - tables - and len(tables) == 1 - and tables[0].atlan_tags - and len(tables[0].atlan_tags) == 2 - ) + assert tables and len(tables) == 1 and tables[0].atlan_tags and len(tables[0].atlan_tags) == 2 for tag in tables[0].atlan_tags: assert str(tag.type_name) in (EXISTING_TAG, EXISTING_SOURCE_SYNCED_TAG) _assert_source_tag(tables, EXISTING_SOURCE_SYNCED_TAG, "Not Restricted") -def test_search_source_specific_custom_attributes( - client: AtlanClient, snowflake_column_qn: str -): +def test_search_source_specific_custom_attributes(client: AtlanClient, snowflake_column_qn: str): # Test with get_by_qualified_name() asset = client.asset.get_by_qualified_name( asset_type=Column, @@ -331,9 +303,7 @@ def test_search_pagination(mock_logger, client: AtlanClient): Asset.NAME.wildcard("jsdk_*"), Asset.NAME.wildcard("gsdk_*"), ] - query = CompoundQuery( - where_nots=exclude_sdk_terms, where_somes=[CompoundQuery.active_assets()] - ).to_query() + query = CompoundQuery(where_nots=exclude_sdk_terms, where_somes=[CompoundQuery.active_assets()]).to_query() # Test search() with DSL: using default offset-based pagination # when results are less than the predefined threshold (i.e: 100,000 assets) @@ -428,10 +398,7 @@ def test_search_pagination(mock_logger, client: AtlanClient): ] _assert_search_results(results, expected_sorts, size, TOTAL_ASSETS) assert mock_logger.call_count < TOTAL_ASSETS - assert ( - "Result size (%s) exceeds threshold (%s)." - in mock_logger.call_args_list[0][0][0] - ) + assert "Result size (%s) exceeds threshold (%s)." in mock_logger.call_args_list[0][0][0] mock_logger.reset_mock() @@ -521,12 +488,7 @@ def test_exists_query_factory(client: AtlanClient, with_name): @pytest.mark.parametrize( "text_query_value, method, clazz", - [ - (method, method, query) - for query in [Match] - for method in sorted(dir(query)) - if method.startswith("with_") - ], + [(method, method, query) for query in [Match] for method in sorted(dir(query)) if method.startswith("with_")], indirect=["text_query_value"], ) def test_text_queries_factory(client: AtlanClient, text_query_value, method, clazz): @@ -584,9 +546,7 @@ def test_bucket_aggregation(client: AtlanClient): def test_nested_bucket_aggregation(client: AtlanClient): - nested_aggs_level_2 = Asset.TYPE_NAME.bucket_by( - nested={"asset_guid": Asset.GUID.bucket_by()} - ) + nested_aggs_level_2 = Asset.TYPE_NAME.bucket_by(nested={"asset_guid": Asset.GUID.bucket_by()}) nested_aggs = Asset.TYPE_NAME.bucket_by(nested={"asset_name": nested_aggs_level_2}) request = ( FluentSearch.select() @@ -629,11 +589,7 @@ def test_aggregation_source_value(client: AtlanClient): .aggregate( "asset_type", Asset.TYPE_NAME.bucket_by( - nested={ - "asset_description": Asset.DESCRIPTION.bucket_by( - include_source_value=True - ) - }, + nested={"asset_description": Asset.DESCRIPTION.bucket_by(include_source_value=True)}, ), ) .sort(Asset.CREATE_TIME.order()) @@ -662,22 +618,15 @@ def test_aggregation_source_value(client: AtlanClient): assert bucket.doc_count assert bucket.nested_results if SearchableField.EMBEDDED_SOURCE_VALUE in bucket.nested_results: - nested_results = bucket.nested_results[ - SearchableField.EMBEDDED_SOURCE_VALUE - ] + nested_results = bucket.nested_results[SearchableField.EMBEDDED_SOURCE_VALUE] assert ( - nested_results - and nested_results.hits - and nested_results.hits.hits - and nested_results.hits.hits[0] + nested_results and nested_results.hits and nested_results.hits.hits and nested_results.hits.hits[0] ) assert bucket.get_source_value(Asset.DESCRIPTION) source_value_found = True if not source_value_found: - pytest.fail( - "Failed to retrieve the source value for asset description in the aggregation" - ) + pytest.fail("Failed to retrieve the source value for asset description in the aggregation") def test_metric_aggregation(client: AtlanClient): @@ -715,9 +664,7 @@ def test_index_search_with_no_aggregation_results(client: AtlanClient): def test_default_sorting(client: AtlanClient): # Empty sorting - request = ( - FluentSearch().where(Asset.QUALIFIED_NAME.eq("test-qn", case_insensitive=True)) - ).to_request() + request = (FluentSearch().where(Asset.QUALIFIED_NAME.eq("test-qn", case_insensitive=True))).to_request() response = client.asset.search(criteria=request) sort_options = response._criteria.dsl.sort # type: ignore assert response @@ -776,9 +723,7 @@ def test_read_timeout(client: AtlanClient): def test_connect_timeout(client: AtlanClient): request = (FluentSearch().select()).to_request() - with client_connection( - connect_timeout=0.0001, retry=Retry(total=0) - ) as timed_client: + with client_connection(connect_timeout=0.0001, retry=Retry(total=0)) as timed_client: with pytest.raises( requests.exceptions.ConnectionError, match=".(timed out\. \(connect timeout=0\.0001\))|(Failed to establish a new connection.)", # noqa W605 diff --git a/tests/integration/test_open_lineage.py b/tests/integration/test_open_lineage.py index f4ff78fa0..20750bcb6 100644 --- a/tests/integration/test_open_lineage.py +++ b/tests/integration/test_open_lineage.py @@ -19,26 +19,19 @@ def connection(client: AtlanClient): admin_role_guid = RoleCache.get_id_for_name("$admin") assert admin_role_guid - response = client.open_lineage.create_connection( - name=MODULE_NAME, admin_roles=[admin_role_guid] - ) + response = client.open_lineage.create_connection(name=MODULE_NAME, admin_roles=[admin_role_guid]) result = response.assets_created(asset_type=Connection)[0] - yield client.asset.get_by_guid( - result.guid, asset_type=Connection, ignore_relationships=False - ) + yield client.asset.get_by_guid(result.guid, asset_type=Connection, ignore_relationships=False) delete_asset(client, asset_type=Connection, guid=result.guid) def test_open_lineage_integration(connection: Connection, client: AtlanClient): - assert connection is not None assert connection.name == MODULE_NAME namespace = "snowflake://abc123.snowflakecomputing.com" producer = "https://your.orchestrator/unique/id/123" - job = OpenLineageJob.creator( - connection_name=MODULE_NAME, job_name="dag_123", producer=producer - ) + job = OpenLineageJob.creator(connection_name=MODULE_NAME, job_name="dag_123", producer=producer) run = OpenLineageRun.creator(job=job) id = job.create_input(namespace=namespace, asset_name="OPS.DEFAULT.RUN_STATS") od = job.create_output(namespace=namespace, asset_name="OPS.DEFAULT.FULL_STATS") @@ -68,9 +61,7 @@ def test_open_lineage_integration(connection: Connection, client: AtlanClient): ] start.emit() - complete = OpenLineageEvent.creator( - run=run, event_type=OpenLineageEventType.COMPLETE - ) + complete = OpenLineageEvent.creator(run=run, event_type=OpenLineageEventType.COMPLETE) complete.emit() assert job @@ -109,21 +100,14 @@ def test_open_lineage_integration(connection: Connection, client: AtlanClient): assert outputs assert process - input_qns = { - input.get("uniqueAttributes", {}).get("qualifiedName") for input in inputs - } + input_qns = {input.get("uniqueAttributes", {}).get("qualifiedName") for input in inputs} assert f"{connection.qualified_name}/OPS/DEFAULT/RUN_STATS" in input_qns assert f"{connection.qualified_name}/SOME/OTHER/TBL" in input_qns assert f"{connection.qualified_name}/AN/OTHER/TBL" in input_qns - outputs_qns = { - output.get("uniqueAttributes", {}).get("qualifiedName") for output in outputs - } + outputs_qns = {output.get("uniqueAttributes", {}).get("qualifiedName") for output in outputs} assert f"{connection.qualified_name}/OPS/DEFAULT/FULL_STATS" in outputs_qns assert f"{connection.qualified_name}/AN/OTHER/VIEW" in outputs_qns - assert ( - process.get("uniqueAttributes", {}).get("qualifiedName") - == f"{connection.qualified_name}/dag_123/process" - ) + assert process.get("uniqueAttributes", {}).get("qualifiedName") == f"{connection.qualified_name}/dag_123/process" delete_asset(client, asset_type=Process, guid=process.get("guid")) delete_asset(client, asset_type=SparkJob, guid=job_asset.detail.guid) diff --git a/tests/integration/test_sql_assets.py b/tests/integration/test_sql_assets.py index 6410a10f8..cf561bc43 100644 --- a/tests/integration/test_sql_assets.py +++ b/tests/integration/test_sql_assets.py @@ -35,11 +35,7 @@ def upsert(client: AtlanClient): def _upsert(asset: Asset) -> AssetMutationResponse: _response = client.asset.save(asset) - if ( - _response - and _response.mutated_entities - and _response.mutated_entities.CREATE - ): + if _response and _response.mutated_entities and _response.mutated_entities.CREATE: guids.append(_response.mutated_entities.CREATE[0].guid) return _response @@ -47,11 +43,7 @@ def _upsert(asset: Asset) -> AssetMutationResponse: for guid in reversed(guids): response = client.asset.purge_by_guid(guid) - if ( - not response - or not response.mutated_entities - or not response.mutated_entities.DELETE - ): + if not response or not response.mutated_entities or not response.mutated_entities.DELETE: LOGGER.error(f"Failed to remove asset with GUID {guid}.") @@ -98,9 +90,7 @@ def test_create( TestConnection.connection = c @pytest.mark.order(after="test_create") - def test_create_for_modification( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestConnection.connection assert TestConnection.connection.name connection = TestConnection.connection @@ -114,9 +104,7 @@ def test_create_for_modification( verify_asset_updated(response, Connection) @pytest.mark.order(after="test_create") - def test_trim_to_required( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestConnection.connection connection = TestConnection.connection.trim_to_required() response = upsert(connection) @@ -154,9 +142,7 @@ def test_create( TestDatabase.database = database @pytest.mark.order(after="test_create") - def test_create_for_modification( - self, client, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_create_for_modification(self, client, upsert: Callable[[Asset], AssetMutationResponse]): assert TestDatabase.database assert TestDatabase.database.qualified_name assert TestDatabase.database.name @@ -170,9 +156,7 @@ def test_create_for_modification( verify_asset_updated(response, Database) @pytest.mark.order(after="test_create") - def test_trim_to_required( - self, client, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_trim_to_required(self, client, upsert: Callable[[Asset], AssetMutationResponse]): assert TestDatabase.database database = TestDatabase.database.trim_to_required() response = upsert(database) @@ -198,14 +182,10 @@ def test_create( response = upsert(schema) assert (schemas := response.assets_created(asset_type=Schema)) assert len(schemas) == 1 - schema = client.asset.get_by_guid( - schemas[0].guid, Schema, ignore_relationships=False - ) + schema = client.asset.get_by_guid(schemas[0].guid, Schema, ignore_relationships=False) assert (databases := response.assets_updated(asset_type=Database)) assert len(databases) == 1 - database = client.asset.get_by_guid( - databases[0].guid, Database, ignore_relationships=False - ) + database = client.asset.get_by_guid(databases[0].guid, Database, ignore_relationships=False) assert database.attributes.schemas schemas = database.attributes.schemas assert len(schemas) == 1 @@ -233,14 +213,10 @@ def test_overload_creator( response = upsert(schema) assert (schemas := response.assets_created(asset_type=Schema)) assert len(schemas) == 1 - overload_schema = client.asset.get_by_guid( - schemas[0].guid, Schema, ignore_relationships=False - ) + overload_schema = client.asset.get_by_guid(schemas[0].guid, Schema, ignore_relationships=False) assert (databases := response.assets_updated(asset_type=Database)) assert len(databases) == 1 - database = client.asset.get_by_guid( - databases[0].guid, Database, ignore_relationships=False - ) + database = client.asset.get_by_guid(databases[0].guid, Database, ignore_relationships=False) assert database.attributes.schemas schemas = database.attributes.schemas assert len(schemas) == 2 @@ -251,25 +227,19 @@ def test_overload_creator( assert overload_schema.guid and overload_schema.guid in schema_guids @pytest.mark.order(after="test_create") - def test_create_for_modification( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestSchema.schema schema = TestSchema.schema assert schema.qualified_name assert schema.name description = f"{schema.description} more stuff" - schema = Schema.create_for_modification( - qualified_name=schema.qualified_name, name=schema.name - ) + schema = Schema.create_for_modification(qualified_name=schema.qualified_name, name=schema.name) schema.description = description response = upsert(schema) verify_asset_updated(response, Schema) @pytest.mark.order(after="test_create") - def test_trim_to_required( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestSchema.schema schema = TestSchema.schema.trim_to_required() response = upsert(schema) @@ -309,14 +279,10 @@ def test_create( response = upsert(table) assert (tables := response.assets_created(asset_type=Table)) assert len(tables) == 1 - table = client.asset.get_by_guid( - guid=tables[0].guid, asset_type=Table, ignore_relationships=False - ) + table = client.asset.get_by_guid(guid=tables[0].guid, asset_type=Table, ignore_relationships=False) assert (schemas := response.assets_updated(asset_type=Schema)) assert len(schemas) == 1 - schema = client.asset.get_by_guid( - guid=schemas[0].guid, asset_type=Schema, ignore_relationships=False - ) + schema = client.asset.get_by_guid(guid=schemas[0].guid, asset_type=Schema, ignore_relationships=False) assert schema.attributes.tables tables = schema.attributes.tables assert len(tables) == 1 @@ -349,14 +315,10 @@ def test_overload_creator( response = upsert(table) assert (tables := response.assets_created(asset_type=Table)) assert len(tables) == 1 - overload_table = client.asset.get_by_guid( - guid=tables[0].guid, asset_type=Table, ignore_relationships=False - ) + overload_table = client.asset.get_by_guid(guid=tables[0].guid, asset_type=Table, ignore_relationships=False) assert (schemas := response.assets_updated(asset_type=Schema)) assert len(schemas) == 1 - schema = client.asset.get_by_guid( - guid=schemas[0].guid, asset_type=Schema, ignore_relationships=False - ) + schema = client.asset.get_by_guid(guid=schemas[0].guid, asset_type=Schema, ignore_relationships=False) assert schema.attributes.tables tables = schema.attributes.tables assert len(tables) == 2 @@ -367,25 +329,19 @@ def test_overload_creator( assert overload_table.guid and overload_table.guid in table_guids @pytest.mark.order(after="test_create") - def test_create_for_modification( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestTable.table table = TestTable.table assert table.qualified_name assert table.name description = f"{table.description} more stuff" - table = Table.create_for_modification( - qualified_name=table.qualified_name, name=table.name - ) + table = Table.create_for_modification(qualified_name=table.qualified_name, name=table.name) table.description = description response = upsert(table) verify_asset_updated(response, Table) @pytest.mark.order(after="test_create") - def test_trim_to_required( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestTable.table table = TestTable.table.trim_to_required() response = upsert(table) @@ -413,9 +369,7 @@ def test_source_read_recent_user_record_list_readable( popularity_insight: PopularityInsights, ): assert TestTable.table - asset = client.asset.get_by_guid( - guid=TestTable.table.guid, asset_type=Table, ignore_relationships=False - ) + asset = client.asset.get_by_guid(guid=TestTable.table.guid, asset_type=Table, ignore_relationships=False) assert asset.source_read_recent_user_record_list asset_popularity = asset.source_read_recent_user_record_list[0] self.verify_popularity(asset_popularity, popularity_insight) @@ -444,28 +398,12 @@ def test_source_read_recent_user_record_list_readable_with_fluent_search( def verify_popularity(self, asset_popularity, popularity_insight): assert popularity_insight.record_user == asset_popularity.record_user - assert ( - popularity_insight.record_query_count == asset_popularity.record_query_count - ) - assert ( - popularity_insight.record_compute_cost - == asset_popularity.record_compute_cost - ) - assert ( - popularity_insight.record_query_count == asset_popularity.record_query_count - ) - assert ( - popularity_insight.record_total_user_count - == asset_popularity.record_total_user_count - ) - assert ( - popularity_insight.record_compute_cost_unit - == asset_popularity.record_compute_cost_unit - ) - assert ( - popularity_insight.record_query_duration - == asset_popularity.record_query_duration - ) + assert popularity_insight.record_query_count == asset_popularity.record_query_count + assert popularity_insight.record_compute_cost == asset_popularity.record_compute_cost + assert popularity_insight.record_query_count == asset_popularity.record_query_count + assert popularity_insight.record_total_user_count == asset_popularity.record_total_user_count + assert popularity_insight.record_compute_cost_unit == asset_popularity.record_compute_cost_unit + assert popularity_insight.record_query_duration == asset_popularity.record_query_duration assert popularity_insight.record_warehouse == asset_popularity.record_warehouse @@ -525,25 +463,19 @@ def test_overload_creator( assert response.guid_assignments @pytest.mark.order(after="test_create") - def test_create_for_modification( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestView.view view = TestView.view assert view.qualified_name assert view.name description = f"{view.description} more stuff" - view = View.create_for_modification( - qualified_name=view.qualified_name, name=view.name - ) + view = View.create_for_modification(qualified_name=view.qualified_name, name=view.name) view.description = description response = upsert(view) verify_asset_updated(response, View) @pytest.mark.order(after="test_create") - def test_trim_to_required( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestView.view view = TestView.view.trim_to_required() response = upsert(view) @@ -614,9 +546,7 @@ def test_overload_creator( assert response.guid_assignments @pytest.mark.order(after="test_creator") - def test_updater( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_updater(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestProcedure.procedure procedure = TestProcedure.procedure assert procedure.qualified_name @@ -633,9 +563,7 @@ def test_updater( verify_asset_updated(response, Procedure) @pytest.mark.order(after="test_creator") - def test_trim_to_required( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestProcedure.procedure procedure = TestProcedure.procedure.trim_to_required() response = upsert(procedure) @@ -703,9 +631,7 @@ def test_overload_creator( assert response.guid_assignments @pytest.mark.order(after="test_creator") - def test_updater( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_updater(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestTablePartition.table_partition table_partition = TestTablePartition.table_partition assert table_partition.qualified_name @@ -720,9 +646,7 @@ def test_updater( verify_asset_updated(response, TablePartition) @pytest.mark.order(after="test_creator") - def test_trim_to_required( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestTablePartition.table_partition table_partition = TestTablePartition.table_partition.trim_to_required() response = upsert(table_partition) @@ -750,12 +674,8 @@ def test_create( response = client.asset.save(column) assert (columns := response.assets_created(asset_type=Column)) assert len(columns) == 1 - column = client.asset.get_by_guid( - asset_type=Column, guid=columns[0].guid, ignore_relationships=False - ) - table = client.asset.get_by_guid( - asset_type=Table, guid=TestTable.table.guid, ignore_relationships=False - ) + column = client.asset.get_by_guid(asset_type=Column, guid=columns[0].guid, ignore_relationships=False) + table = client.asset.get_by_guid(asset_type=Table, guid=TestTable.table.guid, ignore_relationships=False) assert table.attributes.columns columns = table.attributes.columns assert len(columns) == 1 @@ -826,12 +746,8 @@ def test_overload_creator( assert (columns := response.assets_created(asset_type=Column)) assert len(columns) == 1 - overload_column = client.asset.get_by_guid( - asset_type=Column, guid=columns[0].guid, ignore_relationships=False - ) - table = client.asset.get_by_guid( - asset_type=Table, guid=TestTable.table.guid, ignore_relationships=False - ) + overload_column = client.asset.get_by_guid(asset_type=Column, guid=columns[0].guid, ignore_relationships=False) + table = client.asset.get_by_guid(asset_type=Table, guid=TestTable.table.guid, ignore_relationships=False) assert table.attributes.columns columns = table.attributes.columns @@ -843,36 +759,24 @@ def test_overload_creator( assert overload_column.guid and overload_column.guid in column_guids assert overload_column.attributes assert overload_column.attributes.schema_name == TestSchema.schema.name - assert ( - overload_column.attributes.schema_qualified_name - == TestSchema.schema.qualified_name - ) + assert overload_column.attributes.schema_qualified_name == TestSchema.schema.qualified_name assert overload_column.attributes.database_name == TestDatabase.database.name - assert ( - overload_column.attributes.database_qualified_name - == TestDatabase.database.qualified_name - ) + assert overload_column.attributes.database_qualified_name == TestDatabase.database.qualified_name @pytest.mark.order(after="test_create") - def test_create_for_modification( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestColumn.column column = TestColumn.column assert column.qualified_name assert column.name description = f"{column.description} more stuff" - column = Column.create_for_modification( - qualified_name=column.qualified_name, name=column.name - ) + column = Column.create_for_modification(qualified_name=column.qualified_name, name=column.name) column.description = description response = upsert(column) verify_asset_updated(response, Column) @pytest.mark.order(after="test_create") - def test_trim_to_required( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestColumn.column column = TestColumn.column.trim_to_required() response = upsert(column) @@ -889,7 +793,6 @@ def test_create( client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse], ): - assert TestColumn.column and TestColumn.column.guid readme = Readme.create(asset=TestColumn.column, content=self.CONTENT) response = upsert(readme) @@ -897,32 +800,24 @@ def test_create( assert len(reaadmes) == 1 assert (columns := response.assets_updated(asset_type=Column)) assert len(columns) == 1 - readme = client.asset.get_by_guid( - guid=reaadmes[0].guid, asset_type=Readme, ignore_relationships=False - ) + readme = client.asset.get_by_guid(guid=reaadmes[0].guid, asset_type=Readme, ignore_relationships=False) assert readme.description == self.CONTENT TestReadme.readme = readme @pytest.mark.order(after="test_create") - def test_create_for_modification( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestReadme.readme readme = TestReadme.readme assert readme.qualified_name assert readme.name description = f"{readme.description} more stuff" - readme = Readme.create_for_modification( - qualified_name=readme.qualified_name, name=readme.name - ) + readme = Readme.create_for_modification(qualified_name=readme.qualified_name, name=readme.name) readme.description = description response = upsert(readme) verify_asset_updated(response, Readme) @pytest.mark.order(after="test_create") - def test_trim_to_required( - self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] - ): + def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): assert TestReadme.readme readme = TestReadme.readme readme = readme.trim_to_required() diff --git a/tests/integration/test_sso_client.py b/tests/integration/test_sso_client.py index d4078bf37..ef3f75be4 100644 --- a/tests/integration/test_sso_client.py +++ b/tests/integration/test_sso_client.py @@ -26,9 +26,7 @@ def delete_group(client: AtlanClient, guid: str) -> None: def delete_sso_mapping(client: AtlanClient, group_map_id: str) -> None: - response = client.sso.delete_group_mapping( - sso_alias=AtlanSSO.JUMPCLOUD, group_map_id=group_map_id - ) + response = client.sso.delete_group_mapping(sso_alias=AtlanSSO.JUMPCLOUD, group_map_id=group_map_id) assert response is None @@ -47,9 +45,7 @@ def group(client: AtlanClient) -> Generator[AtlanGroup, None, None]: @pytest.fixture(scope="module") -def sso_mapping( - client: AtlanClient, group: AtlanGroup -) -> Generator[SSOMapper, None, None]: +def sso_mapping(client: AtlanClient, group: AtlanGroup) -> Generator[SSOMapper, None, None]: assert group assert group.id response = client.sso.create_group_mapping( @@ -72,9 +68,7 @@ def sso_mapping( delete_sso_mapping(client, azure_group_mapping.id) -def _assert_sso_group_mapping( - group: AtlanGroup, sso_mapping: SSOMapper, is_updated: bool = False -): +def _assert_sso_group_mapping(group: AtlanGroup, sso_mapping: SSOMapper, is_updated: bool = False): assert sso_mapping assert sso_mapping.id assert sso_mapping.identity_provider_alias == AtlanSSO.JUMPCLOUD @@ -125,9 +119,7 @@ def test_sso_create_group_mapping_again_raises_invalid_request_error( ) in str(err.value) -@pytest.mark.order( - after="test_sso_create_group_mapping_again_raises_invalid_request_error" -) +@pytest.mark.order(after="test_sso_create_group_mapping_again_raises_invalid_request_error") def test_sso_retrieve_group_mapping( client: AtlanClient, group: AtlanGroup, @@ -138,9 +130,7 @@ def test_sso_retrieve_group_mapping( assert sso_mapping.id time.sleep(5) - retrieved_sso_mapping = client.sso.get_group_mapping( - sso_alias=AtlanSSO.JUMPCLOUD, group_map_id=sso_mapping.id - ) + retrieved_sso_mapping = client.sso.get_group_mapping(sso_alias=AtlanSSO.JUMPCLOUD, group_map_id=sso_mapping.id) _assert_sso_group_mapping(group, retrieved_sso_mapping) @@ -159,10 +149,7 @@ def test_sso_retrieve_all_group_mappings( assert len(retrieved_mappings) >= 1 mapping_found = False for mapping in retrieved_mappings: - if ( - group.id in str(mapping.name) - and mapping.identity_provider_mapper == SSOClient.IDP_GROUP_MAPPER - ): + if group.id in str(mapping.name) and mapping.identity_provider_mapper == SSOClient.IDP_GROUP_MAPPER: mapping_found = True _assert_sso_group_mapping(group, mapping) break diff --git a/tests/integration/test_task_client.py b/tests/integration/test_task_client.py index 8e81b1ba2..ea8452803 100644 --- a/tests/integration/test_task_client.py +++ b/tests/integration/test_task_client.py @@ -23,9 +23,7 @@ @pytest.fixture(scope="module") def snowflake_conn(client: AtlanClient): - return client.asset.find_connections_by_name( - "production", AtlanConnectorType.SNOWFLAKE - )[0] + return client.asset.find_connections_by_name("production", AtlanConnectorType.SNOWFLAKE)[0] @pytest.fixture(scope="module") @@ -34,9 +32,7 @@ def snowflake_column_qn(snowflake_conn): @pytest.fixture() -def snowflake_column( - client: AtlanClient, snowflake_column_qn -) -> Generator[Column, None, None]: +def snowflake_column(client: AtlanClient, snowflake_column_qn) -> Generator[Column, None, None]: client.asset.add_atlan_tags( asset_type=Column, qualified_name=snowflake_column_qn, @@ -79,9 +75,7 @@ def atlan_tag_def(make_atlan_tag) -> AtlanTagDef: return make_atlan_tag(TAG_NAME) -def test_task_search( - client: AtlanClient, atlan_tag_def, task_search_request, snowflake_column -): +def test_task_search(client: AtlanClient, atlan_tag_def, task_search_request, snowflake_column): assert snowflake_column assert snowflake_column.atlan_tags diff --git a/tests/integration/test_workflow_client.py b/tests/integration/test_workflow_client.py index f31da1a18..f5823a99c 100644 --- a/tests/integration/test_workflow_client.py +++ b/tests/integration/test_workflow_client.py @@ -65,9 +65,7 @@ def delete_credentials(client: AtlanClient, guid: str): @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - connection = create_connection( - client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.SNOWFLAKE - ) + connection = create_connection(client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.SNOWFLAKE) yield connection delete_asset(client, guid=connection.guid, asset_type=Connection) @@ -77,9 +75,7 @@ def delete_workflow(client: AtlanClient, workflow_name: str) -> None: @pytest.fixture(scope="module") -def workflow( - client: AtlanClient, connection: Connection -) -> Generator[WorkflowResponse, None, None]: +def workflow(client: AtlanClient, connection: Connection) -> Generator[WorkflowResponse, None, None]: assert connection and connection.qualified_name miner = ( SnowflakeMiner(connection_qualified_name=connection.qualified_name) @@ -97,9 +93,7 @@ def workflow( .custom_config(config={"test": True, "feature": 1234}) .to_workflow() ) - schedule = WorkflowSchedule( - cron_schedule=WORKFLOW_SCHEDULE_SCHEDULE, timezone=WORKFLOW_SCHEDULE_TIMEZONE - ) + schedule = WorkflowSchedule(cron_schedule=WORKFLOW_SCHEDULE_SCHEDULE, timezone=WORKFLOW_SCHEDULE_TIMEZONE) workflow = client.workflow.run(miner, workflow_schedule=schedule) assert workflow # Adding some delay to make sure @@ -111,9 +105,7 @@ def workflow( def test_workflow_find_by_methods(client: AtlanClient): - results = client.workflow.find_by_type( - prefix=WorkflowPackage.SNOWFLAKE, max_results=10 - ) + results = client.workflow.find_by_type(prefix=WorkflowPackage.SNOWFLAKE, max_results=10) assert results assert len(results) >= 1 @@ -130,9 +122,7 @@ def test_workflow_find_by_methods(client: AtlanClient): def test_workflow_get_runs_and_stop(client: AtlanClient, workflow: WorkflowResponse): # Retrieve the lastest workflow run assert workflow and workflow.metadata and workflow.metadata.name - runs = client.workflow.get_runs( - workflow_name=workflow.metadata.name, workflow_phase=AtlanWorkflowPhase.RUNNING - ) + runs = client.workflow.get_runs(workflow_name=workflow.metadata.name, workflow_phase=AtlanWorkflowPhase.RUNNING) assert runs assert len(runs) == 1 run = runs[0] @@ -142,14 +132,10 @@ def test_workflow_get_runs_and_stop(client: AtlanClient, workflow: WorkflowRespo # Stop the running workflow run_response = client.workflow.stop(workflow_run_id=run.id) assert run_response - assert ( - run_response.status and run_response.status.phase == AtlanWorkflowPhase.RUNNING - ) + assert run_response.status and run_response.status.phase == AtlanWorkflowPhase.RUNNING assert ( run_response.status.stored_workflow_template_spec - and run_response.status.stored_workflow_template_spec.get( - WORKFLOW_TEMPLATE_REF - ).get("name") + and run_response.status.stored_workflow_template_spec.get(WORKFLOW_TEMPLATE_REF).get("name") == workflow.metadata.name ) @@ -167,30 +153,22 @@ def test_workflow_get_runs_and_stop(client: AtlanClient, workflow: WorkflowRespo ) -def test_workflow_get_all_scheduled_runs( - client: AtlanClient, workflow: WorkflowResponse -): +def test_workflow_get_all_scheduled_runs(client: AtlanClient, workflow: WorkflowResponse): runs = client.workflow.get_all_scheduled_runs() assert workflow and workflow.metadata and workflow.metadata.name scheduled_workflow_name = f"{workflow.metadata.name}-cron" assert runs and len(runs) >= 1 - found = any( - run.metadata and run.metadata.name == scheduled_workflow_name for run in runs - ) + found = any(run.metadata and run.metadata.name == scheduled_workflow_name for run in runs) if not found: - pytest.fail( - f"Unable to find scheduled run for workflow: {workflow.metadata.name}" - ) + pytest.fail(f"Unable to find scheduled run for workflow: {workflow.metadata.name}") def _assert_scheduled_run(client: AtlanClient, workflow: WorkflowResponse): assert workflow and workflow.metadata and workflow.metadata.name - scheduled_workflow = client.workflow.get_scheduled_run( - workflow_name=workflow.metadata.name - ) + scheduled_workflow = client.workflow.get_scheduled_run(workflow_name=workflow.metadata.name) scheduled_workflow_name = f"{workflow.metadata.name}-cron" assert ( scheduled_workflow @@ -208,18 +186,8 @@ def _assert_add_schedule(workflow, scheduled_workflow, schedule, timezone): assert scheduled_workflow.metadata assert scheduled_workflow.metadata.name == workflow.metadata.name assert scheduled_workflow.metadata.annotations - assert ( - scheduled_workflow.metadata.annotations.get( - WorkflowClient._WORKFLOW_RUN_SCHEDULE - ) - == schedule - ) - assert ( - scheduled_workflow.metadata.annotations.get( - WorkflowClient._WORKFLOW_RUN_TIMEZONE - ) - == timezone - ) + assert scheduled_workflow.metadata.annotations.get(WorkflowClient._WORKFLOW_RUN_SCHEDULE) == schedule + assert scheduled_workflow.metadata.annotations.get(WorkflowClient._WORKFLOW_RUN_TIMEZONE) == timezone def _assert_remove_schedule(response, workflow): @@ -238,9 +206,7 @@ def test_workflow_add_remove_schedule(client: AtlanClient, workflow: WorkflowRes # NOTE: This method will overwrite existing workflow run schedule # Try to update schedule again, with `Workflow` object - scheduled_workflow = client.workflow.add_schedule( - workflow=workflow, workflow_schedule=schedule - ) + scheduled_workflow = client.workflow.add_schedule(workflow=workflow, workflow_schedule=schedule) _assert_add_schedule( workflow, @@ -255,14 +221,8 @@ def test_workflow_add_remove_schedule(client: AtlanClient, workflow: WorkflowRes _assert_remove_schedule(response, workflow) # Try to update schedule again, with `WorkflowSearchResult` object - existing_workflow = client.workflow.find_by_type( - prefix=WorkflowPackage.SNOWFLAKE_MINER - )[0] - assert ( - existing_workflow - and existing_workflow.source - and existing_workflow.source.metadata - ) + existing_workflow = client.workflow.find_by_type(prefix=WorkflowPackage.SNOWFLAKE_MINER)[0] + assert existing_workflow and existing_workflow.source and existing_workflow.source.metadata assert workflow and workflow.metadata assert existing_workflow.source.metadata.name == workflow.metadata.name @@ -270,9 +230,7 @@ def test_workflow_add_remove_schedule(client: AtlanClient, workflow: WorkflowRes cron_schedule=WORKFLOW_SCHEDULE_UPDATED_2, timezone=WORKFLOW_SCHEDULE_TIMEZONE_UPDATED_2, ) - scheduled_workflow = client.workflow.add_schedule( - workflow=existing_workflow, workflow_schedule=schedule - ) + scheduled_workflow = client.workflow.add_schedule(workflow=existing_workflow, workflow_schedule=schedule) _assert_add_schedule( workflow, @@ -329,23 +287,17 @@ def test_get_all_credentials(client: AtlanClient): credentials = client.credentials.get_all() assert credentials, "Expected credentials but found None" assert credentials.records is not None, "Expected records but found None" - assert ( - len(credentials.records or []) > 0 - ), "Expected at least one record but found none" + assert len(credentials.records or []) > 0, "Expected at least one record but found none" def test_get_all_credentials_with_filter_limit_offset(client: AtlanClient): filter_criteria = {"connectorType": "jdbc"} limit = 1 offset = 1 - credentials = client.credentials.get_all( - filter=filter_criteria, limit=limit, offset=offset - ) + credentials = client.credentials.get_all(filter=filter_criteria, limit=limit, offset=offset) assert len(credentials.records or []) <= limit, "Exceeded limit in results" for cred in credentials.records or []: - assert ( - cred.connector_type == "jdbc" - ), f"Expected 'jdbc', got {cred.connector_type}" + assert cred.connector_type == "jdbc", f"Expected 'jdbc', got {cred.connector_type}" def test_get_all_credentials_with_multiple_filters(client: AtlanClient): @@ -354,14 +306,10 @@ def test_get_all_credentials_with_multiple_filters(client: AtlanClient): credentials = client.credentials.get_all(filter=filter_criteria) assert credentials, "Expected credentials but found None" assert credentials.records is not None, "Expected records but found None" - assert ( - len(credentials.records or []) > 0 - ), "Expected at least one record but found none" + assert len(credentials.records or []) > 0, "Expected at least one record but found none" for record in credentials.records or []: - assert ( - record.connector_type == "jdbc" - ), f"Expected 'jdbc', got {record.connector_type}" + assert record.connector_type == "jdbc", f"Expected 'jdbc', got {record.connector_type}" assert record.is_active, f"Expected active record, but got inactive: {record}" diff --git a/tests/unit/model/a_d_l_s_account_test.py b/tests/unit/model/a_d_l_s_account_test.py index 4833dd2ce..325046178 100644 --- a/tests/unit/model/a_d_l_s_account_test.py +++ b/tests/unit/model/a_d_l_s_account_test.py @@ -16,19 +16,13 @@ (ADLS_ACCOUNT_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - ADLSAccount.create( - name=name, connection_qualified_name=connection_qualified_name - ) + ADLSAccount.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): - sut = ADLSAccount.create( - name=ADLS_ACCOUNT_NAME, connection_qualified_name=ADLS_CONNECTION_QUALIFIED_NAME - ) + sut = ADLSAccount.create(name=ADLS_ACCOUNT_NAME, connection_qualified_name=ADLS_CONNECTION_QUALIFIED_NAME) assert sut.name == ADLS_ACCOUNT_NAME assert sut.connection_qualified_name == ADLS_CONNECTION_QUALIFIED_NAME @@ -51,9 +45,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = ADLSAccount.create_for_modification( - qualified_name=ADLS_QUALIFIED_NAME, name=ADLS_ACCOUNT_NAME - ) + sut = ADLSAccount.create_for_modification(qualified_name=ADLS_QUALIFIED_NAME, name=ADLS_ACCOUNT_NAME) assert sut.qualified_name == ADLS_QUALIFIED_NAME assert sut.name == ADLS_ACCOUNT_NAME diff --git a/tests/unit/model/a_d_l_s_container_test.py b/tests/unit/model/a_d_l_s_container_test.py index 58883773f..72c55c7a4 100644 --- a/tests/unit/model/a_d_l_s_container_test.py +++ b/tests/unit/model/a_d_l_s_container_test.py @@ -18,13 +18,9 @@ (ADLS_CONTAINER_NAME, None, "adls_account_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, adls_account_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, adls_account_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - ADLSContainer.create( - name=name, adls_account_qualified_name=adls_account_qualified_name - ) + ADLSContainer.create(name=name, adls_account_qualified_name=adls_account_qualified_name) # Test case for creating an ADLSContainer @@ -70,9 +66,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = ADLSContainer.create_for_modification( - qualified_name=ADLS_CONTAINER_QUALIFIED_NAME, name=ADLS_CONTAINER_NAME - ) + sut = ADLSContainer.create_for_modification(qualified_name=ADLS_CONTAINER_QUALIFIED_NAME, name=ADLS_CONTAINER_NAME) assert sut.name == ADLS_CONTAINER_NAME assert sut.qualified_name == ADLS_CONTAINER_QUALIFIED_NAME diff --git a/tests/unit/model/a_d_l_s_object_test.py b/tests/unit/model/a_d_l_s_object_test.py index 9b6b09198..545c6bc0f 100644 --- a/tests/unit/model/a_d_l_s_object_test.py +++ b/tests/unit/model/a_d_l_s_object_test.py @@ -43,18 +43,14 @@ def test_create(): assert sut.qualified_name == f"{ADLS_CONTAINER_QUALIFIED_NAME}/{ADLS_OBJECT_NAME}" assert sut.connection_qualified_name == ADLS_CONNECTION_QUALIFIED_NAME assert sut.connector_name == ADLS_CONNECTOR_TYPE - assert sut.adls_account_qualified_name == get_parent_qualified_name( - ADLS_CONTAINER_QUALIFIED_NAME - ) + assert sut.adls_account_qualified_name == get_parent_qualified_name(ADLS_CONTAINER_QUALIFIED_NAME) def test_overload_creator(): sut = ADLSObject.creator( name=ADLS_OBJECT_NAME, adls_container_qualified_name=ADLS_CONTAINER_QUALIFIED_NAME, - adls_account_qualified_name=get_parent_qualified_name( - ADLS_CONTAINER_QUALIFIED_NAME - ), + adls_account_qualified_name=get_parent_qualified_name(ADLS_CONTAINER_QUALIFIED_NAME), connection_qualified_name=ADLS_CONNECTION_QUALIFIED_NAME, ) @@ -63,9 +59,7 @@ def test_overload_creator(): assert sut.qualified_name == f"{ADLS_CONTAINER_QUALIFIED_NAME}/{ADLS_OBJECT_NAME}" assert sut.connection_qualified_name == ADLS_CONNECTION_QUALIFIED_NAME assert sut.connector_name == ADLS_CONNECTOR_TYPE - assert sut.adls_account_qualified_name == get_parent_qualified_name( - ADLS_CONTAINER_QUALIFIED_NAME - ) + assert sut.adls_account_qualified_name == get_parent_qualified_name(ADLS_CONTAINER_QUALIFIED_NAME) # Test cases for creating ADLSObject for modification @@ -84,9 +78,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = ADLSObject.create_for_modification( - qualified_name=ADLS_OBJECT_QUALIFIED_NAME, name=ADLS_OBJECT_NAME - ) + sut = ADLSObject.create_for_modification(qualified_name=ADLS_OBJECT_QUALIFIED_NAME, name=ADLS_OBJECT_NAME) assert sut.name == ADLS_OBJECT_NAME assert sut.qualified_name == ADLS_OBJECT_QUALIFIED_NAME diff --git a/tests/unit/model/a_p_i_field_test.py b/tests/unit/model/a_p_i_field_test.py index d1c4097e3..350765040 100644 --- a/tests/unit/model/a_p_i_field_test.py +++ b/tests/unit/model/a_p_i_field_test.py @@ -53,10 +53,7 @@ def test_create_parent_object(): assert sut.name == API_FIELD_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name - == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" - ) + assert sut.qualified_name == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" assert sut.connector_name == API_CONNECTOR_TYPE assert sut.api_object.qualified_name == API_FIELD_PARENT_OBJECT_QUALIFIED_NAME @@ -70,10 +67,7 @@ def test_create_parent_query(): assert sut.name == API_FIELD_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name - == f"{API_FIELD_PARENT_QUERY_QUALIFIED_NAME}/{API_FIELD_NAME}" - ) + assert sut.qualified_name == f"{API_FIELD_PARENT_QUERY_QUALIFIED_NAME}/{API_FIELD_NAME}" assert sut.connector_name == API_CONNECTOR_TYPE assert sut.api_query.qualified_name == API_FIELD_PARENT_QUERY_QUALIFIED_NAME @@ -93,10 +87,7 @@ def test_overload_creator_parent_object(): assert sut.name == API_FIELD_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name - == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" - ) + assert sut.qualified_name == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" assert sut.connector_name == API_CONNECTOR_TYPE assert sut.api_field_type == "api-object-ref" assert sut.api_field_type_secondary == "Object" @@ -120,10 +111,7 @@ def test_overload_creator_parent_query(): assert sut.name == API_FIELD_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name - == f"{API_FIELD_PARENT_QUERY_QUALIFIED_NAME}/{API_FIELD_NAME}" - ) + assert sut.qualified_name == f"{API_FIELD_PARENT_QUERY_QUALIFIED_NAME}/{API_FIELD_NAME}" assert sut.connector_name == API_CONNECTOR_TYPE assert sut.api_field_type == "api-object-ref" assert sut.api_field_type_secondary == "Object" @@ -156,10 +144,7 @@ def test_create_for_modification(): name=API_FIELD_NAME, ) - assert ( - sut.qualified_name - == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" - ) + assert sut.qualified_name == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" assert sut.name == API_FIELD_NAME @@ -170,7 +155,4 @@ def test_trim_to_required(): ).trim_to_required() assert sut.name == API_FIELD_NAME - assert ( - sut.qualified_name - == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" - ) + assert sut.qualified_name == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" diff --git a/tests/unit/model/a_p_i_object_test.py b/tests/unit/model/a_p_i_object_test.py index 18db31943..27e0c0d7b 100644 --- a/tests/unit/model/a_p_i_object_test.py +++ b/tests/unit/model/a_p_i_object_test.py @@ -16,19 +16,13 @@ (API_OBJECT_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - APIObject.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + APIObject.creator(name=name, connection_qualified_name=connection_qualified_name) def test_create(): - sut = APIObject.creator( - name=API_OBJECT_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME - ) + sut = APIObject.creator(name=API_OBJECT_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME) assert sut.name == API_OBJECT_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME @@ -65,18 +59,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = APIObject.updater( - qualified_name=API_OBJECT_QUALIFIED_NAME, name=API_OBJECT_NAME - ) + sut = APIObject.updater(qualified_name=API_OBJECT_QUALIFIED_NAME, name=API_OBJECT_NAME) assert sut.qualified_name == API_OBJECT_QUALIFIED_NAME assert sut.name == API_OBJECT_NAME def test_trim_to_required(): - sut = APIObject.updater( - name=API_OBJECT_NAME, qualified_name=API_OBJECT_QUALIFIED_NAME - ).trim_to_required() + sut = APIObject.updater(name=API_OBJECT_NAME, qualified_name=API_OBJECT_QUALIFIED_NAME).trim_to_required() assert sut.name == API_OBJECT_NAME assert sut.qualified_name == API_OBJECT_QUALIFIED_NAME diff --git a/tests/unit/model/a_p_i_path_test.py b/tests/unit/model/a_p_i_path_test.py index 20d0b6023..2ef21f9a9 100644 --- a/tests/unit/model/a_p_i_path_test.py +++ b/tests/unit/model/a_p_i_path_test.py @@ -74,18 +74,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = APIPath.create_for_modification( - qualified_name=API_PATH_QUALIFIED_NAME, name=API_PATH_NAME - ) + sut = APIPath.create_for_modification(qualified_name=API_PATH_QUALIFIED_NAME, name=API_PATH_NAME) assert sut.qualified_name == API_PATH_QUALIFIED_NAME assert sut.name == API_PATH_NAME def test_trim_to_required(): - sut = APIPath.create_for_modification( - name=API_PATH_NAME, qualified_name=API_PATH_QUALIFIED_NAME - ).trim_to_required() + sut = APIPath.create_for_modification(name=API_PATH_NAME, qualified_name=API_PATH_QUALIFIED_NAME).trim_to_required() assert sut.name == API_PATH_NAME assert sut.qualified_name == API_PATH_QUALIFIED_NAME diff --git a/tests/unit/model/a_p_i_query_test.py b/tests/unit/model/a_p_i_query_test.py index 4c59c39a7..1338bcf63 100644 --- a/tests/unit/model/a_p_i_query_test.py +++ b/tests/unit/model/a_p_i_query_test.py @@ -17,17 +17,13 @@ (API_QUERY_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): APIQuery.creator(name=name, connection_qualified_name=connection_qualified_name) def test_create(): - sut = APIQuery.creator( - name=API_QUERY_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME - ) + sut = APIQuery.creator(name=API_QUERY_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME) assert sut.name == API_QUERY_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME @@ -79,9 +75,7 @@ def test_create_for_modification(): def test_trim_to_required(): - sut = APIQuery.updater( - name=API_QUERY_NAME, qualified_name=API_QUERY_QUALIFIED_NAME - ).trim_to_required() + sut = APIQuery.updater(name=API_QUERY_NAME, qualified_name=API_QUERY_QUALIFIED_NAME).trim_to_required() assert sut.name == API_QUERY_NAME assert sut.qualified_name == API_QUERY_QUALIFIED_NAME diff --git a/tests/unit/model/a_p_i_spec_test.py b/tests/unit/model/a_p_i_spec_test.py index 25c0c736a..cc31da8d1 100644 --- a/tests/unit/model/a_p_i_spec_test.py +++ b/tests/unit/model/a_p_i_spec_test.py @@ -16,17 +16,13 @@ (API_SPEC_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): APISpec.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): - sut = APISpec.create( - name=API_SPEC_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME - ) + sut = APISpec.create(name=API_SPEC_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME) assert sut.name == API_SPEC_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME @@ -49,18 +45,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = APISpec.create_for_modification( - qualified_name=API_QUALIFIED_NAME, name=API_SPEC_NAME - ) + sut = APISpec.create_for_modification(qualified_name=API_QUALIFIED_NAME, name=API_SPEC_NAME) assert sut.qualified_name == API_QUALIFIED_NAME assert sut.name == API_SPEC_NAME def test_trim_to_required(): - sut = APISpec.create_for_modification( - name=API_SPEC_NAME, qualified_name=API_QUALIFIED_NAME - ).trim_to_required() + sut = APISpec.create_for_modification(name=API_SPEC_NAME, qualified_name=API_QUALIFIED_NAME).trim_to_required() assert sut.name == API_SPEC_NAME assert sut.qualified_name == API_QUALIFIED_NAME diff --git a/tests/unit/model/airflow_dag_test.py b/tests/unit/model/airflow_dag_test.py index 42cb5436c..87be3fe3e 100644 --- a/tests/unit/model/airflow_dag_test.py +++ b/tests/unit/model/airflow_dag_test.py @@ -16,13 +16,9 @@ (AIRFLOW_DAG_NAME, None, "connection_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_creator_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - AirflowDag.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + AirflowDag.creator(name=name, connection_qualified_name=connection_qualified_name) def test_creator(): @@ -44,17 +40,13 @@ def test_creator(): (AIRFLOW_DAG_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error( - qualified_name: str, name: str, message: str -): +def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): with pytest.raises(ValueError, match=message): AirflowDag.updater(qualified_name=qualified_name, name=name) def test_updater(): - dag = AirflowDag.updater( - name=AIRFLOW_DAG_NAME, qualified_name=AIRFLOW_DAG_QUALIFIED_NAME - ) + dag = AirflowDag.updater(name=AIRFLOW_DAG_NAME, qualified_name=AIRFLOW_DAG_QUALIFIED_NAME) assert dag.name == AIRFLOW_DAG_NAME assert dag.qualified_name == AIRFLOW_DAG_QUALIFIED_NAME diff --git a/tests/unit/model/airflow_task_test.py b/tests/unit/model/airflow_task_test.py index cee95f793..e4c0a3b12 100644 --- a/tests/unit/model/airflow_task_test.py +++ b/tests/unit/model/airflow_task_test.py @@ -17,13 +17,9 @@ (AIRFLOW_TASK_NAME, None, "airflow_dag_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error( - name: str, airflow_dag_qualified_name: str, message: str -): +def test_creator_with_missing_parameters_raise_value_error(name: str, airflow_dag_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - AirflowTask.creator( - name=name, airflow_dag_qualified_name=airflow_dag_qualified_name - ) + AirflowTask.creator(name=name, airflow_dag_qualified_name=airflow_dag_qualified_name) def test_creator(): @@ -60,26 +56,20 @@ def test_overload_creator(): (AIRFLOW_TASK_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error( - qualified_name: str, name: str, message: str -): +def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): with pytest.raises(ValueError, match=message): AirflowTask.updater(qualified_name=qualified_name, name=name) def test_updater(): - task = AirflowTask.updater( - name=AIRFLOW_TASK_NAME, qualified_name=AIRFLOW_TASK_QUALIFIED_NAME - ) + task = AirflowTask.updater(name=AIRFLOW_TASK_NAME, qualified_name=AIRFLOW_TASK_QUALIFIED_NAME) assert task.name == AIRFLOW_TASK_NAME assert task.qualified_name == AIRFLOW_TASK_QUALIFIED_NAME def test_trim_to_required(): - task = AirflowTask.updater( - name=AIRFLOW_TASK_NAME, qualified_name=AIRFLOW_TASK_QUALIFIED_NAME - ).trim_to_required() + task = AirflowTask.updater(name=AIRFLOW_TASK_NAME, qualified_name=AIRFLOW_TASK_QUALIFIED_NAME).trim_to_required() assert task.name == AIRFLOW_TASK_NAME assert task.qualified_name == AIRFLOW_TASK_QUALIFIED_NAME diff --git a/tests/unit/model/anaplan_app_test.py b/tests/unit/model/anaplan_app_test.py index cfbd541a2..4abfc3061 100644 --- a/tests/unit/model/anaplan_app_test.py +++ b/tests/unit/model/anaplan_app_test.py @@ -16,13 +16,9 @@ (ANAPLAN_APP_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - AnaplanApp.create( - name=name, connection_qualified_name=connection_qualified_name - ) + AnaplanApp.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): @@ -52,9 +48,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanApp.create_for_modification( - qualified_name=ANAPLAN_APP_QUALIFIED_NAME, name=ANAPLAN_APP_NAME - ) + sut = AnaplanApp.create_for_modification(qualified_name=ANAPLAN_APP_QUALIFIED_NAME, name=ANAPLAN_APP_NAME) assert sut.qualified_name == ANAPLAN_APP_QUALIFIED_NAME assert sut.name == ANAPLAN_APP_NAME diff --git a/tests/unit/model/anaplan_dimension_test.py b/tests/unit/model/anaplan_dimension_test.py index 241577afd..8c93e1245 100644 --- a/tests/unit/model/anaplan_dimension_test.py +++ b/tests/unit/model/anaplan_dimension_test.py @@ -17,9 +17,7 @@ (ANAPLAN_DIMENSION_NAME, None, "model_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, model_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, model_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): AnaplanDimension.creator(name=name, model_qualified_name=model_qualified_name) @@ -47,9 +45,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - AnaplanDimension.create_for_modification( - qualified_name=qualified_name, name=name - ) + AnaplanDimension.create_for_modification(qualified_name=qualified_name, name=name) def test_create_for_modification(): diff --git a/tests/unit/model/anaplan_line_item_test.py b/tests/unit/model/anaplan_line_item_test.py index 06694a6b4..b8c96907d 100644 --- a/tests/unit/model/anaplan_line_item_test.py +++ b/tests/unit/model/anaplan_line_item_test.py @@ -17,9 +17,7 @@ (ANAPLAN_LINE_ITEM_NAME, None, "module_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, module_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, module_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): AnaplanLineItem.creator(name=name, module_qualified_name=module_qualified_name) @@ -47,9 +45,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - AnaplanLineItem.create_for_modification( - qualified_name=qualified_name, name=name - ) + AnaplanLineItem.create_for_modification(qualified_name=qualified_name, name=name) def test_create_for_modification(): diff --git a/tests/unit/model/anaplan_list_test.py b/tests/unit/model/anaplan_list_test.py index c43e50d52..b53e9fbd6 100644 --- a/tests/unit/model/anaplan_list_test.py +++ b/tests/unit/model/anaplan_list_test.py @@ -17,9 +17,7 @@ (ANAPLAN_LIST_NAME, None, "model_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, model_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, model_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): AnaplanList.creator(name=name, model_qualified_name=model_qualified_name) @@ -51,9 +49,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanList.create_for_modification( - qualified_name=ANAPLAN_LIST_QUALIFIED_NAME, name=ANAPLAN_LIST_NAME - ) + sut = AnaplanList.create_for_modification(qualified_name=ANAPLAN_LIST_QUALIFIED_NAME, name=ANAPLAN_LIST_NAME) assert sut.qualified_name == ANAPLAN_LIST_QUALIFIED_NAME assert sut.name == ANAPLAN_LIST_NAME diff --git a/tests/unit/model/anaplan_model_test.py b/tests/unit/model/anaplan_model_test.py index e12197e8b..8974277af 100644 --- a/tests/unit/model/anaplan_model_test.py +++ b/tests/unit/model/anaplan_model_test.py @@ -17,13 +17,9 @@ (ANAPLAN_MODEL_NAME, None, "workspace_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, workspace_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, workspace_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - AnaplanModel.creator( - name=name, workspace_qualified_name=workspace_qualified_name - ) + AnaplanModel.creator(name=name, workspace_qualified_name=workspace_qualified_name) def test_create(): @@ -53,9 +49,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanModel.create_for_modification( - qualified_name=ANAPLAN_MODEL_QUALIFIED_NAME, name=ANAPLAN_MODEL_NAME - ) + sut = AnaplanModel.create_for_modification(qualified_name=ANAPLAN_MODEL_QUALIFIED_NAME, name=ANAPLAN_MODEL_NAME) assert sut.qualified_name == ANAPLAN_MODEL_QUALIFIED_NAME assert sut.name == ANAPLAN_MODEL_NAME diff --git a/tests/unit/model/anaplan_module_test.py b/tests/unit/model/anaplan_module_test.py index 628083648..8f1e06fbe 100644 --- a/tests/unit/model/anaplan_module_test.py +++ b/tests/unit/model/anaplan_module_test.py @@ -17,9 +17,7 @@ (ANAPLAN_MODULE_NAME, None, "model_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, model_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, model_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): AnaplanModule.creator(name=name, model_qualified_name=model_qualified_name) @@ -51,9 +49,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanModule.create_for_modification( - qualified_name=ANAPLAN_MODULE_QUALIFIED_NAME, name=ANAPLAN_MODULE_NAME - ) + sut = AnaplanModule.create_for_modification(qualified_name=ANAPLAN_MODULE_QUALIFIED_NAME, name=ANAPLAN_MODULE_NAME) assert sut.qualified_name == ANAPLAN_MODULE_QUALIFIED_NAME assert sut.name == ANAPLAN_MODULE_NAME diff --git a/tests/unit/model/anaplan_page_test.py b/tests/unit/model/anaplan_page_test.py index 1bbf766cd..5fc61631d 100644 --- a/tests/unit/model/anaplan_page_test.py +++ b/tests/unit/model/anaplan_page_test.py @@ -17,9 +17,7 @@ (ANAPLAN_PAGE_NAME, None, "app_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, app_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, app_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): AnaplanPage.creator(name=name, app_qualified_name=app_qualified_name) @@ -51,9 +49,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanPage.create_for_modification( - qualified_name=ANAPLAN_PAGE_QUALIFIED_NAME, name=ANAPLAN_PAGE_NAME - ) + sut = AnaplanPage.create_for_modification(qualified_name=ANAPLAN_PAGE_QUALIFIED_NAME, name=ANAPLAN_PAGE_NAME) assert sut.qualified_name == ANAPLAN_PAGE_QUALIFIED_NAME assert sut.name == ANAPLAN_PAGE_NAME diff --git a/tests/unit/model/anaplan_system_dimension_test.py b/tests/unit/model/anaplan_system_dimension_test.py index 631c834b9..c2cc87df7 100644 --- a/tests/unit/model/anaplan_system_dimension_test.py +++ b/tests/unit/model/anaplan_system_dimension_test.py @@ -16,13 +16,9 @@ (ANAPLAN_SYSTEM_DIMENSION_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - AnaplanSystemDimension.create( - name=name, connection_qualified_name=connection_qualified_name - ) + AnaplanSystemDimension.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): @@ -48,9 +44,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - AnaplanSystemDimension.create_for_modification( - qualified_name=qualified_name, name=name - ) + AnaplanSystemDimension.create_for_modification(qualified_name=qualified_name, name=name) def test_create_for_modification(): diff --git a/tests/unit/model/anaplan_view_test.py b/tests/unit/model/anaplan_view_test.py index 3250a5a08..416fccdc1 100644 --- a/tests/unit/model/anaplan_view_test.py +++ b/tests/unit/model/anaplan_view_test.py @@ -17,9 +17,7 @@ (ANAPLAN_VIEW_NAME, None, "module_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, module_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, module_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): AnaplanView.creator(name=name, module_qualified_name=module_qualified_name) @@ -51,9 +49,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanView.create_for_modification( - qualified_name=ANAPLAN_VIEW_QUALIFIED_NAME, name=ANAPLAN_VIEW_NAME - ) + sut = AnaplanView.create_for_modification(qualified_name=ANAPLAN_VIEW_QUALIFIED_NAME, name=ANAPLAN_VIEW_NAME) assert sut.qualified_name == ANAPLAN_VIEW_QUALIFIED_NAME assert sut.name == ANAPLAN_VIEW_NAME diff --git a/tests/unit/model/anaplan_workspace_test.py b/tests/unit/model/anaplan_workspace_test.py index 9d32de21f..fab35f939 100644 --- a/tests/unit/model/anaplan_workspace_test.py +++ b/tests/unit/model/anaplan_workspace_test.py @@ -16,13 +16,9 @@ (ANAPLAN_WORKSPACE_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - AnaplanWorkspace.create( - name=name, connection_qualified_name=connection_qualified_name - ) + AnaplanWorkspace.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): @@ -48,9 +44,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - AnaplanWorkspace.create_for_modification( - qualified_name=qualified_name, name=name - ) + AnaplanWorkspace.create_for_modification(qualified_name=qualified_name, name=name) def test_create_for_modification(): diff --git a/tests/unit/model/application_field_test.py b/tests/unit/model/application_field_test.py index e285b9b6f..6cbf16cd4 100644 --- a/tests/unit/model/application_field_test.py +++ b/tests/unit/model/application_field_test.py @@ -17,13 +17,9 @@ (APPLICATION_FIELD_NAME, None, "application_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error( - name: str, application_qualified_name: str, message: str -): +def test_creator_with_missing_parameters_raise_value_error(name: str, application_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - ApplicationField.creator( - name=name, application_qualified_name=application_qualified_name - ) + ApplicationField.creator(name=name, application_qualified_name=application_qualified_name) def test_creator(): @@ -45,9 +41,7 @@ def test_creator(): (APPLICATION_FIELD_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error( - qualified_name: str, name: str, message: str -): +def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): with pytest.raises(ValueError, match=message): ApplicationField.updater(qualified_name=qualified_name, name=name) diff --git a/tests/unit/model/application_test.py b/tests/unit/model/application_test.py index fe1ffcdde..ba8e3e1e8 100644 --- a/tests/unit/model/application_test.py +++ b/tests/unit/model/application_test.py @@ -16,13 +16,9 @@ (APPLICATION_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - Application.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + Application.creator(name=name, connection_qualified_name=connection_qualified_name) def test_create(): diff --git a/tests/unit/model/azure_event_consumer_group_test.py b/tests/unit/model/azure_event_consumer_group_test.py index a65a0fe4d..527f4c801 100644 --- a/tests/unit/model/azure_event_consumer_group_test.py +++ b/tests/unit/model/azure_event_consumer_group_test.py @@ -17,13 +17,9 @@ (EVENT_HUB_QUALIFIED_NAMES, None, "event_hub_qualified_names is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error( - name: str, event_hub_qualified_names: str, message: str -): +def test_creator_with_missing_parameters_raise_value_error(name: str, event_hub_qualified_names: str, message: str): with pytest.raises(ValueError, match=message): - AzureEventHubConsumerGroup.creator( - name=name, event_hub_qualified_names=event_hub_qualified_names - ) + AzureEventHubConsumerGroup.creator(name=name, event_hub_qualified_names=event_hub_qualified_names) def test_creator(): @@ -46,9 +42,7 @@ def test_creator(): (EVENT_HUB_CONSUMER_GROUP_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error( - qualified_name: str, name: str, message: str -): +def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): with pytest.raises(ValueError, match=message): AzureEventHubConsumerGroup.updater(qualified_name=qualified_name, name=name) diff --git a/tests/unit/model/azure_event_hub_test.py b/tests/unit/model/azure_event_hub_test.py index 5a34aa436..98d8b070f 100644 --- a/tests/unit/model/azure_event_hub_test.py +++ b/tests/unit/model/azure_event_hub_test.py @@ -16,13 +16,9 @@ (EVENT_HUB_NAME, None, "connection_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_creator_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - AzureEventHub.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + AzureEventHub.creator(name=name, connection_qualified_name=connection_qualified_name) def test_creator(): @@ -44,17 +40,13 @@ def test_creator(): (EVENT_HUB_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error( - qualified_name: str, name: str, message: str -): +def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): with pytest.raises(ValueError, match=message): AzureEventHub.updater(qualified_name=qualified_name, name=name) def test_updater(): - event_hub = AzureEventHub.updater( - name=EVENT_HUB_NAME, qualified_name=EVENT_HUB_QUALIFIED_NAME - ) + event_hub = AzureEventHub.updater(name=EVENT_HUB_NAME, qualified_name=EVENT_HUB_QUALIFIED_NAME) assert event_hub.name == EVENT_HUB_NAME assert event_hub.qualified_name == EVENT_HUB_QUALIFIED_NAME diff --git a/tests/unit/model/badge_test.py b/tests/unit/model/badge_test.py index 7c0ece1d8..eb8ba2551 100644 --- a/tests/unit/model/badge_test.py +++ b/tests/unit/model/badge_test.py @@ -78,18 +78,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Badge.create_for_modification( - qualified_name=BADGE_QUALIFIED_NAME, name=BADGE_NAME - ) + sut = Badge.create_for_modification(qualified_name=BADGE_QUALIFIED_NAME, name=BADGE_NAME) assert sut.qualified_name == BADGE_QUALIFIED_NAME assert sut.name == BADGE_NAME def test_trim_to_required(): - sut = Badge.create_for_modification( - qualified_name=BADGE_QUALIFIED_NAME, name=BADGE_NAME - ).trim_to_required() + sut = Badge.create_for_modification(qualified_name=BADGE_QUALIFIED_NAME, name=BADGE_NAME).trim_to_required() assert sut.qualified_name == BADGE_QUALIFIED_NAME assert sut.name == BADGE_NAME diff --git a/tests/unit/model/column_process_test.py b/tests/unit/model/column_process_test.py index 25dbb8a74..805cd897e 100644 --- a/tests/unit/model/column_process_test.py +++ b/tests/unit/model/column_process_test.py @@ -140,8 +140,6 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_trim_to_required(): - test_cp = ColumnProcess.create_for_modification( - qualified_name=CP_QUALIFIED_NAME, name=CP_NAME - ).trim_to_required() + test_cp = ColumnProcess.create_for_modification(qualified_name=CP_QUALIFIED_NAME, name=CP_NAME).trim_to_required() assert test_cp.name == CP_NAME assert test_cp.qualified_name == CP_QUALIFIED_NAME diff --git a/tests/unit/model/column_test.py b/tests/unit/model/column_test.py index 4f2d0d8cf..2e7c9acde 100644 --- a/tests/unit/model/column_test.py +++ b/tests/unit/model/column_test.py @@ -211,18 +211,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Column.create_for_modification( - qualified_name=TABLE_COLUMN_QUALIFIED_NAME, name=COLUMN_NAME - ) + sut = Column.create_for_modification(qualified_name=TABLE_COLUMN_QUALIFIED_NAME, name=COLUMN_NAME) assert sut.qualified_name == TABLE_COLUMN_QUALIFIED_NAME assert sut.name == COLUMN_NAME def test_trim_to_required(): - sut = Table.create_for_modification( - qualified_name=TABLE_COLUMN_QUALIFIED_NAME, name=COLUMN_NAME - ).trim_to_required() + sut = Table.create_for_modification(qualified_name=TABLE_COLUMN_QUALIFIED_NAME, name=COLUMN_NAME).trim_to_required() assert sut.qualified_name == TABLE_COLUMN_QUALIFIED_NAME assert sut.name == COLUMN_NAME diff --git a/tests/unit/model/connection_test.py b/tests/unit/model/connection_test.py index f7f83b480..6b2a3a7f8 100644 --- a/tests/unit/model/connection_test.py +++ b/tests/unit/model/connection_test.py @@ -148,9 +148,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Connection.create_for_modification( - qualified_name=CONNECTION_QUALIFIED_NAME, name=CONNECTION_NAME - ) + sut = Connection.create_for_modification(qualified_name=CONNECTION_QUALIFIED_NAME, name=CONNECTION_NAME) assert sut.qualified_name == CONNECTION_QUALIFIED_NAME assert sut.name == CONNECTION_NAME @@ -234,9 +232,7 @@ def test_admin_roles_when_set_to_good_name(mock_role_cache): mock_role_cache.validate_idstrs.assert_called_once -def test_validation_of_admin_not_done_when_constructed_from_json( - mock_user_cache, mock_group_cache, mock_role_cache -): +def test_validation_of_admin_not_done_when_constructed_from_json(mock_user_cache, mock_group_cache, mock_role_cache): data = { "typeName": "Connection", "attributes": { diff --git a/tests/unit/model/constants.py b/tests/unit/model/constants.py index 5651ba1f3..847e1e186 100644 --- a/tests/unit/model/constants.py +++ b/tests/unit/model/constants.py @@ -37,9 +37,7 @@ ADLS_CONNECTOR_TYPE = "adls" ADLS_CONTAINER_NAME = "mycontainer" ADLS_OBJECT_NAME = "myobject.csv" -ADLS_ACCOUNT_QUALIFIED_NAME = ( - f"{ADLS_QUALIFIED_NAME}" # "default/adls/123456789/myaccount" -) +ADLS_ACCOUNT_QUALIFIED_NAME = f"{ADLS_QUALIFIED_NAME}" # "default/adls/123456789/myaccount" # "default/adls/123456789/myaccount/mycontainer" ADLS_CONTAINER_QUALIFIED_NAME = f"{ADLS_QUALIFIED_NAME}/{ADLS_CONTAINER_NAME}" # "default/adls/123456789/myaccount/mycontainer/myobject.csv" @@ -47,33 +45,23 @@ ANAPLAN_CONNECTION_QUALIFIED_NAME = "default/anaplan/123456789" ANAPLAN_CONNECTOR_TYPE = "anaplan" ANAPLAN_WORKSPACE_NAME = "anaplan-workspace" -ANAPLAN_WORKSPACE_QUALIFIED_NAME = ( - f"{ANAPLAN_CONNECTION_QUALIFIED_NAME}/{ANAPLAN_WORKSPACE_NAME}" -) +ANAPLAN_WORKSPACE_QUALIFIED_NAME = f"{ANAPLAN_CONNECTION_QUALIFIED_NAME}/{ANAPLAN_WORKSPACE_NAME}" ANAPLAN_APP_NAME = "anaplan-app" ANAPLAN_APP_QUALIFIED_NAME = f"{ANAPLAN_CONNECTION_QUALIFIED_NAME}/{ANAPLAN_APP_NAME}" ANAPLAN_PAGE_NAME = "anaplan-page" ANAPLAN_PAGE_QUALIFIED_NAME = f"{ANAPLAN_APP_QUALIFIED_NAME}/{ANAPLAN_PAGE_NAME}" ANAPLAN_MODEL_NAME = "anaplan-model" -ANAPLAN_MODEL_QUALIFIED_NAME = ( - f"{ANAPLAN_WORKSPACE_QUALIFIED_NAME}/{ANAPLAN_MODEL_NAME}" -) +ANAPLAN_MODEL_QUALIFIED_NAME = f"{ANAPLAN_WORKSPACE_QUALIFIED_NAME}/{ANAPLAN_MODEL_NAME}" ANAPLAN_MODULE_NAME = "anaplan-module" ANAPLAN_MODULE_QUALIFIED_NAME = f"{ANAPLAN_MODEL_QUALIFIED_NAME}/{ANAPLAN_MODULE_NAME}" ANAPLAN_LIST_NAME = "anaplan-list" ANAPLAN_LIST_QUALIFIED_NAME = f"{ANAPLAN_MODEL_QUALIFIED_NAME}/{ANAPLAN_LIST_NAME}" ANAPLAN_SYSTEM_DIMENSION_NAME = "anaplan-system-dimension" -ANAPLAN_SYSTEM_DIMENSION_QUALIFIED_NAME = ( - f"{ANAPLAN_CONNECTION_QUALIFIED_NAME}/{ANAPLAN_SYSTEM_DIMENSION_NAME}" -) +ANAPLAN_SYSTEM_DIMENSION_QUALIFIED_NAME = f"{ANAPLAN_CONNECTION_QUALIFIED_NAME}/{ANAPLAN_SYSTEM_DIMENSION_NAME}" ANAPLAN_DIMENSION_NAME = "anaplan-list" -ANAPLAN_DIMENSION_QUALIFIED_NAME = ( - f"{ANAPLAN_MODEL_QUALIFIED_NAME}/{ANAPLAN_DIMENSION_NAME}" -) +ANAPLAN_DIMENSION_QUALIFIED_NAME = f"{ANAPLAN_MODEL_QUALIFIED_NAME}/{ANAPLAN_DIMENSION_NAME}" ANAPLAN_LINE_ITEM_NAME = "anaplan-lineitem" -ANAPLAN_LINE_ITEM_QUALIFIED_NAME = ( - f"{ANAPLAN_MODULE_QUALIFIED_NAME}/{ANAPLAN_LINE_ITEM_NAME}" -) +ANAPLAN_LINE_ITEM_QUALIFIED_NAME = f"{ANAPLAN_MODULE_QUALIFIED_NAME}/{ANAPLAN_LINE_ITEM_NAME}" ANAPLAN_VIEW_NAME = "anaplan-view" ANAPLAN_VIEW_QUALIFIED_NAME = f"{ANAPLAN_MODULE_QUALIFIED_NAME}/{ANAPLAN_VIEW_NAME}" API_SPEC_NAME = "api-spec" @@ -87,18 +75,12 @@ API_CONNECTOR_TYPE = "api" API_PATH_RAW_URI = "/api/path" API_SPEC_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_SPEC_NAME}" -API_PATH_QUALIFIED_NAME = ( - f"{API_CONNECTION_QUALIFIED_NAME}/{API_SPEC_NAME}{API_PATH_RAW_URI}" -) +API_PATH_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_SPEC_NAME}{API_PATH_RAW_URI}" API_OBJECT_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_OBJECT_NAME}" API_QUERY_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_QUERY_NAME}" API_QUERY_REFERENCE_OBJECT_QN = f"{API_CONNECTION_QUALIFIED_NAME}/{API_OBJECT_REF_NAME}" -API_FIELD_PARENT_OBJECT_QUALIFIED_NAME = ( - f"{API_CONNECTION_QUALIFIED_NAME}/{API_OBJECT_NAME}" -) -API_FIELD_PARENT_QUERY_QUALIFIED_NAME = ( - f"{API_CONNECTION_QUALIFIED_NAME}/{API_QUERY_NAME}" -) +API_FIELD_PARENT_OBJECT_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_OBJECT_NAME}" +API_FIELD_PARENT_QUERY_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_QUERY_NAME}" API_FIELD_REFERENCE_OBJECT_QN = f"{API_CONNECTION_QUALIFIED_NAME}/{API_OBJECT_REF_NAME}" APPLICATION_NAME = "application" APP_CONNECTOR_TYPE = "app" @@ -121,33 +103,23 @@ CONNECTOR_NAME = "datastudio" PRESET_WORKSPACE_NAME = "ps-workspace" PRESET_CONNECTION_QUALIFIED_NAME = "default/preset/123456789" -PRESET_WORKSPACE_QUALIFIED_NAME = ( - f"{PRESET_CONNECTION_QUALIFIED_NAME}/{PRESET_WORKSPACE_NAME}" -) +PRESET_WORKSPACE_QUALIFIED_NAME = f"{PRESET_CONNECTION_QUALIFIED_NAME}/{PRESET_WORKSPACE_NAME}" PRESET_CONNECTOR_TYPE = "preset" PRESET_DASHBOARD_NAME = "ps-collection" PRESET_DASHBOARD_QUALIFIED_NAME = f"{PRESET_CONNECTION_QUALIFIED_NAME}/{PRESET_WORKSPACE_NAME}/{PRESET_DASHBOARD_NAME}" PRESET_CHART_NAME = "ps-chart" PRESET_CHART_QUALIFIED_NAME = f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_CHART_NAME}" PRESET_DATASET_NAME = "ps-dataset" -PRESET_DATASET_QUALIFIED_NAME = ( - f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" -) +PRESET_DATASET_QUALIFIED_NAME = f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" PERSONA_NAME = "my-persona" PURPOSE_NAME = "my-purpose" DATA_DOMAIN_NAME = "data-domain" DATA_DOMAIN_QUALIFIED_NAME = f"default/domain/{DATA_DOMAIN_NAME}/super" DATA_SUB_DOMAIN_NAME = "data-sub-domain" -DATA_SUB_DOMAIN_QUALIFIED_NAME = ( - f"{DATA_DOMAIN_QUALIFIED_NAME}/domain/{DATA_SUB_DOMAIN_NAME}" -) +DATA_SUB_DOMAIN_QUALIFIED_NAME = f"{DATA_DOMAIN_QUALIFIED_NAME}/domain/{DATA_SUB_DOMAIN_NAME}" DATA_PRODUCT_NAME = "data-product" -DATA_PRODUCT_QUALIFIED_NAME = ( - f"{DATA_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" -) -DATA_PRODUCT_UNDER_SUB_DOMAIN_QUALIFIED_NAME = ( - f"{DATA_SUB_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" -) +DATA_PRODUCT_QUALIFIED_NAME = f"{DATA_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" +DATA_PRODUCT_UNDER_SUB_DOMAIN_QUALIFIED_NAME = f"{DATA_SUB_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" ASSET_QUALIFIED_NAME = "default/snowflake/1234567890/db/schema/test-table" DATA_CONTRACT_NAME_DEFAULT = "Data contract for test-table" DATA_CONTRACT_QUALIFIED_NAME = f"{ASSET_QUALIFIED_NAME}/contract" @@ -191,9 +163,7 @@ CP_NAME = "column-process" CP_PROCESS_ID = "cp-process-id" CP_CONNECTION_QUALIFIED_NAME = "default/vertica/123456789" -CP_QUALIFIED_NAME_HASH = ( - f"{CP_CONNECTION_QUALIFIED_NAME}/ecb5f77380c04710c979acfb8d3bba2f" -) +CP_QUALIFIED_NAME_HASH = f"{CP_CONNECTION_QUALIFIED_NAME}/ecb5f77380c04710c979acfb8d3bba2f" CP_QUALIFIED_NAME = f"{CP_CONNECTION_QUALIFIED_NAME}/{CP_PROCESS_ID}" AIRFLOW_DAG_NAME = "test-airflow-dag" AIRFLOW_CONNECTION_QUALIFIED_NAME = "default/airflow/123456789" @@ -203,63 +173,44 @@ KAFKA_TOPIC_NAME = "test-kafka-topic" KAFKA_TOPIC_NAME_2 = f"{KAFKA_TOPIC_NAME}-2" KAFKA_CONNECTION_QUALIFIED_NAME = "default/kafka/123456789" -KAFKA_TOPIC_QUALIFIED_NAME = ( - f"{KAFKA_CONNECTION_QUALIFIED_NAME}/topic/{KAFKA_TOPIC_NAME}" -) +KAFKA_TOPIC_QUALIFIED_NAME = f"{KAFKA_CONNECTION_QUALIFIED_NAME}/topic/{KAFKA_TOPIC_NAME}" KAFKA_TOPIC_QUALIFIED_NAMES = [ KAFKA_TOPIC_QUALIFIED_NAME, f"{KAFKA_CONNECTION_QUALIFIED_NAME}/topic/{KAFKA_TOPIC_NAME_2}", ] KAFKA_CONSUMER_GROUP_NAME = "test-kafka-cg" -KAFKA_CONSUMER_GROUP_QUALIFIED_NAME = ( - f"{KAFKA_CONNECTION_QUALIFIED_NAME}/consumer-group/{KAFKA_CONSUMER_GROUP_NAME}" -) +KAFKA_CONSUMER_GROUP_QUALIFIED_NAME = f"{KAFKA_CONNECTION_QUALIFIED_NAME}/consumer-group/{KAFKA_CONSUMER_GROUP_NAME}" EVENT_HUB_NAME = "test-event-hub" EVENT_HUB_NAME_2 = f"{EVENT_HUB_NAME}-2" EVENT_HUB_CONNECTION_QUALIFIED_NAME = "default/azure-event-hub/123456789" -EVENT_HUB_QUALIFIED_NAME = ( - f"{EVENT_HUB_CONNECTION_QUALIFIED_NAME}/topic/{EVENT_HUB_NAME}" -) +EVENT_HUB_QUALIFIED_NAME = f"{EVENT_HUB_CONNECTION_QUALIFIED_NAME}/topic/{EVENT_HUB_NAME}" EVENT_HUB_QUALIFIED_NAMES = [ EVENT_HUB_QUALIFIED_NAME, f"{EVENT_HUB_CONNECTION_QUALIFIED_NAME}/topic/{EVENT_HUB_NAME_2}", ] EVENT_HUB_CONSUMER_GROUP_NAME = "test-event-cg" EVENT_HUB_CONSUMER_GROUP_QUALIFIED_NAME = ( - f"{EVENT_HUB_CONNECTION_QUALIFIED_NAME}/consumer-group" - f"/{EVENT_HUB_NAME}/{EVENT_HUB_CONSUMER_GROUP_NAME}" + f"{EVENT_HUB_CONNECTION_QUALIFIED_NAME}/consumer-group/{EVENT_HUB_NAME}/{EVENT_HUB_CONSUMER_GROUP_NAME}" ) SUPERSET_CONNECTION_QUALIFIED_NAME = "default/superset/123456789" SUPERSET_CONNECTOR_TYPE = "superset" SUPERSET_DASHBOARD_NAME = "ss-dashboard" -SUPERSET_DASHBOARD_QUALIFIED_NAME = ( - f"{SUPERSET_CONNECTION_QUALIFIED_NAME}/{SUPERSET_DASHBOARD_NAME}" -) +SUPERSET_DASHBOARD_QUALIFIED_NAME = f"{SUPERSET_CONNECTION_QUALIFIED_NAME}/{SUPERSET_DASHBOARD_NAME}" SUPERSET_CHART_NAME = "ss-chart" -SUPERSET_CHART_QUALIFIED_NAME = ( - f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" -) +SUPERSET_CHART_QUALIFIED_NAME = f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" SUPERSET_DATASET_NAME = "ss-dataset" -SUPERSET_DATASET_QUALIFIED_NAME = ( - f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" -) +SUPERSET_DATASET_QUALIFIED_NAME = f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" CUSTOM_CONNECTION_QUALIFIED_NAME = "default/custom/123456789" CUSTOM_CONNECTOR_TYPE = "custom" CUSTOM_ENTITY_NAME = "test-custom-entity" -CUSTOM_ENTITY_QUALIFIED_NAME = ( - f"{CUSTOM_CONNECTION_QUALIFIED_NAME}/{CUSTOM_ENTITY_NAME}" -) +CUSTOM_ENTITY_QUALIFIED_NAME = f"{CUSTOM_CONNECTION_QUALIFIED_NAME}/{CUSTOM_ENTITY_NAME}" PROCEDURE_NAME = "test-procedure" DATAVERSE_CONNECTION_QUALIFIED_NAME = "default/dataverse/123456789" DATAVERSE_CONNECTOR_TYPE = "dataverse" DATAVERSE_ENTITY_NAME = "dv-entity" -DATAVERSE_ENTITY_QUALIFIED_NAME = ( - f"{DATAVERSE_CONNECTION_QUALIFIED_NAME}/{DATAVERSE_ENTITY_NAME}" -) +DATAVERSE_ENTITY_QUALIFIED_NAME = f"{DATAVERSE_CONNECTION_QUALIFIED_NAME}/{DATAVERSE_ENTITY_NAME}" DATAVERSE_ATTRIBUTE_NAME = "dv-attribute" -DATAVERSE_ATTRIBUTE_QUALIFIED_NAME = ( - f"{DATAVERSE_ENTITY_QUALIFIED_NAME}/{DATAVERSE_ATTRIBUTE_NAME}" -) +DATAVERSE_ATTRIBUTE_QUALIFIED_NAME = f"{DATAVERSE_ENTITY_QUALIFIED_NAME}/{DATAVERSE_ATTRIBUTE_NAME}" TABLE_PARTITION_NAME = "test-table-partition" QUICK_SIGHT_NAME = "test-quick-sight-name" QUICK_SIGHT_CONNECTION_QUALIFIED_NAME = "default/quicksight/123456789" @@ -271,20 +222,14 @@ f"{QUICK_SIGHT_CONNECTION_QUALIFIED_NAME}/1235663folder", ] QUICK_SIGHT_ID_DATASET_FEILD = "23045523" -QUICK_SIGHT_DATASET_FIELD_QUALIFIED_NAME = ( - f"{QUICK_SIGHT_QUALIFIED_NAME}/{QUICK_SIGHT_ID_DATASET_FEILD}" -) +QUICK_SIGHT_DATASET_FIELD_QUALIFIED_NAME = f"{QUICK_SIGHT_QUALIFIED_NAME}/{QUICK_SIGHT_ID_DATASET_FEILD}" QUICK_SIGHT_ID_ANALYSIS_VISUAL = "23045532" QUICK_SIGHT_SHEET_ID = "1234" QUICK_SIGHT_ANALYSIS_VISUAL_QUALIFIED_NAME = ( - f"{QUICK_SIGHT_QUALIFIED_NAME}/" - f"{QUICK_SIGHT_SHEET_ID}/" - f"{QUICK_SIGHT_ID_ANALYSIS_VISUAL}" + f"{QUICK_SIGHT_QUALIFIED_NAME}/{QUICK_SIGHT_SHEET_ID}/{QUICK_SIGHT_ID_ANALYSIS_VISUAL}" ) QUICK_SIGHT_SHEET_NAME = "test-qs-sheet-name" QUICK_SIGHT_ID_DASHBOARD_VISUAL = "230455332" QUICK_SIGHT_DASHBOARD_VISUAL_QUALIFIED_NAME = ( - f"{QUICK_SIGHT_QUALIFIED_NAME}/" - f"{QUICK_SIGHT_SHEET_ID}/" - f"{QUICK_SIGHT_ID_DASHBOARD_VISUAL}" + f"{QUICK_SIGHT_QUALIFIED_NAME}/{QUICK_SIGHT_SHEET_ID}/{QUICK_SIGHT_ID_DASHBOARD_VISUAL}" ) diff --git a/tests/unit/model/custom_entity_test.py b/tests/unit/model/custom_entity_test.py index 283e63b10..d97a5a0a0 100644 --- a/tests/unit/model/custom_entity_test.py +++ b/tests/unit/model/custom_entity_test.py @@ -16,13 +16,9 @@ (CUSTOM_ENTITY_NAME, None, "connection_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_creator_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - CustomEntity.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + CustomEntity.creator(name=name, connection_qualified_name=connection_qualified_name) def test_creator(): @@ -44,26 +40,20 @@ def test_creator(): (CUSTOM_ENTITY_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error( - qualified_name: str, name: str, message: str -): +def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): with pytest.raises(ValueError, match=message): CustomEntity.updater(qualified_name=qualified_name, name=name) def test_updater(): - sut = CustomEntity.updater( - qualified_name=CUSTOM_ENTITY_QUALIFIED_NAME, name=CUSTOM_ENTITY_NAME - ) + sut = CustomEntity.updater(qualified_name=CUSTOM_ENTITY_QUALIFIED_NAME, name=CUSTOM_ENTITY_NAME) assert sut.qualified_name == CUSTOM_ENTITY_QUALIFIED_NAME assert sut.name == CUSTOM_ENTITY_NAME def test_trim_to_required(): - sut = CustomEntity.updater( - name=CUSTOM_ENTITY_NAME, qualified_name=CUSTOM_ENTITY_QUALIFIED_NAME - ).trim_to_required() + sut = CustomEntity.updater(name=CUSTOM_ENTITY_NAME, qualified_name=CUSTOM_ENTITY_QUALIFIED_NAME).trim_to_required() assert sut.name == CUSTOM_ENTITY_NAME assert sut.qualified_name == CUSTOM_ENTITY_QUALIFIED_NAME diff --git a/tests/unit/model/data_contract_test.py b/tests/unit/model/data_contract_test.py index d9888eba2..ca2fa4f3d 100644 --- a/tests/unit/model/data_contract_test.py +++ b/tests/unit/model/data_contract_test.py @@ -62,9 +62,7 @@ def test_creator_with_missing_parameters_raise_value_error( ), ], ) -def test_creator_with_invalid_contract_json_raises_error( - asset_qualified_name: str, contract_json: str, error_msg: str -): +def test_creator_with_invalid_contract_json_raises_error(asset_qualified_name: str, contract_json: str, error_msg: str): with pytest.raises(InvalidRequestError, match=error_msg): DataContract.creator( asset_qualified_name=asset_qualified_name, diff --git a/tests/unit/model/data_domain_test.py b/tests/unit/model/data_domain_test.py index 93ae25618..594b85b86 100644 --- a/tests/unit/model/data_domain_test.py +++ b/tests/unit/model/data_domain_test.py @@ -28,9 +28,7 @@ def test_create_atttributes_with_required_parameters(): name=DATA_DOMAIN_NAME, parent_domain_qualified_name=DATA_DOMAIN_QUALIFIED_NAME, ) - assert test_domain.parent_domain.unique_attributes == { - "qualifiedName": DATA_DOMAIN_QUALIFIED_NAME - } + assert test_domain.parent_domain.unique_attributes == {"qualifiedName": DATA_DOMAIN_QUALIFIED_NAME} def test_create(): @@ -48,9 +46,7 @@ def test_create(): def test_create_for_modification(): - test_domain = DataDomain.create_for_modification( - name=DATA_DOMAIN_NAME, qualified_name=DATA_DOMAIN_QUALIFIED_NAME - ) + test_domain = DataDomain.create_for_modification(name=DATA_DOMAIN_NAME, qualified_name=DATA_DOMAIN_QUALIFIED_NAME) _assert_domain(test_domain) diff --git a/tests/unit/model/data_product_test.py b/tests/unit/model/data_product_test.py index 142b23642..ccafa7547 100644 --- a/tests/unit/model/data_product_test.py +++ b/tests/unit/model/data_product_test.py @@ -45,9 +45,7 @@ def data_product_asset_selection(): ).to_request() -def _assert_product( - product: DataProduct, qualified_name: str = DATA_PRODUCT_QUALIFIED_NAME -) -> None: +def _assert_product(product: DataProduct, qualified_name: str = DATA_PRODUCT_QUALIFIED_NAME) -> None: assert product.name == DATA_PRODUCT_NAME assert product.qualified_name == qualified_name @@ -89,50 +87,36 @@ def test_create_with_missing_parameters_raise_value_error( ) -def test_create( - data_product_asset_selection: IndexSearchRequest, data_product_assets_dsl_json -): +def test_create(data_product_asset_selection: IndexSearchRequest, data_product_assets_dsl_json): test_product = DataProduct.create( name=DATA_PRODUCT_NAME, asset_selection=data_product_asset_selection, domain_qualified_name=DATA_DOMAIN_QUALIFIED_NAME, ) - assert test_product.data_domain.unique_attributes == { - "qualifiedName": DATA_DOMAIN_QUALIFIED_NAME - } + assert test_product.data_domain.unique_attributes == {"qualifiedName": DATA_DOMAIN_QUALIFIED_NAME} assert test_product.parent_domain_qualified_name == DATA_DOMAIN_QUALIFIED_NAME assert test_product.super_domain_qualified_name == DATA_DOMAIN_QUALIFIED_NAME - test_asset_dsl = dumps( - loads(test_product.data_product_assets_d_s_l), sort_keys=True - ) + test_asset_dsl = dumps(loads(test_product.data_product_assets_d_s_l), sort_keys=True) expected_asset_dsl = dumps(data_product_assets_dsl_json, sort_keys=True) assert test_asset_dsl == expected_asset_dsl assert test_product.data_product_assets_playbook_filter == ASSETS_PLAYBOOK_FILTER _assert_product(test_product) -def test_create_under_sub_domain( - data_product_asset_selection: IndexSearchRequest, data_product_assets_dsl_json -): +def test_create_under_sub_domain(data_product_asset_selection: IndexSearchRequest, data_product_assets_dsl_json): test_product = DataProduct.create( name=DATA_PRODUCT_NAME, asset_selection=data_product_asset_selection, domain_qualified_name=DATA_SUB_DOMAIN_QUALIFIED_NAME, ) - assert test_product.data_domain.unique_attributes == { - "qualifiedName": DATA_SUB_DOMAIN_QUALIFIED_NAME - } + assert test_product.data_domain.unique_attributes == {"qualifiedName": DATA_SUB_DOMAIN_QUALIFIED_NAME} assert test_product.parent_domain_qualified_name == DATA_SUB_DOMAIN_QUALIFIED_NAME assert test_product.super_domain_qualified_name == DATA_DOMAIN_QUALIFIED_NAME - test_asset_dsl = dumps( - loads(test_product.data_product_assets_d_s_l), sort_keys=True - ) + test_asset_dsl = dumps(loads(test_product.data_product_assets_d_s_l), sort_keys=True) expected_asset_dsl = dumps(data_product_assets_dsl_json, sort_keys=True) assert test_asset_dsl == expected_asset_dsl assert test_product.data_product_assets_playbook_filter == ASSETS_PLAYBOOK_FILTER - _assert_product( - test_product, qualified_name=DATA_PRODUCT_UNDER_SUB_DOMAIN_QUALIFIED_NAME - ) + _assert_product(test_product, qualified_name=DATA_PRODUCT_UNDER_SUB_DOMAIN_QUALIFIED_NAME) assert test_product.daap_status == DataProductStatus.ACTIVE diff --git a/tests/unit/model/data_studio_asset_test.py b/tests/unit/model/data_studio_asset_test.py index de7d488f1..7e815c3c9 100644 --- a/tests/unit/model/data_studio_asset_test.py +++ b/tests/unit/model/data_studio_asset_test.py @@ -90,24 +90,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - DataStudioAsset.create_for_modification( - qualified_name=qualified_name, name=name - ) + DataStudioAsset.create_for_modification(qualified_name=qualified_name, name=name) def test_create_for_modification_report(): - sut = DataStudioAsset.create_for_modification( - qualified_name=QUALIFIED_NAME_REPORT, name=REPORT_NAME - ) + sut = DataStudioAsset.create_for_modification(qualified_name=QUALIFIED_NAME_REPORT, name=REPORT_NAME) assert sut.qualified_name == QUALIFIED_NAME_REPORT assert sut.name == REPORT_NAME def test_create_for_modification_data_source(): - sut = DataStudioAsset.create_for_modification( - qualified_name=QUALIFIED_NAME_SOURCE, name=SOURCE_NAME - ) + sut = DataStudioAsset.create_for_modification(qualified_name=QUALIFIED_NAME_SOURCE, name=SOURCE_NAME) assert sut.qualified_name == QUALIFIED_NAME_SOURCE assert sut.name == SOURCE_NAME diff --git a/tests/unit/model/database_test.py b/tests/unit/model/database_test.py index c8be5108a..38a2cb55a 100644 --- a/tests/unit/model/database_test.py +++ b/tests/unit/model/database_test.py @@ -27,17 +27,13 @@ ), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): Database.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): - sut = Database.create( - name=DATABASE_NAME, connection_qualified_name=CONNECTION_QUALIFIED_NAME - ) + sut = Database.create(name=DATABASE_NAME, connection_qualified_name=CONNECTION_QUALIFIED_NAME) assert sut.name == DATABASE_NAME assert sut.connection_qualified_name == CONNECTION_QUALIFIED_NAME @@ -60,9 +56,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Database.create_for_modification( - qualified_name=DATABASE_QUALIFIED_NAME, name=DATABASE_NAME - ) + sut = Database.create_for_modification(qualified_name=DATABASE_QUALIFIED_NAME, name=DATABASE_NAME) assert sut.qualified_name == DATABASE_QUALIFIED_NAME assert sut.name == DATABASE_NAME diff --git a/tests/unit/model/dataverse_attribute_test.py b/tests/unit/model/dataverse_attribute_test.py index e50d14a76..ff017d514 100644 --- a/tests/unit/model/dataverse_attribute_test.py +++ b/tests/unit/model/dataverse_attribute_test.py @@ -17,13 +17,9 @@ (DATAVERSE_ATTRIBUTE_NAME, None, "entity_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error( - name: str, entity_qualified_name: str, message: str -): +def test_creator_with_missing_parameters_raise_value_error(name: str, entity_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - DataverseAttribute.creator( - name=name, dataverse_entity_qualified_name=entity_qualified_name - ) + DataverseAttribute.creator(name=name, dataverse_entity_qualified_name=entity_qualified_name) def test_creator(): @@ -45,17 +41,13 @@ def test_creator(): (DATAVERSE_ATTRIBUTE_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error( - qualified_name: str, name: str, message: str -): +def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): with pytest.raises(ValueError, match=message): DataverseAttribute.updater(qualified_name=qualified_name, name=name) def test_updater(): - sut = DataverseAttribute.updater( - qualified_name=DATAVERSE_ATTRIBUTE_QUALIFIED_NAME, name=DATAVERSE_ATTRIBUTE_NAME - ) + sut = DataverseAttribute.updater(qualified_name=DATAVERSE_ATTRIBUTE_QUALIFIED_NAME, name=DATAVERSE_ATTRIBUTE_NAME) assert sut.qualified_name == DATAVERSE_ATTRIBUTE_QUALIFIED_NAME assert sut.name == DATAVERSE_ATTRIBUTE_NAME diff --git a/tests/unit/model/dataverse_entity_test.py b/tests/unit/model/dataverse_entity_test.py index 665f6c940..3816ebb98 100644 --- a/tests/unit/model/dataverse_entity_test.py +++ b/tests/unit/model/dataverse_entity_test.py @@ -16,13 +16,9 @@ (DATAVERSE_ENTITY_NAME, None, "connection_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_creator_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - DataverseEntity.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + DataverseEntity.creator(name=name, connection_qualified_name=connection_qualified_name) def test_creator(): @@ -44,17 +40,13 @@ def test_creator(): (DATAVERSE_ENTITY_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error( - qualified_name: str, name: str, message: str -): +def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): with pytest.raises(ValueError, match=message): DataverseEntity.updater(qualified_name=qualified_name, name=name) def test_updater(): - sut = DataverseEntity.updater( - qualified_name=DATAVERSE_ENTITY_QUALIFIED_NAME, name=DATAVERSE_ENTITY_NAME - ) + sut = DataverseEntity.updater(qualified_name=DATAVERSE_ENTITY_QUALIFIED_NAME, name=DATAVERSE_ENTITY_NAME) assert sut.qualified_name == DATAVERSE_ENTITY_QUALIFIED_NAME assert sut.name == DATAVERSE_ENTITY_NAME diff --git a/tests/unit/model/fields/atlan_fields_test.py b/tests/unit/model/fields/atlan_fields_test.py index 3bca4dd02..db9a79c17 100644 --- a/tests/unit/model/fields/atlan_fields_test.py +++ b/tests/unit/model/fields/atlan_fields_test.py @@ -21,9 +21,7 @@ class TestSearchableField: @pytest.fixture() def sut(self) -> SearchableField: - return SearchableField( - atlan_field_name=ATLAN_FIELD_NAME, elastic_field_name=ELASTIC_FIELD_NAME - ) + return SearchableField(atlan_field_name=ATLAN_FIELD_NAME, elastic_field_name=ELASTIC_FIELD_NAME) def test_internal_field_name(self, sut: SearchableField): assert sut.internal_field_name == ATLAN_FIELD_NAME @@ -52,9 +50,7 @@ def test_order(self, sut: SearchableField): class TestKeywordField: @pytest.fixture() def sut(self) -> KeywordField: - return KeywordField( - atlan_field_name=ATLAN_FIELD_NAME, keyword_field_name=KEYWORD_FIELD_NAME - ) + return KeywordField(atlan_field_name=ATLAN_FIELD_NAME, keyword_field_name=KEYWORD_FIELD_NAME) def test_internal_field_name(self, sut: KeywordField): assert sut.internal_field_name == ATLAN_FIELD_NAME diff --git a/tests/unit/model/file_test.py b/tests/unit/model/file_test.py index 967e1279f..4ffbfedff 100644 --- a/tests/unit/model/file_test.py +++ b/tests/unit/model/file_test.py @@ -22,9 +22,7 @@ (FILE_NAME, FILE_CONNECTION_QUALIFIED_NAME, "", "file_type cannot be blank"), ], ) -def test__create_without_required_parameters_raises_validation_error( - name, connection_qualified_name, file_type, msg -): +def test__create_without_required_parameters_raises_validation_error(name, connection_qualified_name, file_type, msg): with pytest.raises(ValueError, match=msg): File.create( name=name, @@ -42,9 +40,7 @@ def test_create_with_required_parameters(): assert attributes.name == FILE_NAME assert attributes.connection_qualified_name == FILE_CONNECTION_QUALIFIED_NAME assert attributes.qualified_name == FILE_QUALIFIED_NAME - assert attributes.connector_name == AtlanConnectorType.get_connector_name( - FILE_CONNECTION_QUALIFIED_NAME - ) + assert attributes.connector_name == AtlanConnectorType.get_connector_name(FILE_CONNECTION_QUALIFIED_NAME) @pytest.mark.parametrize( @@ -62,18 +58,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = File.create_for_modification( - qualified_name=FILE_QUALIFIED_NAME, name=FILE_NAME - ) + sut = File.create_for_modification(qualified_name=FILE_QUALIFIED_NAME, name=FILE_NAME) assert sut.qualified_name == FILE_QUALIFIED_NAME assert sut.name == FILE_NAME def test_trim_to_required(): - sut = File.create_for_modification( - qualified_name=FILE_QUALIFIED_NAME, name=FILE_NAME - ).trim_to_required() + sut = File.create_for_modification(qualified_name=FILE_QUALIFIED_NAME, name=FILE_NAME).trim_to_required() assert sut.qualified_name == FILE_QUALIFIED_NAME assert sut.name == FILE_NAME diff --git a/tests/unit/model/gcs_bucket_test.py b/tests/unit/model/gcs_bucket_test.py index 115ddf2b9..5bf14f261 100644 --- a/tests/unit/model/gcs_bucket_test.py +++ b/tests/unit/model/gcs_bucket_test.py @@ -16,17 +16,13 @@ (GCS_BUCKET_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): GCSBucket.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): - sut = GCSBucket.create( - name=GCS_BUCKET_NAME, connection_qualified_name=GCS_CONNECTION_QUALIFIED_NAME - ) + sut = GCSBucket.create(name=GCS_BUCKET_NAME, connection_qualified_name=GCS_CONNECTION_QUALIFIED_NAME) assert sut.name == GCS_BUCKET_NAME assert sut.connection_qualified_name == GCS_CONNECTION_QUALIFIED_NAME @@ -49,9 +45,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = GCSBucket.create_for_modification( - qualified_name=GCS_QUALIFIED_NAME, name=GCS_BUCKET_NAME - ) + sut = GCSBucket.create_for_modification(qualified_name=GCS_QUALIFIED_NAME, name=GCS_BUCKET_NAME) assert sut.qualified_name == GCS_QUALIFIED_NAME assert sut.name == GCS_BUCKET_NAME diff --git a/tests/unit/model/gcs_object_test.py b/tests/unit/model/gcs_object_test.py index 285476497..4711de5ba 100644 --- a/tests/unit/model/gcs_object_test.py +++ b/tests/unit/model/gcs_object_test.py @@ -16,17 +16,13 @@ (GCS_OBJECT_NAME, None, "gcs_bucket_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, gcs_bucket_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, gcs_bucket_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): GCSObject.create(name=name, gcs_bucket_qualified_name=gcs_bucket_qualified_name) def test_create(): - sut = GCSObject.create( - name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=GCS_BUCKET_QUALIFIED_NAME - ) + sut = GCSObject.create(name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=GCS_BUCKET_QUALIFIED_NAME) assert sut.name == GCS_OBJECT_NAME assert sut.gcs_bucket_qualified_name == GCS_BUCKET_QUALIFIED_NAME @@ -62,18 +58,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = GCSObject.create_for_modification( - qualified_name=GCS_OBJECT_QUALIFIED_NAME, name=GCS_OBJECT_NAME - ) + sut = GCSObject.create_for_modification(qualified_name=GCS_OBJECT_QUALIFIED_NAME, name=GCS_OBJECT_NAME) assert sut.qualified_name == GCS_OBJECT_QUALIFIED_NAME assert sut.name == GCS_OBJECT_NAME def test_trim_to_required(): - sut = GCSObject.create( - name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=GCS_BUCKET_QUALIFIED_NAME - ).trim_to_required() + sut = GCSObject.create(name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=GCS_BUCKET_QUALIFIED_NAME).trim_to_required() assert sut.name == GCS_OBJECT_NAME assert sut.qualified_name == GCS_OBJECT_QUALIFIED_NAME diff --git a/tests/unit/model/glossary_category_test.py b/tests/unit/model/glossary_category_test.py index c9b78b00a..c7916fdfa 100644 --- a/tests/unit/model/glossary_category_test.py +++ b/tests/unit/model/glossary_category_test.py @@ -8,9 +8,7 @@ GLOSSARY_QUALIFIED_NAME, ) -ANCHOR = AtlasGlossary.create_for_modification( - qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME -) +ANCHOR = AtlasGlossary.create_for_modification(qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME) GLOSSARY_GUID = "123" PARENT_CATEGORY = AtlasGlossaryCategory.create_for_modification( qualified_name="123", name="Category", glossary_guid=GLOSSARY_GUID diff --git a/tests/unit/model/glossary_term_test.py b/tests/unit/model/glossary_term_test.py index 3d247c6dd..22e5068a7 100644 --- a/tests/unit/model/glossary_term_test.py +++ b/tests/unit/model/glossary_term_test.py @@ -10,9 +10,7 @@ GLOSSARY_TERM_QUALIFIED_NAME, ) -ANCHOR = AtlasGlossary.create_for_modification( - qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME -) +ANCHOR = AtlasGlossary.create_for_modification(qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME) GLOSSARY_GUID = "123" @@ -96,11 +94,7 @@ def test_create_with_missing_parameters_raise_value_error( None, None, GLOSSARY_GUID, - [ - AtlasGlossaryCategory.updater( - qualified_name="123", name="Category", glossary_guid=GLOSSARY_GUID - ) - ], + [AtlasGlossaryCategory.updater(qualified_name="123", name="Category", glossary_guid=GLOSSARY_GUID)], ), ], ) @@ -127,8 +121,7 @@ def test_create( glossary_qualified_name and sut.anchor is not None and sut.anchor.unique_attributes is not None - and sut.anchor.unique_attributes - == {"qualifiedName": glossary_qualified_name} + and sut.anchor.unique_attributes == {"qualifiedName": glossary_qualified_name} ) or (glossary_guid and sut and sut.anchor and sut.anchor.guid == glossary_guid) ) @@ -151,9 +144,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( name: str, qualified_name: str, glossary_guid: str, message: str ): with pytest.raises(ValueError, match=message): - AtlasGlossaryTerm.create_for_modification( - qualified_name=qualified_name, name=name, glossary_guid=glossary_guid - ) + AtlasGlossaryTerm.create_for_modification(qualified_name=qualified_name, name=name, glossary_guid=glossary_guid) def test_create_for_modification(): diff --git a/tests/unit/model/glossary_test.py b/tests/unit/model/glossary_test.py index 3727dc4c8..9067d5093 100644 --- a/tests/unit/model/glossary_test.py +++ b/tests/unit/model/glossary_test.py @@ -31,9 +31,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AtlasGlossary.create_for_modification( - qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME - ) + sut = AtlasGlossary.create_for_modification(qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME) assert sut.qualified_name == GLOSSARY_QUALIFIED_NAME assert sut.name == GLOSSARY_NAME diff --git a/tests/unit/model/kafka_consumer_group_test.py b/tests/unit/model/kafka_consumer_group_test.py index 13aeabc04..488a65ce6 100644 --- a/tests/unit/model/kafka_consumer_group_test.py +++ b/tests/unit/model/kafka_consumer_group_test.py @@ -17,13 +17,9 @@ (KAFKA_TOPIC_QUALIFIED_NAMES, None, "kafka_topic_qualified_names is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error( - name: str, kafka_topic_qualified_names: str, message: str -): +def test_creator_with_missing_parameters_raise_value_error(name: str, kafka_topic_qualified_names: str, message: str): with pytest.raises(ValueError, match=message): - KafkaConsumerGroup.creator( - name=name, kafka_topic_qualified_names=kafka_topic_qualified_names - ) + KafkaConsumerGroup.creator(name=name, kafka_topic_qualified_names=kafka_topic_qualified_names) def test_creator(): @@ -46,9 +42,7 @@ def test_creator(): (KAFKA_CONSUMER_GROUP_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error( - qualified_name: str, name: str, message: str -): +def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): with pytest.raises(ValueError, match=message): KafkaConsumerGroup.updater(qualified_name=qualified_name, name=name) diff --git a/tests/unit/model/kafka_topic_test.py b/tests/unit/model/kafka_topic_test.py index 2a235378b..686ffc08e 100644 --- a/tests/unit/model/kafka_topic_test.py +++ b/tests/unit/model/kafka_topic_test.py @@ -16,13 +16,9 @@ (KAFKA_TOPIC_NAME, None, "connection_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_creator_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - KafkaTopic.creator( - name=name, connection_qualified_name=connection_qualified_name - ) + KafkaTopic.creator(name=name, connection_qualified_name=connection_qualified_name) def test_creator(): @@ -44,17 +40,13 @@ def test_creator(): (KAFKA_TOPIC_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error( - qualified_name: str, name: str, message: str -): +def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): with pytest.raises(ValueError, match=message): KafkaTopic.updater(qualified_name=qualified_name, name=name) def test_updater(): - topic = KafkaTopic.updater( - name=KAFKA_TOPIC_NAME, qualified_name=KAFKA_TOPIC_QUALIFIED_NAME - ) + topic = KafkaTopic.updater(name=KAFKA_TOPIC_NAME, qualified_name=KAFKA_TOPIC_QUALIFIED_NAME) assert topic.name == KAFKA_TOPIC_NAME assert topic.qualified_name == KAFKA_TOPIC_QUALIFIED_NAME diff --git a/tests/unit/model/materialised_view_test.py b/tests/unit/model/materialised_view_test.py index 691a73677..9adfd3395 100644 --- a/tests/unit/model/materialised_view_test.py +++ b/tests/unit/model/materialised_view_test.py @@ -26,17 +26,13 @@ (VIEW_NAME, VIEW_COLUMN_QUALIFIED_NAME, "Invalid schema_qualified_name"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, schema_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, schema_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): MaterialisedView.create(name=name, schema_qualified_name=schema_qualified_name) def test_create(): - sut = MaterialisedView.create( - name=VIEW_NAME, schema_qualified_name=SCHEMA_QUALIFIED_NAME - ) + sut = MaterialisedView.create(name=VIEW_NAME, schema_qualified_name=SCHEMA_QUALIFIED_NAME) assert sut.name == VIEW_NAME assert sut.database_name == DATABASE_NAME @@ -80,15 +76,11 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - MaterialisedView.create_for_modification( - qualified_name=qualified_name, name=name - ) + MaterialisedView.create_for_modification(qualified_name=qualified_name, name=name) def test_create_for_modification(): - sut = MaterialisedView.create_for_modification( - qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME - ) + sut = MaterialisedView.create_for_modification(qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME) assert sut.qualified_name == VIEW_QUALIFIED_NAME assert sut.name == VIEW_NAME diff --git a/tests/unit/model/open_lineage/open_lineage_test.py b/tests/unit/model/open_lineage/open_lineage_test.py index db77f275b..a0eba84ec 100644 --- a/tests/unit/model/open_lineage/open_lineage_test.py +++ b/tests/unit/model/open_lineage/open_lineage_test.py @@ -52,9 +52,7 @@ def client(): def mock_event_time(): with patch("pyatlan.model.open_lineage.event.datetime") as mock_datetime: mock_datetime_instance = Mock() - mock_datetime_instance.isoformat.return_value = ( - "2024-10-07T10:23:52.239783+00:00" - ) + mock_datetime_instance.isoformat.return_value = "2024-10-07T10:23:52.239783+00:00" mock_datetime.now.return_value = mock_datetime_instance yield mock_datetime @@ -92,9 +90,7 @@ def mock_session(): [OpenLineageEvent(), None, "none is not an allowed value"], ], ) -def test_ol_client_send_raises_validation_error( - test_request, connector_type, error_msg -): +def test_ol_client_send_raises_validation_error(test_request, connector_type, error_msg): with pytest.raises(ValidationError) as err: OpenLineageClient.send(request=test_request, connector_type=connector_type) assert error_msg in str(err.value) @@ -110,9 +106,7 @@ def test_ol_invalid_client_raises_invalid_request_error( ): client_method = getattr(FluentTasks(), test_method) for invalid_client in test_client: - with pytest.raises( - InvalidRequestError, match="No Atlan client has been provided." - ): + with pytest.raises(InvalidRequestError, match="No Atlan client has been provided."): client_method(client=invalid_client) @@ -122,9 +116,7 @@ def test_ol_client_send( mock_api_caller._call_api.side_effect = ["Event recieved"] test_event = OpenLineageEvent() assert ( - OpenLineageClient(client=mock_api_caller).send( - request=test_event, connector_type=AtlanConnectorType.SPARK - ) + OpenLineageClient(client=mock_api_caller).send(request=test_event, connector_type=AtlanConnectorType.SPARK) is None ) @@ -141,15 +133,11 @@ def test_ol_client_send_when_ol_not_configured(client, mock_session): "this connector before you can send events for it." ) with pytest.raises(AtlanError, match=expected_error): - client.open_lineage.send( - request=OpenLineageEvent(), connector_type=AtlanConnectorType.SNOWFLAKE - ) + client.open_lineage.send(request=OpenLineageEvent(), connector_type=AtlanConnectorType.SNOWFLAKE) def test_ol_models(mock_run_id, mock_event_time): - job = OpenLineageJob.creator( - connection_name="ol-spark", job_name="dag_123", producer=PRODUCER - ) + job = OpenLineageJob.creator(connection_name="ol-spark", job_name="dag_123", producer=PRODUCER) run = OpenLineageRun.creator(job=job) id = job.create_input(namespace=NAMESPACE, asset_name="OPS.DEFAULT.RUN_STATS") @@ -181,7 +169,5 @@ def test_ol_models(mock_run_id, mock_event_time): ] assert to_json(start) == load_json(OL_EVENT_START) - complete = OpenLineageEvent.creator( - run=run, event_type=OpenLineageEventType.COMPLETE - ) + complete = OpenLineageEvent.creator(run=run, event_type=OpenLineageEventType.COMPLETE) assert to_json(complete) == load_json(OL_EVENT_COMPLETE) diff --git a/tests/unit/model/preset_chart_test.py b/tests/unit/model/preset_chart_test.py index f4a9c5ea0..e3ed2a0e9 100644 --- a/tests/unit/model/preset_chart_test.py +++ b/tests/unit/model/preset_chart_test.py @@ -21,9 +21,7 @@ def test_create_with_missing_parameters_raise_value_error( name: str, preset_dashboard_qualified_name: str, message: str ): with pytest.raises(ValueError, match=message): - PresetChart.create( - name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name - ) + PresetChart.create(name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name) def test_create(): @@ -35,9 +33,7 @@ def test_create(): assert sut.name == PRESET_CHART_NAME assert sut.preset_dashboard_qualified_name == PRESET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_CHART_NAME}" - ) + assert sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_CHART_NAME}" assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -51,9 +47,7 @@ def test_overload_creator(): assert sut.name == PRESET_CHART_NAME assert sut.preset_dashboard_qualified_name == PRESET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_CHART_NAME}" - ) + assert sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_CHART_NAME}" assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -72,9 +66,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = PresetChart.create_for_modification( - qualified_name=PRESET_CHART_QUALIFIED_NAME, name=PRESET_CHART_NAME - ) + sut = PresetChart.create_for_modification(qualified_name=PRESET_CHART_QUALIFIED_NAME, name=PRESET_CHART_NAME) assert sut.qualified_name == PRESET_CHART_QUALIFIED_NAME assert sut.name == PRESET_CHART_NAME diff --git a/tests/unit/model/preset_dashboard_test.py b/tests/unit/model/preset_dashboard_test.py index e13769c7e..fe3970975 100644 --- a/tests/unit/model/preset_dashboard_test.py +++ b/tests/unit/model/preset_dashboard_test.py @@ -21,9 +21,7 @@ def test_create_with_missing_parameters_raise_value_error( name: str, preset_workspace_qualified_name: str, message: str ): with pytest.raises(ValueError, match=message): - PresetDashboard.create( - name=name, preset_workspace_qualified_name=preset_workspace_qualified_name - ) + PresetDashboard.create(name=name, preset_workspace_qualified_name=preset_workspace_qualified_name) def test_create(): @@ -35,10 +33,7 @@ def test_create(): assert sut.name == PRESET_DASHBOARD_NAME assert sut.preset_workspace_qualified_name == PRESET_WORKSPACE_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name - == f"{PRESET_WORKSPACE_QUALIFIED_NAME}/{PRESET_DASHBOARD_NAME}" - ) + assert sut.qualified_name == f"{PRESET_WORKSPACE_QUALIFIED_NAME}/{PRESET_DASHBOARD_NAME}" assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -52,10 +47,7 @@ def test_overload_creator(): assert sut.name == PRESET_DASHBOARD_NAME assert sut.preset_workspace_qualified_name == PRESET_WORKSPACE_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name - == f"{PRESET_WORKSPACE_QUALIFIED_NAME}/{PRESET_DASHBOARD_NAME}" - ) + assert sut.qualified_name == f"{PRESET_WORKSPACE_QUALIFIED_NAME}/{PRESET_DASHBOARD_NAME}" assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -70,9 +62,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - PresetDashboard.create_for_modification( - qualified_name=qualified_name, name=name - ) + PresetDashboard.create_for_modification(qualified_name=qualified_name, name=name) def test_create_for_modification(): diff --git a/tests/unit/model/preset_dataset_test.py b/tests/unit/model/preset_dataset_test.py index 98301ef12..8283b0c90 100644 --- a/tests/unit/model/preset_dataset_test.py +++ b/tests/unit/model/preset_dataset_test.py @@ -21,9 +21,7 @@ def test_create_with_missing_parameters_raise_value_error( name: str, preset_dashboard_qualified_name: str, message: str ): with pytest.raises(ValueError, match=message): - PresetDataset.create( - name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name - ) + PresetDataset.create(name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name) def test_create(): @@ -35,9 +33,7 @@ def test_create(): assert sut.name == PRESET_DATASET_NAME assert sut.preset_dashboard_qualified_name == PRESET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" - ) + assert sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -51,9 +47,7 @@ def test_creator(): assert sut.name == PRESET_DATASET_NAME assert sut.preset_dashboard_qualified_name == PRESET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" - ) + assert sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -72,9 +66,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = PresetDataset.create_for_modification( - qualified_name=PRESET_DATASET_QUALIFIED_NAME, name=PRESET_DATASET_NAME - ) + sut = PresetDataset.create_for_modification(qualified_name=PRESET_DATASET_QUALIFIED_NAME, name=PRESET_DATASET_NAME) assert sut.qualified_name == PRESET_DATASET_QUALIFIED_NAME assert sut.name == PRESET_DATASET_NAME diff --git a/tests/unit/model/preset_workspace_test.py b/tests/unit/model/preset_workspace_test.py index 09924d28c..341ef49e6 100644 --- a/tests/unit/model/preset_workspace_test.py +++ b/tests/unit/model/preset_workspace_test.py @@ -16,13 +16,9 @@ (PRESET_WORKSPACE_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - PresetWorkspace.create( - name=name, connection_qualified_name=connection_qualified_name - ) + PresetWorkspace.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): @@ -48,9 +44,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - PresetWorkspace.create_for_modification( - qualified_name=qualified_name, name=name - ) + PresetWorkspace.create_for_modification(qualified_name=qualified_name, name=name) def test_create_for_modification(): diff --git a/tests/unit/model/procedure_test.py b/tests/unit/model/procedure_test.py index 088b7da58..8fd5afa3d 100644 --- a/tests/unit/model/procedure_test.py +++ b/tests/unit/model/procedure_test.py @@ -49,9 +49,7 @@ def test_creator(): assert sut.database_name == DATABASE_NAME assert sut.connection_qualified_name == CONNECTION_QUALIFIED_NAME assert sut.database_qualified_name == DATABASE_QUALIFIED_NAME - assert ( - sut.qualified_name == f"{SCHEMA_QUALIFIED_NAME}/_procedures_/{PROCEDURE_NAME}" - ) + assert sut.qualified_name == f"{SCHEMA_QUALIFIED_NAME}/_procedures_/{PROCEDURE_NAME}" assert sut.schema_qualified_name == SCHEMA_QUALIFIED_NAME assert sut.schema_name == SCHEMA_NAME assert sut.connector_name == CONNECTOR_TYPE @@ -73,9 +71,7 @@ def test_overload_creator(): assert sut.database_name == DATABASE_NAME assert sut.connection_qualified_name == CONNECTION_QUALIFIED_NAME assert sut.database_qualified_name == DATABASE_QUALIFIED_NAME - assert ( - sut.qualified_name == f"{SCHEMA_QUALIFIED_NAME}/_procedures_/{PROCEDURE_NAME}" - ) + assert sut.qualified_name == f"{SCHEMA_QUALIFIED_NAME}/_procedures_/{PROCEDURE_NAME}" assert sut.schema_qualified_name == SCHEMA_QUALIFIED_NAME assert sut.schema_name == SCHEMA_NAME assert sut.connector_name == CONNECTOR_TYPE diff --git a/tests/unit/model/process_test.py b/tests/unit/model/process_test.py index c1e3ee94b..fb1e2a5de 100644 --- a/tests/unit/model/process_test.py +++ b/tests/unit/model/process_test.py @@ -90,13 +90,9 @@ def test_create_without_required_parameter_raises_value_error( ), ], ) -def test__create( - name, connection_qualified_name, process_id, inputs, outputs, parent, expected_value -): +def test__create(name, connection_qualified_name, process_id, inputs, outputs, parent, expected_value): expected_value = ( - expected_value - if process_id - else f"{connection_qualified_name}/{md5(expected_value.encode()).hexdigest()}" + expected_value if process_id else f"{connection_qualified_name}/{md5(expected_value.encode()).hexdigest()}" ) process = Process.create( @@ -130,18 +126,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Process.create_for_modification( - qualified_name=PROCESS_QUALIFIED_NAME, name=PROCESS_NAME - ) + sut = Process.create_for_modification(qualified_name=PROCESS_QUALIFIED_NAME, name=PROCESS_NAME) assert sut.qualified_name == PROCESS_QUALIFIED_NAME assert sut.name == PROCESS_NAME def test_trim_to_required(): - sut = Process.create_for_modification( - qualified_name=PROCESS_QUALIFIED_NAME, name=PROCESS_NAME - ).trim_to_required() + sut = Process.create_for_modification(qualified_name=PROCESS_QUALIFIED_NAME, name=PROCESS_NAME).trim_to_required() assert sut.qualified_name == PROCESS_QUALIFIED_NAME assert sut.name == PROCESS_NAME @@ -232,9 +224,7 @@ def test_process_attributes_generate_qualified_name( name, connection_qualified_name, process_id, inputs, outputs, parent, expected_value ): expected_value = ( - expected_value - if process_id - else f"{connection_qualified_name}/{md5(expected_value.encode()).hexdigest()}" + expected_value if process_id else f"{connection_qualified_name}/{md5(expected_value.encode()).hexdigest()}" ) assert ( diff --git a/tests/unit/model/quick_sight_analysis_test.py b/tests/unit/model/quick_sight_analysis_test.py index 4bdf34961..894c54dbc 100644 --- a/tests/unit/model/quick_sight_analysis_test.py +++ b/tests/unit/model/quick_sight_analysis_test.py @@ -75,9 +75,7 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightAnalysis.updater( - qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME - ) + sut = QuickSightAnalysis.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_analysis_visual_test.py b/tests/unit/model/quick_sight_analysis_visual_test.py index c709bc2e7..9bf4b2d6a 100644 --- a/tests/unit/model/quick_sight_analysis_visual_test.py +++ b/tests/unit/model/quick_sight_analysis_visual_test.py @@ -115,9 +115,7 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightAnalysisVisual.updater( - qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME - ) + sut = QuickSightAnalysisVisual.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_dashboard_test.py b/tests/unit/model/quick_sight_dashboard_test.py index 85948c424..48939752e 100644 --- a/tests/unit/model/quick_sight_dashboard_test.py +++ b/tests/unit/model/quick_sight_dashboard_test.py @@ -75,9 +75,7 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightDashboard.updater( - qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME - ) + sut = QuickSightDashboard.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_dashboard_visual_test.py b/tests/unit/model/quick_sight_dashboard_visual_test.py index b54a87719..57d3b6789 100644 --- a/tests/unit/model/quick_sight_dashboard_visual_test.py +++ b/tests/unit/model/quick_sight_dashboard_visual_test.py @@ -115,9 +115,7 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightDashboardVisual.updater( - qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME - ) + sut = QuickSightDashboardVisual.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_dataset_field_test.py b/tests/unit/model/quick_sight_dataset_field_test.py index ec2110bec..da7186eb8 100644 --- a/tests/unit/model/quick_sight_dataset_field_test.py +++ b/tests/unit/model/quick_sight_dataset_field_test.py @@ -82,9 +82,7 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightDatasetField.updater( - qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME - ) + sut = QuickSightDatasetField.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_dataset_test.py b/tests/unit/model/quick_sight_dataset_test.py index 2a3e64ebd..76192a16c 100644 --- a/tests/unit/model/quick_sight_dataset_test.py +++ b/tests/unit/model/quick_sight_dataset_test.py @@ -72,17 +72,13 @@ def test_overload_creator(): assert sut.name == QUICK_SIGHT_NAME assert sut.connection_qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.quick_sight_id == QUICK_SIGHT_ID - assert ( - sut.quick_sight_dataset_import_mode == QuickSightDatasetImportMode.DIRECT_QUERY - ) + assert sut.quick_sight_dataset_import_mode == QuickSightDatasetImportMode.DIRECT_QUERY assert sut.qualified_name == QUICK_SIGHT_QUALIFIED_NAME assert sut.connector_name == QUICK_SIGHT_CONNECTOR_TYPE def test_updater(): - sut = QuickSightDataset.updater( - qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME - ) + sut = QuickSightDataset.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_folder_test.py b/tests/unit/model/quick_sight_folder_test.py index b00b69b1f..d5499524a 100644 --- a/tests/unit/model/quick_sight_folder_test.py +++ b/tests/unit/model/quick_sight_folder_test.py @@ -76,9 +76,7 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightFolder.updater( - qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME - ) + sut = QuickSightFolder.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/readme_test.py b/tests/unit/model/readme_test.py index 891b2b859..c87ad7819 100644 --- a/tests/unit/model/readme_test.py +++ b/tests/unit/model/readme_test.py @@ -30,9 +30,7 @@ ), ], ) -def test_create_readme_without_required_parameters_raises_exception( - asset, content, asset_name, error, message -): +def test_create_readme_without_required_parameters_raises_exception(asset, content, asset_name, error, message): with pytest.raises(error, match=message): Readme.create(asset=asset, content=content, asset_name=asset_name) @@ -81,18 +79,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Readme.create_for_modification( - qualified_name=README_QUALIFIED_NAME, name=README_NAME - ) + sut = Readme.create_for_modification(qualified_name=README_QUALIFIED_NAME, name=README_NAME) assert sut.qualified_name == README_QUALIFIED_NAME assert sut.name == README_NAME def test_trim_to_required(): - sut = Readme.create_for_modification( - qualified_name=README_QUALIFIED_NAME, name=README_NAME - ).trim_to_required() + sut = Readme.create_for_modification(qualified_name=README_QUALIFIED_NAME, name=README_NAME).trim_to_required() assert sut.qualified_name == README_QUALIFIED_NAME assert sut.name == README_NAME diff --git a/tests/unit/model/s3_bucket_test.py b/tests/unit/model/s3_bucket_test.py index fc6394335..79adc8d0b 100644 --- a/tests/unit/model/s3_bucket_test.py +++ b/tests/unit/model/s3_bucket_test.py @@ -33,9 +33,7 @@ ), ], ) -def test_create_without_required_parameters_raises_validation_error( - name, connection_qualified_name, msg -): +def test_create_without_required_parameters_raises_validation_error(name, connection_qualified_name, msg): with pytest.raises(ValueError, match=msg): S3Bucket.create( name=name, @@ -83,18 +81,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = S3Bucket.create_for_modification( - qualified_name=S3_OBJECT_QUALIFIED_NAME, name=BUCKET_NAME - ) + sut = S3Bucket.create_for_modification(qualified_name=S3_OBJECT_QUALIFIED_NAME, name=BUCKET_NAME) assert sut.qualified_name == S3_OBJECT_QUALIFIED_NAME assert sut.name == BUCKET_NAME def test_trim_to_required(): - sut = S3Bucket.create_for_modification( - qualified_name=S3_OBJECT_QUALIFIED_NAME, name=BUCKET_NAME - ).trim_to_required() + sut = S3Bucket.create_for_modification(qualified_name=S3_OBJECT_QUALIFIED_NAME, name=BUCKET_NAME).trim_to_required() assert sut.qualified_name == S3_OBJECT_QUALIFIED_NAME assert sut.name == BUCKET_NAME diff --git a/tests/unit/model/s3object_test.py b/tests/unit/model/s3object_test.py index ab5f75190..353ae696e 100644 --- a/tests/unit/model/s3object_test.py +++ b/tests/unit/model/s3object_test.py @@ -341,9 +341,7 @@ def test_create_with_required_parameters( ), ], ) -def test_create_with_prefix( - name, connection_qualified_name, prefix, s3_bucket_name, s3_bucket_qualified_name -): +def test_create_with_prefix(name, connection_qualified_name, prefix, s3_bucket_name, s3_bucket_qualified_name): attributes = S3Object.create_with_prefix( name=name, connection_qualified_name=connection_qualified_name, @@ -376,9 +374,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = S3Object.create_for_modification( - qualified_name=S3_OBJECT_QUALIFIED_NAME, name=S3_OBJECT_NAME - ) + sut = S3Object.create_for_modification(qualified_name=S3_OBJECT_QUALIFIED_NAME, name=S3_OBJECT_NAME) assert sut.qualified_name == S3_OBJECT_QUALIFIED_NAME assert sut.name == S3_OBJECT_NAME diff --git a/tests/unit/model/schema_test.py b/tests/unit/model/schema_test.py index f630f6d00..b29e91b8d 100644 --- a/tests/unit/model/schema_test.py +++ b/tests/unit/model/schema_test.py @@ -25,17 +25,13 @@ ), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, database_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, database_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): Schema.create(name=name, database_qualified_name=database_qualified_name) def test_create(): - sut = Schema.create( - name=SCHEMA_NAME, database_qualified_name=DATABASE_QUALIFIED_NAME - ) + sut = Schema.create(name=SCHEMA_NAME, database_qualified_name=DATABASE_QUALIFIED_NAME) assert sut.name == SCHEMA_NAME assert sut.database_name == DATABASE_NAME @@ -78,18 +74,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Schema.create_for_modification( - qualified_name=SCHEMA_QUALIFIED_NAME, name=SCHEMA_NAME - ) + sut = Schema.create_for_modification(qualified_name=SCHEMA_QUALIFIED_NAME, name=SCHEMA_NAME) assert sut.qualified_name == SCHEMA_QUALIFIED_NAME assert sut.name == SCHEMA_NAME def test_trim_to_required(): - sut = Schema.create_for_modification( - qualified_name=SCHEMA_QUALIFIED_NAME, name=SCHEMA_NAME - ).trim_to_required() + sut = Schema.create_for_modification(qualified_name=SCHEMA_QUALIFIED_NAME, name=SCHEMA_NAME).trim_to_required() assert sut.qualified_name == SCHEMA_QUALIFIED_NAME assert sut.name == SCHEMA_NAME diff --git a/tests/unit/model/superset_chart_test.py b/tests/unit/model/superset_chart_test.py index 4b9db96b4..152fdc06e 100644 --- a/tests/unit/model/superset_chart_test.py +++ b/tests/unit/model/superset_chart_test.py @@ -36,10 +36,7 @@ def test_create(): assert sut.name == SUPERSET_CHART_NAME assert sut.superset_dashboard_qualified_name == SUPERSET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == SUPERSET_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name - == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" - ) + assert sut.qualified_name == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" assert sut.connector_name == SUPERSET_CONNECTOR_TYPE @@ -53,10 +50,7 @@ def test_overload_creator(): assert sut.name == SUPERSET_CHART_NAME assert sut.superset_dashboard_qualified_name == SUPERSET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == SUPERSET_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name - == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" - ) + assert sut.qualified_name == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" assert sut.connector_name == SUPERSET_CONNECTOR_TYPE @@ -75,9 +69,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = SupersetChart.create_for_modification( - qualified_name=SUPERSET_CHART_QUALIFIED_NAME, name=SUPERSET_CHART_NAME - ) + sut = SupersetChart.create_for_modification(qualified_name=SUPERSET_CHART_QUALIFIED_NAME, name=SUPERSET_CHART_NAME) assert sut.qualified_name == SUPERSET_CHART_QUALIFIED_NAME assert sut.name == SUPERSET_CHART_NAME diff --git a/tests/unit/model/superset_dashboard_test.py b/tests/unit/model/superset_dashboard_test.py index dc9aedd50..7d6b967b0 100644 --- a/tests/unit/model/superset_dashboard_test.py +++ b/tests/unit/model/superset_dashboard_test.py @@ -16,13 +16,9 @@ (SUPERSET_DASHBOARD_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, connection_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): - SupersetDashboard.create( - name=name, connection_qualified_name=connection_qualified_name - ) + SupersetDashboard.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): @@ -33,10 +29,7 @@ def test_create(): assert sut.name == SUPERSET_DASHBOARD_NAME assert sut.connection_qualified_name == SUPERSET_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name - == f"{SUPERSET_CONNECTION_QUALIFIED_NAME}/{SUPERSET_DASHBOARD_NAME}" - ) + assert sut.qualified_name == f"{SUPERSET_CONNECTION_QUALIFIED_NAME}/{SUPERSET_DASHBOARD_NAME}" assert sut.connector_name == SUPERSET_CONNECTOR_TYPE @@ -51,9 +44,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - SupersetDashboard.create_for_modification( - qualified_name=qualified_name, name=name - ) + SupersetDashboard.create_for_modification(qualified_name=qualified_name, name=name) def test_create_for_modification(): diff --git a/tests/unit/model/superset_dataset_test.py b/tests/unit/model/superset_dataset_test.py index 3d0983a2b..bd0bbd023 100644 --- a/tests/unit/model/superset_dataset_test.py +++ b/tests/unit/model/superset_dataset_test.py @@ -36,10 +36,7 @@ def test_create(): assert sut.name == SUPERSET_DATASET_NAME assert sut.superset_dashboard_qualified_name == SUPERSET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == SUPERSET_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name - == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" - ) + assert sut.qualified_name == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" assert sut.connector_name == SUPERSET_CONNECTOR_TYPE @@ -53,10 +50,7 @@ def test_creator(): assert sut.name == SUPERSET_DATASET_NAME assert sut.superset_dashboard_qualified_name == SUPERSET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == SUPERSET_CONNECTION_QUALIFIED_NAME - assert ( - sut.qualified_name - == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" - ) + assert sut.qualified_name == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" assert sut.connector_name == SUPERSET_CONNECTOR_TYPE @@ -71,9 +65,7 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - SupersetDataset.create_for_modification( - qualified_name=qualified_name, name=name - ) + SupersetDataset.create_for_modification(qualified_name=qualified_name, name=name) def test_create_for_modification(): diff --git a/tests/unit/model/table_partition_test.py b/tests/unit/model/table_partition_test.py index 14551b289..a6798cf75 100644 --- a/tests/unit/model/table_partition_test.py +++ b/tests/unit/model/table_partition_test.py @@ -21,9 +21,7 @@ (TABLE_PARTITION_NAME, None, "table_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, table_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, table_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): TablePartition.creator( name=name, diff --git a/tests/unit/model/table_test.py b/tests/unit/model/table_test.py index b017e5aa3..f83ac161f 100644 --- a/tests/unit/model/table_test.py +++ b/tests/unit/model/table_test.py @@ -20,9 +20,7 @@ (TABLE_NAME, None, "schema_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, schema_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, schema_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): Table.create(name=name, schema_qualified_name=schema_qualified_name) @@ -77,18 +75,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Table.create_for_modification( - qualified_name=TABLE_QUALIFIED_NAME, name=TABLE_NAME - ) + sut = Table.create_for_modification(qualified_name=TABLE_QUALIFIED_NAME, name=TABLE_NAME) assert sut.qualified_name == TABLE_QUALIFIED_NAME assert sut.name == TABLE_NAME def test_trim_to_required(): - sut = Table.create_for_modification( - qualified_name=TABLE_QUALIFIED_NAME, name=TABLE_NAME - ).trim_to_required() + sut = Table.create_for_modification(qualified_name=TABLE_QUALIFIED_NAME, name=TABLE_NAME).trim_to_required() assert sut.qualified_name == TABLE_QUALIFIED_NAME assert sut.name == TABLE_NAME diff --git a/tests/unit/model/view_test.py b/tests/unit/model/view_test.py index ec466986f..bc02d7815 100644 --- a/tests/unit/model/view_test.py +++ b/tests/unit/model/view_test.py @@ -26,9 +26,7 @@ (VIEW_NAME, VIEW_COLUMN_QUALIFIED_NAME, "Invalid schema_qualified_name"), ], ) -def test_create_with_missing_parameters_raise_value_error( - name: str, schema_qualified_name: str, message: str -): +def test_create_with_missing_parameters_raise_value_error(name: str, schema_qualified_name: str, message: str): with pytest.raises(ValueError, match=message): View.create(name=name, schema_qualified_name=schema_qualified_name) @@ -82,18 +80,14 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = View.create_for_modification( - qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME - ) + sut = View.create_for_modification(qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME) assert sut.qualified_name == VIEW_QUALIFIED_NAME assert sut.name == VIEW_NAME def test_trim_to_required(): - sut = View.create_for_modification( - qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME - ).trim_to_required() + sut = View.create_for_modification(qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME).trim_to_required() assert sut.qualified_name == VIEW_QUALIFIED_NAME assert sut.name == VIEW_NAME diff --git a/tests/unit/pkg/test_models.py b/tests/unit/pkg/test_models.py index d9c0bec94..45b75aeaf 100644 --- a/tests/unit/pkg/test_models.py +++ b/tests/unit/pkg/test_models.py @@ -100,9 +100,7 @@ class TestPackageConfig: ) def test_validation(self, good_or_bad_labels, good_or_bad_annotations, msg): with pytest.raises(ValidationError, match=msg): - PackageConfig( - labels=good_or_bad_labels, annotations=good_or_bad_annotations - ) + PackageConfig(labels=good_or_bad_labels, annotations=good_or_bad_annotations) def test_constructor(self, labels, annotations): sut = PackageConfig(labels=labels, annotations=annotations) @@ -155,9 +153,7 @@ def test_create_package(self, custom_package, tmp_path: Path): ], indirect=["good_or_bad_custom_package"], ) -def test_generate_parameter_validation( - good_or_bad_custom_package, path, operation, msg -): +def test_generate_parameter_validation(good_or_bad_custom_package, path, operation, msg): with pytest.raises(ValidationError, match=msg): generate(pkg=good_or_bad_custom_package, path=path, operation=operation) diff --git a/tests/unit/pkg/test_widgets.py b/tests/unit/pkg/test_widgets.py index 3fcbd686e..3c285736c 100644 --- a/tests/unit/pkg/test_widgets.py +++ b/tests/unit/pkg/test_widgets.py @@ -138,9 +138,7 @@ def test_constructor_with_overrides(self): ) def test_validation(self, label, required, hidden, help_, grid, msg): with pytest.raises(ValidationError, match=msg): - APITokenSelector( - label=label, required=required, hidden=hidden, help=help_, grid=grid - ) + APITokenSelector(label=label, required=required, hidden=hidden, help=help_, grid=grid) class TestBooleanInput: @@ -233,9 +231,7 @@ def test_constructor_with_overrides(self): ) def test_validation(self, label, required, hidden, help_, grid, msg): with pytest.raises(ValidationError, match=msg): - BooleanInput( - label=label, required=required, hidden=hidden, help=help_, grid=grid - ) + BooleanInput(label=label, required=required, hidden=hidden, help=help_, grid=grid) class TestConnectionCreator: @@ -463,9 +459,7 @@ def test_constructor_with_overrides(self): ), ], ) - def test_validation( - self, label, required, hidden, help_, placeholder, grid, start, msg - ): + def test_validation(self, label, required, hidden, help_, placeholder, grid, start, msg): with pytest.raises(ValidationError, match=msg): ConnectionSelector( label=label, @@ -756,9 +750,7 @@ def test_constructor_with_overrides(self): ), ], ) - def test_validation( - self, label, required, hidden, help_, min, max, default, start, grid, msg - ): + def test_validation(self, label, required, hidden, help_, min, max, default, start, grid, msg): with pytest.raises(ValidationError, match=msg): DateInput( label=label, @@ -889,9 +881,7 @@ def test_constructor_with_overrides(self): ), ], ) - def test_validation( - self, label, possible_values, required, hidden, help_, multi_select, grid, msg - ): + def test_validation(self, label, possible_values, required, hidden, help_, multi_select, grid, msg): with pytest.raises(ValidationError, match=msg): DropDown( label=label, @@ -1001,9 +991,7 @@ def test_constructor_with_overrides(self): ), ], ) - def test_validation( - self, label, file_types, required, hidden, help_, placeholder, msg - ): + def test_validation(self, label, file_types, required, hidden, help_, placeholder, msg): with pytest.raises(ValidationError, match=msg): FileUploader( label=label, @@ -1500,9 +1488,7 @@ def test_validation(self, label, required, hidden, help_, grid, msg): class TestRadio: def test_constructor_with_defaults(self): - sut = Radio( - label=LABEL, posssible_values=POSSIBLE_VALUES, default=(default := "a") - ) + sut = Radio(label=LABEL, posssible_values=POSSIBLE_VALUES, default=(default := "a")) assert sut.type_ == "string" assert sut.required == IS_NOT_REQUIRED # assert sut.possible_values == POSSIBLE_VALUES @@ -1597,9 +1583,7 @@ def test_constructor_with_overrides(self): ), ], ) - def test_validation( - self, label, possible_values, default, required, hidden, help_, msg - ): + def test_validation(self, label, possible_values, default, required, hidden, help_, msg): with pytest.raises(ValidationError, match=msg): Radio( label=label, diff --git a/tests/unit/test_atlan_tag_name.py b/tests/unit/test_atlan_tag_name.py index 88af32cfe..d89d836be 100644 --- a/tests/unit/test_atlan_tag_name.py +++ b/tests/unit/test_atlan_tag_name.py @@ -22,9 +22,7 @@ def get_id_for_name(_): "get_id_for_name", get_id_for_name, ) - with pytest.raises( - ValueError, match=f"{GOOD_ATLAN_TAG_NAME} is not a valid Classification" - ): + with pytest.raises(ValueError, match=f"{GOOD_ATLAN_TAG_NAME} is not a valid Classification"): AtlanTagName(GOOD_ATLAN_TAG_NAME) @@ -59,9 +57,7 @@ def get_id_for_name(value): assert AtlanTagName(GOOD_ATLAN_TAG_NAME) == sut -def test_convert_to_display_text_when_atlan_tag_passed_returns_same_atlan_tag( - monkeypatch, good_atlan_tag -): +def test_convert_to_display_text_when_atlan_tag_passed_returns_same_atlan_tag(monkeypatch, good_atlan_tag): assert good_atlan_tag is AtlanTagName._convert_to_display_text(good_atlan_tag) @@ -75,10 +71,7 @@ def get_name_for_id(_): get_name_for_id, ) - assert ( - AtlanTagName._convert_to_display_text("bad").__repr__() - == f"AtlanTagName('{DELETED_}')" - ) + assert AtlanTagName._convert_to_display_text("bad").__repr__() == f"AtlanTagName('{DELETED_}')" def test_convert_to_display_text_when_id(monkeypatch): diff --git a/tests/unit/test_audit_search.py b/tests/unit/test_audit_search.py index 3e1615a1f..a127ab225 100644 --- a/tests/unit/test_audit_search.py +++ b/tests/unit/test_audit_search.py @@ -40,18 +40,13 @@ def load_json(filename): def _assert_audit_search_results(results, response_json, sorts, bulk=False): for audit in results: assert audit.entity_id == response_json["entityAudits"][0]["entity_id"] - assert ( - audit.entity_qualified_name - == response_json["entityAudits"][0]["entity_qualified_name"] - ) + assert audit.entity_qualified_name == response_json["entityAudits"][0]["entity_qualified_name"] assert audit.type_name == response_json["entityAudits"][0]["type_name"] expected_timestamp = datetime.fromtimestamp( response_json["entityAudits"][0]["timestamp"] / 1000, tz=timezone.utc ) assert audit.timestamp == expected_timestamp - expected_created = datetime.fromtimestamp( - response_json["entityAudits"][0]["created"] / 1000, tz=timezone.utc - ) + expected_created = datetime.fromtimestamp(response_json["entityAudits"][0]["created"] / 1000, tz=timezone.utc) assert audit.created == expected_created assert audit.user == response_json["entityAudits"][0]["user"] assert audit.action == response_json["entityAudits"][0]["action"] @@ -62,9 +57,7 @@ def _assert_audit_search_results(results, response_json, sorts, bulk=False): @patch.object(LOGGER, "debug") -def test_audit_search_pagination( - mock_logger, mock_api_caller, audit_search_paging_json -): +def test_audit_search_pagination(mock_logger, mock_api_caller, audit_search_paging_json): client = AuditClient(mock_api_caller) mock_api_caller._call_api.side_effect = [ audit_search_paging_json, @@ -101,9 +94,7 @@ def test_audit_search_pagination( SortItem(field="entityId", order=SortOrder.ASCENDING), ] - _assert_audit_search_results( - response, audit_search_paging_json, expected_sorts, bulk=True - ) + _assert_audit_search_results(response, audit_search_paging_json, expected_sorts, bulk=True) # The call count will be 2 because # audit search entries are processed in the first API call. # In the second API call, self._entity_audits @@ -129,15 +120,10 @@ def test_audit_search_pagination( ] audit_search_request = AuditSearchRequest(dsl=dsl) response = client.search(criteria=audit_search_request) - _assert_audit_search_results( - response, audit_search_paging_json, expected_sorts, bulk=False - ) + _assert_audit_search_results(response, audit_search_paging_json, expected_sorts, bulk=False) assert mock_logger.call_count == 1 assert mock_api_caller._call_api.call_count == 3 - assert ( - "Result size (%s) exceeds threshold (%s)" - in mock_logger.call_args_list[0][0][0] - ) + assert "Result size (%s) exceeds threshold (%s)" in mock_logger.call_args_list[0][0][0] # Test exception for bulk=False with user-defined sorting and results exceeds the predefined threshold dsl.sort = dsl.sort + [SortItem(field="some-sort1", order=SortOrder.ASCENDING)] diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index 4b4b586f7..b6ba5c07b 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -82,9 +82,7 @@ ) GLOSSARY = AtlasGlossary.create(name=GLOSSARY_NAME) -GLOSSARY_CATEGORY = AtlasGlossaryCategory.create( - name=GLOSSARY_CATEGORY_NAME, anchor=GLOSSARY -) +GLOSSARY_CATEGORY = AtlasGlossaryCategory.create(name=GLOSSARY_CATEGORY_NAME, anchor=GLOSSARY) GLOSSARY_TERM = AtlasGlossaryTerm.create(name=GLOSSARY_TERM_NAME, anchor=GLOSSARY) UNIQUE_USERS = "uniqueUsers" UNIQUE_ASSETS = "uniqueAssets" @@ -123,8 +121,7 @@ announcement_type=AnnouncementType.INFORMATION, ) TEST_MISSING_GLOSSARY_GUID_ERROR = ( - "ATLAN-PYTHON-400-055 'glossary_guid' keyword " - "argument is missing for asset type: {0}" + "ATLAN-PYTHON-400-055 'glossary_guid' keyword argument is missing for asset type: {0}" ) @@ -344,9 +341,10 @@ def test_append_with_valid_guid_and_no_terms_returns_asset(): terms = [] - with patch( - "pyatlan.model.fluent_search.FluentSearch.execute" - ) as mock_execute, patch("pyatlan.client.asset.AssetClient.save") as mock_save: + with ( + patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute, + patch("pyatlan.client.asset.AssetClient.save") as mock_save, + ): mock_execute.return_value.current_page = lambda: [table] mock_save.return_value.assets_updated.return_value = [table] @@ -370,9 +368,10 @@ def test_append_with_valid_guid_when_no_terms_present_returns_asset_with_given_t terms = [AtlasGlossaryTerm(qualified_name="term1")] - with patch( - "pyatlan.model.fluent_search.FluentSearch.execute" - ) as mock_execute, patch("pyatlan.client.asset.AssetClient.save") as mock_save: + with ( + patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute, + patch("pyatlan.client.asset.AssetClient.save") as mock_save, + ): mock_execute.return_value.current_page = lambda: [table] def mock_save_side_effect(entity): @@ -402,9 +401,10 @@ def test_append_with_valid_guid_when_terms_present_returns_asset_with_combined_t new_term = AtlasGlossaryTerm(qualified_name="new_term") terms = [new_term] - with patch( - "pyatlan.model.fluent_search.FluentSearch.execute" - ) as mock_execute, patch("pyatlan.client.asset.AssetClient.save") as mock_save: + with ( + patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute, + patch("pyatlan.client.asset.AssetClient.save") as mock_save, + ): mock_execute.return_value.current_page = lambda: [table] def mock_save_side_effect(entity): @@ -539,9 +539,10 @@ def test_replace_terms(): terms = [AtlasGlossaryTerm(qualified_name="new_term")] - with patch( - "pyatlan.model.fluent_search.FluentSearch.execute" - ) as mock_execute, patch("pyatlan.client.asset.AssetClient.save") as mock_save: + with ( + patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute, + patch("pyatlan.client.asset.AssetClient.save") as mock_save, + ): mock_execute.return_value.current_page = lambda: [table] def mock_save_side_effect(entity): @@ -553,9 +554,7 @@ def mock_save_side_effect(entity): client = AtlanClient() guid = "123" - asset = client.asset.replace_terms( - guid=guid, asset_type=asset_type, terms=terms - ) + asset = client.asset.replace_terms(guid=guid, asset_type=asset_type, terms=terms) assert asset.assigned_terms == terms mock_execute.assert_called_once() @@ -669,23 +668,18 @@ def test_remove_with_valid_guid_when_terms_present_returns_asset_with_terms_remo table.name = "table-test" table.qualified_name = "table_qn" - existing_term = AtlasGlossaryTerm( - qualified_name="term_to_remove", guid="b4113341-251b-4adc-81fb-2420501c30e6" - ) - other_term = AtlasGlossaryTerm( - qualified_name="other_term", guid="b267858d-8316-4c41-a56a-6e9b840cef4a" - ) + existing_term = AtlasGlossaryTerm(qualified_name="term_to_remove", guid="b4113341-251b-4adc-81fb-2420501c30e6") + other_term = AtlasGlossaryTerm(qualified_name="other_term", guid="b267858d-8316-4c41-a56a-6e9b840cef4a") table.attributes.meanings = [existing_term, other_term] - with patch( - "pyatlan.model.fluent_search.FluentSearch.execute" - ) as mock_execute, patch("pyatlan.client.asset.AssetClient.save") as mock_save: + with ( + patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute, + patch("pyatlan.client.asset.AssetClient.save") as mock_save, + ): mock_execute.return_value.current_page = lambda: [table] def mock_save_side_effect(entity): - entity.assigned_terms = [ - t for t in table.attributes.meanings if t != existing_term - ] + entity.assigned_terms = [t for t in table.attributes.meanings if t != existing_term] return Mock(assets_updated=lambda asset_type: [entity]) mock_save.side_effect = mock_save_side_effect @@ -693,9 +687,7 @@ def mock_save_side_effect(entity): client = AtlanClient() guid = "123" - asset = client.asset.remove_terms( - guid=guid, asset_type=asset_type, terms=[existing_term] - ) + asset = client.asset.remove_terms(guid=guid, asset_type=asset_type, terms=[existing_term]) updated_terms = asset.assigned_terms assert updated_terms is not None @@ -706,9 +698,7 @@ def mock_save_side_effect(entity): def test_register_client_with_bad_parameter_raises_value_error(client): - with pytest.raises( - InvalidRequestError, match="client must be an instance of AtlanClient" - ): + with pytest.raises(InvalidRequestError, match="client must be an instance of AtlanClient"): AtlanClient.set_default_client("") assert AtlanClient.get_default_client() is client @@ -746,9 +736,7 @@ def test_register_client(client): ), ], ) -def test_find_glossary_by_name_with_bad_values_raises_value_error( - name, attributes, message, client: AtlanClient -): +def test_find_glossary_by_name_with_bad_values_raises_value_error(name, attributes, message, client: AtlanClient): with pytest.raises(ValueError, match=message): client.asset.find_glossary_by_name(name=name, attributes=attributes) @@ -812,9 +800,7 @@ def test_find_connections_by_name_when_none_found_raises_not_found_error(mock_se NotFoundError, match=f"The Connection asset could not be found by name: {CONNECTION_NAME}.", ): - client.asset.find_connections_by_name( - name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE - ) + client.asset.find_connections_by_name(name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE) @patch.object(AssetClient, "search") @@ -834,13 +820,8 @@ def get_request(*args, **kwargs): client = AtlanClient() - assert GLOSSARY == client.asset.find_glossary_by_name( - name=GLOSSARY_NAME, attributes=attributes - ) - assert ( - f"More than 1 AtlasGlossary found with the name '{GLOSSARY_NAME}', returning only the first." - in caplog.text - ) + assert GLOSSARY == client.asset.find_glossary_by_name(name=GLOSSARY_NAME, attributes=attributes) + assert f"More than 1 AtlasGlossary found with the name '{GLOSSARY_NAME}', returning only the first." in caplog.text assert request assert request.attributes assert attributes == request.attributes @@ -1052,16 +1033,12 @@ def test_find_category_by_name_when_bad_parameter_raises_value_error( sut = client with pytest.raises(ValueError, match=message): - sut.asset.find_category_by_name( - name=name, glossary_name=glossary_name, attributes=attributes - ) + sut.asset.find_category_by_name(name=name, glossary_name=glossary_name, attributes=attributes) def test_find_category_by_name(): attributes = ["name"] - with patch.multiple( - AssetClient, find_glossary_by_name=DEFAULT, find_category_fast_by_name=DEFAULT - ) as values: + with patch.multiple(AssetClient, find_glossary_by_name=DEFAULT, find_category_fast_by_name=DEFAULT) as values: mock_find_glossary_by_name = values["find_glossary_by_name"] mock_find_glossary_by_name.return_value.qualified_name = GLOSSARY_QUALIFIED_NAME mock_find_category_fast_by_name = values["find_category_fast_by_name"] @@ -1108,34 +1085,24 @@ def test_find_category_by_name_qn_guid_correctly_populated( # Glossary assert category.anchor.guid == category_json_attributes.get("anchor").get("guid") - assert category.anchor.name == category_json_attributes.get("anchor").get( - "attributes" - ).get("name") - assert category.anchor.qualified_name == category_json_attributes.get("anchor").get( - "uniqueAttributes" - ).get("qualifiedName") + assert category.anchor.name == category_json_attributes.get("anchor").get("attributes").get("name") + assert category.anchor.qualified_name == category_json_attributes.get("anchor").get("uniqueAttributes").get( + "qualifiedName" + ) # Glossary category - assert category.parent_category.guid == category_json_attributes.get( - "parentCategory" - ).get("guid") - assert category.parent_category.name == category_json_attributes.get( - "parentCategory" - ).get("attributes").get("name") - assert category.parent_category.qualified_name == category_json_attributes.get( - "parentCategory" - ).get("uniqueAttributes").get("qualifiedName") + assert category.parent_category.guid == category_json_attributes.get("parentCategory").get("guid") + assert category.parent_category.name == category_json_attributes.get("parentCategory").get("attributes").get("name") + assert category.parent_category.qualified_name == category_json_attributes.get("parentCategory").get( + "uniqueAttributes" + ).get("qualifiedName") # Glossary term - assert category.terms[0].guid == category_json_attributes.get("terms")[0].get( - "guid" + assert category.terms[0].guid == category_json_attributes.get("terms")[0].get("guid") + assert category.terms[0].name == category_json_attributes.get("terms")[0].get("attributes").get("name") + assert category.terms[0].qualified_name == category_json_attributes.get("terms")[0].get("uniqueAttributes").get( + "qualifiedName" ) - assert category.terms[0].name == category_json_attributes.get("terms")[0].get( - "attributes" - ).get("name") - assert category.terms[0].qualified_name == category_json_attributes.get("terms")[ - 0 - ].get("uniqueAttributes").get("qualifiedName") mock_api_caller.reset_mock() @@ -1207,9 +1174,7 @@ def test_find_term_fast_by_name_when_none_found_raises_not_found_error(mock_sear NotFoundError, match=f"The AtlasGlossaryTerm asset could not be found by name: {GLOSSARY_TERM_NAME}.", ): - client.asset.find_term_fast_by_name( - name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME - ) + client.asset.find_term_fast_by_name(name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME) @patch.object(AssetClient, "search") @@ -1224,9 +1189,7 @@ def test_find_term_fast_by_name_when_non_term_found_raises_not_found_error( NotFoundError, match=f"The AtlasGlossaryTerm asset could not be found by name: {GLOSSARY_TERM_NAME}.", ): - client.asset.find_term_fast_by_name( - name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME - ) + client.asset.find_term_fast_by_name(name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME) mock_search.return_value.current_page.assert_called_once() @@ -1331,16 +1294,12 @@ def test_find_term_by_name_when_bad_parameter_raises_value_error( sut = client with pytest.raises(ValueError, match=message): - sut.asset.find_term_by_name( - name=name, glossary_name=glossary_name, attributes=attributes - ) + sut.asset.find_term_by_name(name=name, glossary_name=glossary_name, attributes=attributes) def test_find_term_by_name(): attributes = ["name"] - with patch.multiple( - AssetClient, find_glossary_by_name=DEFAULT, find_term_fast_by_name=DEFAULT - ) as values: + with patch.multiple(AssetClient, find_glossary_by_name=DEFAULT, find_term_fast_by_name=DEFAULT) as values: mock_find_glossary_by_name = values["find_glossary_by_name"] mock_find_glossary_by_name.return_value.qualified_name = GLOSSARY_QUALIFIED_NAME mock_find_term_fast_by_name = values["find_term_fast_by_name"] @@ -1400,9 +1359,7 @@ def test_search_log_most_recent_viewers(mock_sl_api_call, sl_most_recent_viewers mock_sl_api_call.return_value = sl_most_recent_viewers_json recent_viewers_aggs = sl_most_recent_viewers_json["aggregations"] recent_viewers_aggs_buckets = recent_viewers_aggs[UNIQUE_USERS]["buckets"] - request = SearchLogRequest.most_recent_viewers( - guid="test-guid-123", exclude_users=["testuser"] - ) + request = SearchLogRequest.most_recent_viewers(guid="test-guid-123", exclude_users=["testuser"]) request_dsl_json = loads(request.dsl.json(by_alias=True, exclude_none=True)) response = client.search_log.search(request) viewers = response.user_views @@ -1424,9 +1381,7 @@ def test_search_log_most_viewed_assets(mock_sl_api_call, sl_most_viewed_assets_j mock_sl_api_call.return_value = sl_most_viewed_assets_json viewed_assets_aggs = sl_most_viewed_assets_json["aggregations"] viewed_assets_aggs_buckets = viewed_assets_aggs[UNIQUE_ASSETS]["buckets"][0] - request = SearchLogRequest.most_viewed_assets( - max_assets=10, exclude_users=["testuser"] - ) + request = SearchLogRequest.most_viewed_assets(max_assets=10, exclude_users=["testuser"]) request_dsl_json = loads(request.dsl.json(by_alias=True, exclude_none=True)) response = client.search_log.search(request) detail = response.asset_views @@ -1444,9 +1399,7 @@ def test_search_log_views_by_guid(mock_sl_api_call, sl_detailed_log_entries_json client = AtlanClient() mock_sl_api_call.return_value = sl_detailed_log_entries_json sl_detailed_log_entries = sl_detailed_log_entries_json["logs"] - request = SearchLogRequest.views_by_guid( - guid="test-guid-123", size=10, exclude_users=["testuser"] - ) + request = SearchLogRequest.views_by_guid(guid="test-guid-123", size=10, exclude_users=["testuser"]) request_dsl_json = loads(request.dsl.json(by_alias=True, exclude_none=True)) response = client.search_log.search(request) log_entries = response.current_page() @@ -1475,16 +1428,12 @@ def test_search_log_views_by_guid(mock_sl_api_call, sl_detailed_log_entries_json assert log_entries[0].request_relation_attributes -def test_asset_get_lineage_list_response_with_custom_metadata( - mock_api_caller, mock_cm_cache, lineage_list_json -): +def test_asset_get_lineage_list_response_with_custom_metadata(mock_api_caller, mock_cm_cache, lineage_list_json): client = AssetClient(mock_api_caller) mock_cm_cache.get_name_for_id.return_value = CM_NAME mock_api_caller._call_api.side_effect = [lineage_list_json, {}] - lineage_request = LineageListRequest( - guid="test-guid", depth=1, direction=LineageDirection.UPSTREAM - ) + lineage_request = LineageListRequest(guid="test-guid", depth=1, direction=LineageDirection.UPSTREAM) lineage_request.attributes = [CM_NAME] lineage_response = client.get_lineage_list(lineage_request=lineage_request) @@ -1572,15 +1521,13 @@ def test_user_groups_pagination(mock_api_caller, user_groups_json): mock_api_caller.reset_mock() -def test_index_search_with_no_aggregation_results( - mock_api_caller, aggregations_null_json -): +def test_index_search_with_no_aggregation_results(mock_api_caller, aggregations_null_json): client = AssetClient(mock_api_caller) mock_api_caller._call_api.side_effect = [aggregations_null_json] request = ( - FluentSearch( - aggregations={"test1": {"test2": {"field": "__test_field"}}} - ).where(Column.QUALIFIED_NAME.startswith("test-qn")) + FluentSearch(aggregations={"test1": {"test2": {"field": "__test_field"}}}).where( + Column.QUALIFIED_NAME.startswith("test-qn") + ) ).to_request() response = client.search(criteria=request) assert response @@ -1602,9 +1549,7 @@ def _assert_search_results(results, response_json, sorts, bulk=False): @patch.object(LOGGER, "debug") -def test_index_search_pagination( - mock_logger, mock_api_caller, index_search_paging_json -): +def test_index_search_pagination(mock_logger, mock_api_caller, index_search_paging_json): client = AssetClient(mock_api_caller) mock_api_caller._call_api.side_effect = [index_search_paging_json, {}] @@ -1669,10 +1614,7 @@ def test_index_search_pagination( _assert_search_results(results, index_search_paging_json, expected_sorts) assert mock_api_caller._call_api.call_count == 3 assert mock_logger.call_count == 1 - assert ( - "Result size (%s) exceeds threshold (%s)" - in mock_logger.call_args_list[0][0][0] - ) + assert "Result size (%s) exceeds threshold (%s)" in mock_logger.call_args_list[0][0][0] mock_logger.reset_mock() mock_api_caller.reset_mock() @@ -1731,9 +1673,7 @@ def test_asset_get_by_guid_without_asset_type(mock_api_caller, get_by_guid_json) client = AssetClient(mock_api_caller) mock_api_caller._call_api.side_effect = [get_by_guid_json] - response = client.get_by_guid( - guid="test-table-guid-123", ignore_relationships=False - ) + response = client.get_by_guid(guid="test-table-guid-123", ignore_relationships=False) assert response assert isinstance(response, Table) @@ -1743,9 +1683,7 @@ def test_asset_get_by_guid_without_asset_type(mock_api_caller, get_by_guid_json) mock_api_caller.reset_mock() -def test_asset_retrieve_minimal_without_asset_type( - mock_api_caller, retrieve_minimal_json -): +def test_asset_retrieve_minimal_without_asset_type(mock_api_caller, retrieve_minimal_json): client = AssetClient(mock_api_caller) mock_api_caller._call_api.side_effect = [retrieve_minimal_json] @@ -1836,9 +1774,7 @@ def test_typedef_get_by_name_invalid_response(mock_api_caller): mock_api_caller._call_api.side_effect = [{"category": "ENUM", "test": "invalid"}] with pytest.raises(ApiError) as err: client.get_by_name(name="test-enum") - assert "1 validation error for EnumDef\nelementDefs\n field required" in str( - err.value - ) + assert "1 validation error for EnumDef\nelementDefs\n field required" in str(err.value) mock_api_caller.reset_mock() @@ -2033,9 +1969,7 @@ def test_atlan_call_api_server_error_messages_with_causes( client: AtlanClient, test_error_msg, ): - ERROR_CODE_FOR_HTTP_STATUS.update( - {ErrorCode.ERROR_PASSTHROUGH.http_error_code: ErrorCode.ERROR_PASSTHROUGH} - ) + ERROR_CODE_FOR_HTTP_STATUS.update({ErrorCode.ERROR_PASSTHROUGH.http_error_code: ErrorCode.ERROR_PASSTHROUGH}) STATUS_CODES = set(ERROR_CODE_FOR_HTTP_STATUS.keys()) # For "NOT_FOUND (404)" errors, no error cause is returned by the backend, # so we'll exclude that from the test cases: @@ -2054,11 +1988,7 @@ def test_atlan_call_api_server_error_messages_with_causes( error_id = test_error.get("errorId") error_causes = test_error.get("causes")[0] glossary = AtlasGlossary.creator(name="test-glossary") - error_causes = ( - "ErrorType: testException, " - "Message: test error message, " - "Location: Test.Class.TestException" - ) + error_causes = "ErrorType: testException, Message: test error message, Location: Test.Class.TestException" assert error and error_code and error_message and error_cause and error_causes error_info = error.exception_with_parameters( error_code, @@ -2095,9 +2025,7 @@ def assert_asset_client_not_called(self, mock_atlan_client, sut): (CustomMetadataHandling.MERGE), ], ) - def test_add_when_capture_failure_true( - self, custom_metadata_handling, mock_atlan_client - ): + def test_add_when_capture_failure_true(self, custom_metadata_handling, mock_atlan_client): table_1 = Mock(Table(guid="t1")) table_2 = Mock(Table(guid="t2")) table_3 = Mock(Table(guid="t3")) @@ -2138,9 +2066,7 @@ def test_add_when_capture_failure_true( unsaved.trim_to_required.assert_called_once() assert unsaved.name == saved.name - exception = ErrorCode.INVALID_REQUEST_PASSTHROUGH.exception_with_parameters( - "bad", "stuff", "" - ) + exception = ErrorCode.INVALID_REQUEST_PASSTHROUGH.exception_with_parameters("bad", "stuff", "") if custom_metadata_handling == CustomMetadataHandling.IGNORE: mock_atlan_client.asset.save.side_effect = exception elif custom_metadata_handling == CustomMetadataHandling.OVERWRITE: @@ -2186,12 +2112,8 @@ def test_add_when_capture_failure_true( (CustomMetadataHandling.MERGE), ], ) - def test_add_when_capture_failure_false_then_exception_raised( - self, custom_metadata_handling, mock_atlan_client - ): - exception = ErrorCode.INVALID_REQUEST_PASSTHROUGH.exception_with_parameters( - "bad", "stuff", "" - ) + def test_add_when_capture_failure_false_then_exception_raised(self, custom_metadata_handling, mock_atlan_client): + exception = ErrorCode.INVALID_REQUEST_PASSTHROUGH.exception_with_parameters("bad", "stuff", "") if custom_metadata_handling == CustomMetadataHandling.IGNORE: mock_atlan_client.asset.save.side_effect = exception elif custom_metadata_handling == CustomMetadataHandling.OVERWRITE: @@ -2288,9 +2210,7 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): # Test replace and append (list) term1.attributes.see_also = [ AtlasGlossaryTerm.ref_by_guid(guid=term2.guid), - AtlasGlossaryTerm.ref_by_guid( - guid=term3.guid, semantic=SaveSemantic.APPEND - ), + AtlasGlossaryTerm.ref_by_guid(guid=term3.guid, semantic=SaveSemantic.APPEND), ] request = BulkRequest(entities=[term1]) request_json = self.to_json(request) @@ -2309,14 +2229,10 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): # Test replace and append (list) with multiple relationships term1.attributes.see_also = [ AtlasGlossaryTerm.ref_by_guid(guid=term2.guid), - AtlasGlossaryTerm.ref_by_guid( - guid=term3.guid, semantic=SaveSemantic.APPEND - ), + AtlasGlossaryTerm.ref_by_guid(guid=term3.guid, semantic=SaveSemantic.APPEND), ] term1.attributes.preferred_to_terms = [ - AtlasGlossaryTerm.ref_by_guid( - guid=term3.guid, semantic=SaveSemantic.APPEND - ), + AtlasGlossaryTerm.ref_by_guid(guid=term3.guid, semantic=SaveSemantic.APPEND), ] request = BulkRequest(entities=[term1]) request_json = self.to_json(request) @@ -2337,9 +2253,7 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): # Test append and replace (list) term1.attributes.see_also = [ - AtlasGlossaryTerm.ref_by_guid( - guid=term2.guid, semantic=SaveSemantic.APPEND - ), + AtlasGlossaryTerm.ref_by_guid(guid=term2.guid, semantic=SaveSemantic.APPEND), AtlasGlossaryTerm.ref_by_guid(guid=term3.guid), ] request = BulkRequest(entities=[term1]) @@ -2358,12 +2272,8 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): # Test remove and append (list) term1.attributes.see_also = [ - AtlasGlossaryTerm.ref_by_guid( - guid=term2.guid, semantic=SaveSemantic.REMOVE - ), - AtlasGlossaryTerm.ref_by_guid( - guid=term3.guid, semantic=SaveSemantic.APPEND - ), + AtlasGlossaryTerm.ref_by_guid(guid=term2.guid, semantic=SaveSemantic.REMOVE), + AtlasGlossaryTerm.ref_by_guid(guid=term3.guid, semantic=SaveSemantic.APPEND), ] request = BulkRequest(entities=[term1]) request_json = self.to_json(request) @@ -2382,12 +2292,8 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): # Test same semantic (list) term1.attributes.see_also = [ - AtlasGlossaryTerm.ref_by_guid( - guid=term2.guid, semantic=SaveSemantic.APPEND - ), - AtlasGlossaryTerm.ref_by_guid( - guid=term3.guid, semantic=SaveSemantic.APPEND - ), + AtlasGlossaryTerm.ref_by_guid(guid=term2.guid, semantic=SaveSemantic.APPEND), + AtlasGlossaryTerm.ref_by_guid(guid=term3.guid, semantic=SaveSemantic.APPEND), ] request = BulkRequest(entities=[term1]) request_json = self.to_json(request) @@ -2426,9 +2332,7 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): assert self.REMOVE not in request_json # Test append - term1.attributes.anchor = AtlasGlossary.ref_by_guid( - guid=glossary.guid, semantic=SaveSemantic.APPEND - ) + term1.attributes.anchor = AtlasGlossary.ref_by_guid(guid=glossary.guid, semantic=SaveSemantic.APPEND) request = BulkRequest(entities=[term1]) request_json = self.to_json(request) assert request_json @@ -2440,9 +2344,7 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): assert "anchor" not in request_json["attributes"] # Test remove - term1.attributes.anchor = AtlasGlossary.ref_by_guid( - guid=glossary.guid, semantic=SaveSemantic.REMOVE - ) + term1.attributes.anchor = AtlasGlossary.ref_by_guid(guid=glossary.guid, semantic=SaveSemantic.REMOVE) request = BulkRequest(entities=[term1]) request_json = self.to_json(request) assert request_json @@ -2556,9 +2458,7 @@ def test_get_by_guid_asset_not_found_fluent_search(): mock_execute.return_value.current_page.return_value = [] client = AssetClient(client=ApiCaller) - with pytest.raises( - ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid).__class__ - ): + with pytest.raises(ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid).__class__): client.get_by_guid( guid=guid, asset_type=asset_type, @@ -2580,9 +2480,7 @@ def test_get_by_guid_type_mismatch_fluent_search(): client = AssetClient(client=ApiCaller) with pytest.raises( - ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( - guid, expected_asset_type.__name__ - ).__class__ + ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, expected_asset_type.__name__).__class__ ): client.get_by_guid( guid=guid, @@ -2628,9 +2526,7 @@ def test_get_by_qualified_name_asset_not_found(): client = AssetClient(client=ApiCaller) with pytest.raises( - ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( - qualified_name, asset_type.__name__ - ).__class__ + ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters(qualified_name, asset_type.__name__).__class__ ): client.get_by_qualified_name( qualified_name=qualified_name, diff --git a/tests/unit/test_connection_cache.py b/tests/unit/test_connection_cache.py index 8c51f4b9d..a2998b991 100644 --- a/tests/unit/test_connection_cache.py +++ b/tests/unit/test_connection_cache.py @@ -22,9 +22,7 @@ def test_get_by_guid_with_not_found_error(monkeypatch): @patch.object(ConnectionCache, "lookup_by_guid") -@patch.object( - ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) -) +@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) def test_get_by_guid_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_guid): test_guid = "test-guid-123" with pytest.raises( @@ -41,19 +39,13 @@ def test_get_by_qualified_name_with_not_found_error(monkeypatch): @patch.object(ConnectionCache, "lookup_by_qualified_name") -@patch.object( - ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) -) -def test_get_by_qualified_name_with_no_invalid_request_error( - mock_get_cache, mock_lookup_by_qualified_name -): +@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) +def test_get_by_qualified_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_qualified_name): test_qn = "default/snowflake/123456789" test_connector = "snowflake" with pytest.raises( NotFoundError, - match=ErrorCode.ASSET_NOT_FOUND_BY_QN.error_message.format( - test_qn, test_connector - ), + match=ErrorCode.ASSET_NOT_FOUND_BY_QN.error_message.format(test_qn, test_connector), ): ConnectionCache.get_by_qualified_name(test_qn) mock_get_cache.assert_called_once() @@ -65,9 +57,7 @@ def test_get_by_name_with_not_found_error(monkeypatch): @patch.object(ConnectionCache, "lookup_by_name") -@patch.object( - ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) -) +@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) def test_get_by_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_name): test_name = ConnectionName("snowflake/test") with pytest.raises( @@ -82,9 +72,7 @@ def test_get_by_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_b @patch.object(ConnectionCache, "lookup_by_guid") -@patch.object( - ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) -) +@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) def test_get_by_guid(mock_get_cache, mock_lookup_by_guid): test_guid = "test-guid-123" test_qn = "test-qualified-name" @@ -135,9 +123,7 @@ def test_get_by_guid(mock_get_cache, mock_lookup_by_guid): @patch.object(ConnectionCache, "lookup_by_guid") @patch.object(ConnectionCache, "lookup_by_qualified_name") -@patch.object( - ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) -) +@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) def test_get_by_qualified_name(mock_get_cache, mock_lookup_by_qn, mock_lookup_by_guid): test_guid = "test-guid-123" test_qn = "test-qualified-name" @@ -195,9 +181,7 @@ def test_get_by_qualified_name(mock_get_cache, mock_lookup_by_qn, mock_lookup_by @patch.object(ConnectionCache, "lookup_by_guid") @patch.object(ConnectionCache, "lookup_by_name") -@patch.object( - ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) -) +@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) def test_get_by_name(mock_get_cache, mock_lookup_by_name, mock_lookup_by_guid): test_name = ConnectionName("snowflake/test") test_guid = "test-guid-123" diff --git a/tests/unit/test_core.py b/tests/unit/test_core.py index da216f7ec..619e16c1c 100644 --- a/tests/unit/test_core.py +++ b/tests/unit/test_core.py @@ -18,9 +18,7 @@ def test_get_deleted_sentinel(self): assert "(DELETED)" == str(sentinel) assert id(sentinel) == id(AtlanTagName.get_deleted_sentinel()) - def test_atlan_tag_name_when_name_found_returns_atlan_tag_name( - self, mock_tag_cache - ): + def test_atlan_tag_name_when_name_found_returns_atlan_tag_name(self, mock_tag_cache): mock_tag_cache.get_id_for_name.return_value = "123" sut = AtlanTagName(DISPLAY_TEXT) @@ -31,9 +29,7 @@ def test_atlan_tag_name_when_name_found_returns_atlan_tag_name( def test_atlan_tag_name_when_name_not_found_raise_value_error(self, mock_tag_cache): mock_tag_cache.get_id_for_name.return_value = None - with pytest.raises( - ValueError, match=f"{DISPLAY_TEXT} is not a valid Classification" - ): + with pytest.raises(ValueError, match=f"{DISPLAY_TEXT} is not a valid Classification"): AtlanTagName(DISPLAY_TEXT) def test_json_encode_atlan_tag_returns_internal_code(self, mock_tag_cache): @@ -42,9 +38,7 @@ def test_json_encode_atlan_tag_returns_internal_code(self, mock_tag_cache): sut = AtlanTagName(DISPLAY_TEXT) assert internal_value == AtlanTagName.json_encode_atlan_tag(sut) - mock_tag_cache.get_id_for_name.assert_has_calls( - [call(DISPLAY_TEXT), call(DISPLAY_TEXT)] - ) + mock_tag_cache.get_id_for_name.assert_has_calls([call(DISPLAY_TEXT), call(DISPLAY_TEXT)]) class TestAtlanTag: @@ -55,9 +49,7 @@ def test_atlan_tag_when_tag_name_is_found(self, mock_tag_cache): assert str(sut.type_name) == DISPLAY_TEXT - def test_atlan_tag_when_tag_name_is_not_found_then_sentinel_is_returned( - self, mock_tag_cache - ): + def test_atlan_tag_when_tag_name_is_not_found_then_sentinel_is_returned(self, mock_tag_cache): mock_tag_cache.get_name_for_id.return_value = None sut = AtlanTag(**{"typeName": "123"}) diff --git a/tests/unit/test_credential_client.py b/tests/unit/test_credential_client.py index 289c8b0a7..00bf3b5c8 100644 --- a/tests/unit/test_credential_client.py +++ b/tests/unit/test_credential_client.py @@ -15,34 +15,22 @@ CredentialTestResponse, ) -TEST_MISSING_TOKEN_ID = ( - "ATLAN-PYTHON-400-032 No ID was provided when attempting to update the API token." -) -TEST_INVALID_CREDENTIALS = ( - "ATLAN-PYTHON-400-054 Credentials provided did not work: failed" -) -TEST_INVALID_GUID_GET_VALIDATION_ERR = ( - "1 validation error for Get\nguid\n str type expected (type=type_error.str)" -) +TEST_MISSING_TOKEN_ID = "ATLAN-PYTHON-400-032 No ID was provided when attempting to update the API token." +TEST_INVALID_CREDENTIALS = "ATLAN-PYTHON-400-054 Credentials provided did not work: failed" +TEST_INVALID_GUID_GET_VALIDATION_ERR = "1 validation error for Get\nguid\n str type expected (type=type_error.str)" TEST_INVALID_GUID_PURGE_BY_GUID_VALIDATION_ERR = ( - "1 validation error for PurgeByGuid\n" - "guid\n str type expected (type=type_error.str)" + "1 validation error for PurgeByGuid\nguid\n str type expected (type=type_error.str)" ) TEST_INVALID_CRED_TEST_VALIDATION_ERR = ( - "1 validation error for Test\ncredential\n " - "value is not a valid dict (type=type_error.dict)" + "1 validation error for Test\ncredential\n value is not a valid dict (type=type_error.dict)" ) TEST_INVALID_CRED_TEST_UPDATE_VALIDATION_ERR = ( - "1 validation error for TestAndUpdate\ncredential\n " - "value is not a valid dict (type=type_error.dict)" + "1 validation error for TestAndUpdate\ncredential\n value is not a valid dict (type=type_error.dict)" ) TEST_INVALID_CRED_CREATOR_VALIDATION_ERR = ( - "1 validation error for Creator\ncredential\n " - "value is not a valid dict (type=type_error.dict)" -) -TEST_INVALID_API_CALLER_PARAMETER_TYPE = ( - "ATLAN-PYTHON-400-048 Invalid parameter type for client should be ApiCaller" + "1 validation error for Creator\ncredential\n value is not a valid dict (type=type_error.dict)" ) +TEST_INVALID_API_CALLER_PARAMETER_TYPE = "ATLAN-PYTHON-400-048 Invalid parameter type for client should be ApiCaller" @pytest.fixture() @@ -102,27 +90,21 @@ def test_init_when_wrong_class_raises_exception(test_api_caller): @pytest.mark.parametrize("test_guid", [[123], set(), dict()]) -def test_cred_get_wrong_params_raises_validation_error( - test_guid, client: CredentialClient -): +def test_cred_get_wrong_params_raises_validation_error(test_guid, client: CredentialClient): with pytest.raises(ValidationError) as err: client.get(guid=test_guid) assert TEST_INVALID_GUID_GET_VALIDATION_ERR == str(err.value) @pytest.mark.parametrize("test_credentials", ["invalid_cred", 123]) -def test_cred_test_wrong_params_raises_validation_error( - test_credentials, client: CredentialClient -): +def test_cred_test_wrong_params_raises_validation_error(test_credentials, client: CredentialClient): with pytest.raises(ValidationError) as err: client.test(credential=test_credentials) assert TEST_INVALID_CRED_TEST_VALIDATION_ERR == str(err.value) @pytest.mark.parametrize("test_credentials", ["invalid_cred", 123]) -def test_cred_test_and_update_wrong_params_raises_validation_error( - test_credentials, client: CredentialClient -): +def test_cred_test_and_update_wrong_params_raises_validation_error(test_credentials, client: CredentialClient): with pytest.raises(ValidationError) as err: client.test_and_update(credential=test_credentials) assert TEST_INVALID_CRED_TEST_UPDATE_VALIDATION_ERR == str(err.value) @@ -192,9 +174,7 @@ def test_cred_test_update_when_given_cred( {"message": "successful"}, credential_response.dict(), ] - cred_response = client.test_and_update( - credential=Credential(id=credential_response.id) - ) + cred_response = client.test_and_update(credential=Credential(id=credential_response.id)) assert isinstance(cred_response, CredentialResponse) cred = cred_response.to_credential() _assert_cred_response(cred, credential_response) @@ -208,9 +188,7 @@ def test_cred_test_update_when_given_cred( ({"invalid": "field"}, 10, 0, {"records": []}), ], ) -def test_cred_get_all_success( - test_filter, test_limit, test_offset, test_response, mock_api_caller -): +def test_cred_get_all_success(test_filter, test_limit, test_offset, test_response, mock_api_caller): mock_api_caller._call_api.return_value = test_response client = CredentialClient(mock_api_caller) @@ -305,9 +283,7 @@ def test_cred_get_all_no_results(mock_api_caller): @pytest.mark.parametrize("create_credentials", ["invalid_cred", 123]) -def test_cred_creator_wrong_params_raises_validation_error( - create_credentials, client: CredentialClient -): +def test_cred_creator_wrong_params_raises_validation_error(create_credentials, client: CredentialClient): with pytest.raises(ValidationError) as err: client.creator(credential=create_credentials) assert TEST_INVALID_CRED_CREATOR_VALIDATION_ERR == str(err.value) @@ -338,7 +314,6 @@ def test_creator_success( mock_api_caller, client: CredentialClient, ): - mock_api_caller._call_api.return_value = credential_response.dict() client = CredentialClient(mock_api_caller) @@ -376,17 +351,13 @@ def test_creator_success( ), ], ) -def test_cred_creator_with_test_false_with_username_password( - credential_data, client: CredentialClient -): +def test_cred_creator_with_test_false_with_username_password(credential_data, client: CredentialClient): with pytest.raises(Exception, match="ATLAN-PYTHON-400-071"): client.creator(credential=credential_data, test=False) @pytest.mark.parametrize("test_guid", [[123], set(), dict()]) -def test_cred_purge_by_guid_wrong_params_raises_validation_error( - test_guid, client: CredentialClient -): +def test_cred_purge_by_guid_wrong_params_raises_validation_error(test_guid, client: CredentialClient): with pytest.raises(ValidationError) as err: client.purge_by_guid(guid=test_guid) assert TEST_INVALID_GUID_PURGE_BY_GUID_VALIDATION_ERR == str(err.value) diff --git a/tests/unit/test_custom_metadata.py b/tests/unit/test_custom_metadata.py index 09ff2b8cf..14edf5bb8 100644 --- a/tests/unit/test_custom_metadata.py +++ b/tests/unit/test_custom_metadata.py @@ -48,9 +48,7 @@ def sut(self, mock_cache): return CustomMetadataDict(CM_NAME) def test_init_when_invalid_name_throws_not_found_error(self, mock_cache): - mock_cache.get_id_for_name.side_effect = ( - ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters("123") - ) + mock_cache.get_id_for_name.side_effect = ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters("123") with pytest.raises(NotFoundError): CustomMetadataDict(CM_NAME) mock_cache.get_id_for_name.assert_called_with(CM_NAME) @@ -67,15 +65,11 @@ def test_can_get_set_items(self, sut): assert sut.modified is True def test_get_item_with_invalid_name_raises_key_error(self, sut): - with pytest.raises( - KeyError, match="'garb' is not a valid property name for Something" - ): + with pytest.raises(KeyError, match="'garb' is not a valid property name for Something"): sut["garb"] def test_set_item_with_invalid_name_raises_key_error(self, sut): - with pytest.raises( - KeyError, match="'garb' is not a valid property name for Something" - ): + with pytest.raises(KeyError, match="'garb' is not a valid property name for Something"): sut["garb"] = ATTR_FIRST_NAME_ID @pytest.mark.parametrize("name", [ATTR_FIRST_NAME, ATTR_FIRST_NAME]) @@ -123,9 +117,7 @@ def test_get_deleted_sentinel(self): assert 0 == len(sentinel) assert sentinel.modified is False assert sentinel._name == "(DELETED)" - with pytest.raises( - KeyError, match=r"'abc' is not a valid property name for \(DELETED\)" - ): + with pytest.raises(KeyError, match=r"'abc' is not a valid property name for \(DELETED\)"): sentinel["abc"] = 1 @@ -134,15 +126,11 @@ class TestCustomMetadataProxy: def sut(self, mock_cache): yield CustomMetadataProxy(business_attributes=None) - def test_when_intialialized_with_no_business_attributes_then_modified_is_false( - self, sut - ): + def test_when_intialialized_with_no_business_attributes_then_modified_is_false(self, sut): assert sut.modified is False assert sut.business_attributes is None - def test_when_intialialized_with_no_business_attributes_then_business_attributes_returns_none( - self, sut - ): + def test_when_intialialized_with_no_business_attributes_then_business_attributes_returns_none(self, sut): assert sut.business_attributes is None def test_set_custom_metadata(self, sut): @@ -193,9 +181,7 @@ def test_when_modified_returns_updated_business_attributes(self, mock_cache): assert ba == {CM_ID: {ATTR_FIRST_NAME_ID: donna, ATTR_LAST_NAME_ID: joey}} def test_when_invalid_metadata_set_then_delete_sentinel_is_used(self, mock_cache): - mock_cache.get_name_for_id.side_effect = ( - ErrorCode.CM_NOT_FOUND_BY_ID.exception_with_parameters(CM_ID) - ) + mock_cache.get_name_for_id.side_effect = ErrorCode.CM_NOT_FOUND_BY_ID.exception_with_parameters(CM_ID) ba = {CM_ID: {ATTR_FIRST_NAME_ID: "Dave"}} sut = CustomMetadataProxy(business_attributes=ba) diff --git a/tests/unit/test_deprecated.py b/tests/unit/test_deprecated.py index 8f7317e83..78f92c952 100644 --- a/tests/unit/test_deprecated.py +++ b/tests/unit/test_deprecated.py @@ -29,9 +29,7 @@ ) GLOSSARY = AtlasGlossary.create(name=GLOSSARY_NAME) -GLOSSARY_CATEGORY = AtlasGlossaryCategory.create( - name=GLOSSARY_CATEGORY_NAME, anchor=GLOSSARY -) +GLOSSARY_CATEGORY = AtlasGlossaryCategory.create(name=GLOSSARY_CATEGORY_NAME, anchor=GLOSSARY) GLOSSARY_TERM = AtlasGlossaryTerm.create(name=GLOSSARY_TERM_NAME, anchor=GLOSSARY) @@ -53,9 +51,7 @@ def test_get_groups(mock_group_client, client: AtlanClient): sort = "sort" count = False offset = 3 - client.get_groups( - limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset - ) + client.get_groups(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) mock_group_client.assert_called_once_with( limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset @@ -104,9 +100,7 @@ def test_get_roles(mock_role_client, client: AtlanClient): count = False offset = 3 - client.get_roles( - limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset - ) + client.get_roles(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) mock_role_client.assert_called_once_with( limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset @@ -128,9 +122,7 @@ def test_get_api_tokens(mock_token_client, client: AtlanClient): count = False offset = 3 - client.get_api_tokens( - limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset - ) + client.get_api_tokens(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) mock_token_client.assert_called_once_with( limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset @@ -184,9 +176,7 @@ def test_update_api_token(mock_token_client, client: AtlanClient): description = "something" personas = {"something"} - client.update_api_token( - guid=guid, display_name=display_name, description=description, personas=personas - ) + client.update_api_token(guid=guid, display_name=display_name, description=description, personas=personas) mock_token_client.assert_called_once_with( guid=guid, display_name=display_name, description=description, personas=personas @@ -306,9 +296,7 @@ def test_get_users(mock_type_def_client, client: AtlanClient): count = False offset = 6 - client.get_users( - limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset - ) + client.get_users(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) mock_type_def_client.assert_called_once_with( limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset @@ -645,9 +633,7 @@ def test_get_user_by_username(mock_type_def_client, client: AtlanClient): ), ], ) -def test_asset_deprecated_methods( - deprecated_name: str, current_name: str, values, client: AtlanClient -): +def test_asset_deprecated_methods(deprecated_name: str, current_name: str, values, client: AtlanClient): with patch.object(AssetClient, current_name) as mock: func = getattr(client, deprecated_name) func(**values) diff --git a/tests/unit/test_file_client.py b/tests/unit/test_file_client.py index f41cc0ce9..f964b399a 100644 --- a/tests/unit/test_file_client.py +++ b/tests/unit/test_file_client.py @@ -124,9 +124,7 @@ def test_file_client_methods_validation_error(client, method, params): ], ], ) -def test_file_client_upload_file_raises_invalid_request_error( - mock_api_caller, file_path, expected_error -): +def test_file_client_upload_file_raises_invalid_request_error(mock_api_caller, file_path, expected_error): client = FileClient(client=mock_api_caller) with pytest.raises(InvalidRequestError, match=expected_error): @@ -148,9 +146,7 @@ def test_file_client_upload_file_raises_invalid_request_error( ], ], ) -def test_file_client_download_file_raises_invalid_request_error( - client, file_path, expected_error -): +def test_file_client_download_file_raises_invalid_request_error(client, file_path, expected_error): with pytest.raises(InvalidRequestError, match=expected_error): client.files.download_file( presigned_url="test-url", @@ -166,9 +162,7 @@ def test_file_client_download_file_invalid_format_raises_invalid_request_error( f"Error: 'str' object has no attribute 'read', Path: {DOWNLOAD_FILE_PATH}" ) with pytest.raises(InvalidRequestError, match=expected_error): - client.files.download_file( - presigned_url=s3_presigned_url, file_path=DOWNLOAD_FILE_PATH - ) + client.files.download_file(presigned_url=s3_presigned_url, file_path=DOWNLOAD_FILE_PATH) def test_file_client_get_presigned_url(mock_api_caller, s3_presigned_url): @@ -196,9 +190,7 @@ def test_file_client_s3_upload_file(mock_call_api_internal, client, s3_presigned @patch.object(AtlanClient, "_call_api_internal", return_value=None) -def test_file_client_azure_blob_upload_file( - mock_call_api_internal, client, blob_presigned_url -): +def test_file_client_azure_blob_upload_file(mock_call_api_internal, client, blob_presigned_url): client = FileClient(client=client) client.upload_file(presigned_url=blob_presigned_url, file_path=UPLOAD_FILE_PATH) @@ -218,9 +210,7 @@ def test_file_client_gcs_upload_file(mock_call_api_internal, client, gcs_presign def test_file_client_download_file(client, s3_presigned_url, mock_session): # Make sure the download file doesn't exist before downloading assert not os.path.exists(DOWNLOAD_FILE_PATH) - response = client.files.download_file( - presigned_url=s3_presigned_url, file_path=DOWNLOAD_FILE_PATH - ) + response = client.files.download_file(presigned_url=s3_presigned_url, file_path=DOWNLOAD_FILE_PATH) assert response == DOWNLOAD_FILE_PATH assert mock_session.request.call_count == 1 # The file should exist after calling the method diff --git a/tests/unit/test_glossary_term.py b/tests/unit/test_glossary_term.py index a88bf0bd1..94e14179b 100644 --- a/tests/unit/test_glossary_term.py +++ b/tests/unit/test_glossary_term.py @@ -57,9 +57,7 @@ def test_create_atttributes_without_required_parameters_raises_value_error( ("Glossary", None, None, "123"), ], ) -def test_create_atttributes_with_required_parameters( - name, anchor, glossary_qualified_name, glossary_guid -): +def test_create_atttributes_with_required_parameters(name, anchor, glossary_qualified_name, glossary_guid): sut = AtlasGlossaryTerm.Attributes.create( name=name, anchor=anchor, @@ -70,9 +68,7 @@ def test_create_atttributes_with_required_parameters( if anchor: assert anchor == sut.anchor if glossary_qualified_name: - assert sut.anchor.unique_attributes == { - "qualifiedName": glossary_qualified_name - } + assert sut.anchor.unique_attributes == {"qualifiedName": glossary_qualified_name} if glossary_guid: assert sut.anchor.guid == glossary_guid @@ -131,9 +127,7 @@ def test_create_without_required_parameters_raises_value_error( ("Glossary", None, None, "123"), ], ) -def test_create_with_required_parameters( - name, anchor, glossary_qualified_name, glossary_guid -): +def test_create_with_required_parameters(name, anchor, glossary_qualified_name, glossary_guid): sut = AtlasGlossaryTerm.create( name=name, anchor=anchor, @@ -144,8 +138,6 @@ def test_create_with_required_parameters( if anchor: assert anchor == sut.attributes.anchor if glossary_qualified_name: - assert sut.attributes.anchor.unique_attributes == { - "qualifiedName": glossary_qualified_name - } + assert sut.attributes.anchor.unique_attributes == {"qualifiedName": glossary_qualified_name} if glossary_guid: assert sut.attributes.anchor.guid == glossary_guid diff --git a/tests/unit/test_lineage.py b/tests/unit/test_lineage.py index c44d1fe42..d151e7879 100644 --- a/tests/unit/test_lineage.py +++ b/tests/unit/test_lineage.py @@ -67,13 +67,7 @@ def test_create_when_relation_is_not_full_link_then_raises_invalid_request_excep InvalidRequestError, match="Lineage was retrieved using hideProces=False. We do not provide a graph view in this case.", ): - LineageGraph.create( - [ - LineageRelation( - from_entity_id="123", to_entity_id="456", process_id=None - ) - ] - ) + LineageGraph.create([LineageRelation(from_entity_id="123", to_entity_id="456", process_id=None)]) def test_get_downstream_asset_guid_with_invalid_guid_returns_empty_set_of_guids( self, @@ -81,9 +75,7 @@ def test_get_downstream_asset_guid_with_invalid_guid_returns_empty_set_of_guids( ): assert len(lineage_graph.get_downstream_asset_guids("123")) == 0 - def test_get_downstream_asset_guid_with_valid_guid_returns_set_of_guids( - self, lineage_graph - ): + def test_get_downstream_asset_guid_with_valid_guid_returns_set_of_guids(self, lineage_graph): assert (guids := lineage_graph.get_downstream_asset_guids(BASE_GUID)) assert len(guids) == 1 assert "e44ed3a2-1de5-4f23-b3f1-6e005156fee9" in guids @@ -100,9 +92,7 @@ def test_get_upstream_asset_guid_with_base_guid_returns_empty_set_of_guids( ): assert len(lineage_graph.get_upstream_asset_guids(BASE_GUID)) == 0 - def test_get_upstream_asset_guid_with_valid_guid_returns_set_of_guids( - self, lineage_graph - ): + def test_get_upstream_asset_guid_with_valid_guid_returns_set_of_guids(self, lineage_graph): assert (guids := lineage_graph.get_upstream_asset_guids(BASE_GUID_TARGET)) assert len(guids) == 1 assert BASE_GUID in guids @@ -116,9 +106,7 @@ def test_get_downstream_process_guid_with_valid_guid_returns_set_of_guids( assert "621d3fa2-54b0-4cc0-a858-5c5ea8c49349" in guids assert "d67d4188-010b-4adf-9886-10162f08c77b" in guids - def test_get_upstream_process_guids_with_valid_guid_returns_set_of_guids( - self, lineage_graph - ): + def test_get_upstream_process_guids_with_valid_guid_returns_set_of_guids(self, lineage_graph): assert (guids := lineage_graph.get_upstream_process_guids(BASE_GUID_TARGET)) assert len(guids) == 2 assert "621d3fa2-54b0-4cc0-a858-5c5ea8c49349" in guids @@ -146,9 +134,7 @@ def test_get_upstream_process_guid_with_invalid_guid_returns_empty_set_of_guids( ("80680c12-f625-4b7f-a5fa-d3fd296e2db1", 18), ], ) - def test_get_all_downstream_asset_guids_dfs( - self, guid, expected_count, lineage_graph - ): + def test_get_all_downstream_asset_guids_dfs(self, guid, expected_count, lineage_graph): assert (guids := lineage_graph.get_all_downstream_asset_guids_dfs(guid)) assert len(guids) == expected_count @@ -162,9 +148,7 @@ def test_get_all_downstream_asset_guids_dfs( ("80680c12-f625-4b7f-a5fa-d3fd296e2db1", 8), ], ) - def test_get_all_upstream_asset_guids_dfs( - self, guid, expected_count, lineage_graph - ): + def test_get_all_upstream_asset_guids_dfs(self, guid, expected_count, lineage_graph): assert (guids := lineage_graph.get_all_upstream_asset_guids_dfs(guid)) assert len(guids) == expected_count @@ -180,9 +164,7 @@ class TestLineageResponse: ("80680c12-f625-4b7f-a5fa-d3fd296e2db1", 18), ], ) - def test_get_all_downstream_asset_guids_dfs( - self, guid, expected_count, lineage_response - ): + def test_get_all_downstream_asset_guids_dfs(self, guid, expected_count, lineage_response): assert (guids := lineage_response.get_all_downstream_asset_guids_dfs(guid)) assert len(guids) == expected_count @@ -196,9 +178,7 @@ def test_get_all_downstream_asset_guids_dfs( ("80680c12-f625-4b7f-a5fa-d3fd296e2db1", 18), ], ) - def test_get_all_downstream_assets_dfs( - self, guid, expected_count, lineage_response - ): + def test_get_all_downstream_assets_dfs(self, guid, expected_count, lineage_response): assert (assets := lineage_response.get_all_downstream_assets_dfs(guid)) assert len(assets) == expected_count @@ -212,9 +192,7 @@ def test_get_all_downstream_assets_dfs( ("80680c12-f625-4b7f-a5fa-d3fd296e2db1", 8), ], ) - def test_get_all_upstream_asset_guids_dfs( - self, guid, expected_count, lineage_response - ): + def test_get_all_upstream_asset_guids_dfs(self, guid, expected_count, lineage_response): assert (guids := lineage_response.get_all_upstream_asset_guids_dfs(guid)) assert len(guids) == expected_count @@ -238,16 +216,12 @@ def test_get_downstream_asset_guid_with_invalid_guid_returns_empty_set_of_guids( ): assert len(lineage_response.get_downstream_asset_guids("123")) == 0 - def test_get_downstream_asset_guid_with_valid_guid_returns_set_of_guids( - self, lineage_response - ): + def test_get_downstream_asset_guid_with_valid_guid_returns_set_of_guids(self, lineage_response): assert (guids := lineage_response.get_downstream_asset_guids(BASE_GUID)) assert len(guids) == 1 assert "e44ed3a2-1de5-4f23-b3f1-6e005156fee9" in guids - def test_get_downstream_assets_with_valid_guid_returns_set_of_guids( - self, lineage_response - ): + def test_get_downstream_assets_with_valid_guid_returns_set_of_guids(self, lineage_response): assert (assets := lineage_response.get_downstream_assets(BASE_GUID)) assert len(assets) == 1 @@ -263,9 +237,7 @@ def test_get_upstream_asset_guid_with_base_guid_returns_empty_set_of_guids( ): assert len(lineage_response.get_upstream_asset_guids(BASE_GUID)) == 0 - def test_get_upstream_asset_guid_with_valid_guid_returns_set_of_guids( - self, lineage_response - ): + def test_get_upstream_asset_guid_with_valid_guid_returns_set_of_guids(self, lineage_response): assert (guids := lineage_response.get_upstream_asset_guids(BASE_GUID_TARGET)) assert len(guids) == 1 assert BASE_GUID in guids @@ -279,17 +251,13 @@ def test_get_downstream_process_guid_with_valid_guid_returns_set_of_guids( assert "621d3fa2-54b0-4cc0-a858-5c5ea8c49349" in guids assert "d67d4188-010b-4adf-9886-10162f08c77b" in guids - def test_get_upstream_process_guids_with_valid_guid_returns_set_of_guids( - self, lineage_response - ): + def test_get_upstream_process_guids_with_valid_guid_returns_set_of_guids(self, lineage_response): assert (guids := lineage_response.get_upstream_process_guids(BASE_GUID_TARGET)) assert len(guids) == 2 assert "621d3fa2-54b0-4cc0-a858-5c5ea8c49349" in guids assert "d67d4188-010b-4adf-9886-10162f08c77b" in guids - def test_get_upstream_assets_with_valid_guid_returns_set_of_assets( - self, lineage_response - ): + def test_get_upstream_assets_with_valid_guid_returns_set_of_assets(self, lineage_response): assert (assets := lineage_response.get_upstream_process_guids(BASE_GUID_TARGET)) assert len(assets) == 2 @@ -308,9 +276,7 @@ def test_get_upstream_process_guid_with_invalid_guid_returns_empty_set_of_guids( @pytest.fixture def searchable_field() -> SearchableField: - return SearchableField( - atlan_field_name="atlan_field", elastic_field_name="elastic_field" - ) + return SearchableField(atlan_field_name="atlan_field", elastic_field_name="elastic_field") class TestLineageFilterField: @@ -339,23 +305,17 @@ class TestLineageFilterFieldBoolean: def sut(self, searchable_field: SearchableField) -> LineageFilterFieldBoolean: return LineageFilterFieldBoolean(field=searchable_field) - def test_init( - self, sut: LineageFilterFieldBoolean, searchable_field: SearchableField - ): + def test_init(self, sut: LineageFilterFieldBoolean, searchable_field: SearchableField): assert sut.field == searchable_field - @pytest.mark.parametrize( - "value, expected", [(True, str(True)), (False, str(False))] - ) + @pytest.mark.parametrize("value, expected", [(True, str(True)), (False, str(False))]) def test_eq(self, value, expected, sut: LineageFilterFieldBoolean): _filter = sut.eq(value) assert _filter.field == sut.field assert _filter.operator == AtlanComparisonOperator.EQ assert _filter.value == expected - @pytest.mark.parametrize( - "value, expected", [(True, str(True)), (False, str(False))] - ) + @pytest.mark.parametrize("value, expected", [(True, str(True)), (False, str(False))]) def test_neq(self, value, expected, sut: LineageFilterFieldBoolean): _filter = sut.neq(value) assert _filter.field == sut.field @@ -378,28 +338,20 @@ def configure_custom_metadata_field(custom_metadata_field, type_name): attribute_def.configure_mock(**{"type_name": type_name}) custom_metadata_field.attach_mock(attribute_def, "attribute_def") custom_metadata_field.attach_mock(attribute_def, "attribute_def") - custom_metadata_field.configure_mock( - **{"set_name": "something", "attribute_name": "an_attribute"} - ) + custom_metadata_field.configure_mock(**{"set_name": "something", "attribute_name": "an_attribute"}) - def test_init( - self, sut: LineageFilterFieldCM, custom_metadata_field: CustomMetadataField - ): + def test_init(self, sut: LineageFilterFieldCM, custom_metadata_field: CustomMetadataField): assert sut.field == custom_metadata_field assert sut.cm_field == custom_metadata_field - @pytest.mark.parametrize( - "value, expected", [("value", "value"), (FileType.CSV, FileType.CSV.value)] - ) + @pytest.mark.parametrize("value, expected", [("value", "value"), (FileType.CSV, FileType.CSV.value)]) def test_eq(self, value, expected, sut: LineageFilterFieldCM): _filter = sut.eq(value) assert _filter.field == sut.field assert _filter.operator == AtlanComparisonOperator.EQ assert _filter.value == expected - @pytest.mark.parametrize( - "value, expected", [("value", "value"), (FileType.CSV, FileType.CSV.value)] - ) + @pytest.mark.parametrize("value, expected", [("value", "value"), (FileType.CSV, FileType.CSV.value)]) def test_neq(self, value, expected, sut: LineageFilterFieldCM): _filter = sut.neq(value) assert _filter.field == sut.field @@ -486,13 +438,10 @@ def test_non_comparable_type_raises_atlan_error( ("gte", "int, float or date"), ], ) - def test_method_with_wrong_type_raise_atlan_error( - self, method, valid_types, sut: LineageFilterFieldCM - ): + def test_method_with_wrong_type_raise_atlan_error(self, method, valid_types, sut: LineageFilterFieldCM): with pytest.raises( AtlanError, - match="ATLAN-PYTHON-400-048 Invalid parameter type for dict should be " - + valid_types, + match="ATLAN-PYTHON-400-048 Invalid parameter type for dict should be " + valid_types, ): getattr(sut, method)({}) @@ -502,18 +451,14 @@ class TestLineageFilterFieldNumeric: def sut(self, searchable_field: SearchableField) -> LineageFilterFieldNumeric: return LineageFilterFieldNumeric(field=searchable_field) - def test_init( - self, sut: LineageFilterFieldNumeric, searchable_field: SearchableField - ): + def test_init(self, sut: LineageFilterFieldNumeric, searchable_field: SearchableField): assert sut.field == searchable_field @pytest.mark.parametrize( "method", ["eq", "neq", "lt", "lte", "gt", "gte"], ) - def test_method_with_wrong_type_raise_atlan_error( - self, method: str, sut: LineageFilterFieldNumeric - ): + def test_method_with_wrong_type_raise_atlan_error(self, method: str, sut: LineageFilterFieldNumeric): with pytest.raises( AtlanError, match="ATLAN-PYTHON-400-048 Invalid parameter type for dict should be int, float or date", @@ -544,9 +489,7 @@ class TestLineageFilterFieldString: def sut(self, searchable_field: SearchableField) -> LineageFilterFieldString: return LineageFilterFieldString(field=searchable_field) - def test_init( - self, sut: LineageFilterFieldString, searchable_field: SearchableField - ): + def test_init(self, sut: LineageFilterFieldString, searchable_field: SearchableField): assert sut.field == searchable_field @pytest.mark.parametrize( @@ -560,9 +503,7 @@ def test_init( "does_not_contain", ], ) - def test_method_with_wrong_type_raise_atlan_error( - self, method: str, sut: LineageFilterFieldNumeric - ): + def test_method_with_wrong_type_raise_atlan_error(self, method: str, sut: LineageFilterFieldNumeric): with pytest.raises( AtlanError, match="ATLAN-PYTHON-400-048 Invalid parameter type for dict should be int, float or date", @@ -580,12 +521,8 @@ def test_method_with_wrong_type_raise_atlan_error( ("does_not_contain", AtlanComparisonOperator.NOT_CONTAINS), ], ) - @pytest.mark.parametrize( - "value, expected", [("abc", "abc"), (FileType.CSV, FileType.CSV.value)] - ) - def test_eq( - self, method, operator, value, expected, sut: LineageFilterFieldBoolean - ): + @pytest.mark.parametrize("value, expected", [("abc", "abc"), (FileType.CSV, FileType.CSV.value)]) + def test_eq(self, method, operator, value, expected, sut: LineageFilterFieldBoolean): _filter = getattr(sut, method)(value) assert _filter.field == sut.field assert _filter.operator == operator @@ -857,9 +794,7 @@ def test_request( assert request.direction == direction assert request.exclude_meanings == exclude_meanings assert request.exclude_classifications == exclude_atlan_tags - assert request.attributes == [ - field.atlan_field_name for field in includes_on_results - ] + assert request.attributes == [field.atlan_field_name for field in includes_on_results] self.validate_filter( filter_=request.entity_filters, filter_condition=FilterList.Condition.AND, @@ -897,9 +832,7 @@ def test_request( assert request.direction == direction assert request.exclude_meanings == exclude_meanings assert request.exclude_classifications == exclude_atlan_tags - assert request.attributes == [ - field.atlan_field_name for field in includes_on_results - ] + assert request.attributes == [field.atlan_field_name for field in includes_on_results] self.validate_filter( filter_=request.entity_filters, filter_condition=FilterList.Condition.OR, @@ -1021,9 +954,7 @@ def test_method_with_valid_parameter(self, method, value, sut: FluentLineage): ), ], ) - def test_method_adds_to_list_valid_parameter( - self, method, value, internal_name, sut: FluentLineage - ): + def test_method_adds_to_list_valid_parameter(self, method, value, internal_name, sut: FluentLineage): lineage = getattr(sut, method)(value) assert lineage is not sut diff --git a/tests/unit/test_model.py b/tests/unit/test_model.py index 9ee9bc36f..162cf6b5d 100644 --- a/tests/unit/test_model.py +++ b/tests/unit/test_model.py @@ -273,9 +273,7 @@ "Optional[SourceCostUnitType]": SourceCostUnitType.CREDITS, "Optional[List[PopularityInsights]]": [PopularityInsights()], "Optional[QueryUsernameStrategy]": QueryUsernameStrategy.CONNECTION_USERNAME, - "Optional[List[GoogleLabel]]": [ - GoogleLabel(google_label_key="", google_label_value="") - ], + "Optional[List[GoogleLabel]]": [GoogleLabel(google_label_key="", google_label_value="")], "Optional[List[GoogleTag]]": [GoogleTag(google_tag_key="", google_tag_value="")], "Optional[GoogleDatastudioAssetType]": GoogleDatastudioAssetType.REPORT, "Optional[List[AzureTag]]": [AzureTag(azure_tag_key="", azure_tag_value="")], @@ -637,9 +635,7 @@ def type_def_response(): "displayName": "Table URL", "isDefaultValueNull": False, "indexTypeESConfig": {"normalizer": "atlan_normalizer"}, - "indexTypeESFields": { - "text": {"analyzer": "atlan_text_analyzer", "type": "text"} - }, + "indexTypeESFields": {"text": {"analyzer": "atlan_text_analyzer", "type": "text"}}, }, { "name": "VdRC4dyNdTJHfFjCiNaKt9", @@ -670,9 +666,7 @@ def type_def_response(): "displayName": "Freshness", "isDefaultValueNull": False, "indexTypeESConfig": {"normalizer": "atlan_normalizer"}, - "indexTypeESFields": { - "text": {"analyzer": "atlan_text_analyzer", "type": "text"} - }, + "indexTypeESFields": {"text": {"analyzer": "atlan_text_analyzer", "type": "text"}}, }, { "name": "loYJQi6ycokTirQTGVCHpD", @@ -703,9 +697,7 @@ def type_def_response(): }, "displayName": "Freshness Date", "isDefaultValueNull": False, - "indexTypeESFields": { - "date": {"format": "epoch_millis", "type": "date"} - }, + "indexTypeESFields": {"date": {"format": "epoch_millis", "type": "date"}}, }, ], "displayName": "Monte Carlo", @@ -755,9 +747,7 @@ def type_def_response(): "displayName": "Name", "isDefaultValueNull": False, "indexTypeESConfig": {"normalizer": "atlan_normalizer"}, - "indexTypeESFields": { - "text": {"analyzer": "atlan_text_analyzer", "type": "text"} - }, + "indexTypeESFields": {"text": {"analyzer": "atlan_text_analyzer", "type": "text"}}, } ], "displayName": "Moon", @@ -855,9 +845,7 @@ def attribute_value(request): (asset_type, property_name, (asset_type, property_name)) for asset_type in get_all_subclasses(Asset) for property_name in [ - p - for p in dir(asset_type) - if isinstance(getattr(asset_type, p) and p != "atlan_tag_names", property) + p for p in dir(asset_type) if isinstance(getattr(asset_type, p) and p != "atlan_tag_names", property) ] ], indirect=["attribute_value"], @@ -907,9 +895,7 @@ def test_attributes( ), ], ) -def test_validate_single_required_field_with_bad_values_raises_value_error( - names, values, message -): +def test_validate_single_required_field_with_bad_values_raises_value_error(names, values, message): with pytest.raises(ValueError, match=message): validate_single_required_field(names, values) @@ -952,8 +938,7 @@ def test_readme_creator_asset_guid_validation(): with pytest.raises( ValueError, match=escape( - "asset guid must be present, use the client.asset.ref_by_guid() " - "method to retrieve an asset by its GUID" + "asset guid must be present, use the client.asset.ref_by_guid() method to retrieve an asset by its GUID" ), ): Readme.creator( @@ -981,12 +966,9 @@ def test_readme_creator_asset_guid_validation(): ], ) def test_tableau_upstream_fields_deserialization(test_data): - td = TableauDatasource(**{"typeName": "TableauDatasource", "attributes": test_data}) assert td.upstream_tables == test_data["upstreamTables"] assert td.upstream_datasources == test_data["upstreamDatasources"] - tdf = TableauDatasourceField( - **{"typeName": "TableauDatasourceField", "attributes": test_data} - ) + tdf = TableauDatasourceField(**{"typeName": "TableauDatasourceField", "attributes": test_data}) assert tdf.upstream_tables == test_data["upstreamTables"] diff --git a/tests/unit/test_packages.py b/tests/unit/test_packages.py index 69e27305f..0726cd4e8 100644 --- a/tests/unit/test_packages.py +++ b/tests/unit/test_packages.py @@ -89,9 +89,7 @@ DATABRICKS_MINER_OFFLINE = "databricks_miner_offline.json" DATABRICKS_MINER_SYSTEM_TABLE = "databricks_miner_system_table.json" DATABRICKS_MINER_POPULARITY_REST = "databricks_miner_popularity_rest.json" -DATABRICKS_MINER_POPULARITY_SYSTEM_TABLE = ( - "databricks_miner_popularity_system_table.json" -) +DATABRICKS_MINER_POPULARITY_SYSTEM_TABLE = "databricks_miner_popularity_system_table.json" ORACLE_CRAWLER_BASIC = "oracle_crawler_basic.json" ORACLE_CRAWLER_OFFLINE = "oracle_crawler_offline.json" LINEAGE_BUILDER_S3 = "lineage_builder_s3.json" @@ -106,10 +104,7 @@ class NonSerializable: pass -INVALID_REQ_ERROR = ( - "ATLAN-PYTHON-400-014 Unable to translate " - "the provided include/exclude asset filters into JSON" -) +INVALID_REQ_ERROR = "ATLAN-PYTHON-400-014 Unable to translate the provided include/exclude asset filters into JSON" def load_json(filename): @@ -163,9 +158,7 @@ def test_snowflake_package(mock_package_env): .tags(True) .to_workflow() ) - request_json = loads( - snowflake_with_connection_default.json(by_alias=True, exclude_none=True) - ) + request_json = loads(snowflake_with_connection_default.json(by_alias=True, exclude_none=True)) assert request_json == load_json(SNOWFLAKE_BASIC) snowflake_basic_auth = ( @@ -198,9 +191,7 @@ def test_snowflake_package(mock_package_env): admin_groups=None, admin_users=None, ) - .account_usage( - hostname="test-hostname", database_name="test-db", schema_name="test-schema" - ) + .account_usage(hostname="test-hostname", database_name="test-db", schema_name="test-schema") .keypair_auth( username="test-user", private_key="test-key", @@ -247,9 +238,7 @@ def test_tableau_package(mock_package_env): admin_groups=None, admin_users=None, ) - .direct( - hostname="test.tableau.com", port=444, site="test-site", ssl_enabled=True - ) + .direct(hostname="test.tableau.com", port=444, site="test-site", ssl_enabled=True) .basic_auth( username="test-username", password="test-password", @@ -281,9 +270,7 @@ def test_tableau_package(mock_package_env): .crawl_hidden_fields(False) .to_workflow() ) - request_json = loads( - tableau_access_token_auth.json(by_alias=True, exclude_none=True) - ) + request_json = loads(tableau_access_token_auth.json(by_alias=True, exclude_none=True)) assert request_json == load_json(TABLEAU_ACCESS_TOKEN) tableau_offline = ( @@ -344,9 +331,7 @@ def test_powerbi_package(mock_package_env): .exclude(workspaces=None) .to_workflow() ) - request_json = loads( - powerbi_service_principal.json(by_alias=True, exclude_none=True) - ) + request_json = loads(powerbi_service_principal.json(by_alias=True, exclude_none=True)) assert request_json == load_json(POWEBI_SERVICE_PRINCIPAL) @@ -497,17 +482,13 @@ def test_snowflake_miner_package(mock_package_env): .custom_config(config={"test": True, "feature": 1234}) .to_workflow() ) - request_json = loads( - snowflake_miner_s3_offline.json(by_alias=True, exclude_none=True) - ) + request_json = loads(snowflake_miner_s3_offline.json(by_alias=True, exclude_none=True)) assert request_json == load_json(SNOWFLAKE_MINER_S3_OFFLINE) def test_databricks_miner_package(mock_package_env): databricks_miner_rest = ( - DatabricksMiner(connection_qualified_name="default/databricks/1234567890") - .rest_api() - .to_workflow() + DatabricksMiner(connection_qualified_name="default/databricks/1234567890").rest_api().to_workflow() ) request_json = loads(databricks_miner_rest.json(by_alias=True, exclude_none=True)) assert request_json == load_json(DATABRICKS_MINER_REST) @@ -517,9 +498,7 @@ def test_databricks_miner_package(mock_package_env): .offline(bucket_name="test-bucket", bucket_prefix="test-prefix") .to_workflow() ) - request_json = loads( - databricks_miner_offline.json(by_alias=True, exclude_none=True) - ) + request_json = loads(databricks_miner_offline.json(by_alias=True, exclude_none=True)) assert request_json == load_json(DATABRICKS_MINER_OFFLINE) databricks_miner_system_table = ( @@ -527,9 +506,7 @@ def test_databricks_miner_package(mock_package_env): .system_table(warehouse_id="test-warehouse-id") .to_workflow() ) - request_json = loads( - databricks_miner_system_table.json(by_alias=True, exclude_none=True) - ) + request_json = loads(databricks_miner_system_table.json(by_alias=True, exclude_none=True)) assert request_json == load_json(DATABRICKS_MINER_SYSTEM_TABLE) databricks_miner_popularity_rest = ( @@ -542,9 +519,7 @@ def test_databricks_miner_package(mock_package_env): ) .to_workflow() ) - request_json = loads( - databricks_miner_popularity_rest.json(by_alias=True, exclude_none=True) - ) + request_json = loads(databricks_miner_popularity_rest.json(by_alias=True, exclude_none=True)) assert request_json == load_json(DATABRICKS_MINER_POPULARITY_REST) databricks_miner_popularity_system_table = ( @@ -559,18 +534,14 @@ def test_databricks_miner_package(mock_package_env): ) .to_workflow() ) - request_json = loads( - databricks_miner_popularity_system_table.json(by_alias=True, exclude_none=True) - ) + request_json = loads(databricks_miner_popularity_system_table.json(by_alias=True, exclude_none=True)) assert request_json == load_json(DATABRICKS_MINER_POPULARITY_SYSTEM_TABLE) def test_big_query_package(mock_package_env): big_query_direct = ( - BigQueryCrawler( - connection_name="test-big-query-conn", admin_roles=["admin-guid-1234"] - ) + BigQueryCrawler(connection_name="test-big-query-conn", admin_roles=["admin-guid-1234"]) .service_account_auth( project_id="test-project-id", service_account_json="test-account-json", @@ -588,35 +559,25 @@ def test_big_query_package(mock_package_env): def test_dynamo_db_package(mock_package_env): dynamo_db_direct_iam_user = ( - DynamoDBCrawler( - connection_name="test-dynamodb-conn", admin_roles=["admin-guid-1234"] - ) + DynamoDBCrawler(connection_name="test-dynamodb-conn", admin_roles=["admin-guid-1234"]) .direct(region="test-region") .iam_user_auth(access_key="test-access-key", secret_key="test-secret-key") .include_regex(regex=".*_TEST_INCLUDE") .exclude_regex(regex=".*_TEST_EXCLUDE") .to_workflow() ) - request_json = loads( - dynamo_db_direct_iam_user.json(by_alias=True, exclude_none=True) - ) + request_json = loads(dynamo_db_direct_iam_user.json(by_alias=True, exclude_none=True)) assert request_json == load_json(DYNAMO_DB_IAM_USER) dynamo_db_direct_iam_user_role = ( - DynamoDBCrawler( - connection_name="test-dynamodb-conn", admin_roles=["admin-guid-1234"] - ) + DynamoDBCrawler(connection_name="test-dynamodb-conn", admin_roles=["admin-guid-1234"]) .direct(region="test-region") - .iam_role_auth( - arn="arn:aws:iam::123456789012:user/test", external_id="test-ext-id" - ) + .iam_role_auth(arn="arn:aws:iam::123456789012:user/test", external_id="test-ext-id") .include_regex(regex=".*_TEST_INCLUDE") .exclude_regex(regex=".*_TEST_EXCLUDE") .to_workflow() ) - request_json = loads( - dynamo_db_direct_iam_user_role.json(by_alias=True, exclude_none=True) - ) + request_json = loads(dynamo_db_direct_iam_user_role.json(by_alias=True, exclude_none=True)) assert request_json == load_json(DYNAMO_DB_IAM_USER_ROLE) @@ -661,9 +622,7 @@ def test_postgres_package(mock_package_env): .to_workflow() ) - request_json = loads( - postgres_direct_iam_user.json(by_alias=True, exclude_none=True) - ) + request_json = loads(postgres_direct_iam_user.json(by_alias=True, exclude_none=True)) assert request_json == load_json(POSTGRES_DIRECT_IAM_USER) postgres_direct_iam_role = ( @@ -685,9 +644,7 @@ def test_postgres_package(mock_package_env): .to_workflow() ) - request_json = loads( - postgres_direct_iam_role.json(by_alias=True, exclude_none=True) - ) + request_json = loads(postgres_direct_iam_role.json(by_alias=True, exclude_none=True)) assert request_json == load_json(POSTGRES_DIRECT_IAM_ROLE) postgres_s3_offline = ( @@ -739,16 +696,12 @@ def test_mongodb_package(mock_package_env): def test_connection_delete_package(mock_package_env): # With PURGE (hard delete) - connection_delete_hard = ConnectionDelete( - qualified_name="default/snowflake/1234567890", purge=True - ).to_workflow() + connection_delete_hard = ConnectionDelete(qualified_name="default/snowflake/1234567890", purge=True).to_workflow() request_json = loads(connection_delete_hard.json(by_alias=True, exclude_none=True)) assert request_json == load_json(CONNECTION_DELETE_HARD) # Without PURGE (soft delete) - connection_delete_soft = ConnectionDelete( - qualified_name="default/snowflake/1234567890", purge=False - ).to_workflow() + connection_delete_soft = ConnectionDelete(qualified_name="default/snowflake/1234567890", purge=False).to_workflow() request_json = loads(connection_delete_soft.json(by_alias=True, exclude_none=True)) assert request_json == load_json(CONNECTION_DELETE_SOFT) @@ -1055,9 +1008,7 @@ def test_asset_import(mock_package_env): ) ).to_workflow() - request_json_default = loads( - asset_import_default.json(by_alias=True, exclude_none=True) - ) + request_json_default = loads(asset_import_default.json(by_alias=True, exclude_none=True)) assert request_json_default == load_json(ASSET_IMPORT_DEFAULT) @@ -1075,9 +1026,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_s3 = loads( - asset_export_basic_glossaries_only_s3.json(by_alias=True, exclude_none=True) - ) + request_json_s3 = loads(asset_export_basic_glossaries_only_s3.json(by_alias=True, exclude_none=True)) assert request_json_s3 == load_json(ASSET_EXPORT_BASIC_GLOSSARIES_ONLY_S3) # Case 2: Export assets with Products only using s3 @@ -1093,9 +1042,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_s3 = loads( - asset_export_basic_products_only_s3.json(by_alias=True, exclude_none=True) - ) + request_json_s3 = loads(asset_export_basic_products_only_s3.json(by_alias=True, exclude_none=True)) assert request_json_s3 == load_json(ASSET_EXPORT_BASIC_PRODUCTS_ONLY_S3) # Case 3: Export assets with Enriched only using s3 @@ -1117,9 +1064,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_s3 = loads( - asset_export_basic_enriched_only_s3.json(by_alias=True, exclude_none=True) - ) + request_json_s3 = loads(asset_export_basic_enriched_only_s3.json(by_alias=True, exclude_none=True)) assert request_json_s3 == load_json(ASSET_EXPORT_BASIC_ENRICHED_ONLY_S3) # Case 4: Export all assets using s3 @@ -1141,9 +1086,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_s3 = loads( - asset_export_basic_all_assets_s3.json(by_alias=True, exclude_none=True) - ) + request_json_s3 = loads(asset_export_basic_all_assets_s3.json(by_alias=True, exclude_none=True)) assert request_json_s3 == load_json(ASSET_EXPORT_BASIC_ALL_ASSETS_S3) # Case 1: Export assets with glossaries only using adls @@ -1160,9 +1103,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_adls = loads( - asset_export_basic_glossaries_only_adls.json(by_alias=True, exclude_none=True) - ) + request_json_adls = loads(asset_export_basic_glossaries_only_adls.json(by_alias=True, exclude_none=True)) assert request_json_adls == load_json(ASSET_EXPORT_BASIC_GLOSSARIES_ONLY_ADLS) # Case 2: Export assets with Products only using adls @@ -1179,9 +1120,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_adls = loads( - asset_export_basic_products_only_adls.json(by_alias=True, exclude_none=True) - ) + request_json_adls = loads(asset_export_basic_products_only_adls.json(by_alias=True, exclude_none=True)) assert request_json_adls == load_json(ASSET_EXPORT_BASIC_PRODUCTS_ONLY_ADLS) # Case 3: Export assets with Enriched only using adls @@ -1204,9 +1143,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_adls = loads( - asset_export_basic_enriched_only_adls.json(by_alias=True, exclude_none=True) - ) + request_json_adls = loads(asset_export_basic_enriched_only_adls.json(by_alias=True, exclude_none=True)) assert request_json_adls == load_json(ASSET_EXPORT_BASIC_ENRICHED_ONLY_ADLS) # Case 4: Export all assets using adls @@ -1229,9 +1166,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_adls = loads( - asset_export_basic_all_assets_adls.json(by_alias=True, exclude_none=True) - ) + request_json_adls = loads(asset_export_basic_all_assets_adls.json(by_alias=True, exclude_none=True)) assert request_json_adls == load_json(ASSET_EXPORT_BASIC_ALL_ASSETS_ADLS) # Case 1: Export assets with glossaries only using gcs @@ -1246,9 +1181,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_gcs = loads( - asset_export_basic_glossaries_only_gcs.json(by_alias=True, exclude_none=True) - ) + request_json_gcs = loads(asset_export_basic_glossaries_only_gcs.json(by_alias=True, exclude_none=True)) assert request_json_gcs == load_json(ASSET_EXPORT_BASIC_GLOSSARIES_ONLY_GCS) # Case 2: Export assets with Products only using gcs @@ -1263,9 +1196,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_gcs = loads( - asset_export_basic_products_only_gcs.json(by_alias=True, exclude_none=True) - ) + request_json_gcs = loads(asset_export_basic_products_only_gcs.json(by_alias=True, exclude_none=True)) assert request_json_gcs == load_json(ASSET_EXPORT_BASIC_PRODUCTS_ONLY_GCS) # Case 3: Export assets with Enriched only using adls @@ -1286,9 +1217,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_gcs = loads( - asset_export_basic_enriched_only_gcs.json(by_alias=True, exclude_none=True) - ) + request_json_gcs = loads(asset_export_basic_enriched_only_gcs.json(by_alias=True, exclude_none=True)) assert request_json_gcs == load_json(ASSET_EXPORT_BASIC_ENRICHED_ONLY_GCS) # Case 4: Export all assets using adls @@ -1309,9 +1238,7 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_gcs = loads( - asset_export_basic_all_assets_gcs.json(by_alias=True, exclude_none=True) - ) + request_json_gcs = loads(asset_export_basic_all_assets_gcs.json(by_alias=True, exclude_none=True)) assert request_json_gcs == load_json(ASSET_EXPORT_BASIC_ALL_ASSETS_GCS) @@ -1341,9 +1268,7 @@ def test_relational_assets_builder(mock_package_env): ) ).to_workflow() - request_json_s3 = loads( - relational_assets_builder_s3.json(by_alias=True, exclude_none=True) - ) + request_json_s3 = loads(relational_assets_builder_s3.json(by_alias=True, exclude_none=True)) assert request_json_s3 == load_json(RELATIONAL_ASSETS_BUILDER_S3) # Case 2: Build/Update relational assets from adls with advanced configuration @@ -1373,9 +1298,7 @@ def test_relational_assets_builder(mock_package_env): ) ).to_workflow() - request_json_adls = loads( - relational_assets_builder_adls.json(by_alias=True, exclude_none=True) - ) + request_json_adls = loads(relational_assets_builder_adls.json(by_alias=True, exclude_none=True)) assert request_json_adls == load_json(RELATIONAL_ASSETS_BUILDER_ADLS) # Case 3: Build/Update relational assets from gcs with advanced configuration @@ -1403,9 +1326,7 @@ def test_relational_assets_builder(mock_package_env): ) ).to_workflow() - request_json_gcs = loads( - relational_assets_builder_gcs.json(by_alias=True, exclude_none=True) - ) + request_json_gcs = loads(relational_assets_builder_gcs.json(by_alias=True, exclude_none=True)) assert request_json_gcs == load_json(RELATIONAL_ASSETS_BUILDER_GCS) @@ -1523,9 +1444,7 @@ def test_lineage_generator_nt(mock_package_env): ) ).to_workflow() - request_json = loads( - lineage_generator_default.json(by_alias=True, exclude_none=True) - ) + request_json = loads(lineage_generator_default.json(by_alias=True, exclude_none=True)) assert request_json == load_json(LINEAGE_GENERATOR_DEFAULT) lineage_generator_full = ( @@ -1581,9 +1500,7 @@ def test_api_token_connection_admin(mock_package_env): {"abc": NonSerializable()}, ], ) -def test_wrong_hierarchical_filter_raises_invalid_req_err( - test_assets, mock_package_env -): +def test_wrong_hierarchical_filter_raises_invalid_req_err(test_assets, mock_package_env): with pytest.raises( InvalidRequestError, match=INVALID_REQ_ERROR, @@ -1617,9 +1534,7 @@ def test_wrong_flat_filter_raises_invalid_req_err(test_projects, mock_package_en "test_assets", [NonSerializable(), [NonSerializable()]], ) -def test_wrong_glue_package_filter_raises_invalid_req_err( - test_assets, mock_package_env -): +def test_wrong_glue_package_filter_raises_invalid_req_err(test_assets, mock_package_env): with pytest.raises( InvalidRequestError, match=INVALID_REQ_ERROR, diff --git a/tests/unit/test_query_client.py b/tests/unit/test_query_client.py index 96c442bb5..a4e780ca2 100644 --- a/tests/unit/test_query_client.py +++ b/tests/unit/test_query_client.py @@ -27,9 +27,7 @@ def client(): @pytest.fixture() def query_request() -> QueryRequest: - return QueryRequest( - sql="test-sql", data_source_name="test-ds-name", default_schema="test-schema" - ) + return QueryRequest(sql="test-sql", data_source_name="test-ds-name", default_schema="test-schema") @pytest.fixture() @@ -64,9 +62,7 @@ def test_init_when_wrong_class_raises_exception(test_api_caller): "test_request, error_msg", [[None, "none is not an allowed value"], ["123", "value is not a valid dict"]], ) -def test_query_stream_wrong_params_raises_validation_error( - test_request, error_msg, client: AtlanClient -): +def test_query_stream_wrong_params_raises_validation_error(test_request, error_msg, client: AtlanClient): with pytest.raises(ValidationError) as err: client.queries.stream(request=test_request) assert error_msg in str(err.value) diff --git a/tests/unit/test_search_log_search.py b/tests/unit/test_search_log_search.py index 76a6e92db..e03137edb 100644 --- a/tests/unit/test_search_log_search.py +++ b/tests/unit/test_search_log_search.py @@ -42,9 +42,7 @@ def _assert_search_log_results(results, response_json, sorts, bulk=False): assert log.user_agent == response_json["logs"][0]["userAgent"] assert log.ip_address == response_json["logs"][0]["ipAddress"] assert log.host == response_json["logs"][0]["host"] - expected_timestamp = datetime.fromtimestamp( - response_json["logs"][0]["timestamp"] / 1000, tz=timezone.utc - ) + expected_timestamp = datetime.fromtimestamp(response_json["logs"][0]["timestamp"] / 1000, tz=timezone.utc) assert log.timestamp == expected_timestamp assert log.entity_guids_all == response_json["logs"][0]["entityGuidsAll"] @@ -94,10 +92,7 @@ def test_search_log_pagination(mock_logger, mock_api_caller, search_logs_json): # to verify if the results are empty assert mock_api_caller._call_api.call_count == 2 assert mock_logger.call_count == 1 - assert ( - "Search log bulk search option is enabled." - in mock_logger.call_args_list[0][0][0] - ) + assert "Search log bulk search option is enabled." in mock_logger.call_args_list[0][0][0] mock_logger.reset_mock() mock_api_caller.reset_mock() @@ -117,15 +112,10 @@ def test_search_log_pagination(mock_logger, mock_api_caller, search_logs_json): exclude_users=["atlansupport"], ) response = client.search(criteria=search_log_request) - _assert_search_log_results( - response, search_logs_json, expected_sorts, bulk=False - ) + _assert_search_log_results(response, search_logs_json, expected_sorts, bulk=False) assert mock_logger.call_count == 1 assert mock_api_caller._call_api.call_count == 3 - assert ( - "Result size (%s) exceeds threshold (%s)" - in mock_logger.call_args_list[0][0][0] - ) + assert "Result size (%s) exceeds threshold (%s)" in mock_logger.call_args_list[0][0][0] # Test exception for bulk=False with user-defined sorting and results exceeding the threshold search_log_request = SearchLogRequest.views_by_guid( diff --git a/tests/unit/test_search_model.py b/tests/unit/test_search_model.py index 1c9b9908c..adcf3023b 100644 --- a/tests/unit/test_search_model.py +++ b/tests/unit/test_search_model.py @@ -242,9 +242,7 @@ def test_term_to_dict(parameters, expected): ), ], ) -def test_bool_to_dict_without_optional_fields( - must, should, must_not, filter, boost, minimum_should_match, expected -): +def test_bool_to_dict_without_optional_fields(must, should, must_not, filter, boost, minimum_should_match, expected): assert ( Bool( must=must, @@ -284,8 +282,7 @@ def test_index_search_request(): ) request = IndexSearchRequest(dsl=dsl, attributes=["schemaName", "databaseName"]) assert ( - request.json(by_alias=True, exclude_none=True) - == '{"attributes": ["schemaName", "databaseName"],' + request.json(by_alias=True, exclude_none=True) == '{"attributes": ["schemaName", "databaseName"],' ' "dsl": {"from": 0, "size": 300, "aggregations": {}, "track_total_hits": true, ' '"post_filter": {"term": {"databaseName.keyword": ' '{"value": "ATLAN_SAMPLE_DATA"}}}, "query": {"term": {"__typeName.keyword": {"value": "Schema"}}}, ' @@ -301,8 +298,7 @@ def test_audit_search_request(): ) request = AuditSearchRequest(dsl=dsl, attributes=["schemaName", "databaseName"]) assert ( - request.json(by_alias=True, exclude_none=True) - == '{"attributes": ["schemaName", "databaseName"],' + request.json(by_alias=True, exclude_none=True) == '{"attributes": ["schemaName", "databaseName"],' ' "dsl": {"from": 0, "size": 300, "aggregations": {}, "track_total_hits": true, ' '"post_filter": {"term": {"databaseName.keyword": ' '{"value": "ATLAN_SAMPLE_DATA"}}}, "query": {"term": {"__typeName.keyword": {"value": "Schema"}}}, ' @@ -317,8 +313,7 @@ def test_search_log_request(): ) request = SearchLogRequest(dsl=dsl, attributes=["schemaName", "databaseName"]) assert ( - request.json(by_alias=True, exclude_none=True) - == '{"attributes": ["schemaName", "databaseName"],' + request.json(by_alias=True, exclude_none=True) == '{"attributes": ["schemaName", "databaseName"],' ' "dsl": {"from": 0, "size": 300, "aggregations": {}, "track_total_hits": true, ' '"post_filter": {"term": {"databaseName.keyword": ' '{"value": "ATLAN_SAMPLE_DATA"}}}, "query": {"term": {"__typeName.keyword": {"value": "Schema"}}}, ' @@ -416,26 +411,20 @@ def test_match_none_plus_other_is_match_none(): def test_match_one_or_other_is_other(): - assert MatchNone() | Term(field="name", value="bob") == Term( - field="name", value="bob" - ) + assert MatchNone() | Term(field="name", value="bob") == Term(field="name", value="bob") def test_nagate_match_one_is_match_all(): assert ~MatchNone() == MatchAll() -@pytest.mark.parametrize( - "boost, expected", [(None, {"match_all": {}}), (1.2, {"match_all": {"boost": 1.2}})] -) +@pytest.mark.parametrize("boost, expected", [(None, {"match_all": {}}), (1.2, {"match_all": {"boost": 1.2}})]) def test_match_all_to_dict(boost, expected): assert MatchAll(boost=boost).to_dict() == expected def test_match_all_and_other_is_other(): - assert MatchAll() & Term(field="name", value="bob") == Term( - field="name", value="bob" - ) + assert MatchAll() & Term(field="name", value="bob") == Term(field="name", value="bob") def test_match_all_or_other_is_match_all(): @@ -546,9 +535,7 @@ def with_name(request): def test_terms_to_dict(): - assert Terms(field="name", values=["john", "dave"]).to_dict() == { - "terms": {"name": ["john", "dave"]} - } + assert Terms(field="name", values=["john", "dave"]).to_dict() == {"terms": {"name": ["john", "dave"]}} @pytest.mark.parametrize( @@ -566,9 +553,7 @@ def test_terms_to_dict(): ], indirect=["with_name"], ) -def test_by_methods_on_term_prefix_regexp_wildcard( - a_class, with_name, value, field, incompatable -): +def test_by_methods_on_term_prefix_regexp_wildcard(a_class, with_name, value, field, incompatable): if incompatable: assert not hasattr(a_class, with_name) else: @@ -579,9 +564,7 @@ def test_by_methods_on_term_prefix_regexp_wildcard( assert t.value == value -@pytest.mark.parametrize( - "with_name, field", [(a, a.value) for a in TermAttributes], indirect=["with_name"] -) +@pytest.mark.parametrize("with_name, field", [(a, a.value) for a in TermAttributes], indirect=["with_name"]) def test_by_methods_on_exists(with_name, field): assert hasattr(Exists, with_name) t = getattr(Exists, with_name)() @@ -812,11 +795,7 @@ def test_sort_item_to_dict(field, order, expected): None, None, None, - { - "fuzzy": { - "user": {"value": "ki", "fuzziness": "AUTO", "max_expansions": 3} - } - }, + {"fuzzy": {"user": {"value": "ki", "fuzziness": "AUTO", "max_expansions": 3}}}, ), ( "user", @@ -1477,17 +1456,13 @@ def test_with_active_glossary(): ), ], ) -def test_with_active_category_when_invalid_parameter_raises_value_error( - name, glossary_qualified_name, message -): +def test_with_active_category_when_invalid_parameter_raises_value_error(name, glossary_qualified_name, message): with pytest.raises(ValueError, match=message): with_active_category(name=name, glossary_qualified_name=glossary_qualified_name) def test_with_active_category(): - sut = with_active_category( - name=GLOSSARY_CATEGORY_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME - ) + sut = with_active_category(name=GLOSSARY_CATEGORY_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME) assert sut.filter assert 4 == len(sut.filter) @@ -1531,17 +1506,13 @@ def test_with_active_category(): ), ], ) -def test_with_active_term_when_invalid_parameter_raises_value_error( - name, glossary_qualified_name, message -): +def test_with_active_term_when_invalid_parameter_raises_value_error(name, glossary_qualified_name, message): with pytest.raises(ValueError, match=message): with_active_term(name=name, glossary_qualified_name=glossary_qualified_name) def test_with_active_term(): - sut = with_active_term( - name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME - ) + sut = with_active_term(name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME) assert sut.filter assert 4 == len(sut.filter) diff --git a/tests/unit/test_source_cache.py b/tests/unit/test_source_cache.py index c46b89584..d61bd905f 100644 --- a/tests/unit/test_source_cache.py +++ b/tests/unit/test_source_cache.py @@ -22,9 +22,7 @@ def test_get_by_guid_with_not_found_error(monkeypatch): @patch.object(SourceTagCache, "lookup_by_guid") -@patch.object( - SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) -) +@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) def test_get_by_guid_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_guid): test_guid = "test-guid-123" with pytest.raises( @@ -41,19 +39,13 @@ def test_get_by_qualified_name_with_not_found_error(monkeypatch): @patch.object(SourceTagCache, "lookup_by_qualified_name") -@patch.object( - SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) -) -def test_get_by_qualified_name_with_no_invalid_request_error( - mock_get_cache, mock_lookup_by_qualified_name -): +@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) +def test_get_by_qualified_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_qualified_name): test_qn = "default/snowflake/123456789" test_connector = "snowflake" with pytest.raises( NotFoundError, - match=ErrorCode.ASSET_NOT_FOUND_BY_QN.error_message.format( - test_qn, test_connector - ), + match=ErrorCode.ASSET_NOT_FOUND_BY_QN.error_message.format(test_qn, test_connector), ): SourceTagCache.get_by_qualified_name(test_qn) mock_get_cache.assert_called_once() @@ -65,9 +57,7 @@ def test_get_by_name_with_not_found_error(monkeypatch): @patch.object(SourceTagCache, "lookup_by_name") -@patch.object( - SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) -) +@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) def test_get_by_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_name): test_name = SourceTagName("snowflake/test@@DB/SCHEMA/TEST_TAG") with pytest.raises( @@ -82,9 +72,7 @@ def test_get_by_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_b @patch.object(SourceTagCache, "lookup_by_guid") -@patch.object( - SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) -) +@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) def test_get_by_guid(mock_get_cache, mock_lookup_by_guid): test_guid = "test-guid-123" test_qn = "test-qualified-name" @@ -135,9 +123,7 @@ def test_get_by_guid(mock_get_cache, mock_lookup_by_guid): @patch.object(SourceTagCache, "lookup_by_guid") @patch.object(SourceTagCache, "lookup_by_qualified_name") -@patch.object( - SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) -) +@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) def test_get_by_qualified_name(mock_get_cache, mock_lookup_by_qn, mock_lookup_by_guid): test_guid = "test-guid-123" test_qn = "test-qualified-name" @@ -195,9 +181,7 @@ def test_get_by_qualified_name(mock_get_cache, mock_lookup_by_qn, mock_lookup_by @patch.object(SourceTagCache, "lookup_by_guid") @patch.object(SourceTagCache, "lookup_by_name") -@patch.object( - SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) -) +@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) def test_get_by_name(mock_get_cache, mock_lookup_by_name, mock_lookup_by_guid): test_name = SourceTagName("snowflake/test@@DB/SCHEMA/TEST_TAG") test_guid = "test-guid-123" diff --git a/tests/unit/test_sso_client.py b/tests/unit/test_sso_client.py index 9d6862ca3..f08133286 100644 --- a/tests/unit/test_sso_client.py +++ b/tests/unit/test_sso_client.py @@ -81,9 +81,7 @@ def test_init_when_wrong_class_raises_exception(test_api_caller): ["azure", [123], "group_map_id\n str type expected"], ], ) -def test_sso_get_group_mapping_wrong_params_raises_validation_error( - sso_alias, group_map_id, error_msg -): +def test_sso_get_group_mapping_wrong_params_raises_validation_error(sso_alias, group_map_id, error_msg): with pytest.raises(ValidationError) as err: SSOClient.get_group_mapping(sso_alias=sso_alias, group_map_id=group_map_id) assert error_msg in str(err.value) @@ -96,9 +94,7 @@ def test_sso_get_group_mapping_wrong_params_raises_validation_error( [[123], "so_alias\n str type expected"], ], ) -def test_sso_get_all_group_mapping_wrong_params_raises_validation_error( - sso_alias, error_msg -): +def test_sso_get_all_group_mapping_wrong_params_raises_validation_error(sso_alias, error_msg): with pytest.raises(ValidationError, match=error_msg): SSOClient.get_all_group_mappings(sso_alias=sso_alias) @@ -118,9 +114,7 @@ def test_sso_create_group_mapping_wrong_params_raises_validation_error( sso_alias, atlan_group, sso_group_name, error_msg ): with pytest.raises(ValidationError, match=error_msg): - SSOClient.create_group_mapping( - sso_alias=sso_alias, atlan_group=atlan_group, sso_group_name=sso_group_name - ) + SSOClient.create_group_mapping(sso_alias=sso_alias, atlan_group=atlan_group, sso_group_name=sso_group_name) @pytest.mark.parametrize( @@ -176,9 +170,7 @@ def test_sso_update_group_mapping_wrong_params_raises_validation_error( ["azure", [123], "group_map_id\n str type expected"], ], ) -def test_sso_delete_group_mapping_wrong_params_raises_validation_error( - sso_alias, group_map_id, error_msg -): +def test_sso_delete_group_mapping_wrong_params_raises_validation_error(sso_alias, group_map_id, error_msg): with pytest.raises(ValidationError, match=error_msg): SSOClient.delete_group_mapping(sso_alias=sso_alias, group_map_id=group_map_id) @@ -235,9 +227,7 @@ def test_sso_create_group_mapping_invalid_request_error( mock_api_caller.reset_mock() -def test_sso_create_group_mapping( - mock_api_caller, get_all_group_mapping_json, create_group_mapping_json -): +def test_sso_create_group_mapping(mock_api_caller, get_all_group_mapping_json, create_group_mapping_json): mock_api_caller._call_api.side_effect = [ get_all_group_mapping_json, create_group_mapping_json, diff --git a/tests/unit/test_structs.py b/tests/unit/test_structs.py index ce9948600..aafebdc0f 100644 --- a/tests/unit/test_structs.py +++ b/tests/unit/test_structs.py @@ -40,9 +40,7 @@ def mc_monitor_response_json(): return load_json(STRUCT_RESPONSES_DIR, MC_MONITOR_JSON) -def test_structs_flatten_attributes( - client, mock_custom_metadata_cache, mc_monitor_response_json -): +def test_structs_flatten_attributes(client, mock_custom_metadata_cache, mc_monitor_response_json): asset_response = {"referredEntities": {}, "entity": mc_monitor_response_json} mc_monitor_model = MCMonitor(**mc_monitor_response_json) mc_monitor_asset_response = AssetResponse[MCMonitor](**asset_response).entity diff --git a/tests/unit/test_task_client.py b/tests/unit/test_task_client.py index 7172513db..4e2e725bf 100644 --- a/tests/unit/test_task_client.py +++ b/tests/unit/test_task_client.py @@ -43,12 +43,7 @@ def mock_api_caller(): @pytest.fixture() def task_search_request() -> TaskSearchRequest: - return ( - FluentTasks() - .page_size(1) - .where(AtlanTask.STATUS.match(AtlanTaskStatus.COMPLETE.value)) - .to_request() - ) + return FluentTasks().page_size(1).where(AtlanTask.STATUS.match(AtlanTaskStatus.COMPLETE.value)).to_request() @pytest.fixture() @@ -90,9 +85,7 @@ def test_fluent_tasks_invalid_client_raises_invalid_request_error( ): client_method = getattr(FluentTasks(), test_method) for invalid_client in test_client: - with pytest.raises( - InvalidRequestError, match="No Atlan client has been provided." - ): + with pytest.raises(InvalidRequestError, match="No Atlan client has been provided."): client_method(client=invalid_client) diff --git a/tests/unit/test_typedef_model.py b/tests/unit/test_typedef_model.py index f29543249..440e45b3d 100644 --- a/tests/unit/test_typedef_model.py +++ b/tests/unit/test_typedef_model.py @@ -139,9 +139,7 @@ def test_enum_defs(self, type_defs): ["my_enum", None, "values is required"], ], ) - def test_enum_create_method_required_parameters( - self, test_name, test_values, error_msg - ): + def test_enum_create_method_required_parameters(self, test_name, test_values, error_msg): with pytest.raises(ValueError) as err: EnumDef.create(name=test_name, values=test_values) assert error_msg in str(err.value) @@ -177,9 +175,7 @@ def test_update_method(self, client, mock_get_enum_cache): } mock_get_by_name = Mock(return_value=EnumDef(**existing_enum)) mock_get_enum_cache.return_value._get_by_name = mock_get_by_name - enum = EnumDef.update( - name="test-enum", values=["test-val1", "test-val2"], replace_existing=False - ) + enum = EnumDef.update(name="test-enum", values=["test-val1", "test-val2"], replace_existing=False) assert enum assert enum.name == "test-enum" assert enum.category == AtlanTypeCategory.ENUM @@ -200,9 +196,7 @@ def test_update_method(self, client, mock_get_enum_cache): } mock_get_by_name = Mock(return_value=EnumDef(**existing_enum)) mock_get_enum_cache.return_value._get_by_name = mock_get_by_name - enum = EnumDef.update( - name="test-enum", values=["test-val1", "test-val2"], replace_existing=False - ) + enum = EnumDef.update(name="test-enum", values=["test-val1", "test-val2"], replace_existing=False) assert enum assert enum.name == "test-enum" assert enum.category == AtlanTypeCategory.ENUM @@ -356,9 +350,7 @@ def sut(self) -> AttributeDef: (APPLICABLE_ENTITY_TYPES, {"Asset"}), ], ) - def test_applicable_types_with_no_options_raises_invalid_request_error( - self, attribute, value, sut: AttributeDef - ): + def test_applicable_types_with_no_options_raises_invalid_request_error(self, attribute, value, sut: AttributeDef): sut = AttributeDef() # Explicitly setting "None" since options # are now initialized with a default factory @@ -393,9 +385,7 @@ def test_applicable_types_with_invalid_type_raises_invalid_request_error( (APPLICABLE_DOMAINS, {"default/domain/uuBI8WSqeom1PXs7oo20L/super"}), ], ) - def test_applicable_types_with_valid_value( - self, attribute, value, sut: AttributeDef - ): + def test_applicable_types_with_valid_value(self, attribute, value, sut: AttributeDef): setattr(sut, attribute, value) assert getattr(sut, attribute) == value options = sut.options @@ -419,16 +409,12 @@ def test_attribute_create_with_limited_applicability(self): attribute_type=AtlanCustomAttributePrimitiveType.STRING, # Optional kwargs that allow limiting # the applicability of an attribute within Atlan - **applicable_kwargs + **applicable_kwargs, ) assert attribute_def_with_limited assert attribute_def_with_limited.options options = attribute_def_with_limited.options for attribute in applicable_kwargs.keys(): - assert getattr( - attribute_def_with_limited, attribute - ) == applicable_kwargs.get(attribute) - assert getattr(options, attribute) == json.dumps( - list(applicable_kwargs.get(attribute)) - ) + assert getattr(attribute_def_with_limited, attribute) == applicable_kwargs.get(attribute) + assert getattr(options, attribute) == json.dumps(list(applicable_kwargs.get(attribute))) diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index d90b079af..58090d23c 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -33,9 +33,7 @@ def test_list_attributes_to_params_with_query_parms(): (None, None, None), ( None, - { - "qualifiedName": "default/glue/1688357913/AwsDataCatalog/development_published_impact/holding_rating" - }, + {"qualifiedName": "default/glue/1688357913/AwsDataCatalog/development_published_impact/holding_rating"}, None, ), (["ihnLo19fqaT4x9pU8JKWbQ.Cyw6GbqST9M1dhXIBE1yHp"], None, None), @@ -77,9 +75,7 @@ def test_list_attributes_to_params_with_query_parms(): ], ) def test_unflatten_custom_metadata(attributes, flattened_attributes, custom_metadata): - assert custom_metadata == unflatten_custom_metadata( - attributes=attributes, asset_attributes=flattened_attributes - ) + assert custom_metadata == unflatten_custom_metadata(attributes=attributes, asset_attributes=flattened_attributes) @patch("pyatlan.utils.unflatten_custom_metadata") diff --git a/tests/unit/test_workflow_client.py b/tests/unit/test_workflow_client.py index 54a78eaf0..db973d496 100644 --- a/tests/unit/test_workflow_client.py +++ b/tests/unit/test_workflow_client.py @@ -267,45 +267,29 @@ def test_find_by_type(client: WorkflowClient, mock_api_caller): assert client.find_by_type(prefix=WorkflowPackage.FIVETRAN) == [] mock_api_caller._call_api.assert_called_once() assert mock_api_caller._call_api.call_args.args[0] == WORKFLOW_INDEX_SEARCH - assert isinstance( - mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest - ) + assert isinstance(mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest) -def test_find_by_id( - client: WorkflowClient, search_response: WorkflowSearchResponse, mock_api_caller -): +def test_find_by_id(client: WorkflowClient, search_response: WorkflowSearchResponse, mock_api_caller): raw_json = search_response.dict() mock_api_caller._call_api.return_value = raw_json assert search_response.hits and search_response.hits.hits - assert ( - client.find_by_id(id="atlan-snowflake-miner-1714638976") - == search_response.hits.hits[0] - ) + assert client.find_by_id(id="atlan-snowflake-miner-1714638976") == search_response.hits.hits[0] mock_api_caller._call_api.assert_called_once() assert mock_api_caller._call_api.call_args.args[0] == WORKFLOW_INDEX_SEARCH - assert isinstance( - mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest - ) + assert isinstance(mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest) -def test_find_run_by_id( - client: WorkflowClient, search_response: WorkflowSearchResponse, mock_api_caller -): +def test_find_run_by_id(client: WorkflowClient, search_response: WorkflowSearchResponse, mock_api_caller): raw_json = search_response.dict() mock_api_caller._call_api.return_value = raw_json assert search_response and search_response.hits and search_response.hits.hits - assert ( - client.find_run_by_id(id="atlan-snowflake-miner-1714638976-mzdza") - == search_response.hits.hits[0] - ) + assert client.find_run_by_id(id="atlan-snowflake-miner-1714638976-mzdza") == search_response.hits.hits[0] mock_api_caller._call_api.assert_called_once() assert mock_api_caller._call_api.call_args.args[0] == WORKFLOW_INDEX_RUN_SEARCH - assert isinstance( - mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest - ) + assert isinstance(mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest) def test_re_run_when_given_workflowpackage_with_no_prior_runs_raises_invalid_request_error( @@ -375,10 +359,7 @@ def test_re_run_when_given_workflowpackage_with_idempotent( search_response.dict(), ] - assert ( - client.rerun(WorkflowPackage.FIVETRAN, idempotent=True) - == rerun_response_with_idempotent - ) + assert client.rerun(WorkflowPackage.FIVETRAN, idempotent=True) == rerun_response_with_idempotent assert mock_api_caller._call_api.call_count == 2 mock_api_caller.reset_mock() @@ -393,10 +374,7 @@ def test_re_run_when_given_workflowsearchresultdetail_with_idempotent( ): mock_api_caller._call_api.return_value = search_response.dict() - assert ( - client.rerun(workflow=search_result_detail, idempotent=True) - == rerun_response_with_idempotent - ) + assert client.rerun(workflow=search_result_detail, idempotent=True) == rerun_response_with_idempotent assert mock_api_caller._call_api.call_count == 1 mock_api_caller.reset_mock() @@ -411,10 +389,7 @@ def test_re_run_when_given_workflowsearchresult_with_idempotent( ): mock_api_caller._call_api.return_value = search_response.dict() - assert ( - client.rerun(workflow=search_result, idempotent=True) - == rerun_response_with_idempotent - ) + assert client.rerun(workflow=search_result, idempotent=True) == rerun_response_with_idempotent assert mock_api_caller._call_api.call_count == 1 mock_api_caller.reset_mock() @@ -429,9 +404,7 @@ def test_run_when_given_workflow( Workflow( metadata=WorkflowMetadata(name="name", namespace="namespace"), spec=WorkflowSpec(), - payload=[ - PackageParameter(parameter="test-param", type="test-type", body={}) - ], + payload=[PackageParameter(parameter="test-param", type="test-type", body={})], ) # type: ignore[call-arg] ) assert response == workflow_response @@ -469,9 +442,7 @@ def test_run_when_given_workflow_with_schedule( Workflow( metadata=WorkflowMetadata(name="name", namespace="namespace"), spec=WorkflowSpec(), - payload=[ - PackageParameter(parameter="test-param", type="test-type", body={}) - ], + payload=[PackageParameter(parameter="test-param", type="test-type", body={})], ), # type: ignore[call-arg] workflow_schedule=schedule, ) @@ -574,9 +545,7 @@ def test_workflow_add_schedule( mock_api_caller._call_api.side_effect = [ workflow_response.dict(), ] - response = client.add_schedule( - workflow=workflow_response, workflow_schedule=schedule - ) + response = client.add_schedule(workflow=workflow_response, workflow_schedule=schedule) assert mock_api_caller._call_api.call_count == 1 assert response == WorkflowResponse(**workflow_response.dict()) @@ -587,9 +556,7 @@ def test_workflow_add_schedule( search_response.dict(), workflow_response.dict(), ] - response = client.add_schedule( - workflow=WorkflowPackage.FIVETRAN, workflow_schedule=schedule - ) + response = client.add_schedule(workflow=WorkflowPackage.FIVETRAN, workflow_schedule=schedule) assert mock_api_caller._call_api.call_count == 2 assert response == WorkflowResponse(**workflow_response.dict()) @@ -616,16 +583,9 @@ def test_workflow_find_schedule_query_between( ) assert mock_api_caller._call_api.call_count == 1 - assert ( - response - and len(response) == 1 - and response[0] == WorkflowRunResponse(**workflow_run_response.dict()) - ) + assert response and len(response) == 1 and response[0] == WorkflowRunResponse(**workflow_run_response.dict()) # Ensure it is called by the correct API endpoint - assert ( - mock_api_caller._call_api.call_args[0][0].path - == SCHEDULE_QUERY_WORKFLOWS_SEARCH.path - ) + assert mock_api_caller._call_api.call_args[0][0].path == SCHEDULE_QUERY_WORKFLOWS_SEARCH.path mock_api_caller.reset_mock() # Missed schedule query workflows @@ -640,15 +600,8 @@ def test_workflow_find_schedule_query_between( assert mock_api_caller._call_api.call_count == 1 # Ensure it is called by the correct API endpoint - assert ( - mock_api_caller._call_api.call_args[0][0].path - == SCHEDULE_QUERY_WORKFLOWS_MISSED.path - ) - assert ( - response - and len(response) == 1 - and response[0] == WorkflowRunResponse(**workflow_run_response.dict()) - ) + assert mock_api_caller._call_api.call_args[0][0].path == SCHEDULE_QUERY_WORKFLOWS_MISSED.path + assert response and len(response) == 1 and response[0] == WorkflowRunResponse(**workflow_run_response.dict()) mock_api_caller.reset_mock() # None response @@ -672,9 +625,7 @@ def test_workflow_find_schedule_query( search_result: WorkflowSearchResult, ): mock_api_caller._call_api.return_value = search_response.dict() - response = client.find_schedule_query( - saved_query_id="test-query-id", max_results=50 - ) + response = client.find_schedule_query(saved_query_id="test-query-id", max_results=50) assert len(response) == 1 assert mock_api_caller._call_api.call_count == 1 From 1448606285eac8c79bf10efcb208bca13c468d3d Mon Sep 17 00:00:00 2001 From: Aryamanz29 Date: Mon, 24 Feb 2025 23:49:07 +0530 Subject: [PATCH 03/10] [deps] Pinned deps for `pip-audit` check --- requirements-dev.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index c0b933707..85885d18b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -mypy~=1.15.0 +mypy~=1.14.0 ruff~=0.9.7 types-requests~=2.32.0.20241016 pytest~=8.3.4 @@ -6,10 +6,10 @@ pytest-order~=1.3.0 pytest-timer[termcolor]~=1.0.0 pytest-sugar~=1.0.0 retry~=0.9.2 -pre-commit~=4.1.0 +pre-commit~=3.5.0 deepdiff~=7.0.1 -pytest-cov~=6.0.0 +pytest-cov~=5.0.0 twine~=6.1.0 types-retry~=0.9.9.20241221 -networkx~=3.4.2 +networkx~=3.1.0 networkx-stubs~=0.0.1 From 8d8c69aef5a413679e7981228ad912ecb8c43b95 Mon Sep 17 00:00:00 2001 From: Aryamanz29 Date: Tue, 25 Feb 2025 00:11:52 +0530 Subject: [PATCH 04/10] [ci] Added coverage to unit and integration tests --- .github/workflows/pyatlan-pr.yaml | 74 ++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pyatlan-pr.yaml b/.github/workflows/pyatlan-pr.yaml index 9510a467b..e2537e98b 100644 --- a/.github/workflows/pyatlan-pr.yaml +++ b/.github/workflows/pyatlan-pr.yaml @@ -68,10 +68,14 @@ jobs: env: # Test tenant environment variables ATLAN_API_KEY: ${{ secrets.ATLAN_API_KEY }} ATLAN_BASE_URL: ${{ secrets.ATLAN_BASE_URL }} - MARK_API_KEY: ${{ secrets.MARK_ATLAN_API_KEY }} - MARK_BASE_URL: https://mark.atlan.com - # Run with `pytest-sugar` for enhancing the overall test report output - run: pytest tests/unit --force-sugar + run: pytest tests/unit --cov=atlan --cov-report=xml --cov-report=term --cov-append + + - name: Upload unit test coverage + uses: actions/upload-artifact@v4 + with: + name: coverage-data + path: .coverage + retention-days: 7 - name: Prepare integration tests distribution id: distribute-integration-test-files @@ -108,14 +112,64 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - - name: Run integration tests - env: # Test tenant environment variables + - name: Download unit test coverage + uses: actions/download-artifact@v4 + with: + name: coverage-data + path: . + + - name: Run integration test with coverage + env: ATLAN_API_KEY: ${{ secrets.ATLAN_API_KEY }} ATLAN_BASE_URL: ${{ secrets.ATLAN_BASE_URL }} uses: nick-fields/retry@v3 with: max_attempts: 3 - timeout_minutes: 10 # Maximum time per test job; otherwise, the job will fail - # Run the integration test file using `pytest-timer` plugin - # to display only the durations of the 10 slowest tests with `pytest-sugar` - command: pytest ${{ matrix.test_file }} -p name_of_plugin --timer-top-n 10 --force-sugar + timeout_minutes: 10 + command: pytest ${{ matrix.test_file }} --cov=atlan --cov-append --cov-report=xml --cov-report=term + + - name: Upload integration test coverage + uses: actions/upload-artifact@v4 + with: + name: coverage-data + path: .coverage + retention-days: 7 + + finalize-coverage: + needs: [integration-tests] + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: "3.9" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest pytest-cov + + - name: Download all coverage data + uses: actions/download-artifact@v4 + with: + name: coverage-data + path: . + + - name: Combine coverage reports + run: | + pytest --cov=atlan --cov-report=html --cov-report=xml --cov-append + + - name: Upload final coverage report + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: htmlcov + retention-days: 7 + + - name: Check coverage threshold + run: | + coverage report --fail-under=80 # Adjust threshold as needed From 03e20eb3e43777497537933be0ccfbafb2221bac Mon Sep 17 00:00:00 2001 From: Aryamanz29 Date: Tue, 25 Feb 2025 00:21:19 +0530 Subject: [PATCH 05/10] [ci] Updated ruff job name --- .github/workflows/pyatlan-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pyatlan-pr.yaml b/.github/workflows/pyatlan-pr.yaml index e2537e98b..0e10c6c86 100644 --- a/.github/workflows/pyatlan-pr.yaml +++ b/.github/workflows/pyatlan-pr.yaml @@ -60,7 +60,7 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - - name: QA checks (black, flake8, mypy) + - name: QA checks (ruff-formatter, ruff-linter, mypy) run: | ./qa-checks From 90250d6ce33844f7f501ded09845cf4b50bc646c Mon Sep 17 00:00:00 2001 From: Aryamanz29 Date: Tue, 25 Feb 2025 00:21:46 +0530 Subject: [PATCH 06/10] [mypy/py3.8] Fixed mypy issues for Python 3.8 --- tests/unit/test_client.py | 150 ++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 80 deletions(-) diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index b6ba5c07b..4badc281c 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -341,23 +341,21 @@ def test_append_with_valid_guid_and_no_terms_returns_asset(): terms = [] - with ( - patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute, - patch("pyatlan.client.asset.AssetClient.save") as mock_save, - ): - mock_execute.return_value.current_page = lambda: [table] + with patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute: + with patch("pyatlan.client.asset.AssetClient.save") as mock_save: + mock_execute.return_value.current_page = lambda: [table] - mock_save.return_value.assets_updated.return_value = [table] + mock_save.return_value.assets_updated.return_value = [table] - client = AtlanClient() - guid = "123" + client = AtlanClient() + guid = "123" - asset = client.asset.append_terms(guid=guid, asset_type=asset_type, terms=terms) + asset = client.asset.append_terms(guid=guid, asset_type=asset_type, terms=terms) - assert asset == table - assert asset.assigned_terms is None - mock_execute.assert_called_once() - mock_save.assert_called_once() + assert asset == table + assert asset.assigned_terms is None + mock_execute.assert_called_once() + mock_save.assert_called_once() def test_append_with_valid_guid_when_no_terms_present_returns_asset_with_given_terms(): @@ -368,25 +366,23 @@ def test_append_with_valid_guid_when_no_terms_present_returns_asset_with_given_t terms = [AtlasGlossaryTerm(qualified_name="term1")] - with ( - patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute, - patch("pyatlan.client.asset.AssetClient.save") as mock_save, - ): - mock_execute.return_value.current_page = lambda: [table] + with patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute: + with patch("pyatlan.client.asset.AssetClient.save") as mock_save: + mock_execute.return_value.current_page = lambda: [table] - def mock_save_side_effect(entity): - entity.assigned_terms = terms - return Mock(assets_updated=lambda asset_type: [entity]) + def mock_save_side_effect(entity): + entity.assigned_terms = terms + return Mock(assets_updated=lambda asset_type: [entity]) - mock_save.side_effect = mock_save_side_effect + mock_save.side_effect = mock_save_side_effect - client = AtlanClient() - guid = "123" - asset = client.asset.append_terms(guid=guid, asset_type=asset_type, terms=terms) + client = AtlanClient() + guid = "123" + asset = client.asset.append_terms(guid=guid, asset_type=asset_type, terms=terms) - assert asset.assigned_terms == terms - mock_execute.assert_called_once() - mock_save.assert_called_once() + assert asset.assigned_terms == terms + mock_execute.assert_called_once() + mock_save.assert_called_once() def test_append_with_valid_guid_when_terms_present_returns_asset_with_combined_terms(): @@ -401,30 +397,28 @@ def test_append_with_valid_guid_when_terms_present_returns_asset_with_combined_t new_term = AtlasGlossaryTerm(qualified_name="new_term") terms = [new_term] - with ( - patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute, - patch("pyatlan.client.asset.AssetClient.save") as mock_save, - ): - mock_execute.return_value.current_page = lambda: [table] + with patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute: + with patch("pyatlan.client.asset.AssetClient.save") as mock_save: + mock_execute.return_value.current_page = lambda: [table] - def mock_save_side_effect(entity): - entity.assigned_terms = table.attributes.meanings + terms - return Mock(assets_updated=lambda asset_type: [entity]) + def mock_save_side_effect(entity): + entity.assigned_terms = table.attributes.meanings + terms + return Mock(assets_updated=lambda asset_type: [entity]) - mock_save.side_effect = mock_save_side_effect + mock_save.side_effect = mock_save_side_effect - client = AtlanClient() - guid = "123" + client = AtlanClient() + guid = "123" - asset = client.asset.append_terms(guid=guid, asset_type=asset_type, terms=terms) + asset = client.asset.append_terms(guid=guid, asset_type=asset_type, terms=terms) - updated_terms = asset.assigned_terms - assert updated_terms is not None - assert len(updated_terms) == 2 - assert exisiting_term in updated_terms - assert new_term in updated_terms - mock_execute.assert_called_once() - mock_save.assert_called_once() + updated_terms = asset.assigned_terms + assert updated_terms is not None + assert len(updated_terms) == 2 + assert exisiting_term in updated_terms + assert new_term in updated_terms + mock_execute.assert_called_once() + mock_save.assert_called_once() @pytest.mark.parametrize( @@ -539,26 +533,24 @@ def test_replace_terms(): terms = [AtlasGlossaryTerm(qualified_name="new_term")] - with ( - patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute, - patch("pyatlan.client.asset.AssetClient.save") as mock_save, - ): - mock_execute.return_value.current_page = lambda: [table] + with patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute: + with patch("pyatlan.client.asset.AssetClient.save") as mock_save: + mock_execute.return_value.current_page = lambda: [table] - def mock_save_side_effect(entity): - entity.assigned_terms = terms - return Mock(assets_updated=lambda asset_type: [entity]) + def mock_save_side_effect(entity): + entity.assigned_terms = terms + return Mock(assets_updated=lambda asset_type: [entity]) - mock_save.side_effect = mock_save_side_effect + mock_save.side_effect = mock_save_side_effect - client = AtlanClient() - guid = "123" + client = AtlanClient() + guid = "123" - asset = client.asset.replace_terms(guid=guid, asset_type=asset_type, terms=terms) + asset = client.asset.replace_terms(guid=guid, asset_type=asset_type, terms=terms) - assert asset.assigned_terms == terms - mock_execute.assert_called_once() - mock_save.assert_called_once() + assert asset.assigned_terms == terms + mock_execute.assert_called_once() + mock_save.assert_called_once() @pytest.mark.parametrize( @@ -672,29 +664,27 @@ def test_remove_with_valid_guid_when_terms_present_returns_asset_with_terms_remo other_term = AtlasGlossaryTerm(qualified_name="other_term", guid="b267858d-8316-4c41-a56a-6e9b840cef4a") table.attributes.meanings = [existing_term, other_term] - with ( - patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute, - patch("pyatlan.client.asset.AssetClient.save") as mock_save, - ): - mock_execute.return_value.current_page = lambda: [table] + with patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute: + with patch("pyatlan.client.asset.AssetClient.save") as mock_save: + mock_execute.return_value.current_page = lambda: [table] - def mock_save_side_effect(entity): - entity.assigned_terms = [t for t in table.attributes.meanings if t != existing_term] - return Mock(assets_updated=lambda asset_type: [entity]) + def mock_save_side_effect(entity): + entity.assigned_terms = [t for t in table.attributes.meanings if t != existing_term] + return Mock(assets_updated=lambda asset_type: [entity]) - mock_save.side_effect = mock_save_side_effect + mock_save.side_effect = mock_save_side_effect - client = AtlanClient() - guid = "123" + client = AtlanClient() + guid = "123" - asset = client.asset.remove_terms(guid=guid, asset_type=asset_type, terms=[existing_term]) + asset = client.asset.remove_terms(guid=guid, asset_type=asset_type, terms=[existing_term]) - updated_terms = asset.assigned_terms - assert updated_terms is not None - assert len(updated_terms) == 1 - assert other_term in updated_terms - mock_execute.assert_called_once() - mock_save.assert_called_once() + updated_terms = asset.assigned_terms + assert updated_terms is not None + assert len(updated_terms) == 1 + assert other_term in updated_terms + mock_execute.assert_called_once() + mock_save.assert_called_once() def test_register_client_with_bad_parameter_raises_value_error(client): From 758951a8f2a278b0cb81e27dac0cc323cf639c48 Mon Sep 17 00:00:00 2001 From: Aryamanz29 Date: Tue, 25 Feb 2025 00:41:59 +0530 Subject: [PATCH 07/10] [ci] Fixed coverage jobs --- .github/workflows/pyatlan-pr.yaml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pyatlan-pr.yaml b/.github/workflows/pyatlan-pr.yaml index 0e10c6c86..49dd38a71 100644 --- a/.github/workflows/pyatlan-pr.yaml +++ b/.github/workflows/pyatlan-pr.yaml @@ -61,14 +61,14 @@ jobs: if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - name: QA checks (ruff-formatter, ruff-linter, mypy) - run: | - ./qa-checks + run: ./qa-checks - name: Run unit tests env: # Test tenant environment variables ATLAN_API_KEY: ${{ secrets.ATLAN_API_KEY }} ATLAN_BASE_URL: ${{ secrets.ATLAN_BASE_URL }} - run: pytest tests/unit --cov=atlan --cov-report=xml --cov-report=term --cov-append + run: | + pytest tests/unit --cov=atlan --cov-report=xml --cov-report=term --cov-append - name: Upload unit test coverage uses: actions/upload-artifact@v4 @@ -126,7 +126,7 @@ jobs: with: max_attempts: 3 timeout_minutes: 10 - command: pytest ${{ matrix.test_file }} --cov=atlan --cov-append --cov-report=xml --cov-report=term + command: pytest ${{ matrix.test_file }} --cov=atlan --cov-append --cov-report=xml --cov-report=term || true - name: Upload integration test coverage uses: actions/upload-artifact@v4 @@ -161,7 +161,10 @@ jobs: - name: Combine coverage reports run: | - pytest --cov=atlan --cov-report=html --cov-report=xml --cov-append + coverage combine + coverage report --fail-under=10 + coverage xml + coverage html - name: Upload final coverage report uses: actions/upload-artifact@v4 @@ -169,7 +172,3 @@ jobs: name: coverage-report path: htmlcov retention-days: 7 - - - name: Check coverage threshold - run: | - coverage report --fail-under=80 # Adjust threshold as needed From 73ca66ff4e52b7269aef0811346dd3e44b754b6a Mon Sep 17 00:00:00 2001 From: Aryamanz29 Date: Tue, 25 Feb 2025 01:19:26 +0530 Subject: [PATCH 08/10] [deps] Pinned mypy to make sure its works for Python 3.8 - 3.13 --- qa-checks | 2 +- requirements-dev.txt | 2 +- ruff.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qa-checks b/qa-checks index 13cbc4fe4..e8985e85e 100755 --- a/qa-checks +++ b/qa-checks @@ -22,7 +22,7 @@ ruff-formatter-check() { # Linter ruff-linter-check() { - perform_check "ruff check 🕵️" "ruff check ." " ruff check ." + perform_check "ruff check 🕵️ " "ruff check ." " ruff check ." } # Static type checker diff --git a/requirements-dev.txt b/requirements-dev.txt index 85885d18b..bac3f4a45 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -mypy~=1.14.0 +mypy~=1.9.0 ruff~=0.9.7 types-requests~=2.32.0.20241016 pytest~=8.3.4 diff --git a/ruff.toml b/ruff.toml index 83185f829..f36a2e075 100644 --- a/ruff.toml +++ b/ruff.toml @@ -18,7 +18,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ########################################################################## -line-length = 120 +line-length = 88 exclude = ["env", "venv", "__pycache__", "pyatlan/model/assets/__init__.py", "pyatlan/model/structs/__init__.py"] # Ignore `E402` (import violations) in all `__init__.py` files, and in selected subdirectories. From bececb200df9359a19589d2a886d838395f32655 Mon Sep 17 00:00:00 2001 From: Aryamanz29 Date: Tue, 25 Feb 2025 01:21:53 +0530 Subject: [PATCH 09/10] [ruff-migration] Used default `line-length = 88` --- check_tag.py | 8 +- pyatlan/cache/abstract_asset_cache.py | 8 +- pyatlan/cache/connection_cache.py | 16 +- pyatlan/cache/custom_metadata_cache.py | 44 +- pyatlan/cache/group_cache.py | 4 +- pyatlan/cache/role_cache.py | 4 +- pyatlan/cache/source_tag_cache.py | 12 +- pyatlan/cache/user_cache.py | 16 +- pyatlan/client/admin.py | 16 +- pyatlan/client/asset.py | 388 ++++- pyatlan/client/atlan.py | 185 ++- pyatlan/client/audit.py | 30 +- pyatlan/client/common.py | 4 +- pyatlan/client/constants.py | 167 +- pyatlan/client/contract.py | 8 +- pyatlan/client/credential.py | 20 +- pyatlan/client/file.py | 24 +- pyatlan/client/group.py | 20 +- pyatlan/client/impersonate.py | 24 +- pyatlan/client/open_lineage.py | 31 +- pyatlan/client/query.py | 4 +- pyatlan/client/role.py | 8 +- pyatlan/client/search_log.py | 68 +- pyatlan/client/sso.py | 36 +- pyatlan/client/task.py | 13 +- pyatlan/client/token.py | 16 +- pyatlan/client/typedef.py | 36 +- pyatlan/client/user.py | 49 +- pyatlan/client/workflow.py | 98 +- pyatlan/errors.py | 4 +- pyatlan/events/atlan_event_handler.py | 14 +- pyatlan/events/atlan_lambda_handler.py | 8 +- pyatlan/generator/class_generator.py | 150 +- pyatlan/model/aggregation.py | 15 +- pyatlan/model/api_tokens.py | 51 +- pyatlan/model/assets/a_d_l_s.py | 28 +- pyatlan/model/assets/a_d_l_s_account.py | 144 +- pyatlan/model/assets/a_d_l_s_container.py | 96 +- pyatlan/model/assets/a_d_l_s_object.py | 221 ++- pyatlan/model/assets/a_p_i.py | 42 +- pyatlan/model/assets/a_p_i_field.py | 95 +- pyatlan/model/assets/a_p_i_object.py | 20 +- pyatlan/model/assets/a_p_i_path.py | 74 +- pyatlan/model/assets/a_p_i_query.py | 69 +- pyatlan/model/assets/a_p_i_spec.py | 72 +- pyatlan/model/assets/a_w_s.py | 16 +- pyatlan/model/assets/anaplan.py | 62 +- pyatlan/model/assets/anaplan_app.py | 24 +- pyatlan/model/assets/anaplan_dimension.py | 28 +- pyatlan/model/assets/anaplan_line_item.py | 34 +- pyatlan/model/assets/anaplan_list.py | 24 +- pyatlan/model/assets/anaplan_model.py | 32 +- pyatlan/model/assets/anaplan_module.py | 20 +- pyatlan/model/assets/anaplan_page.py | 32 +- .../model/assets/anaplan_system_dimension.py | 12 +- pyatlan/model/assets/anaplan_view.py | 62 +- pyatlan/model/assets/anaplan_workspace.py | 56 +- pyatlan/model/assets/auth_service.py | 34 +- pyatlan/model/assets/azure.py | 22 +- pyatlan/model/assets/azure_event_hub.py | 28 +- pyatlan/model/assets/azure_service_bus.py | 54 +- .../assets/azure_service_bus_namespace.py | 14 +- .../model/assets/azure_service_bus_schema.py | 14 +- .../model/assets/azure_service_bus_topic.py | 28 +- pyatlan/model/assets/badge.py | 26 +- pyatlan/model/assets/bigquery_tag.py | 152 +- pyatlan/model/assets/business_policy.py | 174 +- .../model/assets/business_policy_exception.py | 86 +- .../model/assets/business_policy_incident.py | 54 +- pyatlan/model/assets/business_policy_log.py | 54 +- pyatlan/model/assets/cognite3_d_model.py | 4 +- pyatlan/model/assets/cognite_asset.py | 20 +- pyatlan/model/assets/cognite_event.py | 4 +- pyatlan/model/assets/cognite_file.py | 4 +- pyatlan/model/assets/cognite_sequence.py | 4 +- pyatlan/model/assets/cognite_time_series.py | 4 +- pyatlan/model/assets/cognos.py | 32 +- pyatlan/model/assets/cognos_dashboard.py | 4 +- pyatlan/model/assets/cognos_datasource.py | 18 +- pyatlan/model/assets/cognos_exploration.py | 4 +- pyatlan/model/assets/cognos_file.py | 4 +- pyatlan/model/assets/cognos_folder.py | 68 +- pyatlan/model/assets/cognos_module.py | 4 +- pyatlan/model/assets/cognos_package.py | 4 +- pyatlan/model/assets/cognos_report.py | 4 +- pyatlan/model/assets/collection.py | 4 +- pyatlan/model/assets/connection.py | 186 ++- pyatlan/model/assets/core/a_d_f.py | 12 +- pyatlan/model/assets/core/access_control.py | 56 +- pyatlan/model/assets/core/adf_activity.py | 214 ++- pyatlan/model/assets/core/adf_dataflow.py | 28 +- pyatlan/model/assets/core/adf_dataset.py | 112 +- .../model/assets/core/adf_linkedservice.py | 224 ++- pyatlan/model/assets/core/adf_pipeline.py | 44 +- pyatlan/model/assets/core/airflow.py | 56 +- pyatlan/model/assets/core/airflow_dag.py | 22 +- pyatlan/model/assets/core/airflow_task.py | 96 +- pyatlan/model/assets/core/anomalo_check.py | 138 +- pyatlan/model/assets/core/application.py | 44 +- .../model/assets/core/application_field.py | 52 +- pyatlan/model/assets/core/asset.py | 1465 +++++++++++++---- pyatlan/model/assets/core/atlas_glossary.py | 56 +- .../assets/core/atlas_glossary_category.py | 70 +- .../model/assets/core/atlas_glossary_term.py | 106 +- pyatlan/model/assets/core/auth_policy.py | 94 +- pyatlan/model/assets/core/b_i_process.py | 8 +- pyatlan/model/assets/core/calculation_view.py | 48 +- pyatlan/model/assets/core/catalog.py | 98 +- pyatlan/model/assets/core/column.py | 415 +++-- pyatlan/model/assets/core/column_process.py | 12 +- .../assets/core/cosmos_mongo_d_b_account.py | 276 +++- .../core/cosmos_mongo_d_b_collection.py | 490 ++++-- .../assets/core/cosmos_mongo_d_b_database.py | 206 ++- pyatlan/model/assets/core/data_contract.py | 102 +- pyatlan/model/assets/core/data_domain.py | 32 +- pyatlan/model/assets/core/data_mesh.py | 16 +- pyatlan/model/assets/core/data_product.py | 204 ++- pyatlan/model/assets/core/database.py | 32 +- .../core/databricks_unity_catalog_tag.py | 114 +- pyatlan/model/assets/core/dbt.py | 76 +- pyatlan/model/assets/core/dbt_metric.py | 144 +- pyatlan/model/assets/core/dbt_model.py | 120 +- pyatlan/model/assets/core/dbt_model_column.py | 50 +- pyatlan/model/assets/core/dbt_source.py | 16 +- pyatlan/model/assets/core/dbt_test.py | 52 +- .../assets/core/dynamo_d_b_secondary_index.py | 270 ++- pyatlan/model/assets/core/file.py | 24 +- pyatlan/model/assets/core/fivetran.py | 44 +- .../model/assets/core/fivetran_connector.py | 610 +++++-- pyatlan/model/assets/core/folder.py | 22 +- pyatlan/model/assets/core/function.py | 40 +- pyatlan/model/assets/core/link.py | 22 +- pyatlan/model/assets/core/m_c_incident.py | 44 +- pyatlan/model/assets/core/m_c_monitor.py | 176 +- .../model/assets/core/materialised_view.py | 49 +- pyatlan/model/assets/core/matillion.py | 4 +- .../model/assets/core/matillion_component.py | 108 +- pyatlan/model/assets/core/matillion_group.py | 12 +- pyatlan/model/assets/core/matillion_job.py | 64 +- .../model/assets/core/matillion_project.py | 40 +- pyatlan/model/assets/core/metric.py | 38 +- pyatlan/model/assets/core/model.py | 82 +- pyatlan/model/assets/core/model_attribute.py | 170 +- .../core/model_attribute_association.py | 98 +- pyatlan/model/assets/core/model_data_model.py | 8 +- pyatlan/model/assets/core/model_entity.py | 202 ++- .../assets/core/model_entity_association.py | 216 ++- pyatlan/model/assets/core/model_version.py | 26 +- .../model/assets/core/mongo_d_b_collection.py | 400 ++++- .../model/assets/core/mongo_d_b_database.py | 122 +- pyatlan/model/assets/core/monte_carlo.py | 14 +- pyatlan/model/assets/core/namespace.py | 8 +- pyatlan/model/assets/core/no_s_q_l.py | 10 +- pyatlan/model/assets/core/persona.py | 16 +- pyatlan/model/assets/core/power_b_i.py | 42 +- pyatlan/model/assets/core/power_b_i_column.py | 66 +- .../model/assets/core/power_b_i_dashboard.py | 14 +- .../model/assets/core/power_b_i_dataflow.py | 124 +- .../core/power_b_i_dataflow_entity_column.py | 72 +- .../model/assets/core/power_b_i_dataset.py | 30 +- .../model/assets/core/power_b_i_datasource.py | 16 +- .../model/assets/core/power_b_i_measure.py | 46 +- pyatlan/model/assets/core/power_b_i_page.py | 18 +- pyatlan/model/assets/core/power_b_i_report.py | 30 +- pyatlan/model/assets/core/power_b_i_table.py | 82 +- pyatlan/model/assets/core/power_b_i_tile.py | 28 +- .../model/assets/core/power_b_i_workspace.py | 24 +- pyatlan/model/assets/core/procedure.py | 17 +- pyatlan/model/assets/core/process.py | 40 +- pyatlan/model/assets/core/query.py | 100 +- pyatlan/model/assets/core/readme.py | 38 +- pyatlan/model/assets/core/referenceable.py | 69 +- pyatlan/model/assets/core/resource.py | 8 +- pyatlan/model/assets/core/s_q_l.py | 102 +- pyatlan/model/assets/core/schema.py | 80 +- pyatlan/model/assets/core/schema_registry.py | 24 +- .../assets/core/schema_registry_subject.py | 102 +- pyatlan/model/assets/core/snowflake_pipe.py | 50 +- pyatlan/model/assets/core/snowflake_stream.py | 54 +- pyatlan/model/assets/core/snowflake_tag.py | 118 +- pyatlan/model/assets/core/soda_check.py | 48 +- pyatlan/model/assets/core/spark.py | 40 +- pyatlan/model/assets/core/spark_job.py | 8 +- pyatlan/model/assets/core/stakeholder.py | 42 +- .../model/assets/core/stakeholder_title.py | 22 +- pyatlan/model/assets/core/table.py | 149 +- pyatlan/model/assets/core/table_partition.py | 97 +- pyatlan/model/assets/core/tag.py | 12 +- pyatlan/model/assets/core/view.py | 45 +- pyatlan/model/assets/cube.py | 8 +- pyatlan/model/assets/cube_dimension.py | 8 +- pyatlan/model/assets/cube_field.py | 64 +- pyatlan/model/assets/cube_hierarchy.py | 12 +- pyatlan/model/assets/custom_entity.py | 76 +- pyatlan/model/assets/data_studio.py | 118 +- pyatlan/model/assets/data_studio_asset.py | 82 +- pyatlan/model/assets/dataverse.py | 16 +- pyatlan/model/assets/dataverse_attribute.py | 94 +- pyatlan/model/assets/dataverse_entity.py | 32 +- pyatlan/model/assets/dbt_column_process.py | 126 +- pyatlan/model/assets/dbt_process.py | 120 +- pyatlan/model/assets/dbt_tag.py | 88 +- pyatlan/model/assets/domo_card.py | 26 +- pyatlan/model/assets/domo_dashboard.py | 42 +- pyatlan/model/assets/domo_dataset.py | 46 +- pyatlan/model/assets/domo_dataset_column.py | 20 +- pyatlan/model/assets/dynamo_d_b.py | 54 +- .../dynamo_d_b_global_secondary_index.py | 4 +- .../dynamo_d_b_local_secondary_index.py | 4 +- pyatlan/model/assets/dynamo_dbtable.py | 312 +++- pyatlan/model/assets/g_c_s.py | 142 +- pyatlan/model/assets/g_c_s_bucket.py | 104 +- pyatlan/model/assets/g_c_s_object.py | 140 +- pyatlan/model/assets/google.py | 20 +- pyatlan/model/assets/incident.py | 8 +- pyatlan/model/assets/kafka_consumer_group.py | 60 +- pyatlan/model/assets/kafka_topic.py | 158 +- pyatlan/model/assets/looker_dashboard.py | 56 +- pyatlan/model/assets/looker_explore.py | 24 +- pyatlan/model/assets/looker_field.py | 126 +- pyatlan/model/assets/looker_folder.py | 34 +- pyatlan/model/assets/looker_look.py | 66 +- pyatlan/model/assets/looker_model.py | 16 +- pyatlan/model/assets/looker_project.py | 48 +- pyatlan/model/assets/looker_query.py | 36 +- pyatlan/model/assets/looker_tile.py | 16 +- pyatlan/model/assets/looker_view.py | 24 +- pyatlan/model/assets/metabase.py | 24 +- pyatlan/model/assets/metabase_collection.py | 38 +- pyatlan/model/assets/metabase_dashboard.py | 16 +- pyatlan/model/assets/metabase_question.py | 22 +- pyatlan/model/assets/micro_strategy.py | 150 +- .../model/assets/micro_strategy_attribute.py | 62 +- pyatlan/model/assets/micro_strategy_cube.py | 62 +- .../model/assets/micro_strategy_document.py | 16 +- .../model/assets/micro_strategy_dossier.py | 50 +- pyatlan/model/assets/micro_strategy_fact.py | 46 +- pyatlan/model/assets/micro_strategy_metric.py | 216 ++- .../model/assets/micro_strategy_project.py | 98 +- pyatlan/model/assets/micro_strategy_report.py | 48 +- .../assets/micro_strategy_visualization.py | 84 +- pyatlan/model/assets/mode.py | 34 +- pyatlan/model/assets/mode_chart.py | 8 +- pyatlan/model/assets/mode_collection.py | 20 +- pyatlan/model/assets/mode_query.py | 18 +- pyatlan/model/assets/mode_report.py | 50 +- pyatlan/model/assets/mode_workspace.py | 12 +- .../model/assets/multi_dimensional_dataset.py | 36 +- pyatlan/model/assets/preset.py | 44 +- pyatlan/model/assets/preset_chart.py | 50 +- pyatlan/model/assets/preset_dashboard.py | 136 +- pyatlan/model/assets/preset_dataset.py | 58 +- pyatlan/model/assets/preset_workspace.py | 138 +- pyatlan/model/assets/purpose.py | 44 +- pyatlan/model/assets/qlik.py | 18 +- pyatlan/model/assets/qlik_app.py | 44 +- pyatlan/model/assets/qlik_chart.py | 24 +- pyatlan/model/assets/qlik_dataset.py | 18 +- pyatlan/model/assets/qlik_sheet.py | 16 +- pyatlan/model/assets/qlik_space.py | 12 +- pyatlan/model/assets/quick_sight.py | 12 +- pyatlan/model/assets/quick_sight_analysis.py | 96 +- .../assets/quick_sight_analysis_visual.py | 26 +- pyatlan/model/assets/quick_sight_dashboard.py | 76 +- .../assets/quick_sight_dashboard_visual.py | 42 +- pyatlan/model/assets/quick_sight_dataset.py | 72 +- .../model/assets/quick_sight_dataset_field.py | 44 +- pyatlan/model/assets/quick_sight_folder.py | 62 +- pyatlan/model/assets/redash.py | 4 +- pyatlan/model/assets/redash_dashboard.py | 14 +- pyatlan/model/assets/redash_query.py | 90 +- pyatlan/model/assets/redash_visualization.py | 16 +- pyatlan/model/assets/s3.py | 20 +- pyatlan/model/assets/s3_bucket.py | 34 +- pyatlan/model/assets/s3_object.py | 70 +- pyatlan/model/assets/salesforce.py | 10 +- pyatlan/model/assets/salesforce_dashboard.py | 8 +- pyatlan/model/assets/salesforce_field.py | 42 +- pyatlan/model/assets/salesforce_object.py | 12 +- .../model/assets/salesforce_organization.py | 12 +- pyatlan/model/assets/salesforce_report.py | 12 +- pyatlan/model/assets/sigma.py | 42 +- pyatlan/model/assets/sigma_data_element.py | 50 +- .../model/assets/sigma_data_element_field.py | 40 +- pyatlan/model/assets/sigma_dataset.py | 22 +- pyatlan/model/assets/sigma_dataset_column.py | 14 +- pyatlan/model/assets/sigma_page.py | 22 +- pyatlan/model/assets/sigma_workbook.py | 8 +- pyatlan/model/assets/sisense_dashboard.py | 54 +- pyatlan/model/assets/sisense_datamodel.py | 124 +- .../model/assets/sisense_datamodel_table.py | 144 +- pyatlan/model/assets/sisense_folder.py | 64 +- pyatlan/model/assets/sisense_widget.py | 86 +- pyatlan/model/assets/superset.py | 26 +- pyatlan/model/assets/superset_chart.py | 56 +- pyatlan/model/assets/superset_dashboard.py | 140 +- pyatlan/model/assets/superset_dataset.py | 62 +- .../model/assets/tableau_calculated_field.py | 68 +- pyatlan/model/assets/tableau_dashboard.py | 50 +- pyatlan/model/assets/tableau_datasource.py | 90 +- .../model/assets/tableau_datasource_field.py | 186 ++- pyatlan/model/assets/tableau_flow.py | 50 +- pyatlan/model/assets/tableau_metric.py | 38 +- pyatlan/model/assets/tableau_project.py | 58 +- pyatlan/model/assets/tableau_site.py | 4 +- pyatlan/model/assets/tableau_workbook.py | 58 +- pyatlan/model/assets/tableau_worksheet.py | 66 +- pyatlan/model/assets/tag_attachment.py | 6 +- pyatlan/model/assets/task.py | 60 +- pyatlan/model/assets/thoughtspot.py | 36 +- pyatlan/model/assets/thoughtspot_column.py | 96 +- pyatlan/model/assets/thoughtspot_dashlet.py | 40 +- pyatlan/model/assets/thoughtspot_liveboard.py | 8 +- pyatlan/model/assets/thoughtspot_table.py | 8 +- pyatlan/model/assets/thoughtspot_view.py | 8 +- pyatlan/model/assets/thoughtspot_worksheet.py | 8 +- pyatlan/model/assets/workflow.py | 44 +- pyatlan/model/assets/workflow_run.py | 90 +- pyatlan/model/atlan_image.py | 40 +- pyatlan/model/audit.py | 49 +- pyatlan/model/contract.py | 80 +- pyatlan/model/core.py | 54 +- pyatlan/model/credential.py | 12 +- pyatlan/model/custom_metadata.py | 17 +- pyatlan/model/data_mesh.py | 16 +- pyatlan/model/enums.py | 32 +- pyatlan/model/events.py | 28 +- pyatlan/model/fields/atlan_fields.py | 164 +- pyatlan/model/fluent_search.py | 58 +- pyatlan/model/group.py | 60 +- pyatlan/model/keycloak_events.py | 64 +- pyatlan/model/lineage.py | 130 +- pyatlan/model/lineage_ref.py | 8 +- pyatlan/model/open_lineage/base.py | 4 +- .../open_lineage/column_lineage_dataset.py | 16 +- pyatlan/model/open_lineage/dataset.py | 4 +- pyatlan/model/open_lineage/event.py | 8 +- pyatlan/model/open_lineage/facet.py | 14 +- pyatlan/model/open_lineage/input_dataset.py | 4 +- pyatlan/model/open_lineage/job.py | 12 +- pyatlan/model/open_lineage/output_dataset.py | 14 +- pyatlan/model/open_lineage/run.py | 4 +- pyatlan/model/open_lineage/utils.py | 4 +- .../packages/api_token_connection_admin.py | 8 +- pyatlan/model/packages/asset_export_basic.py | 16 +- pyatlan/model/packages/asset_import.py | 36 +- pyatlan/model/packages/base/miner.py | 4 +- pyatlan/model/packages/base/package.py | 14 +- pyatlan/model/packages/big_query_crawler.py | 16 +- .../model/packages/confluent_kafka_crawler.py | 12 +- pyatlan/model/packages/connection_delete.py | 4 +- pyatlan/model/packages/databricks_crawler.py | 44 +- pyatlan/model/packages/databricks_miner.py | 24 +- pyatlan/model/packages/dbt_crawler.py | 28 +- pyatlan/model/packages/dynamo_d_b_crawler.py | 16 +- pyatlan/model/packages/glue_crawler.py | 24 +- pyatlan/model/packages/lineage_builder.py | 4 +- pyatlan/model/packages/mongodb_crawler.py | 16 +- pyatlan/model/packages/oracle_crawler.py | 34 +- pyatlan/model/packages/postgres_crawler.py | 16 +- pyatlan/model/packages/powerbi_crawler.py | 24 +- .../packages/relational_assets_builder.py | 24 +- .../model/packages/s_q_l_server_crawler.py | 24 +- pyatlan/model/packages/sigma_crawler.py | 12 +- pyatlan/model/packages/snowflake_crawler.py | 40 +- pyatlan/model/packages/snowflake_miner.py | 24 +- pyatlan/model/packages/sql_server_crawler.py | 28 +- pyatlan/model/packages/tableau_crawler.py | 16 +- pyatlan/model/query.py | 132 +- pyatlan/model/response.py | 28 +- pyatlan/model/role.py | 16 +- pyatlan/model/search.py | 48 +- pyatlan/model/search_log.py | 102 +- pyatlan/model/sso.py | 8 +- pyatlan/model/structs.py | 36 +- pyatlan/model/suggestions.py | 73 +- pyatlan/model/task.py | 52 +- pyatlan/model/typedef.py | 229 ++- pyatlan/model/user.py | 120 +- pyatlan/model/utils.py | 4 +- pyatlan/model/workflow.py | 8 +- pyatlan/multipart_data_generator.py | 8 +- pyatlan/pkg/create_package_files.py | 4 +- pyatlan/pkg/models.py | 8 +- pyatlan/pkg/ui.py | 4 +- pyatlan/pkg/utils.py | 37 +- pyatlan/pkg/widgets.py | 16 +- .../custom_metadata/deploy_branded_cm.py | 4 +- .../custom_metadata/update_cm_on_assets.py | 24 +- pyatlan/samples/events/lambda_enforcer.py | 10 +- pyatlan/samples/events/lambda_scorer.py | 25 +- pyatlan/samples/search/and_star_assets.py | 18 +- .../samples/search/and_traverse_lineage.py | 9 +- pyatlan/test_utils/__init__.py | 62 +- pyatlan/utils.py | 66 +- setup.py | 4 +- tests/integration/adls_asset_test.py | 55 +- tests/integration/admin_test.py | 6 +- tests/integration/airflow_asset_test.py | 36 +- tests/integration/anaplan_asset_test.py | 181 +- tests/integration/api_asset_test.py | 320 +++- tests/integration/app_asset_test.py | 44 +- .../integration/azure_event_hub_asset_test.py | 16 +- tests/integration/connection_test.py | 28 +- tests/integration/custom_asset_test.py | 28 +- tests/integration/custom_metadata_test.py | 80 +- tests/integration/custom_package_test.py | 4 +- tests/integration/data_mesh_test.py | 95 +- tests/integration/data_studio_asset_test.py | 36 +- tests/integration/dataverse_asset_test.py | 39 +- tests/integration/file_test.py | 8 +- tests/integration/gcs_asset_test.py | 32 +- tests/integration/glossary_test.py | 156 +- tests/integration/insights_test.py | 46 +- tests/integration/kafka_asset_test.py | 28 +- tests/integration/lineage_test.py | 64 +- tests/integration/persona_test.py | 12 +- tests/integration/preset_asset_test.py | 45 +- tests/integration/purpose_test.py | 25 +- tests/integration/quick_sight_asset_test.py | 69 +- tests/integration/requests_test.py | 6 +- tests/integration/s3_asset_test.py | 28 +- tests/integration/suggestions_test.py | 51 +- tests/integration/superset_asset_test.py | 34 +- tests/integration/test_asset_batch.py | 63 +- tests/integration/test_client.py | 281 +++- tests/integration/test_file_client.py | 16 +- tests/integration/test_index_search.py | 93 +- tests/integration/test_open_lineage.py | 29 +- tests/integration/test_sql_assets.py | 198 ++- tests/integration/test_sso_client.py | 25 +- tests/integration/test_task_client.py | 12 +- tests/integration/test_workflow_client.py | 96 +- tests/unit/model/a_d_l_s_account_test.py | 16 +- tests/unit/model/a_d_l_s_container_test.py | 12 +- tests/unit/model/a_d_l_s_object_test.py | 16 +- tests/unit/model/a_p_i_field_test.py | 30 +- tests/unit/model/a_p_i_object_test.py | 20 +- tests/unit/model/a_p_i_path_test.py | 8 +- tests/unit/model/a_p_i_query_test.py | 12 +- tests/unit/model/a_p_i_spec_test.py | 16 +- tests/unit/model/airflow_dag_test.py | 16 +- tests/unit/model/airflow_task_test.py | 20 +- tests/unit/model/anaplan_app_test.py | 12 +- tests/unit/model/anaplan_dimension_test.py | 8 +- tests/unit/model/anaplan_line_item_test.py | 8 +- tests/unit/model/anaplan_list_test.py | 8 +- tests/unit/model/anaplan_model_test.py | 12 +- tests/unit/model/anaplan_module_test.py | 8 +- tests/unit/model/anaplan_page_test.py | 8 +- .../model/anaplan_system_dimension_test.py | 12 +- tests/unit/model/anaplan_view_test.py | 8 +- tests/unit/model/anaplan_workspace_test.py | 12 +- tests/unit/model/application_field_test.py | 12 +- tests/unit/model/application_test.py | 8 +- .../model/azure_event_consumer_group_test.py | 12 +- tests/unit/model/azure_event_hub_test.py | 16 +- tests/unit/model/badge_test.py | 8 +- tests/unit/model/column_process_test.py | 4 +- tests/unit/model/column_test.py | 8 +- tests/unit/model/connection_test.py | 8 +- tests/unit/model/constants.py | 112 +- tests/unit/model/custom_entity_test.py | 20 +- tests/unit/model/data_contract_test.py | 4 +- tests/unit/model/data_domain_test.py | 8 +- tests/unit/model/data_product_test.py | 32 +- tests/unit/model/data_studio_asset_test.py | 12 +- tests/unit/model/database_test.py | 12 +- tests/unit/model/dataverse_attribute_test.py | 16 +- tests/unit/model/dataverse_entity_test.py | 16 +- tests/unit/model/fields/atlan_fields_test.py | 8 +- tests/unit/model/file_test.py | 16 +- tests/unit/model/gcs_bucket_test.py | 12 +- tests/unit/model/gcs_object_test.py | 16 +- tests/unit/model/glossary_category_test.py | 4 +- tests/unit/model/glossary_term_test.py | 17 +- tests/unit/model/glossary_test.py | 4 +- tests/unit/model/kafka_consumer_group_test.py | 12 +- tests/unit/model/kafka_topic_test.py | 16 +- tests/unit/model/materialised_view_test.py | 16 +- .../model/open_lineage/open_lineage_test.py | 28 +- tests/unit/model/preset_chart_test.py | 16 +- tests/unit/model/preset_dashboard_test.py | 18 +- tests/unit/model/preset_dataset_test.py | 16 +- tests/unit/model/preset_workspace_test.py | 12 +- tests/unit/model/procedure_test.py | 8 +- tests/unit/model/process_test.py | 20 +- tests/unit/model/quick_sight_analysis_test.py | 4 +- .../model/quick_sight_analysis_visual_test.py | 4 +- .../unit/model/quick_sight_dashboard_test.py | 4 +- .../quick_sight_dashboard_visual_test.py | 4 +- .../model/quick_sight_dataset_field_test.py | 4 +- tests/unit/model/quick_sight_dataset_test.py | 8 +- tests/unit/model/quick_sight_folder_test.py | 4 +- tests/unit/model/readme_test.py | 12 +- tests/unit/model/s3_bucket_test.py | 12 +- tests/unit/model/s3object_test.py | 8 +- tests/unit/model/schema_test.py | 16 +- tests/unit/model/superset_chart_test.py | 14 +- tests/unit/model/superset_dashboard_test.py | 17 +- tests/unit/model/superset_dataset_test.py | 14 +- tests/unit/model/table_partition_test.py | 4 +- tests/unit/model/table_test.py | 12 +- tests/unit/model/view_test.py | 12 +- tests/unit/pkg/test_models.py | 8 +- tests/unit/pkg/test_widgets.py | 32 +- tests/unit/test_atlan_tag_name.py | 13 +- tests/unit/test_audit_search.py | 26 +- tests/unit/test_client.py | 244 ++- tests/unit/test_connection_cache.py | 32 +- tests/unit/test_core.py | 16 +- tests/unit/test_credential_client.py | 56 +- tests/unit/test_custom_metadata.py | 28 +- tests/unit/test_deprecated.py | 28 +- tests/unit/test_file_client.py | 20 +- tests/unit/test_glossary_term.py | 16 +- tests/unit/test_lineage.py | 135 +- tests/unit/test_model.py | 32 +- tests/unit/test_packages.py | 164 +- tests/unit/test_query_client.py | 8 +- tests/unit/test_search_log_search.py | 18 +- tests/unit/test_search_model.py | 59 +- tests/unit/test_source_cache.py | 32 +- tests/unit/test_sso_client.py | 20 +- tests/unit/test_structs.py | 4 +- tests/unit/test_task_client.py | 11 +- tests/unit/test_typedef_model.py | 28 +- tests/unit/test_utils.py | 8 +- tests/unit/test_workflow_client.py | 87 +- 529 files changed, 21457 insertions(+), 6686 deletions(-) diff --git a/check_tag.py b/check_tag.py index cc0a18389..e19d4d75a 100644 --- a/check_tag.py +++ b/check_tag.py @@ -25,7 +25,9 @@ def read(file_name): """Read a text file and return the content as a string.""" - with io.open(os.path.join(os.path.dirname(__file__), file_name), encoding="utf-8") as f: + with io.open( + os.path.join(os.path.dirname(__file__), file_name), encoding="utf-8" + ) as f: return f.read() @@ -36,7 +38,9 @@ def main(env_var="GITHUB_REF") -> int: if tag == version: return 0 else: - print(f"✖ {env_var} env var {git_ref!r} does not match package version: {tag!r} != {version!r}") + print( + f"✖ {env_var} env var {git_ref!r} does not match package version: {tag!r} != {version!r}" + ) return 1 diff --git a/pyatlan/cache/abstract_asset_cache.py b/pyatlan/cache/abstract_asset_cache.py index 8789f43da..e6059b826 100644 --- a/pyatlan/cache/abstract_asset_cache.py +++ b/pyatlan/cache/abstract_asset_cache.py @@ -129,7 +129,9 @@ def _get_by_qualified_name(self, qualified_name: str, allow_refresh: bool = True if not guid: raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( qualified_name, - AtlanConnectorType._get_connector_type_from_qualified_name(qualified_name).value, + AtlanConnectorType._get_connector_type_from_qualified_name( + qualified_name + ).value, ) return self._get_by_guid(guid=guid, allow_refresh=False) @@ -151,7 +153,9 @@ def _get_by_name(self, name: AbstractAssetName, allow_refresh: bool = True): self.lookup_by_name(name) guid = self.name_to_guid.get(str(name)) if not guid: - raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters(name._TYPE_NAME, name) + raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters( + name._TYPE_NAME, name + ) return self._get_by_guid(guid=guid, allow_refresh=False) diff --git a/pyatlan/cache/connection_cache.py b/pyatlan/cache/connection_cache.py index 164a8358d..cd74b5035 100644 --- a/pyatlan/cache/connection_cache.py +++ b/pyatlan/cache/connection_cache.py @@ -69,7 +69,9 @@ def get_by_guid(cls, guid: str, allow_refresh: bool = True) -> Connection: return cls.get_cache()._get_by_guid(guid=guid, allow_refresh=allow_refresh) @classmethod - def get_by_qualified_name(cls, qualified_name: str, allow_refresh: bool = True) -> Connection: + def get_by_qualified_name( + cls, qualified_name: str, allow_refresh: bool = True + ) -> Connection: """ Retrieve a connection from the cache by its unique Atlan-internal name. @@ -82,10 +84,14 @@ def get_by_qualified_name(cls, qualified_name: str, allow_refresh: bool = True) :raises NotFoundError: if the connection cannot be found (does not exist) in Atlan :raises InvalidRequestError: if no qualified_name was provided for the connection to retrieve """ - return cls.get_cache()._get_by_qualified_name(qualified_name=qualified_name, allow_refresh=allow_refresh) + return cls.get_cache()._get_by_qualified_name( + qualified_name=qualified_name, allow_refresh=allow_refresh + ) @classmethod - def get_by_name(cls, name: ConnectionName, allow_refresh: bool = True) -> Connection: + def get_by_name( + cls, name: ConnectionName, allow_refresh: bool = True + ) -> Connection: """ Retrieve an connection from the cache by its uniquely identifiable name. @@ -142,7 +148,9 @@ def lookup_by_name(self, name: ConnectionName) -> None: return if len(results) > 1: LOGGER.warning( - ("Found multiple connections of the same type with the same name, caching only the first: %s"), + ( + "Found multiple connections of the same type with the same name, caching only the first: %s" + ), name, ) self.cache(results[0]) diff --git a/pyatlan/cache/custom_metadata_cache.py b/pyatlan/cache/custom_metadata_cache.py index a8085f568..b4665c600 100644 --- a/pyatlan/cache/custom_metadata_cache.py +++ b/pyatlan/cache/custom_metadata_cache.py @@ -27,7 +27,9 @@ def get_cache(cls) -> "CustomMetadataCache": client = AtlanClient.get_default_client() cache_key = client.cache_key if cache_key not in cls.caches: - cls.caches[cache_key] = CustomMetadataCache(typedef_client=client.typedef) + cls.caches[cache_key] = CustomMetadataCache( + typedef_client=client.typedef + ) cache = cls.caches[cache_key] return cache @@ -80,7 +82,9 @@ def get_all_custom_attributes( :returns: a dict from custom metadata set name to all details about its attributes :raises NotFoundError: if the custom metadata cannot be found """ - return cls.get_cache()._get_all_custom_attributes(include_deleted=include_deleted, force_refresh=force_refresh) + return cls.get_cache()._get_all_custom_attributes( + include_deleted=include_deleted, force_refresh=force_refresh + ) @classmethod def get_attr_id_for_name(cls, set_name: str, attr_name: str) -> str: @@ -93,7 +97,9 @@ def get_attr_id_for_name(cls, set_name: str, attr_name: str) -> str: :returns: Atlan-internal ID string for the attribute :raises NotFoundError: if the custom metadata attribute cannot be found """ - return cls.get_cache()._get_attr_id_for_name(set_name=set_name, attr_name=attr_name) + return cls.get_cache()._get_attr_id_for_name( + set_name=set_name, attr_name=attr_name + ) @classmethod def get_attr_name_for_id(cls, set_id: str, attr_id: str) -> str: @@ -128,7 +134,9 @@ def get_attributes_for_search_results(cls, set_name: str) -> Optional[List[str]] return cls.get_cache()._get_attributes_for_search_results(set_name=set_name) @classmethod - def get_attribute_for_search_results(cls, set_name: str, attr_name: str) -> Optional[str]: + def get_attribute_for_search_results( + cls, set_name: str, attr_name: str + ) -> Optional[str]: """ Retrieve a single custom attribute name to include on search results. @@ -137,7 +145,9 @@ def get_attribute_for_search_results(cls, set_name: str, attr_name: str) -> Opti :param attr_name: human-readable name of the attribute :returns: the attribute name, strictly useful for inclusion in search results """ - return cls.get_cache()._get_attribute_for_search_results(set_name=set_name, attr_name=attr_name) + return cls.get_cache()._get_attribute_for_search_results( + set_name=set_name, attr_name=attr_name + ) @classmethod def get_custom_metadata_def(cls, name: str) -> CustomMetadataDef: @@ -288,7 +298,9 @@ def _get_all_custom_attributes( to_include = [] if attribute_defs: to_include.extend( - attr for attr in attribute_defs if not attr.options or not attr.options.is_archived + attr + for attr in attribute_defs + if not attr.options or not attr.options.is_archived ) m[type_name] = to_include return m @@ -314,7 +326,9 @@ def _get_attr_id_for_name(self, set_name: str, attr_name: str) -> str: if attr_id := sub_map.get(attr_name): # If found, return straight away return attr_id - raise ErrorCode.CM_ATTR_NOT_FOUND_BY_NAME.exception_with_parameters(attr_name, set_name) + raise ErrorCode.CM_ATTR_NOT_FOUND_BY_NAME.exception_with_parameters( + attr_name, set_name + ) raise ErrorCode.CM_ATTR_NOT_FOUND_BY_ID.exception_with_parameters(set_id) def _get_attr_name_for_id(self, set_id: str, attr_id: str) -> str: @@ -334,7 +348,9 @@ def _get_attr_name_for_id(self, set_id: str, attr_id: str) -> str: if sub_map := self.map_attr_id_to_name.get(set_id): if attr_name := sub_map.get(attr_id): return attr_name - raise ErrorCode.CM_ATTR_NOT_FOUND_BY_ID.exception_with_parameters(attr_id, set_id) + raise ErrorCode.CM_ATTR_NOT_FOUND_BY_ID.exception_with_parameters( + attr_id, set_id + ) def _is_attr_archived(self, attr_id: str) -> bool: """ @@ -351,7 +367,9 @@ def _get_attributes_for_search_results_(self, set_id: str) -> Optional[List[str] return [f"{set_id}.{idstr}" for idstr in attr_ids] return None - def _get_attribute_for_search_results_(self, set_id: str, attr_name: str) -> Optional[str]: + def _get_attribute_for_search_results_( + self, set_id: str, attr_name: str + ) -> Optional[str]: if sub_map := self.map_attr_name_to_id.get(set_id): return sub_map.get(attr_name, None) return None @@ -370,7 +388,9 @@ def _get_attributes_for_search_results(self, set_name: str) -> Optional[List[str return self._get_attributes_for_search_results_(set_id) return None - def _get_attribute_for_search_results(self, set_name: str, attr_name: str) -> Optional[str]: + def _get_attribute_for_search_results( + self, set_name: str, attr_name: str + ) -> Optional[str]: """ Retrieve a single custom attribute name to include on search results. @@ -416,4 +436,6 @@ def _get_attribute_def(self, attr_id: str) -> AttributeDef: self._refresh_cache() if attr_def := self.attr_cache_by_id.get(attr_id): return attr_def - raise ErrorCode.CM_ATTR_NOT_FOUND_BY_ID.exception_with_parameters(attr_id, "(unknown)") + raise ErrorCode.CM_ATTR_NOT_FOUND_BY_ID.exception_with_parameters( + attr_id, "(unknown)" + ) diff --git a/pyatlan/cache/group_cache.py b/pyatlan/cache/group_cache.py index 6dde2c4aa..48c9e8e94 100644 --- a/pyatlan/cache/group_cache.py +++ b/pyatlan/cache/group_cache.py @@ -131,4 +131,6 @@ def _validate_aliases(self, aliases: Iterable[str]): """ for group_alias in aliases: if not self.get_id_for_name(group_alias): - raise ValueError(f"Provided group name {group_alias} was not found in Atlan.") + raise ValueError( + f"Provided group name {group_alias} was not found in Atlan." + ) diff --git a/pyatlan/cache/role_cache.py b/pyatlan/cache/role_cache.py index c72d0e466..896d00a1b 100644 --- a/pyatlan/cache/role_cache.py +++ b/pyatlan/cache/role_cache.py @@ -65,7 +65,9 @@ def __init__(self, role_client: RoleClient): def _refresh_cache(self) -> None: with self.lock: - response = self.role_client.get(limit=100, post_filter='{"name":{"$ilike":"$%"}}') + response = self.role_client.get( + limit=100, post_filter='{"name":{"$ilike":"$%"}}' + ) if response is not None: self.cache_by_id = {} self.map_id_to_name = {} diff --git a/pyatlan/cache/source_tag_cache.py b/pyatlan/cache/source_tag_cache.py index 8ec6e8f26..98d58a432 100644 --- a/pyatlan/cache/source_tag_cache.py +++ b/pyatlan/cache/source_tag_cache.py @@ -66,7 +66,9 @@ def get_by_guid(cls, guid: str, allow_refresh: bool = True) -> Tag: return cls.get_cache()._get_by_guid(guid=guid, allow_refresh=allow_refresh) @classmethod - def get_by_qualified_name(cls, qualified_name: str, allow_refresh: bool = True) -> Tag: + def get_by_qualified_name( + cls, qualified_name: str, allow_refresh: bool = True + ) -> Tag: """ Retrieve a source tag from the cache by its unique Atlan-internal name. @@ -79,7 +81,9 @@ def get_by_qualified_name(cls, qualified_name: str, allow_refresh: bool = True) :raises NotFoundError: if the source tag cannot be found (does not exist) in Atlan :raises InvalidRequestError: if no qualified_name was provided for the source tag to retrieve """ - return cls.get_cache()._get_by_qualified_name(qualified_name=qualified_name, allow_refresh=allow_refresh) + return cls.get_cache()._get_by_qualified_name( + qualified_name=qualified_name, allow_refresh=allow_refresh + ) @classmethod def get_by_name(cls, name: SourceTagName, allow_refresh: bool = True) -> Tag: @@ -164,7 +168,9 @@ def get_name(self, asset: Asset): try: source_tag_name = str(SourceTagName(asset)) except AtlanError as e: - LOGGER.error("Unable to construct a source tag name for: %s", asset.qualified_name) + LOGGER.error( + "Unable to construct a source tag name for: %s", asset.qualified_name + ) LOGGER.debug("Details: %s", e) return source_tag_name diff --git a/pyatlan/cache/user_cache.py b/pyatlan/cache/user_cache.py index 5a870f6ac..0f95c3a4a 100644 --- a/pyatlan/cache/user_cache.py +++ b/pyatlan/cache/user_cache.py @@ -26,7 +26,9 @@ def get_cache(cls) -> "UserCache": client = AtlanClient.get_default_client() cache_key = client.cache_key if cache_key not in cls.caches: - cls.caches[cache_key] = UserCache(user_client=client.user, token_client=client.token) + cls.caches[cache_key] = UserCache( + user_client=client.user, token_client=client.token + ) return cls.caches[cache_key] @classmethod @@ -108,7 +110,9 @@ def _get_id_for_name(self, name: str) -> Optional[str]: self.map_name_to_id[name] = token.guid return token.guid else: - raise ErrorCode.API_TOKEN_NOT_FOUND_BY_NAME.exception_with_parameters(name) + raise ErrorCode.API_TOKEN_NOT_FOUND_BY_NAME.exception_with_parameters( + name + ) self._refresh_cache() return self.map_name_to_id.get(name) @@ -148,5 +152,9 @@ def _validate_names(self, names: Iterable[str]): :param names: a collection of usernames to be checked """ for username in names: - if not self.get_id_for_name(username) and not self.token_client.get_by_id(username): - raise ValueError(f"Provided username {username} was not found in Atlan.") + if not self.get_id_for_name(username) and not self.token_client.get_by_id( + username + ): + raise ValueError( + f"Provided username {username} was not found in Atlan." + ) diff --git a/pyatlan/client/admin.py b/pyatlan/client/admin.py index 79107e66d..fccf0ee84 100644 --- a/pyatlan/client/admin.py +++ b/pyatlan/client/admin.py @@ -26,11 +26,15 @@ class AdminClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @validate_arguments - def get_keycloak_events(self, keycloak_request: KeycloakEventRequest) -> KeycloakEventResponse: + def get_keycloak_events( + self, keycloak_request: KeycloakEventRequest + ) -> KeycloakEventResponse: """ Retrieve all events, based on the supplied filters. @@ -46,7 +50,9 @@ def get_keycloak_events(self, keycloak_request: KeycloakEventRequest) -> Keycloa try: events = parse_obj_as(List[KeycloakEvent], raw_json) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err else: events = [] return KeycloakEventResponse( @@ -72,7 +78,9 @@ def get_admin_events(self, admin_request: AdminEventRequest) -> AdminEventRespon try: events = parse_obj_as(List[AdminEvent], raw_json) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err else: events = [] return AdminEventResponse( diff --git a/pyatlan/client/asset.py b/pyatlan/client/asset.py index ece5b0a75..3f453135c 100644 --- a/pyatlan/client/asset.py +++ b/pyatlan/client/asset.py @@ -142,7 +142,9 @@ class AssetClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @staticmethod @@ -154,8 +156,13 @@ def _prepare_sorts_for_bulk_search(sorts: List[SortItem]): def _get_bulk_search_log_message(self, bulk): return ( - "Bulk search option is enabled. " if bulk else "Result size (%s) exceeds threshold (%s). " - ) + "Ignoring requests for offset-based paging and using timestamp-based paging instead." + ( + "Bulk search option is enabled. " + if bulk + else "Result size (%s) exceeds threshold (%s). " + ) + + "Ignoring requests for offset-based paging and using timestamp-based paging instead." + ) # TODO: Try adding @validate_arguments to this method once # the issue below is fixed or when we switch to pydantic v2 @@ -194,17 +201,22 @@ def search(self, criteria: IndexSearchRequest, bulk=False) -> IndexSearchResults if "entities" in raw_json: try: for entity in raw_json["entities"]: - unflatten_custom_metadata_for_entity(entity=entity, attributes=criteria.attributes) + unflatten_custom_metadata_for_entity( + entity=entity, attributes=criteria.attributes + ) assets = parse_obj_as(List[Asset], raw_json["entities"]) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err else: assets = [] aggregations = self._get_aggregations(raw_json) count = raw_json.get("approximateCount", 0) - if count > IndexSearchResults._MASS_EXTRACT_THRESHOLD and not IndexSearchResults.presorted_by_timestamp( - criteria.dsl.sort + if ( + count > IndexSearchResults._MASS_EXTRACT_THRESHOLD + and not IndexSearchResults.presorted_by_timestamp(criteria.dsl.sort) ): # If there is any user-specified sorting present in the search request if criteria.dsl.sort and len(criteria.dsl.sort) > 1: @@ -242,7 +254,9 @@ def _get_aggregations(self, raw_json) -> Optional[Aggregations]: # TODO: Try adding @validate_arguments to this method once # the issue below is fixed or when we switch to pydantic v2 # https://github.com/pydantic/pydantic/issues/2901 - def get_lineage_list(self, lineage_request: LineageListRequest) -> LineageListResults: + def get_lineage_list( + self, lineage_request: LineageListRequest + ) -> LineageListResults: """ Retrieve lineage using the higher-performance "list" API. @@ -253,15 +267,21 @@ def get_lineage_list(self, lineage_request: LineageListRequest) -> LineageListRe """ if lineage_request.direction == LineageDirection.BOTH: raise ErrorCode.INVALID_LINEAGE_DIRECTION.exception_with_parameters() - raw_json = self._client._call_api(GET_LINEAGE_LIST, None, request_obj=lineage_request, exclude_unset=True) + raw_json = self._client._call_api( + GET_LINEAGE_LIST, None, request_obj=lineage_request, exclude_unset=True + ) if "entities" in raw_json: try: for entity in raw_json["entities"]: - unflatten_custom_metadata_for_entity(entity=entity, attributes=lineage_request.attributes) + unflatten_custom_metadata_for_entity( + entity=entity, attributes=lineage_request.attributes + ) assets = parse_obj_as(List[Asset], raw_json["entities"]) has_more = parse_obj_as(bool, raw_json["hasMore"]) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err else: assets = [] has_more = False @@ -290,7 +310,11 @@ def find_personas_by_name( """ if attributes is None: attributes = [] - query = Term.with_state("ACTIVE") + Term.with_type_name("PERSONA") + Term.with_name(name) + query = ( + Term.with_state("ACTIVE") + + Term.with_type_name("PERSONA") + + Term.with_name(name) + ) return self._search_for_asset_with_name( query=query, name=name, @@ -315,7 +339,11 @@ def find_purposes_by_name( """ if attributes is None: attributes = [] - query = Term.with_state("ACTIVE") + Term.with_type_name("PURPOSE") + Term.with_name(name) + query = ( + Term.with_state("ACTIVE") + + Term.with_type_name("PURPOSE") + + Term.with_name(name) + ) return self._search_for_asset_with_name( query=query, name=name, @@ -358,9 +386,13 @@ def get_by_qualified_name( attributes = attributes or [] related_attributes = related_attributes or [] - if (attributes and len(attributes)) or (related_attributes and len(related_attributes)): + if (attributes and len(attributes)) or ( + related_attributes and len(related_attributes) + ): client = AtlanClient.get_default_client() - search = FluentSearch().select().where(Asset.QUALIFIED_NAME.eq(qualified_name)) + search = ( + FluentSearch().select().where(Asset.QUALIFIED_NAME.eq(qualified_name)) + ) for attribute in attributes: search = search.include_on_results(attribute) for relation_attribute in related_attributes: @@ -375,17 +407,23 @@ def get_by_qualified_name( asset_type.__name__, qualified_name ) else: - raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters(qualified_name, asset_type.__name__) + raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( + qualified_name, asset_type.__name__ + ) raw_json = self._client._call_api( GET_ENTITY_BY_UNIQUE_ATTRIBUTE.format_path_with_params(asset_type.__name__), query_params, ) if raw_json["entity"]["typeName"] != asset_type.__name__: - raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters(asset_type.__name__, qualified_name) + raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters( + asset_type.__name__, qualified_name + ) asset = self._handle_relationships(raw_json) if not isinstance(asset, asset_type): - raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters(asset_type.__name__, qualified_name) + raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters( + asset_type.__name__, qualified_name + ) return asset @validate_arguments(config=dict(arbitrary_types_allowed=True)) @@ -421,7 +459,9 @@ def get_by_guid( attributes = attributes or [] related_attributes = related_attributes or [] - if (attributes and len(attributes)) or (related_attributes and len(related_attributes)): + if (attributes and len(attributes)) or ( + related_attributes and len(related_attributes) + ): client = AtlanClient.get_default_client() search = FluentSearch().select().where(Asset.GUID.eq(guid)) for attribute in attributes: @@ -434,7 +474,9 @@ def get_by_guid( if isinstance(first_result, asset_type): return first_result else: - raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, asset_type.__name__) + raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( + guid, asset_type.__name__ + ) else: raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid) @@ -444,12 +486,19 @@ def get_by_guid( ) asset = self._handle_relationships(raw_json) if not isinstance(asset, asset_type): - raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, asset_type.__name__) + raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( + guid, asset_type.__name__ + ) return asset def _handle_relationships(self, raw_json): - if "relationshipAttributes" in raw_json["entity"] and raw_json["entity"]["relationshipAttributes"]: - raw_json["entity"]["attributes"].update(raw_json["entity"]["relationshipAttributes"]) + if ( + "relationshipAttributes" in raw_json["entity"] + and raw_json["entity"]["relationshipAttributes"] + ): + raw_json["entity"]["attributes"].update( + raw_json["entity"]["relationshipAttributes"] + ) raw_json["entity"]["relationshipAttributes"] = {} asset = AssetResponse[A](**raw_json).entity asset.is_incomplete = False @@ -556,7 +605,9 @@ def upsert_merging_cm( DeprecationWarning, stacklevel=2, ) - return self.save_merging_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) + return self.save_merging_cm( + entity=entity, replace_atlan_tags=replace_atlan_tags + ) @validate_arguments def save_merging_cm( @@ -579,7 +630,9 @@ def save_merging_cm( ) @validate_arguments - def update_merging_cm(self, entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse: + def update_merging_cm( + self, entity: Asset, replace_atlan_tags: bool = False + ) -> AssetMutationResponse: """ If no asset exists, fails with a NotFoundError. Will merge any provided custom metadata with any custom metadata that already exists on the asset. @@ -596,7 +649,9 @@ def update_merging_cm(self, entity: Asset, replace_atlan_tags: bool = False) -> min_ext_info=True, ignore_relationships=True, ) # Allow this to throw the NotFoundError if the entity does not exist - return self.save_merging_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) + return self.save_merging_cm( + entity=entity, replace_atlan_tags=replace_atlan_tags + ) @validate_arguments def upsert_replacing_cm( @@ -608,7 +663,9 @@ def upsert_replacing_cm( DeprecationWarning, stacklevel=2, ) - return self.save_replacing_cm(entity=entity, replace_atlan_tags=replace_atlan_tagss) + return self.save_replacing_cm( + entity=entity, replace_atlan_tags=replace_atlan_tagss + ) @validate_arguments def save_replacing_cm( @@ -644,7 +701,9 @@ def save_replacing_cm( return AssetMutationResponse(**raw_json) @validate_arguments - def update_replacing_cm(self, entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse: + def update_replacing_cm( + self, entity: Asset, replace_atlan_tags: bool = False + ) -> AssetMutationResponse: """ If no asset exists, fails with a NotFoundError. Will overwrite all custom metadata on any existing asset with only the custom metadata provided @@ -663,7 +722,9 @@ def update_replacing_cm(self, entity: Asset, replace_atlan_tags: bool = False) - min_ext_info=True, ignore_relationships=True, ) # Allow this to throw the NotFoundError if the entity does not exist - return self.save_replacing_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) + return self.save_replacing_cm( + entity=entity, replace_atlan_tags=replace_atlan_tags + ) @validate_arguments def purge_by_guid(self, guid: Union[str, List[str]]) -> AssetMutationResponse: @@ -681,7 +742,9 @@ def purge_by_guid(self, guid: Union[str, List[str]]) -> AssetMutationResponse: else: guids.append(guid) query_params = {"deleteType": AtlanDeleteType.PURGE.value, "guid": guids} - raw_json = self._client._call_api(DELETE_ENTITIES_BY_GUIDS, query_params=query_params) + raw_json = self._client._call_api( + DELETE_ENTITIES_BY_GUIDS, query_params=query_params + ) return AssetMutationResponse(**raw_json) @validate_arguments @@ -704,9 +767,13 @@ def delete_by_guid(self, guid: Union[str, List[str]]) -> AssetMutationResponse: for guid in guids: asset = self.retrieve_minimal(guid=guid, asset_type=Asset) if not asset.can_be_archived(): - raise ErrorCode.ASSET_CAN_NOT_BE_ARCHIVED.exception_with_parameters(guid, asset.type_name) + raise ErrorCode.ASSET_CAN_NOT_BE_ARCHIVED.exception_with_parameters( + guid, asset.type_name + ) query_params = {"deleteType": AtlanDeleteType.SOFT.value, "guid": guids} - raw_json = self._client._call_api(DELETE_ENTITIES_BY_GUIDS, query_params=query_params) + raw_json = self._client._call_api( + DELETE_ENTITIES_BY_GUIDS, query_params=query_params + ) response = AssetMutationResponse(**raw_json) for asset in response.assets_deleted(asset_type=Asset): self._wait_till_deleted(asset) @@ -882,7 +949,9 @@ def update_atlan_tags( ) @validate_arguments - def remove_atlan_tag(self, asset_type: Type[A], qualified_name: str, atlan_tag_name: str) -> None: + def remove_atlan_tag( + self, asset_type: Type[A], qualified_name: str, atlan_tag_name: str + ) -> None: """ Removes a single Atlan tag from the provided asset. Note: if the provided Atlan tag does not exist on the asset, an error will be raised. @@ -897,7 +966,9 @@ def remove_atlan_tag(self, asset_type: Type[A], qualified_name: str, atlan_tag_n classification_id = AtlanTagCache.get_id_for_name(atlan_tag_name) if not classification_id: - raise ErrorCode.ATLAN_TAG_NOT_FOUND_BY_NAME.exception_with_parameters(atlan_tag_name) + raise ErrorCode.ATLAN_TAG_NOT_FOUND_BY_NAME.exception_with_parameters( + atlan_tag_name + ) query_params = {"attr:qualifiedName": qualified_name} self._client._call_api( DELETE_ENTITY_BY_ATTRIBUTE.format_path_with_params( @@ -906,10 +977,14 @@ def remove_atlan_tag(self, asset_type: Type[A], qualified_name: str, atlan_tag_n query_params, ) - def _update_asset_by_attribute(self, asset: A, asset_type: Type[A], qualified_name: str): + def _update_asset_by_attribute( + self, asset: A, asset_type: Type[A], qualified_name: str + ): query_params = {"attr:qualifiedName": qualified_name} raw_json = self._client._call_api( - PARTIAL_UPDATE_ENTITY_BY_ATTRIBUTE.format_path_with_params(asset_type.__name__), + PARTIAL_UPDATE_ENTITY_BY_ATTRIBUTE.format_path_with_params( + asset_type.__name__ + ), query_params, AssetRequest[Asset](entity=asset), ) @@ -1159,7 +1234,9 @@ def remove_announcement( return self._update_asset_by_attribute(asset, asset_type, qualified_name) @validate_arguments(config=dict(arbitrary_types_allowed=True)) - def update_custom_metadata_attributes(self, guid: str, custom_metadata: CustomMetadataDict): + def update_custom_metadata_attributes( + self, guid: str, custom_metadata: CustomMetadataDict + ): """ Update only the provided custom metadata attributes on the asset. This will leave all other custom metadata attributes, even within the same named custom metadata, unchanged. @@ -1168,7 +1245,9 @@ def update_custom_metadata_attributes(self, guid: str, custom_metadata: CustomMe :param custom_metadata: custom metadata to update, as human-readable names mapped to values :raises AtlanError: on any API communication issue """ - custom_metadata_request = CustomMetadataRequest.create(custom_metadata_dict=custom_metadata) + custom_metadata_request = CustomMetadataRequest.create( + custom_metadata_dict=custom_metadata + ) self._client._call_api( ADD_BUSINESS_ATTRIBUTE_BY_ID.format_path( { @@ -1192,7 +1271,9 @@ def replace_custom_metadata(self, guid: str, custom_metadata: CustomMetadataDict """ # clear unset attributes so that they are removed custom_metadata.clear_unset() - custom_metadata_request = CustomMetadataRequest.create(custom_metadata_dict=custom_metadata) + custom_metadata_request = CustomMetadataRequest.create( + custom_metadata_dict=custom_metadata + ) self._client._call_api( ADD_BUSINESS_ATTRIBUTE_BY_ID.format_path( { @@ -1216,7 +1297,9 @@ def remove_custom_metadata(self, guid: str, cm_name: str): custom_metadata = CustomMetadataDict(name=cm_name) # invoke clear_all so all attributes are set to None and consequently removed custom_metadata.clear_all() - custom_metadata_request = CustomMetadataRequest.create(custom_metadata_dict=custom_metadata) + custom_metadata_request = CustomMetadataRequest.create( + custom_metadata_dict=custom_metadata + ) self._client._call_api( ADD_BUSINESS_ATTRIBUTE_BY_ID.format_path( { @@ -1255,9 +1338,19 @@ def append_terms( if guid: if qualified_name: raise ErrorCode.QN_OR_GUID_NOT_BOTH.exception_with_parameters() - results = FluentSearch().select().where(asset_type.GUID.eq(guid)).execute(client=client) + results = ( + FluentSearch() + .select() + .where(asset_type.GUID.eq(guid)) + .execute(client=client) + ) elif qualified_name: - results = FluentSearch().select().where(asset_type.QUALIFIED_NAME.eq(qualified_name)).execute(client=client) + results = ( + FluentSearch() + .select() + .where(asset_type.QUALIFIED_NAME.eq(qualified_name)) + .execute(client=client) + ) else: raise ErrorCode.QN_OR_GUID.exception_with_parameters() @@ -1269,10 +1362,14 @@ def append_terms( asset_type.__name__, qualified_name ) else: - raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, asset_type.__name__) + raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( + guid, asset_type.__name__ + ) else: if guid is None: - raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters(qualified_name, asset_type.__name__) + raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( + qualified_name, asset_type.__name__ + ) else: raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid) qualified_name = first_result.qualified_name @@ -1280,7 +1377,9 @@ def append_terms( updated_asset = asset_type.updater(qualified_name=qualified_name, name=name) for i, term in enumerate(terms): if hasattr(term, "guid") and term.guid: - terms[i] = AtlasGlossaryTerm.ref_by_guid(guid=term.guid, semantic=SaveSemantic.APPEND) + terms[i] = AtlasGlossaryTerm.ref_by_guid( + guid=term.guid, semantic=SaveSemantic.APPEND + ) elif hasattr(term, "qualified_name") and term.qualified_name: terms[i] = AtlasGlossaryTerm.ref_by_qualified_name( qualified_name=term.qualified_name, semantic=SaveSemantic.APPEND @@ -1316,9 +1415,19 @@ def replace_terms( if guid: if qualified_name: raise ErrorCode.QN_OR_GUID_NOT_BOTH.exception_with_parameters() - results = FluentSearch().select().where(asset_type.GUID.eq(guid)).execute(client=client) + results = ( + FluentSearch() + .select() + .where(asset_type.GUID.eq(guid)) + .execute(client=client) + ) elif qualified_name: - results = FluentSearch().select().where(asset_type.QUALIFIED_NAME.eq(qualified_name)).execute(client=client) + results = ( + FluentSearch() + .select() + .where(asset_type.QUALIFIED_NAME.eq(qualified_name)) + .execute(client=client) + ) else: raise ErrorCode.QN_OR_GUID.exception_with_parameters() @@ -1330,10 +1439,14 @@ def replace_terms( asset_type.__name__, qualified_name ) else: - raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, asset_type.__name__) + raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( + guid, asset_type.__name__ + ) else: if guid is None: - raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters(qualified_name, asset_type.__name__) + raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( + qualified_name, asset_type.__name__ + ) else: raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid) qualified_name = first_result.qualified_name @@ -1341,7 +1454,9 @@ def replace_terms( updated_asset = asset_type.updater(qualified_name=qualified_name, name=name) for i, term in enumerate(terms): if hasattr(term, "guid") and term.guid: - terms[i] = AtlasGlossaryTerm.ref_by_guid(guid=term.guid, semantic=SaveSemantic.REPLACE) + terms[i] = AtlasGlossaryTerm.ref_by_guid( + guid=term.guid, semantic=SaveSemantic.REPLACE + ) elif hasattr(term, "qualified_name") and term.qualified_name: terms[i] = AtlasGlossaryTerm.ref_by_qualified_name( qualified_name=term.qualified_name, semantic=SaveSemantic.REPLACE @@ -1379,9 +1494,19 @@ def remove_terms( if guid: if qualified_name: raise ErrorCode.QN_OR_GUID_NOT_BOTH.exception_with_parameters() - results = FluentSearch().select().where(asset_type.GUID.eq(guid)).execute(client=client) + results = ( + FluentSearch() + .select() + .where(asset_type.GUID.eq(guid)) + .execute(client=client) + ) elif qualified_name: - results = FluentSearch().select().where(asset_type.QUALIFIED_NAME.eq(qualified_name)).execute(client=client) + results = ( + FluentSearch() + .select() + .where(asset_type.QUALIFIED_NAME.eq(qualified_name)) + .execute(client=client) + ) else: raise ErrorCode.QN_OR_GUID.exception_with_parameters() @@ -1393,10 +1518,14 @@ def remove_terms( asset_type.__name__, qualified_name ) else: - raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, asset_type.__name__) + raise ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( + guid, asset_type.__name__ + ) else: if guid is None: - raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters(qualified_name, asset_type.__name__) + raise ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( + qualified_name, asset_type.__name__ + ) else: raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid) qualified_name = first_result.qualified_name @@ -1404,7 +1533,9 @@ def remove_terms( updated_asset = asset_type.updater(qualified_name=qualified_name, name=name) for i, term in enumerate(terms): if hasattr(term, "guid") and term.guid: - terms[i] = AtlasGlossaryTerm.ref_by_guid(guid=term.guid, semantic=SaveSemantic.REMOVE) + terms[i] = AtlasGlossaryTerm.ref_by_guid( + guid=term.guid, semantic=SaveSemantic.REMOVE + ) elif hasattr(term, "qualified_name") and term.qualified_name: terms[i] = AtlasGlossaryTerm.ref_by_qualified_name( qualified_name=term.qualified_name, semantic=SaveSemantic.REMOVE @@ -1472,7 +1603,9 @@ def find_glossary_by_name( def find_category_fast_by_name( self, name: constr(strip_whitespace=True, min_length=1, strict=True), # type: ignore - glossary_qualified_name: constr(strip_whitespace=True, min_length=1, strict=True), # type: ignore + glossary_qualified_name: constr( # type: ignore + strip_whitespace=True, min_length=1, strict=True + ), attributes: Optional[List[StrictStr]] = None, ) -> List[AtlasGlossaryCategory]: """ @@ -1489,7 +1622,9 @@ def find_category_fast_by_name( """ if attributes is None: attributes = [] - query = with_active_category(name=name, glossary_qualified_name=glossary_qualified_name) + query = with_active_category( + name=name, glossary_qualified_name=glossary_qualified_name + ) return self._search_for_asset_with_name( query=query, name=name, @@ -1534,7 +1669,9 @@ def _search_for_asset_with_name( allow_multiple: bool = False, ) -> List[A]: dsl = DSL(query=query) - search_request = IndexSearchRequest(dsl=dsl, attributes=attributes, relation_attributes=["name"]) + search_request = IndexSearchRequest( + dsl=dsl, attributes=attributes, relation_attributes=["name"] + ) results = self.search(search_request) if ( results @@ -1542,7 +1679,11 @@ def _search_for_asset_with_name( and ( # Check for paginated results first; # if not paginated, iterate over the results - assets := [asset for asset in (results.current_page() or results) if isinstance(asset, asset_type)] + assets := [ + asset + for asset in (results.current_page() or results) + if isinstance(asset, asset_type) + ] ) ): if not allow_multiple and len(assets) > 1: @@ -1552,13 +1693,17 @@ def _search_for_asset_with_name( name, ) return assets - raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters(asset_type.__name__, name) + raise ErrorCode.ASSET_NOT_FOUND_BY_NAME.exception_with_parameters( + asset_type.__name__, name + ) @validate_arguments def find_term_fast_by_name( self, name: constr(strip_whitespace=True, min_length=1, strict=True), # type: ignore - glossary_qualified_name: constr(strip_whitespace=True, min_length=1, strict=True), # type: ignore + glossary_qualified_name: constr( # type: ignore + strip_whitespace=True, min_length=1, strict=True + ), attributes: Optional[List[StrictStr]] = None, ) -> AtlasGlossaryTerm: """ @@ -1574,7 +1719,9 @@ def find_term_fast_by_name( """ if attributes is None: attributes = [] - query = with_active_term(name=name, glossary_qualified_name=glossary_qualified_name) + query = with_active_term( + name=name, glossary_qualified_name=glossary_qualified_name + ) return self._search_for_asset_with_name( query=query, name=name, asset_type=AtlasGlossaryTerm, attributes=attributes )[0] @@ -1621,7 +1768,9 @@ def find_domain_by_name( """ attributes = attributes or [] query = Term.with_name(name) + Term.with_type_name("DataDomain") - return self._search_for_asset_with_name(query=query, name=name, asset_type=DataDomain, attributes=attributes)[0] + return self._search_for_asset_with_name( + query=query, name=name, asset_type=DataDomain, attributes=attributes + )[0] @validate_arguments def find_product_by_name( @@ -1639,9 +1788,9 @@ def find_product_by_name( """ attributes = attributes or [] query = Term.with_name(name) + Term.with_type_name("DataProduct") - return self._search_for_asset_with_name(query=query, name=name, asset_type=DataProduct, attributes=attributes)[ - 0 - ] + return self._search_for_asset_with_name( + query=query, name=name, asset_type=DataProduct, attributes=attributes + )[0] # TODO: Try adding @validate_arguments to this method once # the issue below is fixed or when we switch to pydantic v2 @@ -1688,14 +1837,18 @@ def get_hierarchy( search = search.include_on_relations(field) request = search.to_request() response = self.search(request) - for category in filter(lambda a: isinstance(a, AtlasGlossaryCategory), response): + for category in filter( + lambda a: isinstance(a, AtlasGlossaryCategory), response + ): guid = category.guid category_dict[guid] = category if category.parent_category is None: top_categories.add(guid) if not top_categories: - raise ErrorCode.NO_CATEGORIES.exception_with_parameters(glossary.guid, glossary.qualified_name) + raise ErrorCode.NO_CATEGORIES.exception_with_parameters( + glossary.guid, glossary.qualified_name + ) return CategoryHierarchy(top_level=top_categories, stub_dict=category_dict) @@ -1771,11 +1924,15 @@ def _get_next_page_json(self, is_bulk_search: bool = False): return raw_json except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err def _process_entities(self, entities): for entity in entities: - unflatten_custom_metadata_for_entity(entity=entity, attributes=self._criteria.attributes) + unflatten_custom_metadata_for_entity( + entity=entity, attributes=self._criteria.attributes + ) self._assets = parse_obj_as(List[Asset], entities) def _update_first_last_record_creation_times(self): @@ -1794,7 +1951,9 @@ def _update_first_last_record_creation_times(self): def _filter_processed_assets(self): self._assets = [ - asset for asset in self._assets if asset is not None and asset.guid not in self._processed_guids + asset + for asset in self._assets + if asset is not None and asset.guid not in self._processed_guids ] def __iter__(self) -> Generator[Asset, None, None]: @@ -1857,7 +2016,9 @@ def _prepare_query_for_timestamp_paging(self, query: Query): rewritten_filters.append(filter_) if self._first_record_creation_time != self._last_record_creation_time: - rewritten_filters.append(self.get_paging_timestamp_query(self._last_record_creation_time)) + rewritten_filters.append( + self.get_paging_timestamp_query(self._last_record_creation_time) + ) if isinstance(query, Bool): rewritten_query = Bool( filter=rewritten_filters, @@ -1897,7 +2058,9 @@ def next_page(self, start=None, size=None) -> bool: :returns: True if there is a next page of results, otherwise False """ self._start = start or self._start + self._size - is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + is_bulk_search = ( + self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + ) if size: self._size = size if is_bulk_search: @@ -1906,7 +2069,9 @@ def next_page(self, start=None, size=None) -> bool: # in a previous page of results. # If it has,then exclude it from the current results; # otherwise, we may encounter duplicate asset records. - self._processed_guids.update(asset.guid for asset in self._assets if asset is not None) + self._processed_guids.update( + asset.guid for asset in self._assets if asset is not None + ) return self._get_next_page() if self._assets else False def _get_next_page(self): @@ -1918,7 +2083,9 @@ def _get_next_page(self): query = self._criteria.dsl.query self._criteria.dsl.size = self._size self._criteria.dsl.from_ = self._start - is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + is_bulk_search = ( + self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + ) if is_bulk_search: self._prepare_query_for_timestamp_paging(query) @@ -1969,7 +2136,9 @@ def sort_by_timestamp_first(sorts: List[SortItem]) -> List[SortItem]: return creation_asc_sort rewritten_sorts = [ - sort for sort in sorts if (not sort.field) or (sort.field != Asset.CREATE_TIME.internal_field_name) + sort + for sort in sorts + if (not sort.field) or (sort.field != Asset.CREATE_TIME.internal_field_name) ] return creation_asc_sort + rewritten_sorts @@ -2103,7 +2272,9 @@ def __init__( self._client: AtlanClient = client self._max_size: int = max_size self._replace_atlan_tags: bool = replace_atlan_tags - self._custom_metadata_handling: CustomMetadataHandling = custom_metadata_handling + self._custom_metadata_handling: CustomMetadataHandling = ( + custom_metadata_handling + ) self._capture_failures: bool = capture_failures self._update_only: bool = update_only self._track: bool = track @@ -2227,15 +2398,24 @@ def flush(self) -> Optional[AssetMutationResponse]: fuzzy_match: bool = False if self._table_view_agnostic: types_in_batch = {asset.type_name for asset in self._batch} - fuzzy_match = any(type_name in types_in_batch for type_name in self._TABLE_LEVEL_ASSETS) - if self._update_only or self._creation_handling != AssetCreationHandling.FULL or fuzzy_match: + fuzzy_match = any( + type_name in types_in_batch + for type_name in self._TABLE_LEVEL_ASSETS + ) + if ( + self._update_only + or self._creation_handling != AssetCreationHandling.FULL + or fuzzy_match + ): found: Dict[str, str] = {} qualified_names = [asset.qualified_name or "" for asset in self._batch] if self._case_insensitive: search = FluentSearch().select(include_archived=True).min_somes(1) for qn in qualified_names: search = search.where_some( - Asset.QUALIFIED_NAME.eq(value=qn or "", case_insensitive=self._case_insensitive) + Asset.QUALIFIED_NAME.eq( + value=qn or "", case_insensitive=self._case_insensitive + ) ) else: search = ( @@ -2271,7 +2451,10 @@ def flush(self) -> Optional[AssetMutationResponse]: actual_qn=found.get(str(asset_id), ""), revised=revised, ) - elif self._table_view_agnostic and asset.type_name in self._TABLE_LEVEL_ASSETS: + elif ( + self._table_view_agnostic + and asset.type_name in self._TABLE_LEVEL_ASSETS + ): # If found as a different (but acceptable) type, update that instead as_table = AssetIdentity( type_name=Table.__name__, @@ -2338,8 +2521,13 @@ def flush(self) -> Optional[AssetMutationResponse]: if revised: try: if self._custom_metadata_handling == CustomMetadataHandling.IGNORE: - response = self._client.asset.save(revised, replace_atlan_tags=self._replace_atlan_tags) - elif self._custom_metadata_handling == CustomMetadataHandling.OVERWRITE: + response = self._client.asset.save( + revised, replace_atlan_tags=self._replace_atlan_tags + ) + elif ( + self._custom_metadata_handling + == CustomMetadataHandling.OVERWRITE + ): response = self._client.asset.save_replacing_cm( revised, replace_atlan_tags=self._replace_atlan_tags ) @@ -2355,7 +2543,9 @@ def flush(self) -> Optional[AssetMutationResponse]: ) except AtlanError as er: if self._capture_failures: - self._failures.append(FailedBatch(failed_assets=self._batch, failure_reason=er)) + self._failures.append( + FailedBatch(failed_assets=self._batch, failure_reason=er) + ) else: raise er self._batch = [] @@ -2384,17 +2574,27 @@ def _track_response(self, response: AssetMutationResponse, sent: list[Asset]): created_guids, updated_guids = set(), set() if response.mutated_entities: if response.mutated_entities.CREATE: - created_guids = {asset.guid for asset in response.mutated_entities.CREATE} + created_guids = { + asset.guid for asset in response.mutated_entities.CREATE + } if response.mutated_entities.UPDATE: - updated_guids = {asset.guid for asset in response.mutated_entities.UPDATE} + updated_guids = { + asset.guid for asset in response.mutated_entities.UPDATE + } for one in sent: guid = one.guid - if guid and (not response.guid_assignments or guid not in response.guid_assignments): + if guid and ( + not response.guid_assignments + or guid not in response.guid_assignments + ): # Ensure any assets that were sent with GUIDs # that were used as-is are added to the resolved GUIDs map self._resolved_guids[guid] = guid mapped_guid = self._resolved_guids.get(guid, guid) - if mapped_guid not in created_guids and mapped_guid not in updated_guids: + if ( + mapped_guid not in created_guids + and mapped_guid not in updated_guids + ): # Ensure any assets that do not show as either created or updated are still tracked # as possibly restored (and inject the mapped GUID in case it had a placeholder) one.guid = mapped_guid @@ -2448,7 +2648,9 @@ class AssetIdentity(AtlanObject): type_name: str qualified_name: str - def __init__(self, type_name: str, qualified_name: str, case_insensitive: bool = False): + def __init__( + self, type_name: str, qualified_name: str, case_insensitive: bool = False + ): """ Initializes an AssetIdentity. @@ -2496,7 +2698,9 @@ def _dfs(dfs_list: List[AtlasGlossaryCategory], to_add: List[AtlasGlossaryCatego class CategoryHierarchy: - def __init__(self, top_level: Set[str], stub_dict: Dict[str, AtlasGlossaryCategory]): + def __init__( + self, top_level: Set[str], stub_dict: Dict[str, AtlasGlossaryCategory] + ): self._top_level = top_level self._root_categories: list = [] self._categories: Dict[str, AtlasGlossaryCategory] = {} @@ -2510,7 +2714,9 @@ def _build_category_dict(self, stub_dict: Dict[str, AtlasGlossaryCategory]): parent_guid = parent.guid full_parent = self._categories.get(parent_guid, stub_dict[parent_guid]) children: List[AtlasGlossaryCategory] = ( - [] if full_parent.children_categories is None else full_parent.children_categories.copy() + [] + if full_parent.children_categories is None + else full_parent.children_categories.copy() ) if category not in children: children.append(category) diff --git a/pyatlan/client/atlan.py b/pyatlan/client/atlan.py index 405e394e6..662131718 100644 --- a/pyatlan/client/atlan.py +++ b/pyatlan/client/atlan.py @@ -395,7 +395,9 @@ def _call_api_internal( if not line: continue if not line.startswith("data: "): - raise ErrorCode.UNABLE_TO_DESERIALIZE.exception_with_parameters(line) + raise ErrorCode.UNABLE_TO_DESERIALIZE.exception_with_parameters( + line + ) events.append(json.loads(line.split("data: ")[1])) if text_response: response_ = response.text @@ -420,8 +422,14 @@ def _call_api_internal( else: with contextlib.suppress(ValueError, json.decoder.JSONDecodeError): error_info = json.loads(response.text) - error_code = error_info.get("errorCode", 0) or error_info.get("code", 0) or error_info.get("status") - error_message = error_info.get("errorMessage", "") or error_info.get("message", "") + error_code = ( + error_info.get("errorCode", 0) + or error_info.get("code", 0) + or error_info.get("status") + ) + error_message = error_info.get( + "errorMessage", "" + ) or error_info.get("message", "") error_cause = error_info.get("errorCause", []) causes = error_info.get("causes", []) backend_error_id = error_info.get("errorId") @@ -434,14 +442,17 @@ def _call_api_internal( for cause in causes ] # Join the error cause details into a single string, separated by newlines - error_cause_details_str = "\n".join(error_cause_details) if error_cause_details else "" + error_cause_details_str = ( + "\n".join(error_cause_details) if error_cause_details else "" + ) # Retry with impersonation (if _user_id is present) # on authentication failure (token may have expired) if ( self._user_id and not self._has_retried_for_401 - and response.status_code == ErrorCode.AUTHENTICATION_PASSTHROUGH.http_error_code + and response.status_code + == ErrorCode.AUTHENTICATION_PASSTHROUGH.http_error_code ): try: return self._handle_401_token_refresh( @@ -460,7 +471,9 @@ def _call_api_internal( ) if error_code and error_message: - error = ERROR_CODE_FOR_HTTP_STATUS.get(response.status_code, ErrorCode.ERROR_PASSTHROUGH) + error = ERROR_CODE_FOR_HTTP_STATUS.get( + response.status_code, ErrorCode.ERROR_PASSTHROUGH + ) # Raise exception with error details and causes raise error.exception_with_parameters( error_code, @@ -513,7 +526,9 @@ def _upload_file(self, api, file=None, filename=None): post_data = generator.get_post_data() api.produces = f"multipart/form-data; boundary={generator.boundary}" path = self._create_path(api) - params = self._create_params(api, query_params=None, request_obj=None, exclude_unset=True) + params = self._create_params( + api, query_params=None, request_obj=None, exclude_unset=True + ) if LOGGER.isEnabledFor(logging.DEBUG): self._api_logger(api, path) return self._call_api_internal(api, path, params, binary_data=post_data) @@ -548,7 +563,9 @@ def _presigned_url_file_download(self, api: API, file_path: str): params["headers"].pop("authorization", None) return self._call_api_internal(api, path, params, download_file_path=file_path) - def _create_params(self, api: API, query_params, request_obj, exclude_unset: bool = True): + def _create_params( + self, api: API, query_params, request_obj, exclude_unset: bool = True + ): params = copy.deepcopy(self._request_params) params["headers"]["Accept"] = api.consumes params["headers"]["content-type"] = api.produces @@ -556,7 +573,9 @@ def _create_params(self, api: API, query_params, request_obj, exclude_unset: boo params["params"] = query_params if request_obj is not None: if isinstance(request_obj, AtlanObject): - params["data"] = request_obj.json(by_alias=True, exclude_unset=exclude_unset) + params["data"] = request_obj.json( + by_alias=True, exclude_unset=exclude_unset + ) elif api.consumes == APPLICATION_ENCODED_FORM: params["data"] = request_obj else: @@ -621,7 +640,9 @@ def get_roles( DeprecationWarning, stacklevel=2, ) - return self.role.get(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) + return self.role.get( + limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset + ) def get_all_roles(self) -> RoleResponse: """Deprecated - use self.role.get_all() instead.""" @@ -683,7 +704,9 @@ def get_groups( DeprecationWarning, stacklevel=2, ) - return self.group.get(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) + return self.group.get( + limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset + ) def get_all_groups( self, @@ -816,7 +839,9 @@ def get_users( DeprecationWarning, stacklevel=2, ) - return self.user.get(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) + return self.user.get( + limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset + ) def get_all_users( self, @@ -973,7 +998,9 @@ def upsert_merging_cm( DeprecationWarning, stacklevel=2, ) - return self.asset.save_merging_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) + return self.asset.save_merging_cm( + entity=entity, replace_atlan_tags=replace_atlan_tags + ) def save_merging_cm( self, entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False @@ -985,9 +1012,13 @@ def save_merging_cm( DeprecationWarning, stacklevel=2, ) - return self.asset.save_merging_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) + return self.asset.save_merging_cm( + entity=entity, replace_atlan_tags=replace_atlan_tags + ) - def update_merging_cm(self, entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse: + def update_merging_cm( + self, entity: Asset, replace_atlan_tags: bool = False + ) -> AssetMutationResponse: """Deprecated - use asset.update_merging_cm() instead.""" warn( "This method is deprecated, please use 'asset.update_merging_cm' instead, which offers identical " @@ -995,7 +1026,9 @@ def update_merging_cm(self, entity: Asset, replace_atlan_tags: bool = False) -> DeprecationWarning, stacklevel=2, ) - return self.asset.update_merging_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) + return self.asset.update_merging_cm( + entity=entity, replace_atlan_tags=replace_atlan_tags + ) def upsert_replacing_cm( self, entity: Union[Asset, List[Asset]], replace_atlan_tagss: bool = False @@ -1007,7 +1040,9 @@ def upsert_replacing_cm( DeprecationWarning, stacklevel=2, ) - return self.asset.save_replacing_cm(entity=entity, replace_atlan_tags=replace_atlan_tagss) + return self.asset.save_replacing_cm( + entity=entity, replace_atlan_tags=replace_atlan_tagss + ) def save_replacing_cm( self, entity: Union[Asset, List[Asset]], replace_atlan_tags: bool = False @@ -1019,9 +1054,13 @@ def save_replacing_cm( DeprecationWarning, stacklevel=2, ) - return self.asset.save_replacing_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) + return self.asset.save_replacing_cm( + entity=entity, replace_atlan_tags=replace_atlan_tags + ) - def update_replacing_cm(self, entity: Asset, replace_atlan_tags: bool = False) -> AssetMutationResponse: + def update_replacing_cm( + self, entity: Asset, replace_atlan_tags: bool = False + ) -> AssetMutationResponse: """Deprecated - use asset.update_replacing_cm() instead.""" warn( "This method is deprecated, please use 'asset.update_replacing_cm' instead, which offers identical " @@ -1029,9 +1068,13 @@ def update_replacing_cm(self, entity: Asset, replace_atlan_tags: bool = False) - DeprecationWarning, stacklevel=2, ) - return self.asset.update_replacing_cm(entity=entity, replace_atlan_tags=replace_atlan_tags) + return self.asset.update_replacing_cm( + entity=entity, replace_atlan_tags=replace_atlan_tags + ) - def purge_entity_by_guid(self, guid: Union[str, List[str]]) -> AssetMutationResponse: + def purge_entity_by_guid( + self, guid: Union[str, List[str]] + ) -> AssetMutationResponse: """Deprecated - use asset.purge_by_guid() instead.""" warn( "This method is deprecated, please use 'asset.purge_by_guid' instead, which offers identical " @@ -1041,7 +1084,9 @@ def purge_entity_by_guid(self, guid: Union[str, List[str]]) -> AssetMutationResp ) return self.asset.purge_by_guid(guid=guid) - def delete_entity_by_guid(self, guid: Union[str, List[str]]) -> AssetMutationResponse: + def delete_entity_by_guid( + self, guid: Union[str, List[str]] + ) -> AssetMutationResponse: """Deprecated - use asset.delete_by_guid() instead.""" warn( "This method is deprecated, please use 'asset.delete_by_guid' instead, which offers identical " @@ -1078,7 +1123,9 @@ def get_all_typedefs(self) -> TypeDefResponse: ) return self.typedef.get_all() - def get_typedefs(self, type_category: Union[AtlanTypeCategory, List[AtlanTypeCategory]]) -> TypeDefResponse: + def get_typedefs( + self, type_category: Union[AtlanTypeCategory, List[AtlanTypeCategory]] + ) -> TypeDefResponse: """Deprecated - use typedef.get() instead.""" warn( "This method is deprecated, please use 'typedef.get' instead, which offers identical functionality.", @@ -1143,7 +1190,9 @@ def add_atlan_tags( ) @validate_arguments - def remove_atlan_tag(self, asset_type: Type[A], qualified_name: str, atlan_tag_name: str) -> None: + def remove_atlan_tag( + self, asset_type: Type[A], qualified_name: str, atlan_tag_name: str + ) -> None: """Deprecated - use asset.remove_atlan_tag() instead.""" warn( "This method is deprecated, please use 'asset.remove_atlan_tag' instead, which offers identical " @@ -1182,7 +1231,9 @@ def update_certificate( ) @validate_arguments - def remove_certificate(self, asset_type: Type[A], qualified_name: str, name: str) -> Optional[A]: + def remove_certificate( + self, asset_type: Type[A], qualified_name: str, name: str + ) -> Optional[A]: """Deprecated - use asset.remove_certificate() instead.""" warn( "This method is deprecated, please use 'asset.remove_certificate' instead, which offers identical " @@ -1190,7 +1241,9 @@ def remove_certificate(self, asset_type: Type[A], qualified_name: str, name: str DeprecationWarning, stacklevel=2, ) - return self.asset.remove_certificate(asset_type=asset_type, qualified_name=qualified_name, name=name) + return self.asset.remove_certificate( + asset_type=asset_type, qualified_name=qualified_name, name=name + ) @validate_arguments def update_announcement( @@ -1215,7 +1268,9 @@ def update_announcement( ) @validate_arguments - def remove_announcement(self, asset_type: Type[A], qualified_name: str, name: str) -> Optional[A]: + def remove_announcement( + self, asset_type: Type[A], qualified_name: str, name: str + ) -> Optional[A]: """Deprecated - use asset.remove_announcement() instead.""" warn( "This method is deprecated, please use 'asset.remove_announcement' instead, which offers identical " @@ -1223,9 +1278,13 @@ def remove_announcement(self, asset_type: Type[A], qualified_name: str, name: st DeprecationWarning, stacklevel=2, ) - return self.asset.remove_announcement(asset_type=asset_type, qualified_name=qualified_name, name=name) + return self.asset.remove_announcement( + asset_type=asset_type, qualified_name=qualified_name, name=name + ) - def update_custom_metadata_attributes(self, guid: str, custom_metadata: CustomMetadataDict): + def update_custom_metadata_attributes( + self, guid: str, custom_metadata: CustomMetadataDict + ): """Deprecated - use asset.update_custom_metadata_attributes() instead.""" warn( "This method is deprecated, please use 'asset.update_custom_metadata_attributes' instead, which offers " @@ -1233,7 +1292,9 @@ def update_custom_metadata_attributes(self, guid: str, custom_metadata: CustomMe DeprecationWarning, stacklevel=2, ) - self.asset.update_custom_metadata_attributes(guid=guid, custom_metadata=custom_metadata) + self.asset.update_custom_metadata_attributes( + guid=guid, custom_metadata=custom_metadata + ) def replace_custom_metadata(self, guid: str, custom_metadata: CustomMetadataDict): """Deprecated - use asset.replace_custom_metadata() instead.""" @@ -1269,7 +1330,9 @@ def append_terms( DeprecationWarning, stacklevel=2, ) - return self.asset.append_terms(asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name) + return self.asset.append_terms( + asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name + ) @validate_arguments def replace_terms( @@ -1286,7 +1349,9 @@ def replace_terms( DeprecationWarning, stacklevel=2, ) - return self.asset.replace_terms(asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name) + return self.asset.replace_terms( + asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name + ) @validate_arguments def remove_terms( @@ -1302,7 +1367,9 @@ def remove_terms( DeprecationWarning, stacklevel=2, ) - return self.asset.remove_terms(asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name) + return self.asset.remove_terms( + asset_type=asset_type, terms=terms, guid=guid, qualified_name=qualified_name + ) @validate_arguments def find_connections_by_name( @@ -1318,9 +1385,13 @@ def find_connections_by_name( DeprecationWarning, stacklevel=2, ) - return self.asset.find_connections_by_name(name=name, connector_type=connector_type, attributes=attributes) + return self.asset.find_connections_by_name( + name=name, connector_type=connector_type, attributes=attributes + ) - def get_lineage_list(self, lineage_request: LineageListRequest) -> LineageListResults: + def get_lineage_list( + self, lineage_request: LineageListRequest + ) -> LineageListResults: """Deprecated - use asset.get_lineage_list() instead.""" warn( "This method is deprecated, please use 'asset.get_lineage_list' instead, which offers identical " @@ -1330,23 +1401,31 @@ def get_lineage_list(self, lineage_request: LineageListRequest) -> LineageListRe ) return self.asset.get_lineage_list(lineage_request=lineage_request) - def add_api_token_as_admin(self, asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]: + def add_api_token_as_admin( + self, asset_guid: str, impersonation_token: str + ) -> Optional[AssetMutationResponse]: """Deprecated - use user.add_as_admin() instead.""" warn( "This method is deprecated, please use 'user.add_as_admin' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) - return self.user.add_as_admin(asset_guid=asset_guid, impersonation_token=impersonation_token) + return self.user.add_as_admin( + asset_guid=asset_guid, impersonation_token=impersonation_token + ) - def add_api_token_as_viewer(self, asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]: + def add_api_token_as_viewer( + self, asset_guid: str, impersonation_token: str + ) -> Optional[AssetMutationResponse]: """Deprecated - use user.add_as_viewer() instead.""" warn( "This method is deprecated, please use 'user.add_as_viewer' instead, which offers identical functionality.", DeprecationWarning, stacklevel=2, ) - return self.user.add_as_viewer(asset_guid=asset_guid, impersonation_token=impersonation_token) + return self.user.add_as_viewer( + asset_guid=asset_guid, impersonation_token=impersonation_token + ) def get_api_tokens( self, @@ -1362,7 +1441,9 @@ def get_api_tokens( DeprecationWarning, stacklevel=2, ) - return self.token.get(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) + return self.token.get( + limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset + ) def get_api_token_by_name(self, display_name: str) -> Optional[ApiToken]: """Deprecated - use token.get_by_name() instead.""" @@ -1431,7 +1512,9 @@ def purge_api_token(self, guid: str) -> None: ) self.token.purge(guid=guid) - def get_keycloak_events(self, keycloak_request: KeycloakEventRequest) -> KeycloakEventResponse: + def get_keycloak_events( + self, keycloak_request: KeycloakEventRequest + ) -> KeycloakEventResponse: """Deprecated - use admin.get_keycloak_events() instead.""" warn( "This method is deprecated, please use 'admin.get_keycloak_events' instead, which offers identical " @@ -1499,7 +1582,9 @@ def find_glossary_by_name( def find_category_fast_by_name( self, name: constr(strip_whitespace=True, min_length=1, strict=True), # type: ignore - glossary_qualified_name: constr(strip_whitespace=True, min_length=1, strict=True), # type: ignore + glossary_qualified_name: constr( # type: ignore + strip_whitespace=True, min_length=1, strict=True + ), attributes: Optional[List[StrictStr]] = None, ) -> List[AtlasGlossaryCategory]: """Deprecated - use asset.find_category_fast_by_name() instead.""" @@ -1529,13 +1614,17 @@ def find_category_by_name( DeprecationWarning, stacklevel=2, ) - return self.asset.find_category_by_name(name=name, glossary_name=glossary_name, attributes=attributes) + return self.asset.find_category_by_name( + name=name, glossary_name=glossary_name, attributes=attributes + ) @validate_arguments def find_term_fast_by_name( self, name: constr(strip_whitespace=True, min_length=1, strict=True), # type: ignore - glossary_qualified_name: constr(strip_whitespace=True, min_length=1, strict=True), # type: ignore + glossary_qualified_name: constr( # type: ignore + strip_whitespace=True, min_length=1, strict=True + ), attributes: Optional[List[StrictStr]] = None, ) -> AtlasGlossaryTerm: """Deprecated - use asset.find_category_by_name() instead.""" @@ -1565,10 +1654,14 @@ def find_term_by_name( DeprecationWarning, stacklevel=2, ) - return self.asset.find_term_by_name(name=name, glossary_name=glossary_name, attributes=attributes) + return self.asset.find_term_by_name( + name=name, glossary_name=glossary_name, attributes=attributes + ) @contextlib.contextmanager - def max_retries(self, max_retries: Retry = CONNECTION_RETRY) -> Generator[None, None, None]: + def max_retries( + self, max_retries: Retry = CONNECTION_RETRY + ) -> Generator[None, None, None]: """Creates a context manger that can used to temporarily change parameters used for retrying connnections. The original Retry information will be restored when the context is exited.""" if self.base_url == "INTERNAL": diff --git a/pyatlan/client/audit.py b/pyatlan/client/audit.py index 99443e31b..a90715d36 100644 --- a/pyatlan/client/audit.py +++ b/pyatlan/client/audit.py @@ -23,7 +23,9 @@ class AuditClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @staticmethod @@ -39,8 +41,13 @@ def _prepare_sorts_for_audit_bulk_search(sorts: List[SortItem]) -> List[SortItem def _get_audit_bulk_search_log_message(self, bulk): return ( - "Audit bulk search option is enabled. " if bulk else "Result size (%s) exceeds threshold (%s). " - ) + "Ignoring requests for offset-based paging and using timestamp-based paging instead." + ( + "Audit bulk search option is enabled. " + if bulk + else "Result size (%s) exceeds threshold (%s). " + ) + + "Ignoring requests for offset-based paging and using timestamp-based paging instead." + ) @validate_arguments def search(self, criteria: AuditSearchRequest, bulk=False) -> AuditSearchResults: @@ -67,7 +74,9 @@ def search(self, criteria: AuditSearchRequest, bulk=False) -> AuditSearchResults if bulk: if criteria.dsl.sort and len(criteria.dsl.sort) > 1: raise ErrorCode.UNABLE_TO_RUN_AUDIT_BULK_WITH_SORTS.exception_with_parameters() - criteria.dsl.sort = self._prepare_sorts_for_audit_bulk_search(criteria.dsl.sort) + criteria.dsl.sort = self._prepare_sorts_for_audit_bulk_search( + criteria.dsl.sort + ) LOGGER.debug(self._get_audit_bulk_search_log_message(bulk)) raw_json = self._client._call_api( @@ -78,21 +87,26 @@ def search(self, criteria: AuditSearchRequest, bulk=False) -> AuditSearchResults try: entity_audits = parse_obj_as(List[EntityAudit], raw_json[ENTITY_AUDITS]) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err else: entity_audits = [] count = raw_json["totalCount"] if "totalCount" in raw_json else 0 - if count > AuditSearchResults._MASS_EXTRACT_THRESHOLD and not AuditSearchResults.presorted_by_timestamp( - criteria.dsl.sort + if ( + count > AuditSearchResults._MASS_EXTRACT_THRESHOLD + and not AuditSearchResults.presorted_by_timestamp(criteria.dsl.sort) ): # If there is any user-specified sorting present in the search request if criteria.dsl.sort and len(criteria.dsl.sort) > 1: raise ErrorCode.UNABLE_TO_RUN_AUDIT_BULK_WITH_SORTS.exception_with_parameters() # Re-fetch the first page results with updated timestamp sorting # for bulk search if count > _MASS_EXTRACT_THRESHOLD (10,000 assets) - criteria.dsl.sort = self._prepare_sorts_for_audit_bulk_search(criteria.dsl.sort) + criteria.dsl.sort = self._prepare_sorts_for_audit_bulk_search( + criteria.dsl.sort + ) LOGGER.debug( self._get_audit_bulk_search_log_message(bulk), count, diff --git a/pyatlan/client/common.py b/pyatlan/client/common.py index 85b3dbe65..d717182cc 100644 --- a/pyatlan/client/common.py +++ b/pyatlan/client/common.py @@ -28,7 +28,9 @@ def _call_api( ): pass - def max_retries(self, max_retries: Retry = CONNECTION_RETRY) -> Generator[None, None, None]: + def max_retries( + self, max_retries: Retry = CONNECTION_RETRY + ) -> Generator[None, None, None]: pass def _s3_presigned_url_file_upload(self, api, upload_file: Any): diff --git a/pyatlan/client/constants.py b/pyatlan/client/constants.py index 35995feeb..2f54887a1 100644 --- a/pyatlan/client/constants.py +++ b/pyatlan/client/constants.py @@ -26,9 +26,15 @@ GET_ROLES = API(ROLE_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) # Group APIs -GET_GROUPS = API(GROUP_API_V2, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) -CREATE_GROUP = API(GROUP_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) -UPDATE_GROUP = API(GROUP_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +GET_GROUPS = API( + GROUP_API_V2, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) +CREATE_GROUP = API( + GROUP_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) +UPDATE_GROUP = API( + GROUP_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) DELETE_GROUP = API( GROUP_API + "/{group_guid}/delete", HTTPMethod.POST, @@ -76,10 +82,14 @@ HTTPStatus.OK, endpoint=EndPoint.HERACLES, ) -GET_CURRENT_USER = API(f"{USER_API}/current", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +GET_CURRENT_USER = API( + f"{USER_API}/current", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) # SQL parsing APIs -PARSE_QUERY = API(f"{QUERY_API}/parse", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HEKA) +PARSE_QUERY = API( + f"{QUERY_API}/parse", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HEKA +) # For running SQL queries EVENT_STREAM = "text/event-stream" @@ -93,16 +103,28 @@ ) # File upload APIs -UPLOAD_IMAGE = API(IMAGE_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +UPLOAD_IMAGE = API( + IMAGE_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) # Keycloak event APIs -KEYCLOAK_EVENTS = API(f"{LOGS_API}/login", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) -ADMIN_EVENTS = API(f"{LOGS_API}/main", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +KEYCLOAK_EVENTS = API( + f"{LOGS_API}/login", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) +ADMIN_EVENTS = API( + f"{LOGS_API}/main", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) # API token APIs -GET_API_TOKENS = API(TOKENS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) -UPSERT_API_TOKEN = API(TOKENS_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) -DELETE_API_TOKEN = API(TOKENS_API, HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +GET_API_TOKENS = API( + TOKENS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) +UPSERT_API_TOKEN = API( + TOKENS_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) +DELETE_API_TOKEN = API( + TOKENS_API, HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) GET_TOKEN = API( "/auth/realms/default/protocol/openid-connect/token", @@ -134,19 +156,29 @@ BULK_SET_CLASSIFICATIONS = "bulk/setClassifications" BULK_HEADERS = "bulk/headers" -BULK_UPDATE = API(ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +BULK_UPDATE = API( + ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) # Lineage APIs -GET_LINEAGE = API("lineage/getlineage", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) -GET_LINEAGE_LIST = API("lineage/list", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +GET_LINEAGE = API( + "lineage/getlineage", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) +GET_LINEAGE_LIST = API( + "lineage/list", HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) # Entity APIs -GET_ENTITY_BY_GUID = API(f"{ENTITY_API}guid", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +GET_ENTITY_BY_GUID = API( + f"{ENTITY_API}guid", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) GET_ENTITY_BY_UNIQUE_ATTRIBUTE = API( f"{ENTITY_API}uniqueAttribute/type", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS, ) -GET_ENTITIES_BY_GUIDS = API(ENTITY_BULK_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +GET_ENTITIES_BY_GUIDS = API( + ENTITY_BULK_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) GET_ENTITIES_BY_UNIQUE_ATTRIBUTE = API( f"{ENTITY_BULK_API}uniqueAttribute/type", HTTPMethod.GET, @@ -166,9 +198,13 @@ endpoint=EndPoint.ATLAS, ) -GET_AUDIT_EVENTS = API(ENTITY_API + "{guid}/audit", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +GET_AUDIT_EVENTS = API( + ENTITY_API + "{guid}/audit", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) CREATE_ENTITY = API(ENTITY_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) -CREATE_ENTITIES = API(ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +CREATE_ENTITIES = API( + ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) UPDATE_ENTITY = API(ENTITY_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) UPDATE_ENTITY_BY_ATTRIBUTE = API( f"{ENTITY_API}uniqueAttribute/type/", @@ -176,7 +212,9 @@ HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS, ) -UPDATE_ENTITIES = API(ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +UPDATE_ENTITIES = API( + ENTITY_BULK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) PARTIAL_UPDATE_ENTITY_BY_ATTRIBUTE = API( f"{ENTITY_API}uniqueAttribute/type/", HTTPMethod.PUT, @@ -189,15 +227,21 @@ HTTPStatus.OK, endpoint=EndPoint.ATLAS, ) -DELETE_ENTITY_BY_GUID = API(f"{ENTITY_API}guid", HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +DELETE_ENTITY_BY_GUID = API( + f"{ENTITY_API}guid", HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) DELETE_ENTITY_BY_ATTRIBUTE = API( f"{ENTITY_API}uniqueAttribute/type/", HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS, ) -DELETE_ENTITIES_BY_GUIDS = API(ENTITY_BULK_API, HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.ATLAS) -PURGE_ENTITIES_BY_GUIDS = API(ENTITY_PURGE_API, HTTPMethod.PUT, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +DELETE_ENTITIES_BY_GUIDS = API( + ENTITY_BULK_API, HTTPMethod.DELETE, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) +PURGE_ENTITIES_BY_GUIDS = API( + ENTITY_PURGE_API, HTTPMethod.PUT, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) # Classification APIs GET_CLASSIFICATIONS = API( @@ -255,12 +299,15 @@ endpoint=EndPoint.ATLAS, ) DELETE_CLASSIFICATION_BY_TYPE_AND_ATTRIBUTE = API( - ENTITY_API + "uniqueAttribute/type/{type_name}/classification/{classification_name}", + ENTITY_API + + "uniqueAttribute/type/{type_name}/classification/{classification_name}", HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS, ) -GET_BULK_HEADERS = API(ENTITY_API + BULK_HEADERS, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +GET_BULK_HEADERS = API( + ENTITY_API + BULK_HEADERS, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) # Business Attributes APIs ADD_BUSINESS_ATTRIBUTE = API( @@ -312,7 +359,9 @@ # Glossary APIS GLOSSARY_URI = "glossary" -GET_ALL_GLOSSARIES = API(GLOSSARY_URI, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +GET_ALL_GLOSSARIES = API( + GLOSSARY_URI, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) # Labels APIs ADD_LABELS = API( @@ -378,18 +427,28 @@ endpoint=EndPoint.HERACLES, ) -WORKFLOW_INDEX_SEARCH = API(WORKFLOW_INDEX_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) -WORKFLOW_INDEX_RUN_SEARCH = API(WORKFLOW_INDEX_RUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +WORKFLOW_INDEX_SEARCH = API( + WORKFLOW_INDEX_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) +WORKFLOW_INDEX_RUN_SEARCH = API( + WORKFLOW_INDEX_RUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) # triggers a workflow using the current user's credentials WORKFLOW_RERUN_API = "workflows/submit" -WORKFLOW_RERUN = API(WORKFLOW_RERUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +WORKFLOW_RERUN = API( + WORKFLOW_RERUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) # triggers a workflow using the workflow owner's credentials WORKFLOW_OWNER_RERUN_API = "workflows/triggerAsOwner" -WORKFLOW_OWNER_RERUN = API(WORKFLOW_OWNER_RERUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +WORKFLOW_OWNER_RERUN = API( + WORKFLOW_OWNER_RERUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) WORKFLOW_RUN_API = "workflows?submit=true" -WORKFLOW_RUN = API(WORKFLOW_RUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +WORKFLOW_RUN = API( + WORKFLOW_RUN_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) WORKFLOW_API = "workflows" WORKFLOW_UPDATE = API( WORKFLOW_API + "/{workflow_name}", @@ -444,7 +503,9 @@ HTTPStatus.OK, endpoint=EndPoint.HERACLES, ) -GET_ALL_CREDENTIALS = API(CREDENTIALS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +GET_ALL_CREDENTIALS = API( + CREDENTIALS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) UPDATE_CREDENTIAL_BY_GUID = API( CREDENTIALS_API + "/{credential_guid}", HTTPMethod.POST, @@ -466,7 +527,9 @@ AUDIT_API = "entity/auditSearch" AUDIT_SEARCH = API(AUDIT_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) SEARCH_LOG_API = "search/searchlog" -SEARCH_LOG = API(SEARCH_LOG_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) +SEARCH_LOG = API( + SEARCH_LOG_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) TASK_API = "task/search" TASK_SEARCH = API(TASK_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) @@ -477,14 +540,30 @@ GET_BY_NAME_TEMPLATE = TYPES_API + "{path_type}/name/{name}" GET_BY_GUID_TEMPLATE = TYPES_API + "{path_type}/guid/{guid}" -GET_TYPE_DEF_BY_NAME = API(TYPEDEF_BY_NAME, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) -GET_TYPE_DEF_BY_GUID = API(TYPEDEF_BY_GUID, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) -GET_ALL_TYPE_DEFS = API(TYPEDEFS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) -GET_ALL_TYPE_DEF_HEADERS = API(f"{TYPEDEFS_API}headers", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS) -UPDATE_TYPE_DEFS = API(TYPEDEFS_API, HTTPMethod.PUT, HTTPStatus.OK, endpoint=EndPoint.ATLAS) -CREATE_TYPE_DEFS = API(TYPEDEFS_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS) -DELETE_TYPE_DEFS = API(TYPEDEFS_API, HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS) -DELETE_TYPE_DEF_BY_NAME = API(TYPEDEF_BY_NAME, HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS) +GET_TYPE_DEF_BY_NAME = API( + TYPEDEF_BY_NAME, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) +GET_TYPE_DEF_BY_GUID = API( + TYPEDEF_BY_GUID, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) +GET_ALL_TYPE_DEFS = API( + TYPEDEFS_API, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) +GET_ALL_TYPE_DEF_HEADERS = API( + f"{TYPEDEFS_API}headers", HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) +UPDATE_TYPE_DEFS = API( + TYPEDEFS_API, HTTPMethod.PUT, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) +CREATE_TYPE_DEFS = API( + TYPEDEFS_API, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.ATLAS +) +DELETE_TYPE_DEFS = API( + TYPEDEFS_API, HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS +) +DELETE_TYPE_DEF_BY_NAME = API( + TYPEDEF_BY_NAME, HTTPMethod.DELETE, HTTPStatus.NO_CONTENT, endpoint=EndPoint.ATLAS +) SSO_API = "idp/" SSO_GROUP_MAPPER = SSO_API + "{sso_alias}/mappers" @@ -495,8 +574,12 @@ HTTPStatus.OK, endpoint=EndPoint.HERACLES, ) -GET_ALL_SSO_GROUP_MAPPING = API(SSO_GROUP_MAPPER, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES) -CREATE_SSO_GROUP_MAPPING = API(SSO_GROUP_MAPPER, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES) +GET_ALL_SSO_GROUP_MAPPING = API( + SSO_GROUP_MAPPER, HTTPMethod.GET, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) +CREATE_SSO_GROUP_MAPPING = API( + SSO_GROUP_MAPPER, HTTPMethod.POST, HTTPStatus.OK, endpoint=EndPoint.HERACLES +) UPDATE_SSO_GROUP_MAPPING = API( SSO_GROUP_MAPPER + "/{group_map_id}", HTTPMethod.POST, diff --git a/pyatlan/client/contract.py b/pyatlan/client/contract.py index 54a1b352d..978f88fc4 100644 --- a/pyatlan/client/contract.py +++ b/pyatlan/client/contract.py @@ -16,7 +16,9 @@ class ContractClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @validate_arguments @@ -35,6 +37,8 @@ def generate_initial_spec( """ response = self._client._call_api( CONTRACT_INIT_API, - request_obj=InitRequest(asset_type=asset.type_name, asset_qualified_name=asset.qualified_name), + request_obj=InitRequest( + asset_type=asset.type_name, asset_qualified_name=asset.qualified_name + ), ) return response.get("contract") diff --git a/pyatlan/client/credential.py b/pyatlan/client/credential.py index fcc2ba993..eea81ed7d 100644 --- a/pyatlan/client/credential.py +++ b/pyatlan/client/credential.py @@ -31,7 +31,9 @@ class CredentialClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @validate_arguments @@ -68,7 +70,9 @@ def get(self, guid: str) -> CredentialResponse: :returns: A CredentialResponse instance. :raises: AtlanError on any error during API invocation. """ - raw_json = self._client._call_api(GET_CREDENTIAL_BY_GUID.format_path({"credential_guid": guid})) + raw_json = self._client._call_api( + GET_CREDENTIAL_BY_GUID.format_path({"credential_guid": guid}) + ) if not isinstance(raw_json, dict): return raw_json return CredentialResponse(**raw_json) @@ -97,7 +101,9 @@ def get_all( if offset is not None: params["offset"] = offset - raw_json = self._client._call_api(GET_ALL_CREDENTIALS.format_path_with_params(), query_params=params) + raw_json = self._client._call_api( + GET_ALL_CREDENTIALS.format_path_with_params(), query_params=params + ) if not isinstance(raw_json, dict) or "records" not in raw_json: raise ErrorCode.JSON_ERROR.exception_with_parameters( @@ -117,7 +123,9 @@ def purge_by_guid(self, guid: str) -> CredentialResponse: :returns: details of the hard-deleted asset(s) :raises AtlanError: on any API communication issue """ - raw_json = self._client._call_api(DELETE_CREDENTIALS_BY_GUID.format_path({"credential_guid": guid})) + raw_json = self._client._call_api( + DELETE_CREDENTIALS_BY_GUID.format_path({"credential_guid": guid}) + ) return raw_json @@ -152,7 +160,9 @@ def test_and_update(self, credential: Credential) -> CredentialResponse: """ test_response = self.test(credential=credential) if not test_response.is_successful: - raise ErrorCode.INVALID_CREDENTIALS.exception_with_parameters(test_response.message) + raise ErrorCode.INVALID_CREDENTIALS.exception_with_parameters( + test_response.message + ) if not credential.id: raise ErrorCode.MISSING_TOKEN_ID.exception_with_parameters() raw_json = self._client._call_api( diff --git a/pyatlan/client/file.py b/pyatlan/client/file.py index 57ef3f320..35465cc9d 100644 --- a/pyatlan/client/file.py +++ b/pyatlan/client/file.py @@ -19,7 +19,9 @@ class FileClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @validate_arguments @@ -49,21 +51,29 @@ def upload_file(self, presigned_url: str, file_path: str) -> None: try: upload_file = open(file_path, "rb") except FileNotFoundError as err: - raise ErrorCode.INVALID_UPLOAD_FILE_PATH.exception_with_parameters(str(err.strerror), file_path) + raise ErrorCode.INVALID_UPLOAD_FILE_PATH.exception_with_parameters( + str(err.strerror), file_path + ) if CloudStorageIdentifier.S3 in presigned_url: return self._client._s3_presigned_url_file_upload( upload_file=upload_file, - api=PRESIGNED_URL_UPLOAD_S3.format_path({"presigned_url_put": presigned_url}), + api=PRESIGNED_URL_UPLOAD_S3.format_path( + {"presigned_url_put": presigned_url} + ), ) elif CloudStorageIdentifier.AZURE_BLOB in presigned_url: return self._client._azure_blob_presigned_url_file_upload( upload_file=upload_file, - api=PRESIGNED_URL_UPLOAD_AZURE_BLOB.format_path({"presigned_url_put": presigned_url}), + api=PRESIGNED_URL_UPLOAD_AZURE_BLOB.format_path( + {"presigned_url_put": presigned_url} + ), ) elif CloudStorageIdentifier.GCS in presigned_url: return self._client._gcs_presigned_url_file_upload( upload_file=upload_file, - api=PRESIGNED_URL_UPLOAD_GCS.format_path({"presigned_url_put": presigned_url}), + api=PRESIGNED_URL_UPLOAD_GCS.format_path( + {"presigned_url_put": presigned_url} + ), ) else: raise ErrorCode.UNSUPPORTED_PRESIGNED_URL.exception_with_parameters() @@ -85,5 +95,7 @@ def download_file( """ return self._client._presigned_url_file_download( file_path=file_path, - api=PRESIGNED_URL_DOWNLOAD.format_path({"presigned_url_get": presigned_url}), + api=PRESIGNED_URL_DOWNLOAD.format_path( + {"presigned_url_get": presigned_url} + ), ) diff --git a/pyatlan/client/group.py b/pyatlan/client/group.py index cc53d44b5..5fafcb2a8 100644 --- a/pyatlan/client/group.py +++ b/pyatlan/client/group.py @@ -33,7 +33,9 @@ class GroupClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @validate_arguments @@ -53,7 +55,9 @@ def create( payload = CreateGroupRequest(group=group) if user_ids: payload.users = user_ids - raw_json = self._client._call_api(CREATE_GROUP, request_obj=payload, exclude_unset=True) + raw_json = self._client._call_api( + CREATE_GROUP, request_obj=payload, exclude_unset=True + ) return CreateGroupResponse(**raw_json) @validate_arguments @@ -117,7 +121,9 @@ def get( columns=columns, ) endpoint = GET_GROUPS.format_path_with_params() - raw_json = self._client._call_api(api=endpoint, query_params=request.query_params) + raw_json = self._client._call_api( + api=endpoint, query_params=request.query_params + ) return GroupResponse( client=self._client, endpoint=GET_GROUPS, @@ -177,7 +183,9 @@ def get_by_name( return None @validate_arguments - def get_members(self, guid: str, request: Optional[UserRequest] = None) -> UserResponse: + def get_members( + self, guid: str, request: Optional[UserRequest] = None + ) -> UserResponse: """ Retrieves a UserResponse object which contains a list of the members (users) of a group. @@ -188,7 +196,9 @@ def get_members(self, guid: str, request: Optional[UserRequest] = None) -> UserR """ if not request: request = UserRequest() - endpoint = GET_GROUP_MEMBERS.format_path({"group_guid": guid}).format_path_with_params() + endpoint = GET_GROUP_MEMBERS.format_path( + {"group_guid": guid} + ).format_path_with_params() raw_json = self._client._call_api( api=endpoint, query_params=request.query_params, diff --git a/pyatlan/client/impersonate.py b/pyatlan/client/impersonate.py index 525023163..e935ec9b7 100644 --- a/pyatlan/client/impersonate.py +++ b/pyatlan/client/impersonate.py @@ -26,7 +26,9 @@ class ImpersonationClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client def user(self, user_id: str) -> str: @@ -104,10 +106,14 @@ def get_client_secret(self, client_guid: str) -> Optional[str]: - InvalidRequestError: If the provided GUID is invalid or retrieval fails. """ try: - raw_json = self._client._call_api(GET_CLIENT_SECRET.format_path({"client_guid": client_guid})) + raw_json = self._client._call_api( + GET_CLIENT_SECRET.format_path({"client_guid": client_guid}) + ) return raw_json and raw_json.get("value") except AtlanError as e: - raise ErrorCode.UNABLE_TO_RETRIEVE_CLIENT_SECRET.exception_with_parameters(client_guid) from e + raise ErrorCode.UNABLE_TO_RETRIEVE_CLIENT_SECRET.exception_with_parameters( + client_guid + ) from e def get_user_id(self, username: str) -> Optional[str]: """ @@ -125,6 +131,14 @@ def get_user_id(self, username: str) -> Optional[str]: GET_KEYCLOAK_USER.format_path_with_params(), query_params={"username": username or " "}, ) - return raw_json and isinstance(raw_json, list) and len(raw_json) >= 1 and raw_json[0].get("id") or None + return ( + raw_json + and isinstance(raw_json, list) + and len(raw_json) >= 1 + and raw_json[0].get("id") + or None + ) except AtlanError as e: - raise ErrorCode.UNABLE_TO_RETRIEVE_USER_GUID.exception_with_parameters(username) from e + raise ErrorCode.UNABLE_TO_RETRIEVE_USER_GUID.exception_with_parameters( + username + ) from e diff --git a/pyatlan/client/open_lineage.py b/pyatlan/client/open_lineage.py index 0705a2dea..4919965f1 100644 --- a/pyatlan/client/open_lineage.py +++ b/pyatlan/client/open_lineage.py @@ -21,7 +21,9 @@ class OpenLineageClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @validate_arguments @@ -49,9 +51,13 @@ def create_connection( create_credential = Credential() create_credential.auth_type = "atlan_api_key" - create_credential.name = f"default-{connector_type.value}-{int(utils.get_epoch_timestamp())}-0" + create_credential.name = ( + f"default-{connector_type.value}-{int(utils.get_epoch_timestamp())}-0" + ) create_credential.connector = str(connector_type.value) - create_credential.connector_config_name = f"atlan-connectors-{connector_type.value}" + create_credential.connector_config_name = ( + f"atlan-connectors-{connector_type.value}" + ) create_credential.connector_type = "event" create_credential.extras = { "events.enable-partial-assets": True, @@ -72,7 +78,9 @@ def create_connection( return client.asset.save(connection) @validate_arguments - def send(self, request: OpenLineageEvent, connector_type: AtlanConnectorType) -> None: + def send( + self, request: OpenLineageEvent, connector_type: AtlanConnectorType + ) -> None: """ Sends the OpenLineage event to Atlan to be consumed. @@ -84,12 +92,19 @@ def send(self, request: OpenLineageEvent, connector_type: AtlanConnectorType) -> try: self._client._call_api( request_obj=request, - api=OPEN_LINEAGE_SEND_EVENT_API.format_path({"connector_type": connector_type.value}), + api=OPEN_LINEAGE_SEND_EVENT_API.format_path( + {"connector_type": connector_type.value} + ), text_response=True, ) except AtlanError as e: - if e.error_code.http_error_code == HTTPStatus.UNAUTHORIZED and e.error_code.error_message.startswith( - "Unauthorized: url path not configured to receive data, urlPath:" + if ( + e.error_code.http_error_code == HTTPStatus.UNAUTHORIZED + and e.error_code.error_message.startswith( + "Unauthorized: url path not configured to receive data, urlPath:" + ) ): - raise ErrorCode.OPENLINEAGE_NOT_CONFIGURED.exception_with_parameters(connector_type.value) from e + raise ErrorCode.OPENLINEAGE_NOT_CONFIGURED.exception_with_parameters( + connector_type.value + ) from e raise e diff --git a/pyatlan/client/query.py b/pyatlan/client/query.py index ac20514cd..ed984516f 100644 --- a/pyatlan/client/query.py +++ b/pyatlan/client/query.py @@ -13,7 +13,9 @@ class QueryClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @validate_arguments diff --git a/pyatlan/client/role.py b/pyatlan/client/role.py index 007a8306b..e6c8dcd0c 100644 --- a/pyatlan/client/role.py +++ b/pyatlan/client/role.py @@ -18,7 +18,9 @@ class RoleClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @validate_arguments @@ -50,7 +52,9 @@ def get( query_params["filter"] = post_filter if sort: query_params["sort"] = sort - raw_json = self._client._call_api(GET_ROLES.format_path_with_params(), query_params) + raw_json = self._client._call_api( + GET_ROLES.format_path_with_params(), query_params + ) return RoleResponse(**raw_json) def get_all(self) -> RoleResponse: diff --git a/pyatlan/client/search_log.py b/pyatlan/client/search_log.py index 40b4e3547..41e039ea6 100644 --- a/pyatlan/client/search_log.py +++ b/pyatlan/client/search_log.py @@ -30,7 +30,9 @@ class SearchLogClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client def _map_bucket_to_user_view(self, bucket) -> Union[UserViews, None]: @@ -86,11 +88,18 @@ def _prepare_sorts_for_sl_bulk_search( def _get_bulk_search_log_message(self, bulk): return ( - "Search log bulk search option is enabled. " if bulk else "Result size (%s) exceeds threshold (%s). " - ) + "Ignoring requests for offset-based paging and using timestamp-based paging instead." + ( + "Search log bulk search option is enabled. " + if bulk + else "Result size (%s) exceeds threshold (%s). " + ) + + "Ignoring requests for offset-based paging and using timestamp-based paging instead." + ) @validate_arguments - def search(self, criteria: SearchLogRequest, bulk=False) -> Union[SearchLogViewResults, SearchLogResults]: + def search( + self, criteria: SearchLogRequest, bulk=False + ) -> Union[SearchLogViewResults, SearchLogResults]: """ Search for search logs using the provided criteria. `Note:` if the number of results exceeds the predefined threshold @@ -114,7 +123,9 @@ def search(self, criteria: SearchLogRequest, bulk=False) -> Union[SearchLogViewR if bulk: if criteria.dsl.sort and len(criteria.dsl.sort) > 2: raise ErrorCode.UNABLE_TO_RUN_SEARCH_LOG_BULK_WITH_SORTS.exception_with_parameters() - criteria.dsl.sort = self._prepare_sorts_for_sl_bulk_search(criteria.dsl.sort) + criteria.dsl.sort = self._prepare_sorts_for_sl_bulk_search( + criteria.dsl.sort + ) LOGGER.debug(self._get_bulk_search_log_message(bulk)) user_views = [] asset_views = [] @@ -122,28 +133,46 @@ def search(self, criteria: SearchLogRequest, bulk=False) -> Union[SearchLogViewR raw_json = self._call_search_api(criteria) count = raw_json.get("approximateCount", 0) - if "aggregations" in raw_json and UNIQUE_USERS in raw_json.get("aggregations", {}): + if "aggregations" in raw_json and UNIQUE_USERS in raw_json.get( + "aggregations", {} + ): try: - user_views_bucket = raw_json["aggregations"][UNIQUE_USERS].get("buckets", []) + user_views_bucket = raw_json["aggregations"][UNIQUE_USERS].get( + "buckets", [] + ) user_views = parse_obj_as( List[UserViews], - [self._map_bucket_to_user_view(user_view) for user_view in user_views_bucket], + [ + self._map_bucket_to_user_view(user_view) + for user_view in user_views_bucket + ], ) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err return SearchLogViewResults( count=count, user_views=user_views, ) - if "aggregations" in raw_json and UNIQUE_ASSETS in raw_json.get("aggregations", {}): + if "aggregations" in raw_json and UNIQUE_ASSETS in raw_json.get( + "aggregations", {} + ): try: - asset_views_bucket = raw_json["aggregations"][UNIQUE_ASSETS].get("buckets", []) + asset_views_bucket = raw_json["aggregations"][UNIQUE_ASSETS].get( + "buckets", [] + ) asset_views = parse_obj_as( List[AssetViews], - [self._map_bucket_to_asset_view(asset_view) for asset_view in asset_views_bucket], + [ + self._map_bucket_to_asset_view(asset_view) + for asset_view in asset_views_bucket + ], ) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err return SearchLogViewResults( count=count, asset_views=asset_views, @@ -153,13 +182,18 @@ def search(self, criteria: SearchLogRequest, bulk=False) -> Union[SearchLogViewR try: log_entries = parse_obj_as(List[SearchLogEntry], raw_json["logs"]) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err - if count > SearchLogResults._MASS_EXTRACT_THRESHOLD and not SearchLogResults.presorted_by_timestamp( - criteria.dsl.sort + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err + if ( + count > SearchLogResults._MASS_EXTRACT_THRESHOLD + and not SearchLogResults.presorted_by_timestamp(criteria.dsl.sort) ): if criteria.dsl.sort and len(criteria.dsl.sort) > 2: raise ErrorCode.UNABLE_TO_RUN_SEARCH_LOG_BULK_WITH_SORTS.exception_with_parameters() - criteria.dsl.sort = self._prepare_sorts_for_sl_bulk_search(criteria.dsl.sort) + criteria.dsl.sort = self._prepare_sorts_for_sl_bulk_search( + criteria.dsl.sort + ) LOGGER.debug( self._get_bulk_search_log_message(bulk), count, diff --git a/pyatlan/client/sso.py b/pyatlan/client/sso.py index 6c0bb2e92..880489bf8 100644 --- a/pyatlan/client/sso.py +++ b/pyatlan/client/sso.py @@ -27,7 +27,9 @@ class SSOClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @staticmethod @@ -41,9 +43,13 @@ def _parse_sso_mapper(raw_json): return parse_obj_as(List[SSOMapper], raw_json) return parse_obj_as(SSOMapper, raw_json) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err - def _check_existing_group_mappings(self, sso_alias: str, atlan_group: AtlanGroup) -> None: + def _check_existing_group_mappings( + self, sso_alias: str, atlan_group: AtlanGroup + ) -> None: """ Check if an SSO group mapping already exists within Atlan. This is necessary to avoid duplicate group mappings with @@ -60,7 +66,9 @@ def _check_existing_group_mappings(self, sso_alias: str, atlan_group: AtlanGroup ) @validate_arguments - def create_group_mapping(self, sso_alias: str, atlan_group: AtlanGroup, sso_group_name: str) -> SSOMapper: + def create_group_mapping( + self, sso_alias: str, atlan_group: AtlanGroup, sso_group_name: str + ) -> SSOMapper: """ Creates a new Atlan SSO group mapping. @@ -125,7 +133,9 @@ def update_group_mapping( identity_provider_mapper=self.IDP_GROUP_MAPPER, ) # type: ignore[call-arg] raw_json = self._client._call_api( - UPDATE_SSO_GROUP_MAPPING.format_path({"sso_alias": sso_alias, "group_map_id": group_map_id}), + UPDATE_SSO_GROUP_MAPPING.format_path( + {"sso_alias": sso_alias, "group_map_id": group_map_id} + ), request_obj=group_mapper, ) return self._parse_sso_mapper(raw_json) @@ -139,10 +149,14 @@ def get_all_group_mappings(self, sso_alias: str) -> List[SSOMapper]: :raises AtlanError: on any error during API invocation. :returns: list of existing SSO group mapping instances. """ - raw_json = self._client._call_api(GET_ALL_SSO_GROUP_MAPPING.format_path({"sso_alias": sso_alias})) + raw_json = self._client._call_api( + GET_ALL_SSO_GROUP_MAPPING.format_path({"sso_alias": sso_alias}) + ) # Since `raw_json` includes both user and group mappings group_mappings = [ - mapping for mapping in raw_json if mapping["identityProviderMapper"] == SSOClient.IDP_GROUP_MAPPER + mapping + for mapping in raw_json + if mapping["identityProviderMapper"] == SSOClient.IDP_GROUP_MAPPER ] return self._parse_sso_mapper(group_mappings) @@ -157,7 +171,9 @@ def get_group_mapping(self, sso_alias: str, group_map_id: str) -> SSOMapper: :returns: existing SSO group mapping instance. """ raw_json = self._client._call_api( - GET_SSO_GROUP_MAPPING.format_path({"sso_alias": sso_alias, "group_map_id": group_map_id}) + GET_SSO_GROUP_MAPPING.format_path( + {"sso_alias": sso_alias, "group_map_id": group_map_id} + ) ) return self._parse_sso_mapper(raw_json) @@ -172,6 +188,8 @@ def delete_group_mapping(self, sso_alias: str, group_map_id: str) -> None: :returns: an empty response (`None`). """ raw_json = self._client._call_api( - DELETE_SSO_GROUP_MAPPING.format_path({"sso_alias": sso_alias, "group_map_id": group_map_id}) + DELETE_SSO_GROUP_MAPPING.format_path( + {"sso_alias": sso_alias, "group_map_id": group_map_id} + ) ) return raw_json diff --git a/pyatlan/client/task.py b/pyatlan/client/task.py index 6d70631f1..ab0f5ba6d 100644 --- a/pyatlan/client/task.py +++ b/pyatlan/client/task.py @@ -19,7 +19,9 @@ class TaskClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @staticmethod @@ -29,7 +31,9 @@ def _parse_atlan_tasks(raw_json: Dict): try: atlan_tasks = parse_obj_as(List[AtlanTask], raw_json.get("tasks")) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err return atlan_tasks @staticmethod @@ -40,7 +44,10 @@ def _handle_sorting(sort: List[SortItem]): if not missing_sort: # If there is some sort, see whether time is already included for option in sort: - if option.field and option.field == AtlanTask.START_TIME.numeric_field_name: + if ( + option.field + and option.field == AtlanTask.START_TIME.numeric_field_name + ): missing_time_sort = False break diff --git a/pyatlan/client/token.py b/pyatlan/client/token.py index 2c3f251fd..5c206f079 100644 --- a/pyatlan/client/token.py +++ b/pyatlan/client/token.py @@ -21,7 +21,9 @@ class TokenClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @validate_arguments @@ -54,7 +56,9 @@ def get( query_params["filter"] = post_filter if sort is not None: query_params["sort"] = sort - raw_json = self._client._call_api(GET_API_TOKENS.format_path_with_params(), query_params) + raw_json = self._client._call_api( + GET_API_TOKENS.format_path_with_params(), query_params + ) return ApiTokenResponse(**raw_json) @validate_arguments @@ -101,7 +105,9 @@ def get_by_guid(self, guid: str) -> Optional[ApiToken]: :param guid: unique identifier by which to retrieve the API token :returns: the API token whose clientId matches the provided string, or None if there is none """ - if response := self.get(offset=0, limit=5, post_filter='{"id":"' + guid + '"}', sort="createdAt"): + if response := self.get( + offset=0, limit=5, post_filter='{"id":"' + guid + '"}', sort="createdAt" + ): if response.records and len(response.records) >= 1: return response.records[0] return None @@ -159,7 +165,9 @@ def update( description=description, persona_qualified_names=personas or set(), ) - raw_json = self._client._call_api(UPSERT_API_TOKEN.format_path_with_params(guid), request_obj=request) + raw_json = self._client._call_api( + UPSERT_API_TOKEN.format_path_with_params(guid), request_obj=request + ) return ApiToken(**raw_json) @validate_arguments diff --git a/pyatlan/client/typedef.py b/pyatlan/client/typedef.py index 0e5e36a61..9697b87f0 100644 --- a/pyatlan/client/typedef.py +++ b/pyatlan/client/typedef.py @@ -58,7 +58,9 @@ def _build_typedef_request(typedef: TypeDef) -> TypeDefResponse: custom_metadata_defs=[], ) # type: ignore[call-arg] else: - raise ErrorCode.UNABLE_TO_UPDATE_TYPEDEF_CATEGORY.exception_with_parameters(typedef.category.value) + raise ErrorCode.UNABLE_TO_UPDATE_TYPEDEF_CATEGORY.exception_with_parameters( + typedef.category.value + ) return payload @@ -113,7 +115,9 @@ class TypeDefClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client def get_all(self) -> TypeDefResponse: @@ -127,7 +131,9 @@ def get_all(self) -> TypeDefResponse: return TypeDefResponse(**raw_json) @validate_arguments - def get(self, type_category: Union[AtlanTypeCategory, List[AtlanTypeCategory]]) -> TypeDefResponse: + def get( + self, type_category: Union[AtlanTypeCategory, List[AtlanTypeCategory]] + ) -> TypeDefResponse: """ Retrieves a TypeDefResponse object that contain a list of the specified category type definitions in Atlan. @@ -158,11 +164,15 @@ def get_by_name(self, name: str) -> TypeDef: category or when unable to produce a valid response :raises AtlanError: on any API communication issue """ - raw_json = self._client._call_api(GET_TYPE_DEF_BY_NAME.format_path_with_params(name)) + raw_json = self._client._call_api( + GET_TYPE_DEF_BY_NAME.format_path_with_params(name) + ) try: return TypeDefFactory.create(raw_json) except (ValidationError, AttributeError) as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err @validate_arguments def create(self, typedef: TypeDef) -> TypeDefResponse: @@ -179,7 +189,9 @@ def create(self, typedef: TypeDef) -> TypeDefResponse: :raises AtlanError: on any API communication issue """ payload = _build_typedef_request(typedef) - raw_json = self._client._call_api(CREATE_TYPE_DEFS, request_obj=payload, exclude_unset=True) + raw_json = self._client._call_api( + CREATE_TYPE_DEFS, request_obj=payload, exclude_unset=True + ) _refresh_caches(typedef) return TypeDefResponse(**raw_json) @@ -198,7 +210,9 @@ def update(self, typedef: TypeDef) -> TypeDefResponse: :raises AtlanError: on any API communication issue """ payload = _build_typedef_request(typedef) - raw_json = self._client._call_api(UPDATE_TYPE_DEFS, request_obj=payload, exclude_unset=True) + raw_json = self._client._call_api( + UPDATE_TYPE_DEFS, request_obj=payload, exclude_unset=True + ) _refresh_caches(typedef) return TypeDefResponse(**raw_json) @@ -226,9 +240,13 @@ def purge(self, name: str, typedef_type: type) -> None: internal_name = str(AtlanTagCache.get_id_for_name(name)) else: - raise ErrorCode.UNABLE_TO_PURGE_TYPEDEF_OF_TYPE.exception_with_parameters(typedef_type) + raise ErrorCode.UNABLE_TO_PURGE_TYPEDEF_OF_TYPE.exception_with_parameters( + typedef_type + ) if internal_name: - self._client._call_api(DELETE_TYPE_DEF_BY_NAME.format_path_with_params(internal_name)) + self._client._call_api( + DELETE_TYPE_DEF_BY_NAME.format_path_with_params(internal_name) + ) else: raise ErrorCode.TYPEDEF_NOT_FOUND_BY_NAME.exception_with_parameters(name) diff --git a/pyatlan/client/user.py b/pyatlan/client/user.py index f3b7d5e4e..b56d9510b 100644 --- a/pyatlan/client/user.py +++ b/pyatlan/client/user.py @@ -40,11 +40,15 @@ class UserClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @validate_arguments - def create(self, users: List[AtlanUser], return_info: bool = False) -> Optional[List[AtlanUser]]: + def create( + self, users: List[AtlanUser], return_info: bool = False + ) -> Optional[List[AtlanUser]]: """ Create one or more new users. @@ -173,7 +177,9 @@ def get( ], ) endpoint = GET_USERS.format_path_with_params() - raw_json = self._client._call_api(api=endpoint, query_params=request.query_params) + raw_json = self._client._call_api( + api=endpoint, query_params=request.query_params + ) return UserResponse( client=self._client, endpoint=endpoint, @@ -269,7 +275,9 @@ def get_by_username(self, username: str) -> Optional[AtlanUser]: return None @validate_arguments - def get_by_usernames(self, usernames: List[str], limit: int = 5, offset: int = 0) -> Optional[List[AtlanUser]]: + def get_by_usernames( + self, usernames: List[str], limit: int = 5, offset: int = 0 + ) -> Optional[List[AtlanUser]]: """ Retrieves users based on their usernames. @@ -279,7 +287,9 @@ def get_by_usernames(self, usernames: List[str], limit: int = 5, offset: int = 0 :returns: the users with the specified usernames """ username_filter = '{"username":{"$in":' + dumps(usernames or [""]) + "}}" - if response := self.get(offset=offset, limit=limit, post_filter=username_filter): + if response := self.get( + offset=offset, limit=limit, post_filter=username_filter + ): return response.records return None @@ -304,7 +314,9 @@ def add_to_groups( ) @validate_arguments - def get_groups(self, guid: str, request: Optional[GroupRequest] = None) -> GroupResponse: + def get_groups( + self, guid: str, request: Optional[GroupRequest] = None + ) -> GroupResponse: """ Retrieve the groups this user belongs to. @@ -315,7 +327,9 @@ def get_groups(self, guid: str, request: Optional[GroupRequest] = None) -> Group """ if not request: request = GroupRequest() - endpoint = GET_USER_GROUPS.format_path({"user_guid": guid}).format_path_with_params() + endpoint = GET_USER_GROUPS.format_path( + {"user_guid": guid} + ).format_path_with_params() raw_json = self._client._call_api( api=endpoint, query_params=request.query_params, @@ -332,7 +346,9 @@ def get_groups(self, guid: str, request: Optional[GroupRequest] = None) -> Group ) @validate_arguments - def add_as_admin(self, asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]: + def add_as_admin( + self, asset_guid: str, impersonation_token: str + ) -> Optional[AssetMutationResponse]: """ Add the API token configured for the default client as an admin to the asset with the provided GUID. This is primarily useful for connections, to allow the API token to manage policies for the connection, and @@ -353,7 +369,9 @@ def add_as_admin(self, asset_guid: str, impersonation_token: str) -> Optional[As ) @validate_arguments - def add_as_viewer(self, asset_guid: str, impersonation_token: str) -> Optional[AssetMutationResponse]: + def add_as_viewer( + self, asset_guid: str, impersonation_token: str + ) -> Optional[AssetMutationResponse]: """ Add the API token configured for the default client as a viewer to the asset with the provided GUID. This is primarily useful for query collections, to allow the API token to view or run queries within the @@ -391,16 +409,23 @@ def _add_as( from pyatlan.model.fluent_search import FluentSearch if keyword_field not in [Asset.ADMIN_USERS, Asset.VIEWER_USERS]: - raise ValueError(f"keyword_field should be {Asset.VIEWER_USERS} or {Asset.ADMIN_USERS}") + raise ValueError( + f"keyword_field should be {Asset.VIEWER_USERS} or {Asset.ADMIN_USERS}" + ) token_user = self.get_current().username or "" with client_connection(api_key=impersonation_token) as tmp: request = ( - FluentSearch().where(Asset.GUID.eq(asset_guid)).include_on_results(keyword_field).page_size(1) + FluentSearch() + .where(Asset.GUID.eq(asset_guid)) + .include_on_results(keyword_field) + .page_size(1) ).to_request() results = tmp.asset.search(request) if not results.current_page(): - raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(asset_guid) + raise ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters( + asset_guid + ) asset = results.current_page()[0] if keyword_field == Asset.VIEWER_USERS: existing_viewers = asset.viewer_users or set() diff --git a/pyatlan/client/workflow.py b/pyatlan/client/workflow.py index df904ddb6..f629b76d5 100644 --- a/pyatlan/client/workflow.py +++ b/pyatlan/client/workflow.py @@ -54,7 +54,9 @@ class WorkflowClient: def __init__(self, client: ApiCaller): if not isinstance(client, ApiCaller): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("client", "ApiCaller") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "client", "ApiCaller" + ) self._client = client @staticmethod @@ -66,10 +68,14 @@ def _parse_response(raw_json, response_type): return parse_obj_as(List[response_type], raw_json) return parse_obj_as(response_type, raw_json) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err @validate_arguments - def find_by_type(self, prefix: WorkflowPackage, max_results: int = 10) -> List[WorkflowSearchResult]: + def find_by_type( + self, prefix: WorkflowPackage, max_results: int = 10 + ) -> List[WorkflowSearchResult]: """ Find workflows based on their type (prefix). Note: Only workflows that have been run will be found. @@ -238,7 +244,9 @@ def _handle_workflow_types(self, workflow): if results := self.find_by_type(workflow): detail = results[0].source else: - raise ErrorCode.NO_PRIOR_RUN_AVAILABLE.exception_with_parameters(workflow.value) + raise ErrorCode.NO_PRIOR_RUN_AVAILABLE.exception_with_parameters( + workflow.value + ) elif isinstance(workflow, WorkflowSearchResult): detail = workflow.source else: @@ -246,17 +254,25 @@ def _handle_workflow_types(self, workflow): return detail @overload - def rerun(self, workflow: WorkflowPackage, idempotent: bool = False) -> WorkflowRunResponse: ... + def rerun( + self, workflow: WorkflowPackage, idempotent: bool = False + ) -> WorkflowRunResponse: ... @overload - def rerun(self, workflow: WorkflowSearchResultDetail, idempotent: bool = False) -> WorkflowRunResponse: ... + def rerun( + self, workflow: WorkflowSearchResultDetail, idempotent: bool = False + ) -> WorkflowRunResponse: ... @overload - def rerun(self, workflow: WorkflowSearchResult, idempotent: bool = False) -> WorkflowRunResponse: ... + def rerun( + self, workflow: WorkflowSearchResult, idempotent: bool = False + ) -> WorkflowRunResponse: ... def rerun( self, - workflow: Union[WorkflowPackage, WorkflowSearchResultDetail, WorkflowSearchResult], + workflow: Union[ + WorkflowPackage, WorkflowSearchResultDetail, WorkflowSearchResult + ], idempotent: bool = False, ) -> WorkflowRunResponse: """ @@ -282,7 +298,11 @@ def rerun( # since it takes some time to start or stop sleep(10) if ( - (current_run_details := self._find_current_run(workflow_name=detail.metadata.name)) + ( + current_run_details := self._find_current_run( + workflow_name=detail.metadata.name + ) + ) and current_run_details.source and current_run_details.source.metadata and current_run_details.source.spec @@ -294,7 +314,9 @@ def rerun( status=current_run_details.source.status, ) if detail and detail.metadata: - request = ReRunRequest(namespace=detail.metadata.namespace, resource_name=detail.metadata.name) + request = ReRunRequest( + namespace=detail.metadata.namespace, resource_name=detail.metadata.name + ) raw_json = self._client._call_api( WORKFLOW_RERUN, request_obj=request, @@ -302,10 +324,14 @@ def rerun( return WorkflowRunResponse(**raw_json) @overload - def run(self, workflow: Workflow, workflow_schedule: Optional[WorkflowSchedule] = None) -> WorkflowResponse: ... + def run( + self, workflow: Workflow, workflow_schedule: Optional[WorkflowSchedule] = None + ) -> WorkflowResponse: ... @overload - def run(self, workflow: str, workflow_schedule: Optional[WorkflowSchedule] = None) -> WorkflowResponse: ... + def run( + self, workflow: str, workflow_schedule: Optional[WorkflowSchedule] = None + ) -> WorkflowResponse: ... def run( self, @@ -356,7 +382,9 @@ def update(self, workflow: Workflow) -> WorkflowResponse: :raises AtlanError: on any API communication issue. """ raw_json = self._client._call_api( - WORKFLOW_UPDATE.format_path({"workflow_name": workflow.metadata and workflow.metadata.name}), + WORKFLOW_UPDATE.format_path( + {"workflow_name": workflow.metadata and workflow.metadata.name} + ), request_obj=workflow, ) return WorkflowResponse(**raw_json) @@ -482,13 +510,19 @@ def delete( ) @overload - def add_schedule(self, workflow: WorkflowResponse, workflow_schedule: WorkflowSchedule) -> WorkflowResponse: ... + def add_schedule( + self, workflow: WorkflowResponse, workflow_schedule: WorkflowSchedule + ) -> WorkflowResponse: ... @overload - def add_schedule(self, workflow: WorkflowPackage, workflow_schedule: WorkflowSchedule) -> WorkflowResponse: ... + def add_schedule( + self, workflow: WorkflowPackage, workflow_schedule: WorkflowSchedule + ) -> WorkflowResponse: ... @overload - def add_schedule(self, workflow: WorkflowSearchResult, workflow_schedule: WorkflowSchedule) -> WorkflowResponse: ... + def add_schedule( + self, workflow: WorkflowSearchResult, workflow_schedule: WorkflowSchedule + ) -> WorkflowResponse: ... @overload def add_schedule( @@ -530,7 +564,10 @@ def add_schedule( self._add_schedule(workflow_to_update, workflow_schedule) raw_json = self._client._call_api( WORKFLOW_UPDATE.format_path( - {"workflow_name": workflow_to_update.metadata and workflow_to_update.metadata.name} + { + "workflow_name": workflow_to_update.metadata + and workflow_to_update.metadata.name + } ), request_obj=workflow_to_update, ) @@ -546,7 +583,9 @@ def remove_schedule(self, workflow: WorkflowPackage) -> WorkflowResponse: ... def remove_schedule(self, workflow: WorkflowSearchResult) -> WorkflowResponse: ... @overload - def remove_schedule(self, workflow: WorkflowSearchResultDetail) -> WorkflowResponse: ... + def remove_schedule( + self, workflow: WorkflowSearchResultDetail + ) -> WorkflowResponse: ... def remove_schedule( self, @@ -576,10 +615,15 @@ def remove_schedule( ) workflow_to_update = self._handle_workflow_types(workflow) if workflow_to_update.metadata and workflow_to_update.metadata.annotations: - workflow_to_update.metadata.annotations.pop(self._WORKFLOW_RUN_SCHEDULE, None) + workflow_to_update.metadata.annotations.pop( + self._WORKFLOW_RUN_SCHEDULE, None + ) raw_json = self._client._call_api( WORKFLOW_UPDATE.format_path( - {"workflow_name": workflow_to_update.metadata and workflow_to_update.metadata.name} + { + "workflow_name": workflow_to_update.metadata + and workflow_to_update.metadata.name + } ), request_obj=workflow_to_update, ) @@ -612,7 +656,9 @@ def get_scheduled_run(self, workflow_name: str) -> WorkflowScheduleResponse: return self._parse_response(raw_json, WorkflowScheduleResponse) @validate_arguments - def find_schedule_query(self, saved_query_id: str, max_results: int = 10) -> List[WorkflowSearchResult]: + def find_schedule_query( + self, saved_query_id: str, max_results: int = 10 + ) -> List[WorkflowSearchResult]: """ Find scheduled query workflows by their saved query identifier. @@ -625,7 +671,9 @@ def find_schedule_query(self, saved_query_id: str, max_results: int = 10) -> Lis filter=[ NestedQuery( path="metadata", - query=Prefix(field="metadata.name.keyword", value=f"asq-{saved_query_id}"), + query=Prefix( + field="metadata.name.keyword", value=f"asq-{saved_query_id}" + ), ), NestedQuery( path="metadata", @@ -680,6 +728,10 @@ def find_schedule_query_between( "startDate": request.start_date, "endDate": request.end_date, } - SEARCH_API = SCHEDULE_QUERY_WORKFLOWS_MISSED if missed else SCHEDULE_QUERY_WORKFLOWS_SEARCH + SEARCH_API = ( + SCHEDULE_QUERY_WORKFLOWS_MISSED + if missed + else SCHEDULE_QUERY_WORKFLOWS_SEARCH + ) raw_json = self._client._call_api(SEARCH_API, query_params=query_params) return self._parse_response(raw_json, WorkflowRunResponse) diff --git a/pyatlan/errors.py b/pyatlan/errors.py index 83f1b15b1..b004e90d0 100644 --- a/pyatlan/errors.py +++ b/pyatlan/errors.py @@ -6,9 +6,7 @@ from typing import Dict, List, Protocol, Type, TypeVar E = TypeVar("E", bound="AtlanError") -RAISE_GITHUB_ISSUE = ( - "Please raise an issue on the Python SDK GitHub repository providing context in which this error occurred." -) +RAISE_GITHUB_ISSUE = "Please raise an issue on the Python SDK GitHub repository providing context in which this error occurred." class ErrorInfo(Protocol): diff --git a/pyatlan/events/atlan_event_handler.py b/pyatlan/events/atlan_event_handler.py index e37b7b935..c49a88a0b 100644 --- a/pyatlan/events/atlan_event_handler.py +++ b/pyatlan/events/atlan_event_handler.py @@ -68,7 +68,15 @@ def get_current_view_of_asset( exclude_atlan_tags=not include_atlan_tags, ) response = client.asset.search(criteria=request) - return result if (result := (response.current_page()[0] if len(response.current_page()) > 0 else None)) else None + return ( + result + if ( + result := ( + response.current_page()[0] if len(response.current_page()) > 0 else None + ) + ) + else None + ) def has_description(asset: Asset) -> bool: @@ -101,7 +109,9 @@ def has_lineage(asset: Asset) -> bool: """ # If possible, look directly on inputs and outputs rather than the __hasLineage flag if isinstance(asset, Catalog): - return (asset.input_to_processes is not None) or (asset.output_from_processes is not None) + return (asset.input_to_processes is not None) or ( + asset.output_from_processes is not None + ) else: return bool(asset.has_lineage) diff --git a/pyatlan/events/atlan_lambda_handler.py b/pyatlan/events/atlan_lambda_handler.py index 1b910c3cc..85eb8eb50 100644 --- a/pyatlan/events/atlan_lambda_handler.py +++ b/pyatlan/events/atlan_lambda_handler.py @@ -32,11 +32,15 @@ def process_event(handler: AtlanEventHandler, event, context): print("Matches a validation request - doing nothing and succeeding.") return {"statusCode": 200} if not valid_signature(SIGNING_SECRET, event.get("headers")): - raise IOError("Invalid signing secret received - will not process this request.") + raise IOError( + "Invalid signing secret received - will not process this request." + ) atlan_event = json.loads(body) atlan_event = AtlanEvent(**atlan_event) if handler.validate_prerequisites(atlan_event): - if isinstance(atlan_event.payload, AtlanEventPayload) and isinstance(atlan_event.payload.asset, Asset): + if isinstance(atlan_event.payload, AtlanEventPayload) and isinstance( + atlan_event.payload.asset, Asset + ): current = handler.get_current_state(atlan_event.payload.asset) if current is not None: updated = handler.calculate_changes(current) diff --git a/pyatlan/generator/class_generator.py b/pyatlan/generator/class_generator.py index 8f5a5fd54..f7cc6c945 100644 --- a/pyatlan/generator/class_generator.py +++ b/pyatlan/generator/class_generator.py @@ -97,7 +97,8 @@ def get_type(type_: str): def get_type_defs() -> TypeDefResponse: if ( not TYPE_DEF_FILE.exists() - or datetime.date.fromtimestamp(os.path.getmtime(TYPE_DEF_FILE)) < datetime.date.today() + or datetime.date.fromtimestamp(os.path.getmtime(TYPE_DEF_FILE)) + < datetime.date.today() ): raise ClassGenerationError( "File containing typedefs does not exist or is not current." @@ -171,7 +172,9 @@ def external_asset_dependencies(self): @property def external_module_dependencies(self): - return {asset_info.module_info for asset_info in self.external_asset_dependencies} + return { + asset_info.module_info for asset_info in self.external_asset_dependencies + } @property def imports(self): @@ -260,7 +263,11 @@ def import_super_class(self): super_type = AssetInfo.asset_info_by_name[self.entity_def.super_types[0]] if self.name not in self._CORE_ASSETS and super_type.name in self._CORE_ASSETS: return f"from .core.{super_type.module_name} import {super_type.name}" - elif not self.is_core_asset and super_type.is_core_asset and self.name not in self._CORE_ASSETS: + elif ( + not self.is_core_asset + and super_type.is_core_asset + and self.name not in self._CORE_ASSETS + ): return f"from .core.{super_type.module_name} import {super_type.name}" else: return f"from .{super_type.module_name} import {super_type.name}" @@ -280,14 +287,22 @@ def imports_for_referenced_assets(self): return imports def update_attribute_defs(self): - def get_ancestor_relationship_defs(ancestor_name: str, ancestor_relationship_defs): + def get_ancestor_relationship_defs( + ancestor_name: str, ancestor_relationship_defs + ): ancestor_entity_def = self.entity_defs_by_name[ancestor_name] if not ancestor_entity_def.super_types or not ancestor_name: return ancestor_relationship_defs - for relationship_def in ancestor_entity_def.relationship_attribute_defs or []: + for relationship_def in ( + ancestor_entity_def.relationship_attribute_defs or [] + ): ancestor_relationship_defs.add(relationship_def["name"]) return get_ancestor_relationship_defs( - (ancestor_entity_def.super_types[0] if ancestor_entity_def.super_types else ""), + ( + ancestor_entity_def.super_types[0] + if ancestor_entity_def.super_types + else "" + ), ancestor_relationship_defs, ) @@ -296,7 +311,9 @@ def get_ancestor_relationship_defs(ancestor_name: str, ancestor_relationship_def entity_def.attribute_defs = self.merge_attributes(entity_def) names = {attribute_def["name"] for attribute_def in entity_def.attribute_defs} super_type_relationship_defs = ( - get_ancestor_relationship_defs(entity_def.super_types[0], set()) if entity_def.super_types else set() + get_ancestor_relationship_defs(entity_def.super_types[0], set()) + if entity_def.super_types + else set() ) entity_def.relationship_attribute_defs = list( { @@ -319,9 +336,13 @@ def update_required_asset_names(self) -> None: attributes_to_remove.add(attribute["name"]) elif type_name in AssetInfo.asset_info_by_name: self.required_asset_infos.add(AssetInfo.asset_info_by_name[type_name]) - self.entity_def.attribute_defs = [a for a in attribute_defs if a["name"] not in attributes_to_remove] + self.entity_def.attribute_defs = [ + a for a in attribute_defs if a["name"] not in attributes_to_remove + ] self.entity_def.relationship_attribute_defs = [ - a for a in relationship_attribute_defs if a["name"] not in attributes_to_remove + a + for a in relationship_attribute_defs + if a["name"] not in attributes_to_remove ] def merge_attributes(self, entity_def): @@ -334,7 +355,9 @@ def merge_them(s, a): for s_type in entity.super_types: merge_them(s_type, a) - attributes = {attribute["name"]: attribute for attribute in entity_def.attribute_defs} + attributes = { + attribute["name"]: attribute for attribute in entity_def.attribute_defs + } for super_type in entity_def.super_types: merge_them(super_type, attributes) @@ -351,7 +374,9 @@ def update_circular_dependencies(self): @classmethod def set_entity_defs(cls, entity_defs: List[EntityDef]): - cls.entity_defs_by_name = {entity_def.name: entity_def for entity_def in entity_defs} + cls.entity_defs_by_name = { + entity_def.name: entity_def for entity_def in entity_defs + } entity_defs = sorted(entity_defs, key=lambda e: ",".join(e.super_types or [])) for entity_def in entity_defs: name = entity_def.name @@ -361,7 +386,8 @@ def set_entity_defs(cls, entity_defs: List[EntityDef]): attribute["typeName"] = "array" if (not entity_def.super_types and name != REFERENCEABLE) or any( - super_type in cls.super_type_names_to_ignore for super_type in (entity_def.super_types or []) + super_type in cls.super_type_names_to_ignore + for super_type in (entity_def.super_types or []) ): cls.super_type_names_to_ignore.add(name) continue @@ -381,7 +407,9 @@ def update_all_circular_dependencies(cls): @classmethod def create_modules(cls): order = 0 - for parent_name, successors in nx.bfs_successors(cls.hierarchy_graph, REFERENCEABLE): + for parent_name, successors in nx.bfs_successors( + cls.hierarchy_graph, REFERENCEABLE + ): for asset_name in [parent_name] + successors: asset_info = cls.asset_info_by_name[asset_name] asset_info.order = order @@ -406,7 +434,9 @@ def create_modules(cls): asset_info.is_core_asset = True cls._CORE_ASSETS.add(asset_info.name) continue - super_asset = cls.asset_info_by_name[related_asset.super_class] + super_asset = cls.asset_info_by_name[ + related_asset.super_class + ] super_asset.is_core_asset = True cls._CORE_ASSETS.add(related_asset.super_class) @@ -585,13 +615,19 @@ def get_indexes_for_attribute() -> Dict[IndexType, str]: search_map = get_indexes_for_attribute() indices = search_map.keys() if indices == {IndexType.KEYWORD}: - return SearchType(name="KeywordField", args=f'"{search_map.get(IndexType.KEYWORD)}"') + return SearchType( + name="KeywordField", args=f'"{search_map.get(IndexType.KEYWORD)}"' + ) elif indices == {IndexType.TEXT}: return SearchType(name="TextField", args=f'"{search_map.get(IndexType.TEXT)}"') elif indices == {IndexType.NUMERIC}: - return SearchType(name="NumericField", args=f'"{search_map.get(IndexType.NUMERIC)}"') + return SearchType( + name="NumericField", args=f'"{search_map.get(IndexType.NUMERIC)}"' + ) elif indices == {IndexType.BOOLEAN}: - return SearchType(name="BooleanField", args=f'"{search_map.get(IndexType.BOOLEAN)}"') + return SearchType( + name="BooleanField", args=f'"{search_map.get(IndexType.BOOLEAN)}"' + ) elif indices == {IndexType.NUMERIC, IndexType.RANK_FEATURE}: return SearchType( name="NumericRankField", @@ -614,7 +650,9 @@ def get_indexes_for_attribute() -> Dict[IndexType, str]: class Generator: def __init__(self) -> None: - self.environment = Environment(loader=PackageLoader("pyatlan.generator", "templates")) + self.environment = Environment( + loader=PackageLoader("pyatlan.generator", "templates") + ) self.environment.filters["to_snake_case"] = to_snake_case self.environment.filters["get_type"] = get_type self.environment.filters["get_search_type"] = get_search_type @@ -631,20 +669,28 @@ def merge_them(s, a): for s_type in entity.super_types: merge_them(s_type, a) - attributes = {attribute["name"]: attribute for attribute in entity_def.attribute_defs} + attributes = { + attribute["name"]: attribute for attribute in entity_def.attribute_defs + } for super_type in entity_def.super_types: merge_them(super_type, attributes) return list(attributes.values()) - def get_ancestor_relationship_defs(self, ancestor_name: str, ancestor_relationship_defs): + def get_ancestor_relationship_defs( + self, ancestor_name: str, ancestor_relationship_defs + ): ancestor_entity_def = AssetInfo.entity_defs_by_name[ancestor_name] if not ancestor_entity_def.super_types or not ancestor_name: return ancestor_relationship_defs for relationship_def in ancestor_entity_def.relationship_attribute_defs or []: ancestor_relationship_defs.add(relationship_def["name"]) return self.get_ancestor_relationship_defs( - (ancestor_entity_def.super_types[0] if ancestor_entity_def.super_types else ""), + ( + ancestor_entity_def.super_types[0] + if ancestor_entity_def.super_types + else "" + ), ancestor_relationship_defs, ) @@ -686,7 +732,11 @@ def render_init(self, assets: List[AssetInfo]): script.write(content) def render_core_init(self, assets: List[AssetInfo]): - asset_names = [asset.name for asset in assets if asset.is_core_asset or asset.name in asset._CORE_ASSETS] + asset_names = [ + asset.name + for asset in assets + if asset.is_core_asset or asset.name in asset._CORE_ASSETS + ] asset_imports = [ f"from .{asset.module_name} import {asset.name}" for asset in assets @@ -694,7 +744,9 @@ def render_core_init(self, assets: List[AssetInfo]): ] template = self.environment.get_template("core/init.jinja2") - content = template.render({"asset_imports": asset_imports, "asset_names": asset_names}) + content = template.render( + {"asset_imports": asset_imports, "asset_names": asset_names} + ) init_path = CORE_ASSETS_DIR / "__init__.py" with init_path.open("w") as script: @@ -732,14 +784,20 @@ def render_enums(self, enum_defs: List["EnumDefInfo"]): new_enums.replace(existing_enums) def render_docs_struct_snippets(self, struct_defs): - template = self.environment.get_template("documentation/struct_attributes.jinja2") + template = self.environment.get_template( + "documentation/struct_attributes.jinja2" + ) for struct_def in struct_defs: content = template.render({"struct_def": struct_def}) - with (DOCS_DIR / f"{struct_def.name.lower()}-properties.md").open("w") as doc: + with (DOCS_DIR / f"{struct_def.name.lower()}-properties.md").open( + "w" + ) as doc: doc.write(content) def render_docs_entity_properties(self, entity_defs): - template = self.environment.get_template("documentation/entity_attributes.jinja2") + template = self.environment.get_template( + "documentation/entity_attributes.jinja2" + ) for entity_def in entity_defs: attr_def_alpha = sorted(entity_def.attribute_defs, key=lambda x: x["name"]) content = template.render( @@ -748,27 +806,40 @@ def render_docs_entity_properties(self, entity_defs): "attribute_defs": attr_def_alpha, } ) - with (DOCS_DIR / f"{entity_def.name.lower()}-properties.md").open("w") as doc: + with (DOCS_DIR / f"{entity_def.name.lower()}-properties.md").open( + "w" + ) as doc: doc.write(content) def render_docs_entity_relationships(self, entity_defs): - template = self.environment.get_template("documentation/entity_relationships.jinja2") + template = self.environment.get_template( + "documentation/entity_relationships.jinja2" + ) for entity_def in entity_defs: - attr_def_alpha = sorted(entity_def.relationship_attribute_defs, key=lambda x: x["name"]) + attr_def_alpha = sorted( + entity_def.relationship_attribute_defs, key=lambda x: x["name"] + ) content = template.render( { "entity_def_name": entity_def.name, "attribute_defs": attr_def_alpha, } ) - with (DOCS_DIR / f"{entity_def.name.lower()}-relationships.md").open("w") as doc: + with (DOCS_DIR / f"{entity_def.name.lower()}-relationships.md").open( + "w" + ) as doc: doc.write(content) def render_sphinx_docs(self, entity_defs): - template = self.environment.get_template("documentation/sphinx_asset_index.jinja2") + template = self.environment.get_template( + "documentation/sphinx_asset_index.jinja2" + ) to_include = [] for entity_def in entity_defs: - if not entity_def.name.startswith("__") and not entity_def.name == "AtlasServer": + if ( + not entity_def.name.startswith("__") + and not entity_def.name == "AtlasServer" + ): to_include.append(entity_def) sorted_defs = sorted(to_include, key=(lambda x: x.name)) content = template.render( @@ -787,7 +858,9 @@ def render_sphinx_docs(self, entity_defs): "title_underline": "=" * len(entity_def.name), } ) - with (SPHINX_DIR / "asset" / f"{entity_def.name.lower()}.rst").open("w") as doc: + with (SPHINX_DIR / "asset" / f"{entity_def.name.lower()}.rst").open( + "w" + ) as doc: doc.write(content) @@ -802,7 +875,8 @@ class EnumDefInfo: def __init__(self, enum_def: EnumDef): self.name = get_type(enum_def.name) self.element_defs: List[KeyValue] = [ - self.get_key_value(e) for e in sorted(enum_def.element_defs, key=lambda e: e.ordinal or 0) + self.get_key_value(e) + for e in sorted(enum_def.element_defs, key=lambda e: e.ordinal or 0) ] def get_key_value(self, element_def: EnumDef.ElementDef): @@ -836,9 +910,13 @@ def filter_attributes_of_custom_entity_type(): filtered_relationship_attribute_defs = [ relationship_attribute_def for relationship_attribute_def in entity_def.relationship_attribute_defs - if not type_defs.is_custom_entity_def_name(relationship_attribute_def["typeName"]) + if not type_defs.is_custom_entity_def_name( + relationship_attribute_def["typeName"] + ) ] - entity_def.relationship_attribute_defs = filtered_relationship_attribute_defs + entity_def.relationship_attribute_defs = ( + filtered_relationship_attribute_defs + ) if __name__ == "__main__": diff --git a/pyatlan/model/aggregation.py b/pyatlan/model/aggregation.py index eda71f3cf..f3a2475c7 100644 --- a/pyatlan/model/aggregation.py +++ b/pyatlan/model/aggregation.py @@ -86,9 +86,16 @@ def get_source_value(self, field: AtlanField) -> Optional[str]: validate_type(name="field", _type=AtlanField, value=field) - if self.nested_results and SearchableField.EMBEDDED_SOURCE_VALUE in self.nested_results: + if ( + self.nested_results + and SearchableField.EMBEDDED_SOURCE_VALUE in self.nested_results + ): result = self.nested_results[SearchableField.EMBEDDED_SOURCE_VALUE] - if isinstance(result, AggregationHitsResult) and result.hits and result.hits.hits: + if ( + isinstance(result, AggregationHitsResult) + and result.hits + and result.hits.hits + ): details = result.hits.hits[0] if details and details.source: if isinstance(field, CustomMetadataField): @@ -128,7 +135,9 @@ def __getitem__(self, item): def get( self, key: str, default=None - ) -> Optional[Union[AggregationMetricResult, AggregationBucketResult, AggregationHitsResult]]: + ) -> Optional[ + Union[AggregationMetricResult, AggregationBucketResult, AggregationHitsResult] + ]: return self.__root__.get(key, default) diff --git a/pyatlan/model/api_tokens.py b/pyatlan/model/api_tokens.py index 08fed94bf..60449aaed 100644 --- a/pyatlan/model/api_tokens.py +++ b/pyatlan/model/api_tokens.py @@ -18,8 +18,12 @@ class Config: description="Unique identifier (GUID) of the linked persona.", alias="id", ) - persona: Optional[str] = Field(default=None, description="Unique name of the linked persona.") - persona_qualified_name: Optional[str] = Field(default=None, description="Unique qualified_name of the persona") + persona: Optional[str] = Field( + default=None, description="Unique name of the linked persona." + ) + persona_qualified_name: Optional[str] = Field( + default=None, description="Unique qualified_name of the persona" + ) class ApiToken(AtlanObject): @@ -39,8 +43,12 @@ class ApiTokenAttributes(AtlanObject): created_at: Optional[int] = Field( description="Epoch time, in milliseconds, at which the API token was created." ) - created_by: Optional[str] = Field(default=None, description="User who created the API token.") - description: Optional[str] = Field(default=None, description="Explanation of the API token.") + created_by: Optional[str] = Field( + default=None, description="User who created the API token." + ) + description: Optional[str] = Field( + default=None, description="Explanation of the API token." + ) display_name: Optional[str] = Field( default=None, description="Human-readable name provided when creating the token.", @@ -63,15 +71,23 @@ class ApiTokenAttributes(AtlanObject): @root_validator(pre=True) def check_embedded_objects(cls, values): - if "workspacePermissions" in values and isinstance(values["workspacePermissions"], str): - values["workspacePermissions"] = json.loads(values["workspacePermissions"]) + if "workspacePermissions" in values and isinstance( + values["workspacePermissions"], str + ): + values["workspacePermissions"] = json.loads( + values["workspacePermissions"] + ) if "personas" in values and isinstance(values["personas"], str): values["personas"] = json.loads(values["personas"]) - if "personaQualifiedName" in values and isinstance(values["personaQualifiedName"], str): + if "personaQualifiedName" in values and isinstance( + values["personaQualifiedName"], str + ): persona_qns = json.loads(values["personaQualifiedName"]) values["personaQualifiedName"] = set() for persona_qn in persona_qns: - values["personaQualifiedName"].add(ApiTokenPersona(persona_qualified_name=persona_qn)) + values["personaQualifiedName"].add( + ApiTokenPersona(persona_qualified_name=persona_qn) + ) return values guid: Optional[str] = Field( @@ -95,12 +111,19 @@ def check_embedded_objects(cls, values): @property def username(self): - return SERVICE_ACCOUNT_ + self.client_id if self.client_id else self.attributes.client_id + return ( + SERVICE_ACCOUNT_ + self.client_id + if self.client_id + else self.attributes.client_id + ) @root_validator(pre=True) def copy_values(cls, values): if "attributes" in values: - if "displayName" in values["attributes"] and values["attributes"]["displayName"]: + if ( + "displayName" in values["attributes"] + and values["attributes"]["displayName"] + ): values["displayName"] = values["attributes"]["displayName"] if "clientId" in values["attributes"] and values["attributes"]["clientId"]: values["clientId"] = values["attributes"]["clientId"] @@ -136,14 +159,18 @@ def set_max_validity(cls, values): if values["validity_seconds"] < 0: values["validity_seconds"] = cls._MAX_VALIDITY else: - values["validity_seconds"] = min(values["validity_seconds"], cls._MAX_VALIDITY) + values["validity_seconds"] = min( + values["validity_seconds"], cls._MAX_VALIDITY + ) if "personas" in values and not values["personas"]: values["personas"] = set() return values class ApiTokenResponse(AtlanObject): - total_record: Optional[int] = Field(default=None, description="Total number of API tokens.") + total_record: Optional[int] = Field( + default=None, description="Total number of API tokens." + ) filter_record: Optional[int] = Field( default=None, description="Number of API records that matched the specified filters.", diff --git a/pyatlan/model/assets/a_d_l_s.py b/pyatlan/model/assets/a_d_l_s.py index e61128c1d..5e10e6a84 100644 --- a/pyatlan/model/assets/a_d_l_s.py +++ b/pyatlan/model/assets/a_d_l_s.py @@ -52,7 +52,9 @@ def __setattr__(self, name, value): """ Resource identifier of this asset in Azure. """ - AZURE_LOCATION: ClassVar[KeywordField] = KeywordField("azureLocation", "azureLocation") + AZURE_LOCATION: ClassVar[KeywordField] = KeywordField( + "azureLocation", "azureLocation" + ) """ Location of this asset in Azure. """ @@ -78,7 +80,11 @@ def __setattr__(self, name, value): @property def adls_account_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_account_qualified_name + return ( + None + if self.attributes is None + else self.attributes.adls_account_qualified_name + ) @adls_account_qualified_name.setter def adls_account_qualified_name(self, adls_account_qualified_name: Optional[str]): @@ -118,13 +124,21 @@ def azure_location(self, azure_location: Optional[str]): @property def adls_account_secondary_location(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_account_secondary_location + return ( + None + if self.attributes is None + else self.attributes.adls_account_secondary_location + ) @adls_account_secondary_location.setter - def adls_account_secondary_location(self, adls_account_secondary_location: Optional[str]): + def adls_account_secondary_location( + self, adls_account_secondary_location: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adls_account_secondary_location = adls_account_secondary_location + self.attributes.adls_account_secondary_location = ( + adls_account_secondary_location + ) @property def azure_tags(self) -> Optional[List[AzureTag]]: @@ -141,7 +155,9 @@ class Attributes(ObjectStore.Attributes): adls_account_name: Optional[str] = Field(default=None, description="") azure_resource_id: Optional[str] = Field(default=None, description="") azure_location: Optional[str] = Field(default=None, description="") - adls_account_secondary_location: Optional[str] = Field(default=None, description="") + adls_account_secondary_location: Optional[str] = Field( + default=None, description="" + ) azure_tags: Optional[List[AzureTag]] = Field(default=None, description="") attributes: ADLS.Attributes = Field( diff --git a/pyatlan/model/assets/a_d_l_s_account.py b/pyatlan/model/assets/a_d_l_s_account.py index 9ac1fb743..e4dddbb28 100644 --- a/pyatlan/model/assets/a_d_l_s_account.py +++ b/pyatlan/model/assets/a_d_l_s_account.py @@ -35,19 +35,27 @@ class ADLSAccount(ADLS): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> ADLSAccount: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) - attributes = ADLSAccount.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) + attributes = ADLSAccount.Attributes.create( + name=name, connection_qualified_name=connection_qualified_name + ) return cls(attributes=attributes) @classmethod @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> ADLSAccount: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, connection_qualified_name=connection_qualified_name) + return cls.creator( + name=name, connection_qualified_name=connection_qualified_name + ) type_name: str = Field(default="ADLSAccount", allow_mutation=False) @@ -66,7 +74,9 @@ def __setattr__(self, name, value): """ Entity tag for the asset. An entity tag is a hash of the object and represents changes to the contents of an object only, not its metadata. """ # noqa: E501 - ADLS_ENCRYPTION_TYPE: ClassVar[KeywordField] = KeywordField("adlsEncryptionType", "adlsEncryptionType") + ADLS_ENCRYPTION_TYPE: ClassVar[KeywordField] = KeywordField( + "adlsEncryptionType", "adlsEncryptionType" + ) """ Type of encryption for this account. """ @@ -86,19 +96,27 @@ def __setattr__(self, name, value): """ Subscription for this account. """ - ADLS_ACCOUNT_PERFORMANCE: ClassVar[KeywordField] = KeywordField("adlsAccountPerformance", "adlsAccountPerformance") + ADLS_ACCOUNT_PERFORMANCE: ClassVar[KeywordField] = KeywordField( + "adlsAccountPerformance", "adlsAccountPerformance" + ) """ Performance of this account. """ - ADLS_ACCOUNT_REPLICATION: ClassVar[KeywordField] = KeywordField("adlsAccountReplication", "adlsAccountReplication") + ADLS_ACCOUNT_REPLICATION: ClassVar[KeywordField] = KeywordField( + "adlsAccountReplication", "adlsAccountReplication" + ) """ Replication of this account. """ - ADLS_ACCOUNT_KIND: ClassVar[KeywordField] = KeywordField("adlsAccountKind", "adlsAccountKind") + ADLS_ACCOUNT_KIND: ClassVar[KeywordField] = KeywordField( + "adlsAccountKind", "adlsAccountKind" + ) """ Kind of this account. """ - ADLS_PRIMARY_DISK_STATE: ClassVar[KeywordField] = KeywordField("adlsPrimaryDiskState", "adlsPrimaryDiskState") + ADLS_PRIMARY_DISK_STATE: ClassVar[KeywordField] = KeywordField( + "adlsPrimaryDiskState", "adlsPrimaryDiskState" + ) """ Primary disk state of this account. """ @@ -108,7 +126,9 @@ def __setattr__(self, name, value): """ Provision state of this account. """ - ADLS_ACCOUNT_ACCESS_TIER: ClassVar[KeywordField] = KeywordField("adlsAccountAccessTier", "adlsAccountAccessTier") + ADLS_ACCOUNT_ACCESS_TIER: ClassVar[KeywordField] = KeywordField( + "adlsAccountAccessTier", "adlsAccountAccessTier" + ) """ Access tier of this account. """ @@ -154,7 +174,11 @@ def adls_encryption_type(self, adls_encryption_type: Optional[ADLSEncryptionType @property def adls_account_resource_group(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_account_resource_group + return ( + None + if self.attributes is None + else self.attributes.adls_account_resource_group + ) @adls_account_resource_group.setter def adls_account_resource_group(self, adls_account_resource_group: Optional[str]): @@ -164,7 +188,11 @@ def adls_account_resource_group(self, adls_account_resource_group: Optional[str] @property def adls_account_subscription(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_account_subscription + return ( + None + if self.attributes is None + else self.attributes.adls_account_subscription + ) @adls_account_subscription.setter def adls_account_subscription(self, adls_account_subscription: Optional[str]): @@ -174,20 +202,32 @@ def adls_account_subscription(self, adls_account_subscription: Optional[str]): @property def adls_account_performance(self) -> Optional[ADLSPerformance]: - return None if self.attributes is None else self.attributes.adls_account_performance + return ( + None + if self.attributes is None + else self.attributes.adls_account_performance + ) @adls_account_performance.setter - def adls_account_performance(self, adls_account_performance: Optional[ADLSPerformance]): + def adls_account_performance( + self, adls_account_performance: Optional[ADLSPerformance] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_account_performance = adls_account_performance @property def adls_account_replication(self) -> Optional[ADLSReplicationType]: - return None if self.attributes is None else self.attributes.adls_account_replication + return ( + None + if self.attributes is None + else self.attributes.adls_account_replication + ) @adls_account_replication.setter - def adls_account_replication(self, adls_account_replication: Optional[ADLSReplicationType]): + def adls_account_replication( + self, adls_account_replication: Optional[ADLSReplicationType] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_account_replication = adls_account_replication @@ -204,30 +244,46 @@ def adls_account_kind(self, adls_account_kind: Optional[ADLSStorageKind]): @property def adls_primary_disk_state(self) -> Optional[ADLSAccountStatus]: - return None if self.attributes is None else self.attributes.adls_primary_disk_state + return ( + None if self.attributes is None else self.attributes.adls_primary_disk_state + ) @adls_primary_disk_state.setter - def adls_primary_disk_state(self, adls_primary_disk_state: Optional[ADLSAccountStatus]): + def adls_primary_disk_state( + self, adls_primary_disk_state: Optional[ADLSAccountStatus] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_primary_disk_state = adls_primary_disk_state @property def adls_account_provision_state(self) -> Optional[ADLSProvisionState]: - return None if self.attributes is None else self.attributes.adls_account_provision_state + return ( + None + if self.attributes is None + else self.attributes.adls_account_provision_state + ) @adls_account_provision_state.setter - def adls_account_provision_state(self, adls_account_provision_state: Optional[ADLSProvisionState]): + def adls_account_provision_state( + self, adls_account_provision_state: Optional[ADLSProvisionState] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_account_provision_state = adls_account_provision_state @property def adls_account_access_tier(self) -> Optional[ADLSAccessTier]: - return None if self.attributes is None else self.attributes.adls_account_access_tier + return ( + None + if self.attributes is None + else self.attributes.adls_account_access_tier + ) @adls_account_access_tier.setter - def adls_account_access_tier(self, adls_account_access_tier: Optional[ADLSAccessTier]): + def adls_account_access_tier( + self, adls_account_access_tier: Optional[ADLSAccessTier] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_account_access_tier = adls_account_access_tier @@ -244,26 +300,48 @@ def adls_containers(self, adls_containers: Optional[List[ADLSContainer]]): class Attributes(ADLS.Attributes): adls_e_tag: Optional[str] = Field(default=None, description="") - adls_encryption_type: Optional[ADLSEncryptionTypes] = Field(default=None, description="") + adls_encryption_type: Optional[ADLSEncryptionTypes] = Field( + default=None, description="" + ) adls_account_resource_group: Optional[str] = Field(default=None, description="") adls_account_subscription: Optional[str] = Field(default=None, description="") - adls_account_performance: Optional[ADLSPerformance] = Field(default=None, description="") - adls_account_replication: Optional[ADLSReplicationType] = Field(default=None, description="") - adls_account_kind: Optional[ADLSStorageKind] = Field(default=None, description="") - adls_primary_disk_state: Optional[ADLSAccountStatus] = Field(default=None, description="") - adls_account_provision_state: Optional[ADLSProvisionState] = Field(default=None, description="") - adls_account_access_tier: Optional[ADLSAccessTier] = Field(default=None, description="") - adls_containers: Optional[List[ADLSContainer]] = Field(default=None, description="") # relationship + adls_account_performance: Optional[ADLSPerformance] = Field( + default=None, description="" + ) + adls_account_replication: Optional[ADLSReplicationType] = Field( + default=None, description="" + ) + adls_account_kind: Optional[ADLSStorageKind] = Field( + default=None, description="" + ) + adls_primary_disk_state: Optional[ADLSAccountStatus] = Field( + default=None, description="" + ) + adls_account_provision_state: Optional[ADLSProvisionState] = Field( + default=None, description="" + ) + adls_account_access_tier: Optional[ADLSAccessTier] = Field( + default=None, description="" + ) + adls_containers: Optional[List[ADLSContainer]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def create(cls, *, name: str, connection_qualified_name: str) -> ADLSAccount.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + def create( + cls, *, name: str, connection_qualified_name: str + ) -> ADLSAccount.Attributes: + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return ADLSAccount.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: ADLSAccount.Attributes = Field( diff --git a/pyatlan/model/assets/a_d_l_s_container.py b/pyatlan/model/assets/a_d_l_s_container.py index afd6e03a7..c6ed7339b 100644 --- a/pyatlan/model/assets/a_d_l_s_container.py +++ b/pyatlan/model/assets/a_d_l_s_container.py @@ -53,7 +53,9 @@ def creator( adls_account_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> ADLSContainer: - validate_required_fields(["name", "adls_account_qualified_name"], [name, adls_account_qualified_name]) + validate_required_fields( + ["name", "adls_account_qualified_name"], [name, adls_account_qualified_name] + ) attributes = ADLSContainer.Attributes.create( name=name, adls_account_qualified_name=adls_account_qualified_name, @@ -65,11 +67,15 @@ def creator( @init_guid def create(cls, *, name: str, adls_account_qualified_name: str) -> ADLSContainer: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, adls_account_qualified_name=adls_account_qualified_name) + return cls.creator( + name=name, adls_account_qualified_name=adls_account_qualified_name + ) type_name: str = Field(default="ADLSContainer", allow_mutation=False) @@ -108,14 +114,18 @@ def __setattr__(self, name, value): """ Encryption scope of this container. """ - ADLS_CONTAINER_VERSION_LEVEL_IMMUTABILITY_SUPPORT: ClassVar[BooleanField] = BooleanField( - "adlsContainerVersionLevelImmutabilitySupport", - "adlsContainerVersionLevelImmutabilitySupport", + ADLS_CONTAINER_VERSION_LEVEL_IMMUTABILITY_SUPPORT: ClassVar[BooleanField] = ( + BooleanField( + "adlsContainerVersionLevelImmutabilitySupport", + "adlsContainerVersionLevelImmutabilitySupport", + ) ) """ Whether this container supports version-level immutability (true) or not (false). """ - ADLS_OBJECT_COUNT: ClassVar[NumericField] = NumericField("adlsObjectCount", "adlsObjectCount") + ADLS_OBJECT_COUNT: ClassVar[NumericField] = NumericField( + "adlsObjectCount", "adlsObjectCount" + ) """ Number of objects that exist within this container. """ @@ -152,37 +162,61 @@ def adls_container_url(self, adls_container_url: Optional[str]): @property def adls_container_lease_state(self) -> Optional[ADLSLeaseState]: - return None if self.attributes is None else self.attributes.adls_container_lease_state + return ( + None + if self.attributes is None + else self.attributes.adls_container_lease_state + ) @adls_container_lease_state.setter - def adls_container_lease_state(self, adls_container_lease_state: Optional[ADLSLeaseState]): + def adls_container_lease_state( + self, adls_container_lease_state: Optional[ADLSLeaseState] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_container_lease_state = adls_container_lease_state @property def adls_container_lease_status(self) -> Optional[ADLSLeaseStatus]: - return None if self.attributes is None else self.attributes.adls_container_lease_status + return ( + None + if self.attributes is None + else self.attributes.adls_container_lease_status + ) @adls_container_lease_status.setter - def adls_container_lease_status(self, adls_container_lease_status: Optional[ADLSLeaseStatus]): + def adls_container_lease_status( + self, adls_container_lease_status: Optional[ADLSLeaseStatus] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_container_lease_status = adls_container_lease_status @property def adls_container_encryption_scope(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_container_encryption_scope + return ( + None + if self.attributes is None + else self.attributes.adls_container_encryption_scope + ) @adls_container_encryption_scope.setter - def adls_container_encryption_scope(self, adls_container_encryption_scope: Optional[str]): + def adls_container_encryption_scope( + self, adls_container_encryption_scope: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adls_container_encryption_scope = adls_container_encryption_scope + self.attributes.adls_container_encryption_scope = ( + adls_container_encryption_scope + ) @property def adls_container_version_level_immutability_support(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.adls_container_version_level_immutability_support + return ( + None + if self.attributes is None + else self.attributes.adls_container_version_level_immutability_support + ) @adls_container_version_level_immutability_support.setter def adls_container_version_level_immutability_support( @@ -226,13 +260,25 @@ def adls_objects(self, adls_objects: Optional[List[ADLSObject]]): class Attributes(ADLS.Attributes): adls_container_url: Optional[str] = Field(default=None, description="") - adls_container_lease_state: Optional[ADLSLeaseState] = Field(default=None, description="") - adls_container_lease_status: Optional[ADLSLeaseStatus] = Field(default=None, description="") - adls_container_encryption_scope: Optional[str] = Field(default=None, description="") - adls_container_version_level_immutability_support: Optional[bool] = Field(default=None, description="") + adls_container_lease_state: Optional[ADLSLeaseState] = Field( + default=None, description="" + ) + adls_container_lease_status: Optional[ADLSLeaseStatus] = Field( + default=None, description="" + ) + adls_container_encryption_scope: Optional[str] = Field( + default=None, description="" + ) + adls_container_version_level_immutability_support: Optional[bool] = Field( + default=None, description="" + ) adls_object_count: Optional[int] = Field(default=None, description="") - adls_account: Optional[ADLSAccount] = Field(default=None, description="") # relationship - adls_objects: Optional[List[ADLSObject]] = Field(default=None, description="") # relationship + adls_account: Optional[ADLSAccount] = Field( + default=None, description="" + ) # relationship + adls_objects: Optional[List[ADLSObject]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -248,7 +294,9 @@ def create( [name, adls_account_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( adls_account_qualified_name, "adls_account_qualified_name", 4 @@ -257,7 +305,9 @@ def create( return ADLSContainer.Attributes( name=name, qualified_name=f"{adls_account_qualified_name}/{name}", - adls_account=ADLSAccount.ref_by_qualified_name(adls_account_qualified_name), + adls_account=ADLSAccount.ref_by_qualified_name( + adls_account_qualified_name + ), adls_account_qualified_name=adls_account_qualified_name, adls_account_name=adls_account_qualified_name.split("/")[-1], connector_name=connector_name, diff --git a/pyatlan/model/assets/a_d_l_s_object.py b/pyatlan/model/assets/a_d_l_s_object.py index 6efefa443..f6e88b319 100644 --- a/pyatlan/model/assets/a_d_l_s_object.py +++ b/pyatlan/model/assets/a_d_l_s_object.py @@ -85,11 +85,15 @@ def create( adls_container_qualified_name: str, ) -> ADLSObject: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, adls_container_qualified_name=adls_container_qualified_name) + return cls.creator( + name=name, adls_container_qualified_name=adls_container_qualified_name + ) type_name: str = Field(default="ADLSObject", allow_mutation=False) @@ -110,19 +114,27 @@ def __setattr__(self, name, value): """ URL of this object. """ - ADLS_OBJECT_VERSION_ID: ClassVar[KeywordField] = KeywordField("adlsObjectVersionId", "adlsObjectVersionId") + ADLS_OBJECT_VERSION_ID: ClassVar[KeywordField] = KeywordField( + "adlsObjectVersionId", "adlsObjectVersionId" + ) """ Identifier of the version of this object, from ADLS. """ - ADLS_OBJECT_TYPE: ClassVar[KeywordField] = KeywordField("adlsObjectType", "adlsObjectType") + ADLS_OBJECT_TYPE: ClassVar[KeywordField] = KeywordField( + "adlsObjectType", "adlsObjectType" + ) """ Type of this object. """ - ADLS_OBJECT_SIZE: ClassVar[NumericField] = NumericField("adlsObjectSize", "adlsObjectSize") + ADLS_OBJECT_SIZE: ClassVar[NumericField] = NumericField( + "adlsObjectSize", "adlsObjectSize" + ) """ Size of this object. """ - ADLS_OBJECT_ACCESS_TIER: ClassVar[KeywordField] = KeywordField("adlsObjectAccessTier", "adlsObjectAccessTier") + ADLS_OBJECT_ACCESS_TIER: ClassVar[KeywordField] = KeywordField( + "adlsObjectAccessTier", "adlsObjectAccessTier" + ) """ Access tier of this object. """ @@ -144,18 +156,24 @@ def __setattr__(self, name, value): """ Whether this object is server encrypted (true) or not (false). """ - ADLS_OBJECT_VERSION_LEVEL_IMMUTABILITY_SUPPORT: ClassVar[BooleanField] = BooleanField( - "adlsObjectVersionLevelImmutabilitySupport", - "adlsObjectVersionLevelImmutabilitySupport", + ADLS_OBJECT_VERSION_LEVEL_IMMUTABILITY_SUPPORT: ClassVar[BooleanField] = ( + BooleanField( + "adlsObjectVersionLevelImmutabilitySupport", + "adlsObjectVersionLevelImmutabilitySupport", + ) ) """ Whether this object supports version-level immutability (true) or not (false). """ - ADLS_OBJECT_CACHE_CONTROL: ClassVar[TextField] = TextField("adlsObjectCacheControl", "adlsObjectCacheControl") + ADLS_OBJECT_CACHE_CONTROL: ClassVar[TextField] = TextField( + "adlsObjectCacheControl", "adlsObjectCacheControl" + ) """ Cache control of this object. """ - ADLS_OBJECT_CONTENT_TYPE: ClassVar[TextField] = TextField("adlsObjectContentType", "adlsObjectContentType") + ADLS_OBJECT_CONTENT_TYPE: ClassVar[TextField] = TextField( + "adlsObjectContentType", "adlsObjectContentType" + ) """ Content type of this object. """ @@ -173,15 +191,21 @@ def __setattr__(self, name, value): """ Language of this object's contents. """ - ADLS_OBJECT_LEASE_STATUS: ClassVar[KeywordField] = KeywordField("adlsObjectLeaseStatus", "adlsObjectLeaseStatus") + ADLS_OBJECT_LEASE_STATUS: ClassVar[KeywordField] = KeywordField( + "adlsObjectLeaseStatus", "adlsObjectLeaseStatus" + ) """ Status of this object's lease. """ - ADLS_OBJECT_LEASE_STATE: ClassVar[KeywordField] = KeywordField("adlsObjectLeaseState", "adlsObjectLeaseState") + ADLS_OBJECT_LEASE_STATE: ClassVar[KeywordField] = KeywordField( + "adlsObjectLeaseState", "adlsObjectLeaseState" + ) """ State of this object's lease. """ - ADLS_OBJECT_METADATA: ClassVar[KeywordField] = KeywordField("adlsObjectMetadata", "adlsObjectMetadata") + ADLS_OBJECT_METADATA: ClassVar[KeywordField] = KeywordField( + "adlsObjectMetadata", "adlsObjectMetadata" + ) """ Metadata associated with this object, from ADLS. """ @@ -241,7 +265,9 @@ def adls_object_url(self, adls_object_url: Optional[str]): @property def adls_object_version_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_object_version_id + return ( + None if self.attributes is None else self.attributes.adls_object_version_id + ) @adls_object_version_id.setter def adls_object_version_id(self, adls_object_version_id: Optional[str]): @@ -271,17 +297,25 @@ def adls_object_size(self, adls_object_size: Optional[int]): @property def adls_object_access_tier(self) -> Optional[ADLSAccessTier]: - return None if self.attributes is None else self.attributes.adls_object_access_tier + return ( + None if self.attributes is None else self.attributes.adls_object_access_tier + ) @adls_object_access_tier.setter - def adls_object_access_tier(self, adls_object_access_tier: Optional[ADLSAccessTier]): + def adls_object_access_tier( + self, adls_object_access_tier: Optional[ADLSAccessTier] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_access_tier = adls_object_access_tier @property def adls_object_access_tier_last_modified_time(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.adls_object_access_tier_last_modified_time + return ( + None + if self.attributes is None + else self.attributes.adls_object_access_tier_last_modified_time + ) @adls_object_access_tier_last_modified_time.setter def adls_object_access_tier_last_modified_time( @@ -289,31 +323,49 @@ def adls_object_access_tier_last_modified_time( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adls_object_access_tier_last_modified_time = adls_object_access_tier_last_modified_time + self.attributes.adls_object_access_tier_last_modified_time = ( + adls_object_access_tier_last_modified_time + ) @property def adls_object_archive_status(self) -> Optional[ADLSObjectArchiveStatus]: - return None if self.attributes is None else self.attributes.adls_object_archive_status + return ( + None + if self.attributes is None + else self.attributes.adls_object_archive_status + ) @adls_object_archive_status.setter - def adls_object_archive_status(self, adls_object_archive_status: Optional[ADLSObjectArchiveStatus]): + def adls_object_archive_status( + self, adls_object_archive_status: Optional[ADLSObjectArchiveStatus] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_archive_status = adls_object_archive_status @property def adls_object_server_encrypted(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.adls_object_server_encrypted + return ( + None + if self.attributes is None + else self.attributes.adls_object_server_encrypted + ) @adls_object_server_encrypted.setter - def adls_object_server_encrypted(self, adls_object_server_encrypted: Optional[bool]): + def adls_object_server_encrypted( + self, adls_object_server_encrypted: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_server_encrypted = adls_object_server_encrypted @property def adls_object_version_level_immutability_support(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.adls_object_version_level_immutability_support + return ( + None + if self.attributes is None + else self.attributes.adls_object_version_level_immutability_support + ) @adls_object_version_level_immutability_support.setter def adls_object_version_level_immutability_support( @@ -321,11 +373,17 @@ def adls_object_version_level_immutability_support( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adls_object_version_level_immutability_support = adls_object_version_level_immutability_support + self.attributes.adls_object_version_level_immutability_support = ( + adls_object_version_level_immutability_support + ) @property def adls_object_cache_control(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_object_cache_control + return ( + None + if self.attributes is None + else self.attributes.adls_object_cache_control + ) @adls_object_cache_control.setter def adls_object_cache_control(self, adls_object_cache_control: Optional[str]): @@ -335,7 +393,11 @@ def adls_object_cache_control(self, adls_object_cache_control: Optional[str]): @property def adls_object_content_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_object_content_type + return ( + None + if self.attributes is None + else self.attributes.adls_object_content_type + ) @adls_object_content_type.setter def adls_object_content_type(self, adls_object_content_type: Optional[str]): @@ -345,17 +407,27 @@ def adls_object_content_type(self, adls_object_content_type: Optional[str]): @property def adls_object_content_m_d5_hash(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_object_content_m_d5_hash + return ( + None + if self.attributes is None + else self.attributes.adls_object_content_m_d5_hash + ) @adls_object_content_m_d5_hash.setter - def adls_object_content_m_d5_hash(self, adls_object_content_m_d5_hash: Optional[str]): + def adls_object_content_m_d5_hash( + self, adls_object_content_m_d5_hash: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_content_m_d5_hash = adls_object_content_m_d5_hash @property def adls_object_content_language(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_object_content_language + return ( + None + if self.attributes is None + else self.attributes.adls_object_content_language + ) @adls_object_content_language.setter def adls_object_content_language(self, adls_object_content_language: Optional[str]): @@ -365,20 +437,30 @@ def adls_object_content_language(self, adls_object_content_language: Optional[st @property def adls_object_lease_status(self) -> Optional[ADLSLeaseStatus]: - return None if self.attributes is None else self.attributes.adls_object_lease_status + return ( + None + if self.attributes is None + else self.attributes.adls_object_lease_status + ) @adls_object_lease_status.setter - def adls_object_lease_status(self, adls_object_lease_status: Optional[ADLSLeaseStatus]): + def adls_object_lease_status( + self, adls_object_lease_status: Optional[ADLSLeaseStatus] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_lease_status = adls_object_lease_status @property def adls_object_lease_state(self) -> Optional[ADLSLeaseState]: - return None if self.attributes is None else self.attributes.adls_object_lease_state + return ( + None if self.attributes is None else self.attributes.adls_object_lease_state + ) @adls_object_lease_state.setter - def adls_object_lease_state(self, adls_object_lease_state: Optional[ADLSLeaseState]): + def adls_object_lease_state( + self, adls_object_lease_state: Optional[ADLSLeaseState] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_object_lease_state = adls_object_lease_state @@ -395,10 +477,16 @@ def adls_object_metadata(self, adls_object_metadata: Optional[Dict[str, str]]): @property def adls_container_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_container_qualified_name + return ( + None + if self.attributes is None + else self.attributes.adls_container_qualified_name + ) @adls_container_qualified_name.setter - def adls_container_qualified_name(self, adls_container_qualified_name: Optional[str]): + def adls_container_qualified_name( + self, adls_container_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adls_container_qualified_name = adls_container_qualified_name @@ -428,21 +516,45 @@ class Attributes(ADLS.Attributes): adls_object_version_id: Optional[str] = Field(default=None, description="") adls_object_type: Optional[ADLSObjectType] = Field(default=None, description="") adls_object_size: Optional[int] = Field(default=None, description="") - adls_object_access_tier: Optional[ADLSAccessTier] = Field(default=None, description="") - adls_object_access_tier_last_modified_time: Optional[datetime] = Field(default=None, description="") - adls_object_archive_status: Optional[ADLSObjectArchiveStatus] = Field(default=None, description="") - adls_object_server_encrypted: Optional[bool] = Field(default=None, description="") - adls_object_version_level_immutability_support: Optional[bool] = Field(default=None, description="") + adls_object_access_tier: Optional[ADLSAccessTier] = Field( + default=None, description="" + ) + adls_object_access_tier_last_modified_time: Optional[datetime] = Field( + default=None, description="" + ) + adls_object_archive_status: Optional[ADLSObjectArchiveStatus] = Field( + default=None, description="" + ) + adls_object_server_encrypted: Optional[bool] = Field( + default=None, description="" + ) + adls_object_version_level_immutability_support: Optional[bool] = Field( + default=None, description="" + ) adls_object_cache_control: Optional[str] = Field(default=None, description="") adls_object_content_type: Optional[str] = Field(default=None, description="") - adls_object_content_m_d5_hash: Optional[str] = Field(default=None, description="") - adls_object_content_language: Optional[str] = Field(default=None, description="") - adls_object_lease_status: Optional[ADLSLeaseStatus] = Field(default=None, description="") - adls_object_lease_state: Optional[ADLSLeaseState] = Field(default=None, description="") - adls_object_metadata: Optional[Dict[str, str]] = Field(default=None, description="") - adls_container_qualified_name: Optional[str] = Field(default=None, description="") + adls_object_content_m_d5_hash: Optional[str] = Field( + default=None, description="" + ) + adls_object_content_language: Optional[str] = Field( + default=None, description="" + ) + adls_object_lease_status: Optional[ADLSLeaseStatus] = Field( + default=None, description="" + ) + adls_object_lease_state: Optional[ADLSLeaseState] = Field( + default=None, description="" + ) + adls_object_metadata: Optional[Dict[str, str]] = Field( + default=None, description="" + ) + adls_container_qualified_name: Optional[str] = Field( + default=None, description="" + ) adls_container_name: Optional[str] = Field(default=None, description="") - adls_container: Optional[ADLSContainer] = Field(default=None, description="") # relationship + adls_container: Optional[ADLSContainer] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -459,13 +571,16 @@ def create( [name, adls_container_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( adls_container_qualified_name, "adls_container_qualified_name", 5 ) - adls_account_qualified_name = adls_account_qualified_name or get_parent_qualified_name( - adls_container_qualified_name + adls_account_qualified_name = ( + adls_account_qualified_name + or get_parent_qualified_name(adls_container_qualified_name) ) return ADLSObject.Attributes( name=name, @@ -474,7 +589,9 @@ def create( qualified_name=f"{adls_container_qualified_name}/{name}", connector_name=connector_name, connection_qualified_name=connection_qualified_name or connection_qn, - adls_container=ADLSContainer.ref_by_qualified_name(adls_container_qualified_name), + adls_container=ADLSContainer.ref_by_qualified_name( + adls_container_qualified_name + ), adls_account_qualified_name=adls_account_qualified_name, adls_account_name=adls_account_qualified_name.split("/")[-1], ) diff --git a/pyatlan/model/assets/a_p_i.py b/pyatlan/model/assets/a_p_i.py index 8d0f36cff..e71226a9f 100644 --- a/pyatlan/model/assets/a_p_i.py +++ b/pyatlan/model/assets/a_p_i.py @@ -37,11 +37,15 @@ def __setattr__(self, name, value): """ Type of API, for example: OpenAPI, GraphQL, etc. """ - API_SPEC_VERSION: ClassVar[KeywordField] = KeywordField("apiSpecVersion", "apiSpecVersion") + API_SPEC_VERSION: ClassVar[KeywordField] = KeywordField( + "apiSpecVersion", "apiSpecVersion" + ) """ Version of the API specification. """ - API_SPEC_NAME: ClassVar[KeywordTextField] = KeywordTextField("apiSpecName", "apiSpecName.keyword", "apiSpecName") + API_SPEC_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "apiSpecName", "apiSpecName.keyword", "apiSpecName" + ) """ Simple name of the API spec, if this asset is contained in an API spec. """ @@ -51,19 +55,27 @@ def __setattr__(self, name, value): """ Unique name of the API spec, if this asset is contained in an API spec. """ - API_EXTERNAL_DOCS: ClassVar[KeywordField] = KeywordField("apiExternalDocs", "apiExternalDocs") + API_EXTERNAL_DOCS: ClassVar[KeywordField] = KeywordField( + "apiExternalDocs", "apiExternalDocs" + ) """ External documentation of the API. """ - API_IS_AUTH_OPTIONAL: ClassVar[BooleanField] = BooleanField("apiIsAuthOptional", "apiIsAuthOptional") + API_IS_AUTH_OPTIONAL: ClassVar[BooleanField] = BooleanField( + "apiIsAuthOptional", "apiIsAuthOptional" + ) """ Whether authentication is optional (true) or required (false). """ - API_IS_OBJECT_REFERENCE: ClassVar[BooleanField] = BooleanField("apiIsObjectReference", "apiIsObjectReference") + API_IS_OBJECT_REFERENCE: ClassVar[BooleanField] = BooleanField( + "apiIsObjectReference", "apiIsObjectReference" + ) """ If this asset refers to an APIObject """ - API_OBJECT_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("apiObjectQualifiedName", "apiObjectQualifiedName") + API_OBJECT_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "apiObjectQualifiedName", "apiObjectQualifiedName" + ) """ Qualified name of the APIObject that is referred to by this asset. When apiIsObjectReference is true. """ @@ -111,7 +123,9 @@ def api_spec_name(self, api_spec_name: Optional[str]): @property def api_spec_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.api_spec_qualified_name + return ( + None if self.attributes is None else self.attributes.api_spec_qualified_name + ) @api_spec_qualified_name.setter def api_spec_qualified_name(self, api_spec_qualified_name: Optional[str]): @@ -141,7 +155,9 @@ def api_is_auth_optional(self, api_is_auth_optional: Optional[bool]): @property def api_is_object_reference(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.api_is_object_reference + return ( + None if self.attributes is None else self.attributes.api_is_object_reference + ) @api_is_object_reference.setter def api_is_object_reference(self, api_is_object_reference: Optional[bool]): @@ -151,7 +167,11 @@ def api_is_object_reference(self, api_is_object_reference: Optional[bool]): @property def api_object_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.api_object_qualified_name + return ( + None + if self.attributes is None + else self.attributes.api_object_qualified_name + ) @api_object_qualified_name.setter def api_object_qualified_name(self, api_object_qualified_name: Optional[str]): @@ -164,7 +184,9 @@ class Attributes(Catalog.Attributes): api_spec_version: Optional[str] = Field(default=None, description="") api_spec_name: Optional[str] = Field(default=None, description="") api_spec_qualified_name: Optional[str] = Field(default=None, description="") - api_external_docs: Optional[Dict[str, str]] = Field(default=None, description="") + api_external_docs: Optional[Dict[str, str]] = Field( + default=None, description="" + ) api_is_auth_optional: Optional[bool] = Field(default=None, description="") api_is_object_reference: Optional[bool] = Field(default=None, description="") api_object_qualified_name: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/a_p_i_field.py b/pyatlan/model/assets/a_p_i_field.py index d42753431..b7143e396 100644 --- a/pyatlan/model/assets/a_p_i_field.py +++ b/pyatlan/model/assets/a_p_i_field.py @@ -126,10 +126,12 @@ def creator( validate_required_fields(["name"], [name]) # valid checker - for either to have a value ONLY if parent_api_object_qualified_name is None or ( - isinstance(parent_api_object_qualified_name, str) and not parent_api_object_qualified_name.strip() + isinstance(parent_api_object_qualified_name, str) + and not parent_api_object_qualified_name.strip() ): if parent_api_query_qualified_name is None or ( - isinstance(parent_api_query_qualified_name, str) and not parent_api_query_qualified_name.strip() + isinstance(parent_api_query_qualified_name, str) + and not parent_api_query_qualified_name.strip() ): raise ValueError( ( @@ -137,7 +139,10 @@ def creator( "parent_api_query_qualified_name requires a valid value" ) ) - elif isinstance(parent_api_query_qualified_name, str) and parent_api_query_qualified_name.strip(): + elif ( + isinstance(parent_api_query_qualified_name, str) + and parent_api_query_qualified_name.strip() + ): raise ValueError( "Both parent_api_object_qualified_name and parent_api_query_qualified_name cannot be valid" ) @@ -145,16 +150,21 @@ def creator( # is api object reference - checker if is_api_object_reference: if not reference_api_object_qualified_name or ( - isinstance(reference_api_object_qualified_name, str) and not reference_api_object_qualified_name.strip() + isinstance(reference_api_object_qualified_name, str) + and not reference_api_object_qualified_name.strip() ): - raise ValueError("Set valid qualified name for reference_api_object_qualified_name") + raise ValueError( + "Set valid qualified name for reference_api_object_qualified_name" + ) else: if ( reference_api_object_qualified_name and isinstance(reference_api_object_qualified_name, str) and reference_api_object_qualified_name.strip() ): - raise ValueError("Set is_api_object_reference to true to set reference_api_object_qualified_name") + raise ValueError( + "Set is_api_object_reference to true to set reference_api_object_qualified_name" + ) attributes = APIField.Attributes.creator( name=name, @@ -182,15 +192,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - API_FIELD_TYPE: ClassVar[KeywordField] = KeywordField("apiFieldType", "apiFieldType") + API_FIELD_TYPE: ClassVar[KeywordField] = KeywordField( + "apiFieldType", "apiFieldType" + ) """ Type of APIField. E.g. STRING, NUMBER etc. It is free text. """ - API_FIELD_TYPE_SECONDARY: ClassVar[KeywordField] = KeywordField("apiFieldTypeSecondary", "apiFieldTypeSecondary") + API_FIELD_TYPE_SECONDARY: ClassVar[KeywordField] = KeywordField( + "apiFieldTypeSecondary", "apiFieldTypeSecondary" + ) """ Secondary Type of APIField. E.g. LIST/STRING, then LIST would be the secondary type. """ - API_QUERY_PARAM_TYPE: ClassVar[KeywordField] = KeywordField("apiQueryParamType", "apiQueryParamType") + API_QUERY_PARAM_TYPE: ClassVar[KeywordField] = KeywordField( + "apiQueryParamType", "apiQueryParamType" + ) """ If parent relationship type is APIQuery, then this attribute denotes if this is input or output parameter. """ @@ -224,7 +240,11 @@ def api_field_type(self, api_field_type: Optional[str]): @property def api_field_type_secondary(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.api_field_type_secondary + return ( + None + if self.attributes is None + else self.attributes.api_field_type_secondary + ) @api_field_type_secondary.setter def api_field_type_secondary(self, api_field_type_secondary: Optional[str]): @@ -237,7 +257,9 @@ def api_query_param_type(self) -> Optional[APIQueryParamTypeEnum]: return None if self.attributes is None else self.attributes.api_query_param_type @api_query_param_type.setter - def api_query_param_type(self, api_query_param_type: Optional[APIQueryParamTypeEnum]): + def api_query_param_type( + self, api_query_param_type: Optional[APIQueryParamTypeEnum] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.api_query_param_type = api_query_param_type @@ -265,9 +287,15 @@ def api_object(self, api_object: Optional[APIObject]): class Attributes(API.Attributes): api_field_type: Optional[str] = Field(default=None, description="") api_field_type_secondary: Optional[str] = Field(default=None, description="") - api_query_param_type: Optional[APIQueryParamTypeEnum] = Field(default=None, description="") - api_query: Optional[APIQuery] = Field(default=None, description="") # relationship - api_object: Optional[APIObject] = Field(default=None, description="") # relationship + api_query_param_type: Optional[APIQueryParamTypeEnum] = Field( + default=None, description="" + ) + api_query: Optional[APIQuery] = Field( + default=None, description="" + ) # relationship + api_object: Optional[APIObject] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -286,10 +314,12 @@ def creator( ) -> APIField.Attributes: validate_required_fields(["name"], [name]) if parent_api_object_qualified_name is None or ( - isinstance(parent_api_object_qualified_name, str) and not parent_api_object_qualified_name.strip() + isinstance(parent_api_object_qualified_name, str) + and not parent_api_object_qualified_name.strip() ): if parent_api_query_qualified_name is None or ( - isinstance(parent_api_query_qualified_name, str) and not parent_api_query_qualified_name.strip() + isinstance(parent_api_query_qualified_name, str) + and not parent_api_query_qualified_name.strip() ): raise ValueError( ( @@ -297,7 +327,10 @@ def creator( "parent_api_query_qualified_name requires a valid value" ) ) - elif isinstance(parent_api_query_qualified_name, str) and parent_api_query_qualified_name.strip(): + elif ( + isinstance(parent_api_query_qualified_name, str) + and parent_api_query_qualified_name.strip() + ): raise ValueError( "Both parent_api_object_qualified_name and parent_api_query_qualified_name cannot be valid" ) @@ -307,18 +340,24 @@ def creator( isinstance(reference_api_object_qualified_name, str) and not reference_api_object_qualified_name.strip() ): - raise ValueError("Set valid qualified name for reference_api_object_qualified_name") + raise ValueError( + "Set valid qualified name for reference_api_object_qualified_name" + ) else: if ( reference_api_object_qualified_name and isinstance(reference_api_object_qualified_name, str) and reference_api_object_qualified_name.strip() ): - raise ValueError("Set is_api_object_reference to true to set reference_api_object_qualified_name") + raise ValueError( + "Set is_api_object_reference to true to set reference_api_object_qualified_name" + ) # connector-name if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) connection_qn = connection_qualified_name elif parent_api_object_qualified_name: connection_qn, connector_name = AtlanConnectorType.get_connector_name( @@ -343,9 +382,13 @@ def creator( api_field_type_secondary=api_field_type_secondary, api_is_object_reference=is_api_object_reference, api_object_qualified_name=( - reference_api_object_qualified_name if is_api_object_reference else None + reference_api_object_qualified_name + if is_api_object_reference + else None + ), + api_object=APIObject.ref_by_qualified_name( + str(parent_api_object_qualified_name) ), - api_object=APIObject.ref_by_qualified_name(str(parent_api_object_qualified_name)), api_query_param_type=api_query_param_type, ) else: @@ -358,9 +401,13 @@ def creator( api_field_type_secondary=api_field_type_secondary, api_is_object_reference=is_api_object_reference, api_object_qualified_name=( - reference_api_object_qualified_name if is_api_object_reference else None + reference_api_object_qualified_name + if is_api_object_reference + else None + ), + api_query=APIQuery.ref_by_qualified_name( + str(parent_api_query_qualified_name) ), - api_query=APIQuery.ref_by_qualified_name(str(parent_api_query_qualified_name)), api_query_param_type=api_query_param_type, ) diff --git a/pyatlan/model/assets/a_p_i_object.py b/pyatlan/model/assets/a_p_i_object.py index 202028836..95812bf67 100644 --- a/pyatlan/model/assets/a_p_i_object.py +++ b/pyatlan/model/assets/a_p_i_object.py @@ -46,7 +46,9 @@ def creator( connection_qualified_name: str, api_field_count: Optional[int] = None, ) -> APIObject: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) attributes = APIObject.Attributes.creator( name=name, connection_qualified_name=connection_qualified_name, @@ -67,7 +69,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - API_FIELD_COUNT: ClassVar[NumericField] = NumericField("apiFieldCount", "apiFieldCount") + API_FIELD_COUNT: ClassVar[NumericField] = NumericField( + "apiFieldCount", "apiFieldCount" + ) """ Count of the APIField of this object. """ @@ -104,7 +108,9 @@ def api_fields(self, api_fields: Optional[List[APIField]]): class Attributes(API.Attributes): api_field_count: Optional[int] = Field(default=None, description="") - api_fields: Optional[List[APIField]] = Field(default=None, description="") # relationship + api_fields: Optional[List[APIField]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -115,12 +121,16 @@ def creator( connection_qualified_name: str, api_field_count: Optional[int] = None, ) -> APIObject.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return APIObject.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), api_field_count=api_field_count, ) diff --git a/pyatlan/model/assets/a_p_i_path.py b/pyatlan/model/assets/a_p_i_path.py index 985d9e852..b74dd3b0a 100644 --- a/pyatlan/model/assets/a_p_i_path.py +++ b/pyatlan/model/assets/a_p_i_path.py @@ -53,7 +53,9 @@ def creator( spec_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> APIPath: - validate_required_fields(["path_raw_uri", "spec_qualified_name"], [path_raw_uri, spec_qualified_name]) + validate_required_fields( + ["path_raw_uri", "spec_qualified_name"], [path_raw_uri, spec_qualified_name] + ) attributes = APIPath.Attributes.create( path_raw_uri=path_raw_uri, spec_qualified_name=spec_qualified_name, @@ -65,11 +67,15 @@ def creator( @init_guid def create(cls, *, path_raw_uri: str, spec_qualified_name: str) -> APIPath: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(path_raw_uri=path_raw_uri, spec_qualified_name=spec_qualified_name) + return cls.creator( + path_raw_uri=path_raw_uri, spec_qualified_name=spec_qualified_name + ) type_name: str = Field(default="APIPath", allow_mutation=False) @@ -84,7 +90,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - API_PATH_SUMMARY: ClassVar[TextField] = TextField("apiPathSummary", "apiPathSummary") + API_PATH_SUMMARY: ClassVar[TextField] = TextField( + "apiPathSummary", "apiPathSummary" + ) """ Descriptive summary intended to apply to all operations in this path. """ @@ -94,7 +102,9 @@ def __setattr__(self, name, value): """ Absolute path to an individual endpoint. """ - API_PATH_IS_TEMPLATED: ClassVar[BooleanField] = BooleanField("apiPathIsTemplated", "apiPathIsTemplated") + API_PATH_IS_TEMPLATED: ClassVar[BooleanField] = BooleanField( + "apiPathIsTemplated", "apiPathIsTemplated" + ) """ Whether the endpoint's path contains replaceable parameters (true) or not (false). """ @@ -154,7 +164,9 @@ def api_path_raw_u_r_i(self, api_path_raw_u_r_i: Optional[str]): @property def api_path_is_templated(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.api_path_is_templated + return ( + None if self.attributes is None else self.attributes.api_path_is_templated + ) @api_path_is_templated.setter def api_path_is_templated(self, api_path_is_templated: Optional[bool]): @@ -164,27 +176,45 @@ def api_path_is_templated(self, api_path_is_templated: Optional[bool]): @property def api_path_available_operations(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.api_path_available_operations + return ( + None + if self.attributes is None + else self.attributes.api_path_available_operations + ) @api_path_available_operations.setter - def api_path_available_operations(self, api_path_available_operations: Optional[Set[str]]): + def api_path_available_operations( + self, api_path_available_operations: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.api_path_available_operations = api_path_available_operations @property def api_path_available_response_codes(self) -> Optional[Dict[str, str]]: - return None if self.attributes is None else self.attributes.api_path_available_response_codes + return ( + None + if self.attributes is None + else self.attributes.api_path_available_response_codes + ) @api_path_available_response_codes.setter - def api_path_available_response_codes(self, api_path_available_response_codes: Optional[Dict[str, str]]): + def api_path_available_response_codes( + self, api_path_available_response_codes: Optional[Dict[str, str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.api_path_available_response_codes = api_path_available_response_codes + self.attributes.api_path_available_response_codes = ( + api_path_available_response_codes + ) @property def api_path_is_ingress_exposed(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.api_path_is_ingress_exposed + return ( + None + if self.attributes is None + else self.attributes.api_path_is_ingress_exposed + ) @api_path_is_ingress_exposed.setter def api_path_is_ingress_exposed(self, api_path_is_ingress_exposed: Optional[bool]): @@ -206,10 +236,18 @@ class Attributes(API.Attributes): api_path_summary: Optional[str] = Field(default=None, description="") api_path_raw_u_r_i: Optional[str] = Field(default=None, description="") api_path_is_templated: Optional[bool] = Field(default=None, description="") - api_path_available_operations: Optional[Set[str]] = Field(default=None, description="") - api_path_available_response_codes: Optional[Dict[str, str]] = Field(default=None, description="") - api_path_is_ingress_exposed: Optional[bool] = Field(default=None, description="") - api_spec: Optional[APISpec] = Field(default=None, description="") # relationship + api_path_available_operations: Optional[Set[str]] = Field( + default=None, description="" + ) + api_path_available_response_codes: Optional[Dict[str, str]] = Field( + default=None, description="" + ) + api_path_is_ingress_exposed: Optional[bool] = Field( + default=None, description="" + ) + api_spec: Optional[APISpec] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -225,7 +263,9 @@ def create( [path_raw_uri, spec_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( spec_qualified_name, "spec_qualified_name", 4 diff --git a/pyatlan/model/assets/a_p_i_query.py b/pyatlan/model/assets/a_p_i_query.py index 24fa4d4ec..2420096ee 100644 --- a/pyatlan/model/assets/a_p_i_query.py +++ b/pyatlan/model/assets/a_p_i_query.py @@ -76,11 +76,14 @@ def creator( is_object_reference: Optional[bool] = False, reference_api_object_qualified_name: Optional[str] = None, ) -> APIQuery: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) # is api object reference - checker if is_object_reference: if not reference_api_object_qualified_name or ( - isinstance(reference_api_object_qualified_name, str) and not reference_api_object_qualified_name.strip() + isinstance(reference_api_object_qualified_name, str) + and not reference_api_object_qualified_name.strip() ): raise ValueError( "Set valid qualified name for reference_api_object_qualified_name when is_object_reference is true" @@ -91,7 +94,9 @@ def creator( and isinstance(reference_api_object_qualified_name, str) and reference_api_object_qualified_name.strip() ): - raise ValueError("Set is_object_reference to true to set reference_api_object_qualified_name") + raise ValueError( + "Set is_object_reference to true to set reference_api_object_qualified_name" + ) attributes = APIQuery.Attributes.creator( name=name, @@ -117,11 +122,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - API_INPUT_FIELD_COUNT: ClassVar[NumericField] = NumericField("apiInputFieldCount", "apiInputFieldCount") + API_INPUT_FIELD_COUNT: ClassVar[NumericField] = NumericField( + "apiInputFieldCount", "apiInputFieldCount" + ) """ Count of the APIField of this query that are input to it. """ - API_QUERY_OUTPUT_TYPE: ClassVar[KeywordField] = KeywordField("apiQueryOutputType", "apiQueryOutputType") + API_QUERY_OUTPUT_TYPE: ClassVar[KeywordField] = KeywordField( + "apiQueryOutputType", "apiQueryOutputType" + ) """ Type of APIQueryOutput. E.g. STRING, NUMBER etc. It is free text. """ @@ -146,7 +155,9 @@ def __setattr__(self, name, value): @property def api_input_field_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.api_input_field_count + return ( + None if self.attributes is None else self.attributes.api_input_field_count + ) @api_input_field_count.setter def api_input_field_count(self, api_input_field_count: Optional[int]): @@ -156,7 +167,9 @@ def api_input_field_count(self, api_input_field_count: Optional[int]): @property def api_query_output_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.api_query_output_type + return ( + None if self.attributes is None else self.attributes.api_query_output_type + ) @api_query_output_type.setter def api_query_output_type(self, api_query_output_type: Optional[str]): @@ -166,13 +179,21 @@ def api_query_output_type(self, api_query_output_type: Optional[str]): @property def api_query_output_type_secondary(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.api_query_output_type_secondary + return ( + None + if self.attributes is None + else self.attributes.api_query_output_type_secondary + ) @api_query_output_type_secondary.setter - def api_query_output_type_secondary(self, api_query_output_type_secondary: Optional[str]): + def api_query_output_type_secondary( + self, api_query_output_type_secondary: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.api_query_output_type_secondary = api_query_output_type_secondary + self.attributes.api_query_output_type_secondary = ( + api_query_output_type_secondary + ) @property def api_fields(self) -> Optional[List[APIField]]: @@ -187,8 +208,12 @@ def api_fields(self, api_fields: Optional[List[APIField]]): class Attributes(API.Attributes): api_input_field_count: Optional[int] = Field(default=None, description="") api_query_output_type: Optional[str] = Field(default=None, description="") - api_query_output_type_secondary: Optional[str] = Field(default=None, description="") - api_fields: Optional[List[APIField]] = Field(default=None, description="") # relationship + api_query_output_type_secondary: Optional[str] = Field( + default=None, description="" + ) + api_fields: Optional[List[APIField]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -203,32 +228,42 @@ def creator( is_object_reference: Optional[bool] = False, reference_api_object_qualified_name: Optional[str] = None, ) -> APIQuery.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) # is api object reference - checker if is_object_reference: if not reference_api_object_qualified_name or ( isinstance(reference_api_object_qualified_name, str) and not reference_api_object_qualified_name.strip() ): - raise ValueError("Set valid qualified name for reference_api_object_qualified_name") + raise ValueError( + "Set valid qualified name for reference_api_object_qualified_name" + ) else: if ( reference_api_object_qualified_name and isinstance(reference_api_object_qualified_name, str) and reference_api_object_qualified_name.strip() ): - raise ValueError("Set is_object_reference to true to set reference_api_object_qualified_name") + raise ValueError( + "Set is_object_reference to true to set reference_api_object_qualified_name" + ) return APIQuery.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), api_input_field_count=api_input_field_count, api_query_output_type=api_query_output_type, api_query_output_type_secondary=api_query_output_type_secondary, api_is_object_reference=is_object_reference, - api_object_qualified_name=(reference_api_object_qualified_name if is_object_reference else None), + api_object_qualified_name=( + reference_api_object_qualified_name if is_object_reference else None + ), ) attributes: APIQuery.Attributes = Field( diff --git a/pyatlan/model/assets/a_p_i_spec.py b/pyatlan/model/assets/a_p_i_spec.py index 3e6085718..433ecebf0 100644 --- a/pyatlan/model/assets/a_p_i_spec.py +++ b/pyatlan/model/assets/a_p_i_spec.py @@ -26,19 +26,27 @@ class APISpec(API): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> APISpec: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) - attributes = APISpec.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) + attributes = APISpec.Attributes.create( + name=name, connection_qualified_name=connection_qualified_name + ) return cls(attributes=attributes) @classmethod @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> APISpec: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, connection_qualified_name=connection_qualified_name) + return cls.creator( + name=name, connection_qualified_name=connection_qualified_name + ) type_name: str = Field(default="APISpec", allow_mutation=False) @@ -91,7 +99,9 @@ def __setattr__(self, name, value): """ URL to the license under which the API specification is available. """ - API_SPEC_CONTRACT_VERSION: ClassVar[KeywordField] = KeywordField("apiSpecContractVersion", "apiSpecContractVersion") + API_SPEC_CONTRACT_VERSION: ClassVar[KeywordField] = KeywordField( + "apiSpecContractVersion", "apiSpecContractVersion" + ) """ Version of the contract for the API specification. """ @@ -121,17 +131,25 @@ def __setattr__(self, name, value): @property def api_spec_terms_of_service_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.api_spec_terms_of_service_url + return ( + None + if self.attributes is None + else self.attributes.api_spec_terms_of_service_url + ) @api_spec_terms_of_service_url.setter - def api_spec_terms_of_service_url(self, api_spec_terms_of_service_url: Optional[str]): + def api_spec_terms_of_service_url( + self, api_spec_terms_of_service_url: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.api_spec_terms_of_service_url = api_spec_terms_of_service_url @property def api_spec_contact_email(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.api_spec_contact_email + return ( + None if self.attributes is None else self.attributes.api_spec_contact_email + ) @api_spec_contact_email.setter def api_spec_contact_email(self, api_spec_contact_email: Optional[str]): @@ -141,7 +159,9 @@ def api_spec_contact_email(self, api_spec_contact_email: Optional[str]): @property def api_spec_contact_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.api_spec_contact_name + return ( + None if self.attributes is None else self.attributes.api_spec_contact_name + ) @api_spec_contact_name.setter def api_spec_contact_name(self, api_spec_contact_name: Optional[str]): @@ -161,7 +181,9 @@ def api_spec_contact_url(self, api_spec_contact_url: Optional[str]): @property def api_spec_license_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.api_spec_license_name + return ( + None if self.attributes is None else self.attributes.api_spec_license_name + ) @api_spec_license_name.setter def api_spec_license_name(self, api_spec_license_name: Optional[str]): @@ -181,7 +203,11 @@ def api_spec_license_url(self, api_spec_license_url: Optional[str]): @property def api_spec_contract_version(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.api_spec_contract_version + return ( + None + if self.attributes is None + else self.attributes.api_spec_contract_version + ) @api_spec_contract_version.setter def api_spec_contract_version(self, api_spec_contract_version: Optional[str]): @@ -191,7 +217,9 @@ def api_spec_contract_version(self, api_spec_contract_version: Optional[str]): @property def api_spec_service_alias(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.api_spec_service_alias + return ( + None if self.attributes is None else self.attributes.api_spec_service_alias + ) @api_spec_service_alias.setter def api_spec_service_alias(self, api_spec_service_alias: Optional[str]): @@ -210,7 +238,9 @@ def api_paths(self, api_paths: Optional[List[APIPath]]): self.attributes.api_paths = api_paths class Attributes(API.Attributes): - api_spec_terms_of_service_url: Optional[str] = Field(default=None, description="") + api_spec_terms_of_service_url: Optional[str] = Field( + default=None, description="" + ) api_spec_contact_email: Optional[str] = Field(default=None, description="") api_spec_contact_name: Optional[str] = Field(default=None, description="") api_spec_contact_url: Optional[str] = Field(default=None, description="") @@ -218,17 +248,25 @@ class Attributes(API.Attributes): api_spec_license_url: Optional[str] = Field(default=None, description="") api_spec_contract_version: Optional[str] = Field(default=None, description="") api_spec_service_alias: Optional[str] = Field(default=None, description="") - api_paths: Optional[List[APIPath]] = Field(default=None, description="") # relationship + api_paths: Optional[List[APIPath]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def create(cls, *, name: str, connection_qualified_name: str) -> APISpec.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + def create( + cls, *, name: str, connection_qualified_name: str + ) -> APISpec.Attributes: + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return APISpec.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: APISpec.Attributes = Field( diff --git a/pyatlan/model/assets/a_w_s.py b/pyatlan/model/assets/a_w_s.py index df7182712..440417bdf 100644 --- a/pyatlan/model/assets/a_w_s.py +++ b/pyatlan/model/assets/a_w_s.py @@ -30,7 +30,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AWS_ARN: ClassVar[KeywordTextField] = KeywordTextField("awsArn", "awsArn", "awsArn.text") + AWS_ARN: ClassVar[KeywordTextField] = KeywordTextField( + "awsArn", "awsArn", "awsArn.text" + ) """ Amazon Resource Name (ARN) for this asset. This uniquely identifies the asset in AWS, and thus must be unique across all AWS asset instances. """ # noqa: E501 @@ -46,15 +48,21 @@ def __setattr__(self, name, value): """ Physical region where the data center in which the asset exists is clustered. """ - AWS_ACCOUNT_ID: ClassVar[KeywordField] = KeywordField("awsAccountId", "awsAccountId") + AWS_ACCOUNT_ID: ClassVar[KeywordField] = KeywordField( + "awsAccountId", "awsAccountId" + ) """ 12-digit number that uniquely identifies an AWS account. """ - AWS_RESOURCE_ID: ClassVar[KeywordField] = KeywordField("awsResourceId", "awsResourceId") + AWS_RESOURCE_ID: ClassVar[KeywordField] = KeywordField( + "awsResourceId", "awsResourceId" + ) """ Unique resource ID assigned when a new resource is created. """ - AWS_OWNER_NAME: ClassVar[KeywordTextField] = KeywordTextField("awsOwnerName", "awsOwnerName", "awsOwnerName.text") + AWS_OWNER_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "awsOwnerName", "awsOwnerName", "awsOwnerName.text" + ) """ Root user's name. """ diff --git a/pyatlan/model/assets/anaplan.py b/pyatlan/model/assets/anaplan.py index 77ae08135..c593ed72a 100644 --- a/pyatlan/model/assets/anaplan.py +++ b/pyatlan/model/assets/anaplan.py @@ -35,7 +35,9 @@ def __setattr__(self, name, value): """ Unique name of the AnaplanWorkspace asset that contains this asset(AnaplanModel and everthing under it's hierarchy). """ - ANAPLAN_WORKSPACE_NAME: ClassVar[KeywordField] = KeywordField("anaplanWorkspaceName", "anaplanWorkspaceName") + ANAPLAN_WORKSPACE_NAME: ClassVar[KeywordField] = KeywordField( + "anaplanWorkspaceName", "anaplanWorkspaceName" + ) """ Simple name of the AnaplanWorkspace asset that contains this asset(AnaplanModel and everthing under it's hierarchy). """ @@ -45,7 +47,9 @@ def __setattr__(self, name, value): """ Unique name of the AnaplanModel asset that contains this asset(AnaplanModule and everthing under it's hierarchy). """ - ANAPLAN_MODEL_NAME: ClassVar[KeywordField] = KeywordField("anaplanModelName", "anaplanModelName") + ANAPLAN_MODEL_NAME: ClassVar[KeywordField] = KeywordField( + "anaplanModelName", "anaplanModelName" + ) """ Simple name of the AnaplanModel asset that contains this asset(AnaplanModule and everthing under it's hierarchy). """ @@ -55,11 +59,15 @@ def __setattr__(self, name, value): """ Unique name of the AnaplanModule asset that contains this asset(AnaplanLineItem, AnaplanList, AnaplanView and everthing under their hierarchy). """ # noqa: E501 - ANAPLAN_MODULE_NAME: ClassVar[KeywordField] = KeywordField("anaplanModuleName", "anaplanModuleName") + ANAPLAN_MODULE_NAME: ClassVar[KeywordField] = KeywordField( + "anaplanModuleName", "anaplanModuleName" + ) """ Simple name of the AnaplanModule asset that contains this asset(AnaplanLineItem, AnaplanList, AnaplanView and everthing under their hierarchy). """ # noqa: E501 - ANAPLAN_SOURCE_ID: ClassVar[KeywordField] = KeywordField("anaplanSourceId", "anaplanSourceId") + ANAPLAN_SOURCE_ID: ClassVar[KeywordField] = KeywordField( + "anaplanSourceId", "anaplanSourceId" + ) """ Id/Guid of the Anaplan asset in the source system. """ @@ -76,17 +84,27 @@ def __setattr__(self, name, value): @property def anaplan_workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anaplan_workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.anaplan_workspace_qualified_name + ) @anaplan_workspace_qualified_name.setter - def anaplan_workspace_qualified_name(self, anaplan_workspace_qualified_name: Optional[str]): + def anaplan_workspace_qualified_name( + self, anaplan_workspace_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anaplan_workspace_qualified_name = anaplan_workspace_qualified_name + self.attributes.anaplan_workspace_qualified_name = ( + anaplan_workspace_qualified_name + ) @property def anaplan_workspace_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anaplan_workspace_name + return ( + None if self.attributes is None else self.attributes.anaplan_workspace_name + ) @anaplan_workspace_name.setter def anaplan_workspace_name(self, anaplan_workspace_name: Optional[str]): @@ -96,7 +114,11 @@ def anaplan_workspace_name(self, anaplan_workspace_name: Optional[str]): @property def anaplan_model_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anaplan_model_qualified_name + return ( + None + if self.attributes is None + else self.attributes.anaplan_model_qualified_name + ) @anaplan_model_qualified_name.setter def anaplan_model_qualified_name(self, anaplan_model_qualified_name: Optional[str]): @@ -116,10 +138,16 @@ def anaplan_model_name(self, anaplan_model_name: Optional[str]): @property def anaplan_module_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anaplan_module_qualified_name + return ( + None + if self.attributes is None + else self.attributes.anaplan_module_qualified_name + ) @anaplan_module_qualified_name.setter - def anaplan_module_qualified_name(self, anaplan_module_qualified_name: Optional[str]): + def anaplan_module_qualified_name( + self, anaplan_module_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anaplan_module_qualified_name = anaplan_module_qualified_name @@ -145,11 +173,17 @@ def anaplan_source_id(self, anaplan_source_id: Optional[str]): self.attributes.anaplan_source_id = anaplan_source_id class Attributes(BI.Attributes): - anaplan_workspace_qualified_name: Optional[str] = Field(default=None, description="") + anaplan_workspace_qualified_name: Optional[str] = Field( + default=None, description="" + ) anaplan_workspace_name: Optional[str] = Field(default=None, description="") - anaplan_model_qualified_name: Optional[str] = Field(default=None, description="") + anaplan_model_qualified_name: Optional[str] = Field( + default=None, description="" + ) anaplan_model_name: Optional[str] = Field(default=None, description="") - anaplan_module_qualified_name: Optional[str] = Field(default=None, description="") + anaplan_module_qualified_name: Optional[str] = Field( + default=None, description="" + ) anaplan_module_name: Optional[str] = Field(default=None, description="") anaplan_source_id: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/anaplan_app.py b/pyatlan/model/assets/anaplan_app.py index 3d1d4b212..e7cc9212a 100644 --- a/pyatlan/model/assets/anaplan_app.py +++ b/pyatlan/model/assets/anaplan_app.py @@ -21,8 +21,12 @@ class AnaplanApp(Anaplan): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> AnaplanApp: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) - attributes = AnaplanApp.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) + attributes = AnaplanApp.Attributes.create( + name=name, connection_qualified_name=connection_qualified_name + ) return cls(attributes=attributes) type_name: str = Field(default="AnaplanApp", allow_mutation=False) @@ -58,17 +62,25 @@ def anaplan_pages(self, anaplan_pages: Optional[List[AnaplanPage]]): self.attributes.anaplan_pages = anaplan_pages class Attributes(Anaplan.Attributes): - anaplan_pages: Optional[List[AnaplanPage]] = Field(default=None, description="") # relationship + anaplan_pages: Optional[List[AnaplanPage]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def create(cls, *, name: str, connection_qualified_name: str) -> AnaplanApp.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + def create( + cls, *, name: str, connection_qualified_name: str + ) -> AnaplanApp.Attributes: + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return AnaplanApp.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: AnaplanApp.Attributes = Field( diff --git a/pyatlan/model/assets/anaplan_dimension.py b/pyatlan/model/assets/anaplan_dimension.py index 82cb14adb..7bb8621f2 100644 --- a/pyatlan/model/assets/anaplan_dimension.py +++ b/pyatlan/model/assets/anaplan_dimension.py @@ -46,7 +46,9 @@ def creator( model_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanDimension: - validate_required_fields(["name", "model_qualified_name"], [name, model_qualified_name]) + validate_required_fields( + ["name", "model_qualified_name"], [name, model_qualified_name] + ) attributes = AnaplanDimension.Attributes.create( name=name, model_qualified_name=model_qualified_name, @@ -147,11 +149,21 @@ def anaplan_row_views(self, anaplan_row_views: Optional[List[AnaplanView]]): self.attributes.anaplan_row_views = anaplan_row_views class Attributes(Anaplan.Attributes): - anaplan_page_views: Optional[List[AnaplanView]] = Field(default=None, description="") # relationship - anaplan_column_views: Optional[List[AnaplanView]] = Field(default=None, description="") # relationship - anaplan_line_items: Optional[List[AnaplanLineItem]] = Field(default=None, description="") # relationship - anaplan_model: Optional[AnaplanModel] = Field(default=None, description="") # relationship - anaplan_row_views: Optional[List[AnaplanView]] = Field(default=None, description="") # relationship + anaplan_page_views: Optional[List[AnaplanView]] = Field( + default=None, description="" + ) # relationship + anaplan_column_views: Optional[List[AnaplanView]] = Field( + default=None, description="" + ) # relationship + anaplan_line_items: Optional[List[AnaplanLineItem]] = Field( + default=None, description="" + ) # relationship + anaplan_model: Optional[AnaplanModel] = Field( + default=None, description="" + ) # relationship + anaplan_row_views: Optional[List[AnaplanView]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -167,7 +179,9 @@ def create( [name, model_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( model_qualified_name, "model_qualified_name", 5 diff --git a/pyatlan/model/assets/anaplan_line_item.py b/pyatlan/model/assets/anaplan_line_item.py index e214a8bdf..b22fe1e7a 100644 --- a/pyatlan/model/assets/anaplan_line_item.py +++ b/pyatlan/model/assets/anaplan_line_item.py @@ -46,7 +46,9 @@ def creator( module_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanLineItem: - validate_required_fields(["name", "module_qualified_name"], [name, module_qualified_name]) + validate_required_fields( + ["name", "module_qualified_name"], [name, module_qualified_name] + ) attributes = AnaplanLineItem.Attributes.create( name=name, module_qualified_name=module_qualified_name, @@ -67,7 +69,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ANAPLAN_LINE_ITEM_FORMULA: ClassVar[KeywordField] = KeywordField("anaplanLineItemFormula", "anaplanLineItemFormula") + ANAPLAN_LINE_ITEM_FORMULA: ClassVar[KeywordField] = KeywordField( + "anaplanLineItemFormula", "anaplanLineItemFormula" + ) """ Formula of the AnaplanLineItem from the source system. """ @@ -94,7 +98,11 @@ def __setattr__(self, name, value): @property def anaplan_line_item_formula(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anaplan_line_item_formula + return ( + None + if self.attributes is None + else self.attributes.anaplan_line_item_formula + ) @anaplan_line_item_formula.setter def anaplan_line_item_formula(self, anaplan_line_item_formula: Optional[str]): @@ -134,9 +142,15 @@ def anaplan_dimensions(self, anaplan_dimensions: Optional[List[AnaplanDimension] class Attributes(Anaplan.Attributes): anaplan_line_item_formula: Optional[str] = Field(default=None, description="") - anaplan_module: Optional[AnaplanModule] = Field(default=None, description="") # relationship - anaplan_lists: Optional[List[AnaplanList]] = Field(default=None, description="") # relationship - anaplan_dimensions: Optional[List[AnaplanDimension]] = Field(default=None, description="") # relationship + anaplan_module: Optional[AnaplanModule] = Field( + default=None, description="" + ) # relationship + anaplan_lists: Optional[List[AnaplanList]] = Field( + default=None, description="" + ) # relationship + anaplan_dimensions: Optional[List[AnaplanDimension]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -152,7 +166,9 @@ def create( [name, module_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( module_qualified_name, "module_qualified_name", 6 @@ -174,7 +190,9 @@ def create( anaplan_model_name=model_name, anaplan_module_qualified_name=module_qualified_name, anaplan_module_name=module_name, - anaplan_module=AnaplanModule.ref_by_qualified_name(module_qualified_name), + anaplan_module=AnaplanModule.ref_by_qualified_name( + module_qualified_name + ), ) attributes: AnaplanLineItem.Attributes = Field( diff --git a/pyatlan/model/assets/anaplan_list.py b/pyatlan/model/assets/anaplan_list.py index 0a729a805..83755036c 100644 --- a/pyatlan/model/assets/anaplan_list.py +++ b/pyatlan/model/assets/anaplan_list.py @@ -46,7 +46,9 @@ def creator( model_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanList: - validate_required_fields(["name", "model_qualified_name"], [name, model_qualified_name]) + validate_required_fields( + ["name", "model_qualified_name"], [name, model_qualified_name] + ) attributes = AnaplanList.Attributes.create( name=name, model_qualified_name=model_qualified_name, @@ -67,7 +69,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ANAPLAN_LIST_ITEM_COUNT: ClassVar[NumericField] = NumericField("anaplanListItemCount", "anaplanListItemCount") + ANAPLAN_LIST_ITEM_COUNT: ClassVar[NumericField] = NumericField( + "anaplanListItemCount", "anaplanListItemCount" + ) """ Item Count of the AnaplanList from the source system. """ @@ -89,7 +93,9 @@ def __setattr__(self, name, value): @property def anaplan_list_item_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.anaplan_list_item_count + return ( + None if self.attributes is None else self.attributes.anaplan_list_item_count + ) @anaplan_list_item_count.setter def anaplan_list_item_count(self, anaplan_list_item_count: Optional[int]): @@ -119,8 +125,12 @@ def anaplan_model(self, anaplan_model: Optional[AnaplanModel]): class Attributes(Anaplan.Attributes): anaplan_list_item_count: Optional[int] = Field(default=None, description="") - anaplan_line_items: Optional[List[AnaplanLineItem]] = Field(default=None, description="") # relationship - anaplan_model: Optional[AnaplanModel] = Field(default=None, description="") # relationship + anaplan_line_items: Optional[List[AnaplanLineItem]] = Field( + default=None, description="" + ) # relationship + anaplan_model: Optional[AnaplanModel] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -136,7 +146,9 @@ def create( [name, model_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( model_qualified_name, "model_qualified_name", 5 diff --git a/pyatlan/model/assets/anaplan_model.py b/pyatlan/model/assets/anaplan_model.py index 9430f556c..33be8dbcc 100644 --- a/pyatlan/model/assets/anaplan_model.py +++ b/pyatlan/model/assets/anaplan_model.py @@ -46,7 +46,9 @@ def creator( workspace_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanModel: - validate_required_fields(["name", "workspace_qualified_name"], [name, workspace_qualified_name]) + validate_required_fields( + ["name", "workspace_qualified_name"], [name, workspace_qualified_name] + ) attributes = AnaplanModel.Attributes.create( name=name, workspace_qualified_name=workspace_qualified_name, @@ -147,11 +149,21 @@ def anaplan_dimensions(self, anaplan_dimensions: Optional[List[AnaplanDimension] self.attributes.anaplan_dimensions = anaplan_dimensions class Attributes(Anaplan.Attributes): - anaplan_workspace: Optional[AnaplanWorkspace] = Field(default=None, description="") # relationship - anaplan_modules: Optional[List[AnaplanModule]] = Field(default=None, description="") # relationship - anaplan_pages: Optional[List[AnaplanPage]] = Field(default=None, description="") # relationship - anaplan_lists: Optional[List[AnaplanList]] = Field(default=None, description="") # relationship - anaplan_dimensions: Optional[List[AnaplanDimension]] = Field(default=None, description="") # relationship + anaplan_workspace: Optional[AnaplanWorkspace] = Field( + default=None, description="" + ) # relationship + anaplan_modules: Optional[List[AnaplanModule]] = Field( + default=None, description="" + ) # relationship + anaplan_pages: Optional[List[AnaplanPage]] = Field( + default=None, description="" + ) # relationship + anaplan_lists: Optional[List[AnaplanList]] = Field( + default=None, description="" + ) # relationship + anaplan_dimensions: Optional[List[AnaplanDimension]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -167,7 +179,9 @@ def create( [name, workspace_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( workspace_qualified_name, "workspace_qualified_name", 4 @@ -182,7 +196,9 @@ def create( connector_name=connector_name, anaplan_workspace_qualified_name=workspace_qualified_name, anaplan_workspace_name=workspace_name, - anaplan_workspace=AnaplanWorkspace.ref_by_qualified_name(workspace_qualified_name), + anaplan_workspace=AnaplanWorkspace.ref_by_qualified_name( + workspace_qualified_name + ), ) attributes: AnaplanModel.Attributes = Field( diff --git a/pyatlan/model/assets/anaplan_module.py b/pyatlan/model/assets/anaplan_module.py index 8942cced9..98963bb8a 100644 --- a/pyatlan/model/assets/anaplan_module.py +++ b/pyatlan/model/assets/anaplan_module.py @@ -46,7 +46,9 @@ def creator( model_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanModule: - validate_required_fields(["name", "model_qualified_name"], [name, model_qualified_name]) + validate_required_fields( + ["name", "model_qualified_name"], [name, model_qualified_name] + ) attributes = AnaplanModule.Attributes.create( name=name, model_qualified_name=model_qualified_name, @@ -117,9 +119,15 @@ def anaplan_model(self, anaplan_model: Optional[AnaplanModel]): self.attributes.anaplan_model = anaplan_model class Attributes(Anaplan.Attributes): - anaplan_views: Optional[List[AnaplanView]] = Field(default=None, description="") # relationship - anaplan_line_items: Optional[List[AnaplanLineItem]] = Field(default=None, description="") # relationship - anaplan_model: Optional[AnaplanModel] = Field(default=None, description="") # relationship + anaplan_views: Optional[List[AnaplanView]] = Field( + default=None, description="" + ) # relationship + anaplan_line_items: Optional[List[AnaplanLineItem]] = Field( + default=None, description="" + ) # relationship + anaplan_model: Optional[AnaplanModel] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -135,7 +143,9 @@ def create( [name, model_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( model_qualified_name, "model_qualified_name", 5 diff --git a/pyatlan/model/assets/anaplan_page.py b/pyatlan/model/assets/anaplan_page.py index 447e0610b..3c48a9039 100644 --- a/pyatlan/model/assets/anaplan_page.py +++ b/pyatlan/model/assets/anaplan_page.py @@ -46,7 +46,9 @@ def creator( app_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanPage: - validate_required_fields(["name", "app_qualified_name"], [name, app_qualified_name]) + validate_required_fields( + ["name", "app_qualified_name"], [name, app_qualified_name] + ) attributes = AnaplanPage.Attributes.create( name=name, app_qualified_name=app_qualified_name, @@ -79,7 +81,9 @@ def __setattr__(self, name, value): """ Category Name of the AnaplanPage from the source system. """ - ANAPLAN_PAGE_TYPE: ClassVar[KeywordField] = KeywordField("anaplanPageType", "anaplanPageType") + ANAPLAN_PAGE_TYPE: ClassVar[KeywordField] = KeywordField( + "anaplanPageType", "anaplanPageType" + ) """ Type of the AnaplanPage from the source system. """ @@ -103,7 +107,11 @@ def __setattr__(self, name, value): @property def anaplan_app_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anaplan_app_qualified_name + return ( + None + if self.attributes is None + else self.attributes.anaplan_app_qualified_name + ) @anaplan_app_qualified_name.setter def anaplan_app_qualified_name(self, anaplan_app_qualified_name: Optional[str]): @@ -113,7 +121,11 @@ def anaplan_app_qualified_name(self, anaplan_app_qualified_name: Optional[str]): @property def anaplan_page_category_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anaplan_page_category_name + return ( + None + if self.attributes is None + else self.attributes.anaplan_page_category_name + ) @anaplan_page_category_name.setter def anaplan_page_category_name(self, anaplan_page_category_name: Optional[str]): @@ -155,8 +167,12 @@ class Attributes(Anaplan.Attributes): anaplan_app_qualified_name: Optional[str] = Field(default=None, description="") anaplan_page_category_name: Optional[str] = Field(default=None, description="") anaplan_page_type: Optional[str] = Field(default=None, description="") - anaplan_models: Optional[List[AnaplanModel]] = Field(default=None, description="") # relationship - anaplan_app: Optional[AnaplanApp] = Field(default=None, description="") # relationship + anaplan_models: Optional[List[AnaplanModel]] = Field( + default=None, description="" + ) # relationship + anaplan_app: Optional[AnaplanApp] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -172,7 +188,9 @@ def create( [name, app_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( app_qualified_name, "app_qualified_name", 4 diff --git a/pyatlan/model/assets/anaplan_system_dimension.py b/pyatlan/model/assets/anaplan_system_dimension.py index f4e9a8fe3..4bc539b9a 100644 --- a/pyatlan/model/assets/anaplan_system_dimension.py +++ b/pyatlan/model/assets/anaplan_system_dimension.py @@ -19,13 +19,19 @@ class AnaplanSystemDimension(Anaplan): @classmethod @init_guid - def creator(cls, *, name: str, connection_qualified_name: str) -> AnaplanSystemDimension: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + def creator( + cls, *, name: str, connection_qualified_name: str + ) -> AnaplanSystemDimension: + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) attributes = AnaplanSystemDimension.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) return cls(attributes=attributes) diff --git a/pyatlan/model/assets/anaplan_view.py b/pyatlan/model/assets/anaplan_view.py index 172eea8bf..42a30ade6 100644 --- a/pyatlan/model/assets/anaplan_view.py +++ b/pyatlan/model/assets/anaplan_view.py @@ -46,7 +46,9 @@ def creator( module_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> AnaplanView: - validate_required_fields(["name", "module_qualified_name"], [name, module_qualified_name]) + validate_required_fields( + ["name", "module_qualified_name"], [name, module_qualified_name] + ) attributes = AnaplanView.Attributes.create( name=name, module_qualified_name=module_qualified_name, @@ -71,15 +73,21 @@ def __setattr__(self, name, value): """ TBC """ - ANAPLAN_PAGE_DIMENSIONS: ClassVar[RelationField] = RelationField("anaplanPageDimensions") + ANAPLAN_PAGE_DIMENSIONS: ClassVar[RelationField] = RelationField( + "anaplanPageDimensions" + ) """ TBC """ - ANAPLAN_ROW_DIMENSIONS: ClassVar[RelationField] = RelationField("anaplanRowDimensions") + ANAPLAN_ROW_DIMENSIONS: ClassVar[RelationField] = RelationField( + "anaplanRowDimensions" + ) """ TBC """ - ANAPLAN_COLUMN_DIMENSIONS: ClassVar[RelationField] = RelationField("anaplanColumnDimensions") + ANAPLAN_COLUMN_DIMENSIONS: ClassVar[RelationField] = RelationField( + "anaplanColumnDimensions" + ) """ TBC """ @@ -103,38 +111,58 @@ def anaplan_module(self, anaplan_module: Optional[AnaplanModule]): @property def anaplan_page_dimensions(self) -> Optional[List[AnaplanDimension]]: - return None if self.attributes is None else self.attributes.anaplan_page_dimensions + return ( + None if self.attributes is None else self.attributes.anaplan_page_dimensions + ) @anaplan_page_dimensions.setter - def anaplan_page_dimensions(self, anaplan_page_dimensions: Optional[List[AnaplanDimension]]): + def anaplan_page_dimensions( + self, anaplan_page_dimensions: Optional[List[AnaplanDimension]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anaplan_page_dimensions = anaplan_page_dimensions @property def anaplan_row_dimensions(self) -> Optional[List[AnaplanDimension]]: - return None if self.attributes is None else self.attributes.anaplan_row_dimensions + return ( + None if self.attributes is None else self.attributes.anaplan_row_dimensions + ) @anaplan_row_dimensions.setter - def anaplan_row_dimensions(self, anaplan_row_dimensions: Optional[List[AnaplanDimension]]): + def anaplan_row_dimensions( + self, anaplan_row_dimensions: Optional[List[AnaplanDimension]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anaplan_row_dimensions = anaplan_row_dimensions @property def anaplan_column_dimensions(self) -> Optional[List[AnaplanDimension]]: - return None if self.attributes is None else self.attributes.anaplan_column_dimensions + return ( + None + if self.attributes is None + else self.attributes.anaplan_column_dimensions + ) @anaplan_column_dimensions.setter - def anaplan_column_dimensions(self, anaplan_column_dimensions: Optional[List[AnaplanDimension]]): + def anaplan_column_dimensions( + self, anaplan_column_dimensions: Optional[List[AnaplanDimension]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anaplan_column_dimensions = anaplan_column_dimensions class Attributes(Anaplan.Attributes): - anaplan_module: Optional[AnaplanModule] = Field(default=None, description="") # relationship - anaplan_page_dimensions: Optional[List[AnaplanDimension]] = Field(default=None, description="") # relationship - anaplan_row_dimensions: Optional[List[AnaplanDimension]] = Field(default=None, description="") # relationship + anaplan_module: Optional[AnaplanModule] = Field( + default=None, description="" + ) # relationship + anaplan_page_dimensions: Optional[List[AnaplanDimension]] = Field( + default=None, description="" + ) # relationship + anaplan_row_dimensions: Optional[List[AnaplanDimension]] = Field( + default=None, description="" + ) # relationship anaplan_column_dimensions: Optional[List[AnaplanDimension]] = Field( default=None, description="" ) # relationship @@ -153,7 +181,9 @@ def create( [name, module_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( module_qualified_name, "module_qualified_name", 6 @@ -175,7 +205,9 @@ def create( anaplan_model_name=model_name, anaplan_module_qualified_name=module_qualified_name, anaplan_module_name=module_name, - anaplan_module=AnaplanModule.ref_by_qualified_name(module_qualified_name), + anaplan_module=AnaplanModule.ref_by_qualified_name( + module_qualified_name + ), ) attributes: AnaplanView.Attributes = Field( diff --git a/pyatlan/model/assets/anaplan_workspace.py b/pyatlan/model/assets/anaplan_workspace.py index c63f10199..bc4ee51e1 100644 --- a/pyatlan/model/assets/anaplan_workspace.py +++ b/pyatlan/model/assets/anaplan_workspace.py @@ -21,8 +21,12 @@ class AnaplanWorkspace(Anaplan): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> AnaplanWorkspace: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) - attributes = AnaplanWorkspace.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) + attributes = AnaplanWorkspace.Attributes.create( + name=name, connection_qualified_name=connection_qualified_name + ) return cls(attributes=attributes) type_name: str = Field(default="AnaplanWorkspace", allow_mutation=False) @@ -64,23 +68,37 @@ def __setattr__(self, name, value): @property def anaplan_workspace_current_size(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.anaplan_workspace_current_size + return ( + None + if self.attributes is None + else self.attributes.anaplan_workspace_current_size + ) @anaplan_workspace_current_size.setter - def anaplan_workspace_current_size(self, anaplan_workspace_current_size: Optional[int]): + def anaplan_workspace_current_size( + self, anaplan_workspace_current_size: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anaplan_workspace_current_size = anaplan_workspace_current_size @property def anaplan_workspace_allowance_size(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.anaplan_workspace_allowance_size + return ( + None + if self.attributes is None + else self.attributes.anaplan_workspace_allowance_size + ) @anaplan_workspace_allowance_size.setter - def anaplan_workspace_allowance_size(self, anaplan_workspace_allowance_size: Optional[int]): + def anaplan_workspace_allowance_size( + self, anaplan_workspace_allowance_size: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anaplan_workspace_allowance_size = anaplan_workspace_allowance_size + self.attributes.anaplan_workspace_allowance_size = ( + anaplan_workspace_allowance_size + ) @property def anaplan_models(self) -> Optional[List[AnaplanModel]]: @@ -93,19 +111,31 @@ def anaplan_models(self, anaplan_models: Optional[List[AnaplanModel]]): self.attributes.anaplan_models = anaplan_models class Attributes(Anaplan.Attributes): - anaplan_workspace_current_size: Optional[int] = Field(default=None, description="") - anaplan_workspace_allowance_size: Optional[int] = Field(default=None, description="") - anaplan_models: Optional[List[AnaplanModel]] = Field(default=None, description="") # relationship + anaplan_workspace_current_size: Optional[int] = Field( + default=None, description="" + ) + anaplan_workspace_allowance_size: Optional[int] = Field( + default=None, description="" + ) + anaplan_models: Optional[List[AnaplanModel]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def create(cls, *, name: str, connection_qualified_name: str) -> AnaplanWorkspace.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + def create( + cls, *, name: str, connection_qualified_name: str + ) -> AnaplanWorkspace.Attributes: + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return AnaplanWorkspace.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: AnaplanWorkspace.Attributes = Field( diff --git a/pyatlan/model/assets/auth_service.py b/pyatlan/model/assets/auth_service.py index 7e5769764..f353c1f2d 100644 --- a/pyatlan/model/assets/auth_service.py +++ b/pyatlan/model/assets/auth_service.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AUTH_SERVICE_TYPE: ClassVar[KeywordField] = KeywordField("authServiceType", "authServiceType") + AUTH_SERVICE_TYPE: ClassVar[KeywordField] = KeywordField( + "authServiceType", "authServiceType" + ) """ TBC """ @@ -37,11 +39,15 @@ def __setattr__(self, name, value): """ TBC """ - AUTH_SERVICE_IS_ENABLED: ClassVar[BooleanField] = BooleanField("authServiceIsEnabled", "authServiceIsEnabled") + AUTH_SERVICE_IS_ENABLED: ClassVar[BooleanField] = BooleanField( + "authServiceIsEnabled", "authServiceIsEnabled" + ) """ TBC """ - AUTH_SERVICE_CONFIG: ClassVar[KeywordField] = KeywordField("authServiceConfig", "authServiceConfig") + AUTH_SERVICE_CONFIG: ClassVar[KeywordField] = KeywordField( + "authServiceConfig", "authServiceConfig" + ) """ TBC """ @@ -82,7 +88,9 @@ def tag_service(self, tag_service: Optional[str]): @property def auth_service_is_enabled(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.auth_service_is_enabled + return ( + None if self.attributes is None else self.attributes.auth_service_is_enabled + ) @auth_service_is_enabled.setter def auth_service_is_enabled(self, auth_service_is_enabled: Optional[bool]): @@ -102,10 +110,16 @@ def auth_service_config(self, auth_service_config: Optional[Dict[str, str]]): @property def auth_service_policy_last_sync(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.auth_service_policy_last_sync + return ( + None + if self.attributes is None + else self.attributes.auth_service_policy_last_sync + ) @auth_service_policy_last_sync.setter - def auth_service_policy_last_sync(self, auth_service_policy_last_sync: Optional[int]): + def auth_service_policy_last_sync( + self, auth_service_policy_last_sync: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.auth_service_policy_last_sync = auth_service_policy_last_sync @@ -114,8 +128,12 @@ class Attributes(Asset.Attributes): auth_service_type: Optional[str] = Field(default=None, description="") tag_service: Optional[str] = Field(default=None, description="") auth_service_is_enabled: Optional[bool] = Field(default=None, description="") - auth_service_config: Optional[Dict[str, str]] = Field(default=None, description="") - auth_service_policy_last_sync: Optional[int] = Field(default=None, description="") + auth_service_config: Optional[Dict[str, str]] = Field( + default=None, description="" + ) + auth_service_policy_last_sync: Optional[int] = Field( + default=None, description="" + ) attributes: AuthService.Attributes = Field( default_factory=lambda: AuthService.Attributes(), diff --git a/pyatlan/model/assets/azure.py b/pyatlan/model/assets/azure.py index a1700d5b5..7ec82c82e 100644 --- a/pyatlan/model/assets/azure.py +++ b/pyatlan/model/assets/azure.py @@ -36,7 +36,9 @@ def __setattr__(self, name, value): """ Resource identifier of this asset in Azure. """ - AZURE_LOCATION: ClassVar[KeywordField] = KeywordField("azureLocation", "azureLocation") + AZURE_LOCATION: ClassVar[KeywordField] = KeywordField( + "azureLocation", "azureLocation" + ) """ Location of this asset in Azure. """ @@ -80,13 +82,21 @@ def azure_location(self, azure_location: Optional[str]): @property def adls_account_secondary_location(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adls_account_secondary_location + return ( + None + if self.attributes is None + else self.attributes.adls_account_secondary_location + ) @adls_account_secondary_location.setter - def adls_account_secondary_location(self, adls_account_secondary_location: Optional[str]): + def adls_account_secondary_location( + self, adls_account_secondary_location: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adls_account_secondary_location = adls_account_secondary_location + self.attributes.adls_account_secondary_location = ( + adls_account_secondary_location + ) @property def azure_tags(self) -> Optional[List[AzureTag]]: @@ -101,7 +111,9 @@ def azure_tags(self, azure_tags: Optional[List[AzureTag]]): class Attributes(Cloud.Attributes): azure_resource_id: Optional[str] = Field(default=None, description="") azure_location: Optional[str] = Field(default=None, description="") - adls_account_secondary_location: Optional[str] = Field(default=None, description="") + adls_account_secondary_location: Optional[str] = Field( + default=None, description="" + ) azure_tags: Optional[List[AzureTag]] = Field(default=None, description="") attributes: Azure.Attributes = Field( diff --git a/pyatlan/model/assets/azure_event_hub.py b/pyatlan/model/assets/azure_event_hub.py index fb4eae95c..589f16594 100644 --- a/pyatlan/model/assets/azure_event_hub.py +++ b/pyatlan/model/assets/azure_event_hub.py @@ -21,8 +21,12 @@ class AzureEventHub(KafkaTopic): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> AzureEventHub: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) - attributes = AzureEventHub.Attributes.creator(name=name, connection_qualified_name=connection_qualified_name) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) + attributes = AzureEventHub.Attributes.creator( + name=name, connection_qualified_name=connection_qualified_name + ) return cls(attributes=attributes) type_name: str = Field(default="AzureEventHub", allow_mutation=False) @@ -38,7 +42,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AZURE_EVENT_HUB_STATUS: ClassVar[KeywordField] = KeywordField("azureEventHubStatus", "azureEventHubStatus") + AZURE_EVENT_HUB_STATUS: ClassVar[KeywordField] = KeywordField( + "azureEventHubStatus", "azureEventHubStatus" + ) """ """ @@ -49,7 +55,9 @@ def __setattr__(self, name, value): @property def azure_event_hub_status(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.azure_event_hub_status + return ( + None if self.attributes is None else self.attributes.azure_event_hub_status + ) @azure_event_hub_status.setter def azure_event_hub_status(self, azure_event_hub_status: Optional[str]): @@ -62,13 +70,19 @@ class Attributes(KafkaTopic.Attributes): @classmethod @init_guid - def creator(cls, *, name: str, connection_qualified_name: str) -> AzureEventHub.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + def creator( + cls, *, name: str, connection_qualified_name: str + ) -> AzureEventHub.Attributes: + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return AzureEventHub.Attributes( name=name, qualified_name=f"{connection_qualified_name}/topic/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: AzureEventHub.Attributes = Field( diff --git a/pyatlan/model/assets/azure_service_bus.py b/pyatlan/model/assets/azure_service_bus.py index 7de9e9492..6c370e27e 100644 --- a/pyatlan/model/assets/azure_service_bus.py +++ b/pyatlan/model/assets/azure_service_bus.py @@ -58,38 +58,68 @@ def __setattr__(self, name, value): @property def azure_service_bus_namespace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.azure_service_bus_namespace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.azure_service_bus_namespace_qualified_name + ) @azure_service_bus_namespace_qualified_name.setter - def azure_service_bus_namespace_qualified_name(self, azure_service_bus_namespace_qualified_name: Optional[str]): + def azure_service_bus_namespace_qualified_name( + self, azure_service_bus_namespace_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.azure_service_bus_namespace_qualified_name = azure_service_bus_namespace_qualified_name + self.attributes.azure_service_bus_namespace_qualified_name = ( + azure_service_bus_namespace_qualified_name + ) @property def azure_service_bus_namespace_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.azure_service_bus_namespace_name + return ( + None + if self.attributes is None + else self.attributes.azure_service_bus_namespace_name + ) @azure_service_bus_namespace_name.setter - def azure_service_bus_namespace_name(self, azure_service_bus_namespace_name: Optional[str]): + def azure_service_bus_namespace_name( + self, azure_service_bus_namespace_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.azure_service_bus_namespace_name = azure_service_bus_namespace_name + self.attributes.azure_service_bus_namespace_name = ( + azure_service_bus_namespace_name + ) @property def azure_service_bus_schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.azure_service_bus_schema_qualified_name + return ( + None + if self.attributes is None + else self.attributes.azure_service_bus_schema_qualified_name + ) @azure_service_bus_schema_qualified_name.setter - def azure_service_bus_schema_qualified_name(self, azure_service_bus_schema_qualified_name: Optional[str]): + def azure_service_bus_schema_qualified_name( + self, azure_service_bus_schema_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.azure_service_bus_schema_qualified_name = azure_service_bus_schema_qualified_name + self.attributes.azure_service_bus_schema_qualified_name = ( + azure_service_bus_schema_qualified_name + ) class Attributes(EventStore.Attributes): - azure_service_bus_namespace_qualified_name: Optional[str] = Field(default=None, description="") - azure_service_bus_namespace_name: Optional[str] = Field(default=None, description="") - azure_service_bus_schema_qualified_name: Optional[str] = Field(default=None, description="") + azure_service_bus_namespace_qualified_name: Optional[str] = Field( + default=None, description="" + ) + azure_service_bus_namespace_name: Optional[str] = Field( + default=None, description="" + ) + azure_service_bus_schema_qualified_name: Optional[str] = Field( + default=None, description="" + ) attributes: AzureServiceBus.Attributes = Field( default_factory=lambda: AzureServiceBus.Attributes(), diff --git a/pyatlan/model/assets/azure_service_bus_namespace.py b/pyatlan/model/assets/azure_service_bus_namespace.py index bbc2004cf..1ca3b68d6 100644 --- a/pyatlan/model/assets/azure_service_bus_namespace.py +++ b/pyatlan/model/assets/azure_service_bus_namespace.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AZURE_SERVICE_BUS_TOPICS: ClassVar[RelationField] = RelationField("azureServiceBusTopics") + AZURE_SERVICE_BUS_TOPICS: ClassVar[RelationField] = RelationField( + "azureServiceBusTopics" + ) """ TBC """ @@ -40,10 +42,16 @@ def __setattr__(self, name, value): @property def azure_service_bus_topics(self) -> Optional[List[AzureServiceBusTopic]]: - return None if self.attributes is None else self.attributes.azure_service_bus_topics + return ( + None + if self.attributes is None + else self.attributes.azure_service_bus_topics + ) @azure_service_bus_topics.setter - def azure_service_bus_topics(self, azure_service_bus_topics: Optional[List[AzureServiceBusTopic]]): + def azure_service_bus_topics( + self, azure_service_bus_topics: Optional[List[AzureServiceBusTopic]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.azure_service_bus_topics = azure_service_bus_topics diff --git a/pyatlan/model/assets/azure_service_bus_schema.py b/pyatlan/model/assets/azure_service_bus_schema.py index dc4e0b3cb..59074ae12 100644 --- a/pyatlan/model/assets/azure_service_bus_schema.py +++ b/pyatlan/model/assets/azure_service_bus_schema.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AZURE_SERVICE_BUS_TOPICS: ClassVar[RelationField] = RelationField("azureServiceBusTopics") + AZURE_SERVICE_BUS_TOPICS: ClassVar[RelationField] = RelationField( + "azureServiceBusTopics" + ) """ TBC """ @@ -40,10 +42,16 @@ def __setattr__(self, name, value): @property def azure_service_bus_topics(self) -> Optional[List[AzureServiceBusTopic]]: - return None if self.attributes is None else self.attributes.azure_service_bus_topics + return ( + None + if self.attributes is None + else self.attributes.azure_service_bus_topics + ) @azure_service_bus_topics.setter - def azure_service_bus_topics(self, azure_service_bus_topics: Optional[List[AzureServiceBusTopic]]): + def azure_service_bus_topics( + self, azure_service_bus_topics: Optional[List[AzureServiceBusTopic]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.azure_service_bus_topics = azure_service_bus_topics diff --git a/pyatlan/model/assets/azure_service_bus_topic.py b/pyatlan/model/assets/azure_service_bus_topic.py index d4dff7f5f..7c3791784 100644 --- a/pyatlan/model/assets/azure_service_bus_topic.py +++ b/pyatlan/model/assets/azure_service_bus_topic.py @@ -29,11 +29,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AZURE_SERVICE_BUS_SCHEMAS: ClassVar[RelationField] = RelationField("azureServiceBusSchemas") + AZURE_SERVICE_BUS_SCHEMAS: ClassVar[RelationField] = RelationField( + "azureServiceBusSchemas" + ) """ TBC """ - AZURE_SERVICE_BUS_NAMESPACE: ClassVar[RelationField] = RelationField("azureServiceBusNamespace") + AZURE_SERVICE_BUS_NAMESPACE: ClassVar[RelationField] = RelationField( + "azureServiceBusNamespace" + ) """ TBC """ @@ -45,20 +49,32 @@ def __setattr__(self, name, value): @property def azure_service_bus_schemas(self) -> Optional[List[AzureServiceBusSchema]]: - return None if self.attributes is None else self.attributes.azure_service_bus_schemas + return ( + None + if self.attributes is None + else self.attributes.azure_service_bus_schemas + ) @azure_service_bus_schemas.setter - def azure_service_bus_schemas(self, azure_service_bus_schemas: Optional[List[AzureServiceBusSchema]]): + def azure_service_bus_schemas( + self, azure_service_bus_schemas: Optional[List[AzureServiceBusSchema]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.azure_service_bus_schemas = azure_service_bus_schemas @property def azure_service_bus_namespace(self) -> Optional[AzureServiceBusNamespace]: - return None if self.attributes is None else self.attributes.azure_service_bus_namespace + return ( + None + if self.attributes is None + else self.attributes.azure_service_bus_namespace + ) @azure_service_bus_namespace.setter - def azure_service_bus_namespace(self, azure_service_bus_namespace: Optional[AzureServiceBusNamespace]): + def azure_service_bus_namespace( + self, azure_service_bus_namespace: Optional[AzureServiceBusNamespace] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.azure_service_bus_namespace = azure_service_bus_namespace diff --git a/pyatlan/model/assets/badge.py b/pyatlan/model/assets/badge.py index ffb3a22bc..fcf102193 100644 --- a/pyatlan/model/assets/badge.py +++ b/pyatlan/model/assets/badge.py @@ -51,7 +51,9 @@ def create( badge_conditions: List[BadgeCondition], ) -> Badge: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -75,11 +77,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - BADGE_CONDITIONS: ClassVar[KeywordField] = KeywordField("badgeConditions", "badgeConditions") + BADGE_CONDITIONS: ClassVar[KeywordField] = KeywordField( + "badgeConditions", "badgeConditions" + ) """ List of conditions that determine the colors to diplay for various values. """ - BADGE_METADATA_ATTRIBUTE: ClassVar[KeywordField] = KeywordField("badgeMetadataAttribute", "badgeMetadataAttribute") + BADGE_METADATA_ATTRIBUTE: ClassVar[KeywordField] = KeywordField( + "badgeMetadataAttribute", "badgeMetadataAttribute" + ) """ Custom metadata attribute for which to show the badge. """ @@ -101,7 +107,11 @@ def badge_conditions(self, badge_conditions: Optional[List[BadgeCondition]]): @property def badge_metadata_attribute(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.badge_metadata_attribute + return ( + None + if self.attributes is None + else self.attributes.badge_metadata_attribute + ) @badge_metadata_attribute.setter def badge_metadata_attribute(self, badge_metadata_attribute: Optional[str]): @@ -110,7 +120,9 @@ def badge_metadata_attribute(self, badge_metadata_attribute: Optional[str]): self.attributes.badge_metadata_attribute = badge_metadata_attribute class Attributes(Asset.Attributes): - badge_conditions: Optional[List[BadgeCondition]] = Field(default=None, description="") + badge_conditions: Optional[List[BadgeCondition]] = Field( + default=None, description="" + ) badge_metadata_attribute: Optional[str] = Field(default=None, description="") @classmethod @@ -130,7 +142,9 @@ def create( from pyatlan.cache.custom_metadata_cache import CustomMetadataCache cm_id = CustomMetadataCache.get_id_for_name(cm_name) - cm_attr_id = CustomMetadataCache.get_attr_id_for_name(set_name=cm_name, attr_name=cm_attribute) + cm_attr_id = CustomMetadataCache.get_attr_id_for_name( + set_name=cm_name, attr_name=cm_attribute + ) return Badge.Attributes( name=name, qualified_name=f"badges/global/{cm_id}.{cm_attr_id}", diff --git a/pyatlan/model/assets/bigquery_tag.py b/pyatlan/model/assets/bigquery_tag.py index 6227ea840..98b9c715e 100644 --- a/pyatlan/model/assets/bigquery_tag.py +++ b/pyatlan/model/assets/bigquery_tag.py @@ -37,11 +37,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - BIGQUERY_TAG_TYPE: ClassVar[KeywordField] = KeywordField("bigqueryTagType", "bigqueryTagType") + BIGQUERY_TAG_TYPE: ClassVar[KeywordField] = KeywordField( + "bigqueryTagType", "bigqueryTagType" + ) """ The specific type or category of the Bigquery tag, which can be used for classification and organization of Bigquery assets. """ # noqa: E501 - BIGQUERY_TAG_HIERARCHY: ClassVar[KeywordField] = KeywordField("bigqueryTagHierarchy", "bigqueryTagHierarchy") + BIGQUERY_TAG_HIERARCHY: ClassVar[KeywordField] = KeywordField( + "bigqueryTagHierarchy", "bigqueryTagHierarchy" + ) """ List of top-level upstream nested bigquery tags. """ @@ -55,7 +59,9 @@ def __setattr__(self, name, value): """ Unique identifier of the tag in the source system. """ - TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("tagAttributes", "tagAttributes") + TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( + "tagAttributes", "tagAttributes" + ) """ Attributes associated with the tag in the source system. """ @@ -75,47 +81,69 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( + "queryUserCount", "queryUserCount" + ) """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( + "queryUserMap", "queryUserMap" + ) """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( + "queryCountUpdatedAt", "queryCountUpdatedAt" + ) """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "databaseName", "databaseName.keyword", "databaseName" + ) """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "databaseQualifiedName", "databaseQualifiedName" + ) """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "schemaName", "schemaName.keyword", "schemaName" + ) """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "schemaQualifiedName", "schemaQualifiedName" + ) """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "tableName", "tableName.keyword", "tableName" + ) """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "tableQualifiedName", "tableQualifiedName" + ) """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "viewName", "viewName.keyword", "viewName" + ) """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "viewQualifiedName", "viewQualifiedName" + ) """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -135,7 +163,9 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( + "lastProfiledAt", "lastProfiledAt" + ) """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -204,23 +234,35 @@ def bigquery_tag_type(self, bigquery_tag_type: Optional[str]): @property def bigquery_tag_hierarchy(self) -> Optional[List[Dict[str, str]]]: - return None if self.attributes is None else self.attributes.bigquery_tag_hierarchy + return ( + None if self.attributes is None else self.attributes.bigquery_tag_hierarchy + ) @bigquery_tag_hierarchy.setter - def bigquery_tag_hierarchy(self, bigquery_tag_hierarchy: Optional[List[Dict[str, str]]]): + def bigquery_tag_hierarchy( + self, bigquery_tag_hierarchy: Optional[List[Dict[str, str]]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.bigquery_tag_hierarchy = bigquery_tag_hierarchy @property def bigquery_tag_taxonomy_properties(self) -> Optional[Dict[str, str]]: - return None if self.attributes is None else self.attributes.bigquery_tag_taxonomy_properties + return ( + None + if self.attributes is None + else self.attributes.bigquery_tag_taxonomy_properties + ) @bigquery_tag_taxonomy_properties.setter - def bigquery_tag_taxonomy_properties(self, bigquery_tag_taxonomy_properties: Optional[Dict[str, str]]): + def bigquery_tag_taxonomy_properties( + self, bigquery_tag_taxonomy_properties: Optional[Dict[str, str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.bigquery_tag_taxonomy_properties = bigquery_tag_taxonomy_properties + self.attributes.bigquery_tag_taxonomy_properties = ( + bigquery_tag_taxonomy_properties + ) @property def tag_id(self) -> Optional[str]: @@ -254,7 +296,9 @@ def tag_allowed_values(self, tag_allowed_values: Optional[Set[str]]): @property def mapped_atlan_tag_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mapped_atlan_tag_name + return ( + None if self.attributes is None else self.attributes.mapped_atlan_tag_name + ) @mapped_atlan_tag_name.setter def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): @@ -294,7 +338,9 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.query_count_updated_at + return ( + None if self.attributes is None else self.attributes.query_count_updated_at + ) @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -314,7 +360,9 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.database_qualified_name + return ( + None if self.attributes is None else self.attributes.database_qualified_name + ) @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -334,7 +382,9 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_qualified_name + return ( + None if self.attributes is None else self.attributes.schema_qualified_name + ) @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -384,7 +434,9 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_name + return ( + None if self.attributes is None else self.attributes.calculation_view_name + ) @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -394,13 +446,21 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.calculation_view_qualified_name + ) @calculation_view_qualified_name.setter - def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): + def calculation_view_qualified_name( + self, calculation_view_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = calculation_view_qualified_name + self.attributes.calculation_view_qualified_name = ( + calculation_view_qualified_name + ) @property def is_profiled(self) -> Optional[bool]: @@ -474,10 +534,16 @@ def dbt_models(self, dbt_models: Optional[List[DbtModel]]): class Attributes(Tag.Attributes): bigquery_tag_type: Optional[str] = Field(default=None, description="") - bigquery_tag_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") - bigquery_tag_taxonomy_properties: Optional[Dict[str, str]] = Field(default=None, description="") + bigquery_tag_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + bigquery_tag_taxonomy_properties: Optional[Dict[str, str]] = Field( + default=None, description="" + ) tag_id: Optional[str] = Field(default=None, description="") - tag_attributes: Optional[List[SourceTagAttribute]] = Field(default=None, description="") + tag_attributes: Optional[List[SourceTagAttribute]] = Field( + default=None, description="" + ) tag_allowed_values: Optional[Set[str]] = Field(default=None, description="") mapped_atlan_tag_name: Optional[str] = Field(default=None, description="") query_count: Optional[int] = Field(default=None, description="") @@ -493,14 +559,26 @@ class Attributes(Tag.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field(default=None, description="") + calculation_view_qualified_name: Optional[str] = Field( + default=None, description="" + ) is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship - dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship + dbt_tests: Optional[List[DbtTest]] = Field( + default=None, description="" + ) # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship attributes: BigqueryTag.Attributes = Field( default_factory=lambda: BigqueryTag.Attributes(), diff --git a/pyatlan/model/assets/business_policy.py b/pyatlan/model/assets/business_policy.py index 67bec76e6..eed3a35fd 100644 --- a/pyatlan/model/assets/business_policy.py +++ b/pyatlan/model/assets/business_policy.py @@ -36,11 +36,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - BUSINESS_POLICY_TYPE: ClassVar[KeywordField] = KeywordField("businessPolicyType", "businessPolicyType") + BUSINESS_POLICY_TYPE: ClassVar[KeywordField] = KeywordField( + "businessPolicyType", "businessPolicyType" + ) """ Type of business policy """ - BUSINESS_POLICY_LONG_DESCRIPTION: ClassVar[RelationField] = RelationField("businessPolicyLongDescription") + BUSINESS_POLICY_LONG_DESCRIPTION: ClassVar[RelationField] = RelationField( + "businessPolicyLongDescription" + ) """ Body of the business policy, a long readme like document """ @@ -56,7 +60,9 @@ def __setattr__(self, name, value): """ Validity start date of the policy """ - BUSINESS_POLICY_VERSION: ClassVar[NumericField] = NumericField("businessPolicyVersion", "businessPolicyVersion") + BUSINESS_POLICY_VERSION: ClassVar[NumericField] = NumericField( + "businessPolicyVersion", "businessPolicyVersion" + ) """ Version of the policy """ @@ -66,7 +72,9 @@ def __setattr__(self, name, value): """ Duration for the business policy to complete review. """ - BUSINESS_POLICY_FILTER_DSL: ClassVar[TextField] = TextField("businessPolicyFilterDSL", "businessPolicyFilterDSL") + BUSINESS_POLICY_FILTER_DSL: ClassVar[TextField] = TextField( + "businessPolicyFilterDSL", "businessPolicyFilterDSL" + ) """ Business Policy Filter ES DSL to denote the associate asset/s involved. """ @@ -82,16 +90,22 @@ def __setattr__(self, name, value): """ Selected approval workflow id for business policy """ - BUSINESS_POLICY_RULES: ClassVar[KeywordField] = KeywordField("businessPolicyRules", "businessPolicyRules") + BUSINESS_POLICY_RULES: ClassVar[KeywordField] = KeywordField( + "businessPolicyRules", "businessPolicyRules" + ) """ List of rules applied to this business policy. """ - EXCEPTIONS_FOR_BUSINESS_POLICY: ClassVar[RelationField] = RelationField("exceptionsForBusinessPolicy") + EXCEPTIONS_FOR_BUSINESS_POLICY: ClassVar[RelationField] = RelationField( + "exceptionsForBusinessPolicy" + ) """ TBC """ - RELATED_BUSINESS_POLICIES: ClassVar[RelationField] = RelationField("relatedBusinessPolicies") + RELATED_BUSINESS_POLICIES: ClassVar[RelationField] = RelationField( + "relatedBusinessPolicies" + ) """ TBC """ @@ -123,37 +137,59 @@ def business_policy_type(self, business_policy_type: Optional[str]): @property def business_policy_long_description(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.business_policy_long_description + return ( + None + if self.attributes is None + else self.attributes.business_policy_long_description + ) @business_policy_long_description.setter - def business_policy_long_description(self, business_policy_long_description: Optional[str]): + def business_policy_long_description( + self, business_policy_long_description: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_long_description = business_policy_long_description + self.attributes.business_policy_long_description = ( + business_policy_long_description + ) @property def business_policy_valid_till(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.business_policy_valid_till + return ( + None + if self.attributes is None + else self.attributes.business_policy_valid_till + ) @business_policy_valid_till.setter - def business_policy_valid_till(self, business_policy_valid_till: Optional[datetime]): + def business_policy_valid_till( + self, business_policy_valid_till: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_valid_till = business_policy_valid_till @property def business_policy_valid_from(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.business_policy_valid_from + return ( + None + if self.attributes is None + else self.attributes.business_policy_valid_from + ) @business_policy_valid_from.setter - def business_policy_valid_from(self, business_policy_valid_from: Optional[datetime]): + def business_policy_valid_from( + self, business_policy_valid_from: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_valid_from = business_policy_valid_from @property def business_policy_version(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.business_policy_version + return ( + None if self.attributes is None else self.attributes.business_policy_version + ) @business_policy_version.setter def business_policy_version(self, business_policy_version: Optional[int]): @@ -163,17 +199,27 @@ def business_policy_version(self, business_policy_version: Optional[int]): @property def business_policy_review_period(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.business_policy_review_period + return ( + None + if self.attributes is None + else self.attributes.business_policy_review_period + ) @business_policy_review_period.setter - def business_policy_review_period(self, business_policy_review_period: Optional[str]): + def business_policy_review_period( + self, business_policy_review_period: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_review_period = business_policy_review_period @property def business_policy_filter_d_s_l(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.business_policy_filter_d_s_l + return ( + None + if self.attributes is None + else self.attributes.business_policy_filter_d_s_l + ) @business_policy_filter_d_s_l.setter def business_policy_filter_d_s_l(self, business_policy_filter_d_s_l: Optional[str]): @@ -183,69 +229,119 @@ def business_policy_filter_d_s_l(self, business_policy_filter_d_s_l: Optional[st @property def business_policy_base_parent_guid(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.business_policy_base_parent_guid + return ( + None + if self.attributes is None + else self.attributes.business_policy_base_parent_guid + ) @business_policy_base_parent_guid.setter - def business_policy_base_parent_guid(self, business_policy_base_parent_guid: Optional[str]): + def business_policy_base_parent_guid( + self, business_policy_base_parent_guid: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_base_parent_guid = business_policy_base_parent_guid + self.attributes.business_policy_base_parent_guid = ( + business_policy_base_parent_guid + ) @property def business_policy_selected_approval_w_f(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.business_policy_selected_approval_w_f + return ( + None + if self.attributes is None + else self.attributes.business_policy_selected_approval_w_f + ) @business_policy_selected_approval_w_f.setter - def business_policy_selected_approval_w_f(self, business_policy_selected_approval_w_f: Optional[str]): + def business_policy_selected_approval_w_f( + self, business_policy_selected_approval_w_f: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_selected_approval_w_f = business_policy_selected_approval_w_f + self.attributes.business_policy_selected_approval_w_f = ( + business_policy_selected_approval_w_f + ) @property def business_policy_rules(self) -> Optional[List[BusinessPolicyRule]]: - return None if self.attributes is None else self.attributes.business_policy_rules + return ( + None if self.attributes is None else self.attributes.business_policy_rules + ) @business_policy_rules.setter - def business_policy_rules(self, business_policy_rules: Optional[List[BusinessPolicyRule]]): + def business_policy_rules( + self, business_policy_rules: Optional[List[BusinessPolicyRule]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_rules = business_policy_rules @property def exceptions_for_business_policy(self) -> Optional[List[BusinessPolicyException]]: - return None if self.attributes is None else self.attributes.exceptions_for_business_policy + return ( + None + if self.attributes is None + else self.attributes.exceptions_for_business_policy + ) @exceptions_for_business_policy.setter - def exceptions_for_business_policy(self, exceptions_for_business_policy: Optional[List[BusinessPolicyException]]): + def exceptions_for_business_policy( + self, exceptions_for_business_policy: Optional[List[BusinessPolicyException]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.exceptions_for_business_policy = exceptions_for_business_policy @property def related_business_policies(self) -> Optional[List[BusinessPolicy]]: - return None if self.attributes is None else self.attributes.related_business_policies + return ( + None + if self.attributes is None + else self.attributes.related_business_policies + ) @related_business_policies.setter - def related_business_policies(self, related_business_policies: Optional[List[BusinessPolicy]]): + def related_business_policies( + self, related_business_policies: Optional[List[BusinessPolicy]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.related_business_policies = related_business_policies class Attributes(Asset.Attributes): business_policy_type: Optional[str] = Field(default=None, description="") - business_policy_long_description: Optional[str] = Field(default=None, description="") - business_policy_valid_till: Optional[datetime] = Field(default=None, description="") - business_policy_valid_from: Optional[datetime] = Field(default=None, description="") + business_policy_long_description: Optional[str] = Field( + default=None, description="" + ) + business_policy_valid_till: Optional[datetime] = Field( + default=None, description="" + ) + business_policy_valid_from: Optional[datetime] = Field( + default=None, description="" + ) business_policy_version: Optional[int] = Field(default=None, description="") - business_policy_review_period: Optional[str] = Field(default=None, description="") - business_policy_filter_d_s_l: Optional[str] = Field(default=None, description="") - business_policy_base_parent_guid: Optional[str] = Field(default=None, description="") - business_policy_selected_approval_w_f: Optional[str] = Field(default=None, description="") - business_policy_rules: Optional[List[BusinessPolicyRule]] = Field(default=None, description="") + business_policy_review_period: Optional[str] = Field( + default=None, description="" + ) + business_policy_filter_d_s_l: Optional[str] = Field( + default=None, description="" + ) + business_policy_base_parent_guid: Optional[str] = Field( + default=None, description="" + ) + business_policy_selected_approval_w_f: Optional[str] = Field( + default=None, description="" + ) + business_policy_rules: Optional[List[BusinessPolicyRule]] = Field( + default=None, description="" + ) exceptions_for_business_policy: Optional[List[BusinessPolicyException]] = Field( default=None, description="" ) # relationship - related_business_policies: Optional[List[BusinessPolicy]] = Field(default=None, description="") # relationship + related_business_policies: Optional[List[BusinessPolicy]] = Field( + default=None, description="" + ) # relationship attributes: BusinessPolicy.Attributes = Field( default_factory=lambda: BusinessPolicy.Attributes(), diff --git a/pyatlan/model/assets/business_policy_exception.py b/pyatlan/model/assets/business_policy_exception.py index bf2fb4072..3b36f2436 100644 --- a/pyatlan/model/assets/business_policy_exception.py +++ b/pyatlan/model/assets/business_policy_exception.py @@ -61,7 +61,9 @@ def __setattr__(self, name, value): Business Policy Exception Filter ES DSL to denote the associate asset/s involved. """ - BUSINESS_POLICY_FOR_EXCEPTION: ClassVar[RelationField] = RelationField("businessPolicyForException") + BUSINESS_POLICY_FOR_EXCEPTION: ClassVar[RelationField] = RelationField( + "businessPolicyForException" + ) """ TBC """ @@ -76,60 +78,106 @@ def __setattr__(self, name, value): @property def business_policy_exception_users(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.business_policy_exception_users + return ( + None + if self.attributes is None + else self.attributes.business_policy_exception_users + ) @business_policy_exception_users.setter - def business_policy_exception_users(self, business_policy_exception_users: Optional[Set[str]]): + def business_policy_exception_users( + self, business_policy_exception_users: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_exception_users = business_policy_exception_users + self.attributes.business_policy_exception_users = ( + business_policy_exception_users + ) @property def business_policy_exception_groups(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.business_policy_exception_groups + return ( + None + if self.attributes is None + else self.attributes.business_policy_exception_groups + ) @business_policy_exception_groups.setter - def business_policy_exception_groups(self, business_policy_exception_groups: Optional[Set[str]]): + def business_policy_exception_groups( + self, business_policy_exception_groups: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_exception_groups = business_policy_exception_groups + self.attributes.business_policy_exception_groups = ( + business_policy_exception_groups + ) @property def business_policy_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.business_policy_qualified_name + return ( + None + if self.attributes is None + else self.attributes.business_policy_qualified_name + ) @business_policy_qualified_name.setter - def business_policy_qualified_name(self, business_policy_qualified_name: Optional[str]): + def business_policy_qualified_name( + self, business_policy_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_qualified_name = business_policy_qualified_name @property def business_policy_exception_filter_d_s_l(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.business_policy_exception_filter_d_s_l + return ( + None + if self.attributes is None + else self.attributes.business_policy_exception_filter_d_s_l + ) @business_policy_exception_filter_d_s_l.setter - def business_policy_exception_filter_d_s_l(self, business_policy_exception_filter_d_s_l: Optional[str]): + def business_policy_exception_filter_d_s_l( + self, business_policy_exception_filter_d_s_l: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_exception_filter_d_s_l = business_policy_exception_filter_d_s_l + self.attributes.business_policy_exception_filter_d_s_l = ( + business_policy_exception_filter_d_s_l + ) @property def business_policy_for_exception(self) -> Optional[BusinessPolicy]: - return None if self.attributes is None else self.attributes.business_policy_for_exception + return ( + None + if self.attributes is None + else self.attributes.business_policy_for_exception + ) @business_policy_for_exception.setter - def business_policy_for_exception(self, business_policy_for_exception: Optional[BusinessPolicy]): + def business_policy_for_exception( + self, business_policy_for_exception: Optional[BusinessPolicy] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.business_policy_for_exception = business_policy_for_exception class Attributes(Asset.Attributes): - business_policy_exception_users: Optional[Set[str]] = Field(default=None, description="") - business_policy_exception_groups: Optional[Set[str]] = Field(default=None, description="") - business_policy_qualified_name: Optional[str] = Field(default=None, description="") - business_policy_exception_filter_d_s_l: Optional[str] = Field(default=None, description="") - business_policy_for_exception: Optional[BusinessPolicy] = Field(default=None, description="") # relationship + business_policy_exception_users: Optional[Set[str]] = Field( + default=None, description="" + ) + business_policy_exception_groups: Optional[Set[str]] = Field( + default=None, description="" + ) + business_policy_qualified_name: Optional[str] = Field( + default=None, description="" + ) + business_policy_exception_filter_d_s_l: Optional[str] = Field( + default=None, description="" + ) + business_policy_for_exception: Optional[BusinessPolicy] = Field( + default=None, description="" + ) # relationship attributes: BusinessPolicyException.Attributes = Field( default_factory=lambda: BusinessPolicyException.Attributes(), diff --git a/pyatlan/model/assets/business_policy_incident.py b/pyatlan/model/assets/business_policy_incident.py index 12bdbd2dd..711c8e91d 100644 --- a/pyatlan/model/assets/business_policy_incident.py +++ b/pyatlan/model/assets/business_policy_incident.py @@ -36,9 +36,11 @@ def __setattr__(self, name, value): """ count of noncompliant assets in the incident """ - BUSINESS_POLICY_INCIDENT_RELATED_POLICY_GUIDS: ClassVar[KeywordField] = KeywordField( - "businessPolicyIncidentRelatedPolicyGUIDs", - "businessPolicyIncidentRelatedPolicyGUIDs", + BUSINESS_POLICY_INCIDENT_RELATED_POLICY_GUIDS: ClassVar[KeywordField] = ( + KeywordField( + "businessPolicyIncidentRelatedPolicyGUIDs", + "businessPolicyIncidentRelatedPolicyGUIDs", + ) ) """ policy ids related to this incident @@ -58,17 +60,29 @@ def __setattr__(self, name, value): @property def business_policy_incident_noncompliant_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.business_policy_incident_noncompliant_count + return ( + None + if self.attributes is None + else self.attributes.business_policy_incident_noncompliant_count + ) @business_policy_incident_noncompliant_count.setter - def business_policy_incident_noncompliant_count(self, business_policy_incident_noncompliant_count: Optional[int]): + def business_policy_incident_noncompliant_count( + self, business_policy_incident_noncompliant_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_incident_noncompliant_count = business_policy_incident_noncompliant_count + self.attributes.business_policy_incident_noncompliant_count = ( + business_policy_incident_noncompliant_count + ) @property def business_policy_incident_related_policy_g_u_i_ds(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.business_policy_incident_related_policy_g_u_i_ds + return ( + None + if self.attributes is None + else self.attributes.business_policy_incident_related_policy_g_u_i_ds + ) @business_policy_incident_related_policy_g_u_i_ds.setter def business_policy_incident_related_policy_g_u_i_ds( @@ -82,18 +96,32 @@ def business_policy_incident_related_policy_g_u_i_ds( @property def business_policy_incident_filter_d_s_l(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.business_policy_incident_filter_d_s_l + return ( + None + if self.attributes is None + else self.attributes.business_policy_incident_filter_d_s_l + ) @business_policy_incident_filter_d_s_l.setter - def business_policy_incident_filter_d_s_l(self, business_policy_incident_filter_d_s_l: Optional[str]): + def business_policy_incident_filter_d_s_l( + self, business_policy_incident_filter_d_s_l: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_incident_filter_d_s_l = business_policy_incident_filter_d_s_l + self.attributes.business_policy_incident_filter_d_s_l = ( + business_policy_incident_filter_d_s_l + ) class Attributes(Incident.Attributes): - business_policy_incident_noncompliant_count: Optional[int] = Field(default=None, description="") - business_policy_incident_related_policy_g_u_i_ds: Optional[Set[str]] = Field(default=None, description="") - business_policy_incident_filter_d_s_l: Optional[str] = Field(default=None, description="") + business_policy_incident_noncompliant_count: Optional[int] = Field( + default=None, description="" + ) + business_policy_incident_related_policy_g_u_i_ds: Optional[Set[str]] = Field( + default=None, description="" + ) + business_policy_incident_filter_d_s_l: Optional[str] = Field( + default=None, description="" + ) attributes: BusinessPolicyIncident.Attributes = Field( default_factory=lambda: BusinessPolicyIncident.Attributes(), diff --git a/pyatlan/model/assets/business_policy_log.py b/pyatlan/model/assets/business_policy_log.py index bb98cc56f..1183261e1 100644 --- a/pyatlan/model/assets/business_policy_log.py +++ b/pyatlan/model/assets/business_policy_log.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - BUSINESS_POLICY_ID: ClassVar[KeywordField] = KeywordField("businessPolicyId", "businessPolicyId") + BUSINESS_POLICY_ID: ClassVar[KeywordField] = KeywordField( + "businessPolicyId", "businessPolicyId" + ) """ business policy guid for which log are created """ @@ -39,15 +41,21 @@ def __setattr__(self, name, value): """ business policy type for which log are created """ - GOVERNED_ASSETS_COUNT: ClassVar[NumericField] = NumericField("governedAssetsCount", "governedAssetsCount") + GOVERNED_ASSETS_COUNT: ClassVar[NumericField] = NumericField( + "governedAssetsCount", "governedAssetsCount" + ) """ number of governed assets in the policy """ - NON_GOVERNED_ASSETS_COUNT: ClassVar[NumericField] = NumericField("nonGovernedAssetsCount", "nonGovernedAssetsCount") + NON_GOVERNED_ASSETS_COUNT: ClassVar[NumericField] = NumericField( + "nonGovernedAssetsCount", "nonGovernedAssetsCount" + ) """ number of non governed assets in the policy """ - COMPLIANT_ASSETS_COUNT: ClassVar[NumericField] = NumericField("compliantAssetsCount", "compliantAssetsCount") + COMPLIANT_ASSETS_COUNT: ClassVar[NumericField] = NumericField( + "compliantAssetsCount", "compliantAssetsCount" + ) """ number of compliant assets in the policy """ @@ -79,17 +87,27 @@ def business_policy_id(self, business_policy_id: Optional[str]): @property def business_policy_log_policy_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.business_policy_log_policy_type + return ( + None + if self.attributes is None + else self.attributes.business_policy_log_policy_type + ) @business_policy_log_policy_type.setter - def business_policy_log_policy_type(self, business_policy_log_policy_type: Optional[str]): + def business_policy_log_policy_type( + self, business_policy_log_policy_type: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.business_policy_log_policy_type = business_policy_log_policy_type + self.attributes.business_policy_log_policy_type = ( + business_policy_log_policy_type + ) @property def governed_assets_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.governed_assets_count + return ( + None if self.attributes is None else self.attributes.governed_assets_count + ) @governed_assets_count.setter def governed_assets_count(self, governed_assets_count: Optional[int]): @@ -99,7 +117,11 @@ def governed_assets_count(self, governed_assets_count: Optional[int]): @property def non_governed_assets_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.non_governed_assets_count + return ( + None + if self.attributes is None + else self.attributes.non_governed_assets_count + ) @non_governed_assets_count.setter def non_governed_assets_count(self, non_governed_assets_count: Optional[int]): @@ -109,7 +131,9 @@ def non_governed_assets_count(self, non_governed_assets_count: Optional[int]): @property def compliant_assets_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.compliant_assets_count + return ( + None if self.attributes is None else self.attributes.compliant_assets_count + ) @compliant_assets_count.setter def compliant_assets_count(self, compliant_assets_count: Optional[int]): @@ -119,7 +143,11 @@ def compliant_assets_count(self, compliant_assets_count: Optional[int]): @property def non_compliant_assets_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.non_compliant_assets_count + return ( + None + if self.attributes is None + else self.attributes.non_compliant_assets_count + ) @non_compliant_assets_count.setter def non_compliant_assets_count(self, non_compliant_assets_count: Optional[int]): @@ -129,7 +157,9 @@ def non_compliant_assets_count(self, non_compliant_assets_count: Optional[int]): class Attributes(Asset.Attributes): business_policy_id: Optional[str] = Field(default=None, description="") - business_policy_log_policy_type: Optional[str] = Field(default=None, description="") + business_policy_log_policy_type: Optional[str] = Field( + default=None, description="" + ) governed_assets_count: Optional[int] = Field(default=None, description="") non_governed_assets_count: Optional[int] = Field(default=None, description="") compliant_assets_count: Optional[int] = Field(default=None, description="") diff --git a/pyatlan/model/assets/cognite3_d_model.py b/pyatlan/model/assets/cognite3_d_model.py index 8c6f3de87..2aa949b13 100644 --- a/pyatlan/model/assets/cognite3_d_model.py +++ b/pyatlan/model/assets/cognite3_d_model.py @@ -49,7 +49,9 @@ def cognite_asset(self, cognite_asset: Optional[CogniteAsset]): self.attributes.cognite_asset = cognite_asset class Attributes(Cognite.Attributes): - cognite_asset: Optional[CogniteAsset] = Field(default=None, description="") # relationship + cognite_asset: Optional[CogniteAsset] = Field( + default=None, description="" + ) # relationship attributes: Cognite3DModel.Attributes = Field( default_factory=lambda: Cognite3DModel.Attributes(), diff --git a/pyatlan/model/assets/cognite_asset.py b/pyatlan/model/assets/cognite_asset.py index eed8604ec..b0a7fb570 100644 --- a/pyatlan/model/assets/cognite_asset.py +++ b/pyatlan/model/assets/cognite_asset.py @@ -109,11 +109,21 @@ def cognite_sequences(self, cognite_sequences: Optional[List[CogniteSequence]]): self.attributes.cognite_sequences = cognite_sequences class Attributes(Cognite.Attributes): - cognite_events: Optional[List[CogniteEvent]] = Field(default=None, description="") # relationship - cognite_timeseries: Optional[List[CogniteTimeSeries]] = Field(default=None, description="") # relationship - cognite3dmodels: Optional[List[Cognite3DModel]] = Field(default=None, description="") # relationship - cognite_files: Optional[List[CogniteFile]] = Field(default=None, description="") # relationship - cognite_sequences: Optional[List[CogniteSequence]] = Field(default=None, description="") # relationship + cognite_events: Optional[List[CogniteEvent]] = Field( + default=None, description="" + ) # relationship + cognite_timeseries: Optional[List[CogniteTimeSeries]] = Field( + default=None, description="" + ) # relationship + cognite3dmodels: Optional[List[Cognite3DModel]] = Field( + default=None, description="" + ) # relationship + cognite_files: Optional[List[CogniteFile]] = Field( + default=None, description="" + ) # relationship + cognite_sequences: Optional[List[CogniteSequence]] = Field( + default=None, description="" + ) # relationship attributes: CogniteAsset.Attributes = Field( default_factory=lambda: CogniteAsset.Attributes(), diff --git a/pyatlan/model/assets/cognite_event.py b/pyatlan/model/assets/cognite_event.py index 3e544c3d1..b2eb4c13b 100644 --- a/pyatlan/model/assets/cognite_event.py +++ b/pyatlan/model/assets/cognite_event.py @@ -49,7 +49,9 @@ def cognite_asset(self, cognite_asset: Optional[CogniteAsset]): self.attributes.cognite_asset = cognite_asset class Attributes(Cognite.Attributes): - cognite_asset: Optional[CogniteAsset] = Field(default=None, description="") # relationship + cognite_asset: Optional[CogniteAsset] = Field( + default=None, description="" + ) # relationship attributes: CogniteEvent.Attributes = Field( default_factory=lambda: CogniteEvent.Attributes(), diff --git a/pyatlan/model/assets/cognite_file.py b/pyatlan/model/assets/cognite_file.py index 9d22ab254..f4a3353d8 100644 --- a/pyatlan/model/assets/cognite_file.py +++ b/pyatlan/model/assets/cognite_file.py @@ -49,7 +49,9 @@ def cognite_asset(self, cognite_asset: Optional[CogniteAsset]): self.attributes.cognite_asset = cognite_asset class Attributes(Cognite.Attributes): - cognite_asset: Optional[CogniteAsset] = Field(default=None, description="") # relationship + cognite_asset: Optional[CogniteAsset] = Field( + default=None, description="" + ) # relationship attributes: CogniteFile.Attributes = Field( default_factory=lambda: CogniteFile.Attributes(), diff --git a/pyatlan/model/assets/cognite_sequence.py b/pyatlan/model/assets/cognite_sequence.py index eff5ba2e7..9ae5c38c8 100644 --- a/pyatlan/model/assets/cognite_sequence.py +++ b/pyatlan/model/assets/cognite_sequence.py @@ -49,7 +49,9 @@ def cognite_asset(self, cognite_asset: Optional[CogniteAsset]): self.attributes.cognite_asset = cognite_asset class Attributes(Cognite.Attributes): - cognite_asset: Optional[CogniteAsset] = Field(default=None, description="") # relationship + cognite_asset: Optional[CogniteAsset] = Field( + default=None, description="" + ) # relationship attributes: CogniteSequence.Attributes = Field( default_factory=lambda: CogniteSequence.Attributes(), diff --git a/pyatlan/model/assets/cognite_time_series.py b/pyatlan/model/assets/cognite_time_series.py index 5163d63c4..41d07504c 100644 --- a/pyatlan/model/assets/cognite_time_series.py +++ b/pyatlan/model/assets/cognite_time_series.py @@ -49,7 +49,9 @@ def cognite_asset(self, cognite_asset: Optional[CogniteAsset]): self.attributes.cognite_asset = cognite_asset class Attributes(Cognite.Attributes): - cognite_asset: Optional[CogniteAsset] = Field(default=None, description="") # relationship + cognite_asset: Optional[CogniteAsset] = Field( + default=None, description="" + ) # relationship attributes: CogniteTimeSeries.Attributes = Field( default_factory=lambda: CogniteTimeSeries.Attributes(), diff --git a/pyatlan/model/assets/cognos.py b/pyatlan/model/assets/cognos.py index 3858a863b..df298bd11 100644 --- a/pyatlan/model/assets/cognos.py +++ b/pyatlan/model/assets/cognos.py @@ -54,7 +54,9 @@ def __setattr__(self, name, value): """ Qualified name of the parent asset in Cognos """ - COGNOS_VERSION: ClassVar[KeywordField] = KeywordField("cognosVersion", "cognosVersion") + COGNOS_VERSION: ClassVar[KeywordField] = KeywordField( + "cognosVersion", "cognosVersion" + ) """ Version of the Cognos asset """ @@ -62,15 +64,21 @@ def __setattr__(self, name, value): """ Cognos type of the Cognos asset. E.g. report, dashboard, package, etc. """ - COGNOS_IS_HIDDEN: ClassVar[BooleanField] = BooleanField("cognosIsHidden", "cognosIsHidden") + COGNOS_IS_HIDDEN: ClassVar[BooleanField] = BooleanField( + "cognosIsHidden", "cognosIsHidden" + ) """ Whether the Cognos asset is hidden from the ui """ - COGNOS_IS_DISABLED: ClassVar[BooleanField] = BooleanField("cognosIsDisabled", "cognosIsDisabled") + COGNOS_IS_DISABLED: ClassVar[BooleanField] = BooleanField( + "cognosIsDisabled", "cognosIsDisabled" + ) """ Whether the Cognos asset is diabled """ - COGNOS_DEFAULT_SCREEN_TIP: ClassVar[TextField] = TextField("cognosDefaultScreenTip", "cognosDefaultScreenTip") + COGNOS_DEFAULT_SCREEN_TIP: ClassVar[TextField] = TextField( + "cognosDefaultScreenTip", "cognosDefaultScreenTip" + ) """ Tooltip text present for the Cognos asset """ @@ -119,7 +127,11 @@ def cognos_parent_name(self, cognos_parent_name: Optional[str]): @property def cognos_parent_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cognos_parent_qualified_name + return ( + None + if self.attributes is None + else self.attributes.cognos_parent_qualified_name + ) @cognos_parent_qualified_name.setter def cognos_parent_qualified_name(self, cognos_parent_qualified_name: Optional[str]): @@ -169,7 +181,11 @@ def cognos_is_disabled(self, cognos_is_disabled: Optional[bool]): @property def cognos_default_screen_tip(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cognos_default_screen_tip + return ( + None + if self.attributes is None + else self.attributes.cognos_default_screen_tip + ) @cognos_default_screen_tip.setter def cognos_default_screen_tip(self, cognos_default_screen_tip: Optional[str]): @@ -181,7 +197,9 @@ class Attributes(BI.Attributes): cognos_id: Optional[str] = Field(default=None, description="") cognos_path: Optional[str] = Field(default=None, description="") cognos_parent_name: Optional[str] = Field(default=None, description="") - cognos_parent_qualified_name: Optional[str] = Field(default=None, description="") + cognos_parent_qualified_name: Optional[str] = Field( + default=None, description="" + ) cognos_version: Optional[str] = Field(default=None, description="") cognos_type: Optional[str] = Field(default=None, description="") cognos_is_hidden: Optional[bool] = Field(default=None, description="") diff --git a/pyatlan/model/assets/cognos_dashboard.py b/pyatlan/model/assets/cognos_dashboard.py index 409883094..8d3fc0e4c 100644 --- a/pyatlan/model/assets/cognos_dashboard.py +++ b/pyatlan/model/assets/cognos_dashboard.py @@ -49,7 +49,9 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship + cognos_folder: Optional[CognosFolder] = Field( + default=None, description="" + ) # relationship attributes: CognosDashboard.Attributes = Field( default_factory=lambda: CognosDashboard.Attributes(), diff --git a/pyatlan/model/assets/cognos_datasource.py b/pyatlan/model/assets/cognos_datasource.py index 29dbdee3b..bf1b4fd67 100644 --- a/pyatlan/model/assets/cognos_datasource.py +++ b/pyatlan/model/assets/cognos_datasource.py @@ -42,16 +42,26 @@ def __setattr__(self, name, value): @property def cognos_datasource_connection_string(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cognos_datasource_connection_string + return ( + None + if self.attributes is None + else self.attributes.cognos_datasource_connection_string + ) @cognos_datasource_connection_string.setter - def cognos_datasource_connection_string(self, cognos_datasource_connection_string: Optional[str]): + def cognos_datasource_connection_string( + self, cognos_datasource_connection_string: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cognos_datasource_connection_string = cognos_datasource_connection_string + self.attributes.cognos_datasource_connection_string = ( + cognos_datasource_connection_string + ) class Attributes(Cognos.Attributes): - cognos_datasource_connection_string: Optional[str] = Field(default=None, description="") + cognos_datasource_connection_string: Optional[str] = Field( + default=None, description="" + ) attributes: CognosDatasource.Attributes = Field( default_factory=lambda: CognosDatasource.Attributes(), diff --git a/pyatlan/model/assets/cognos_exploration.py b/pyatlan/model/assets/cognos_exploration.py index dd0839c2e..4590fa35d 100644 --- a/pyatlan/model/assets/cognos_exploration.py +++ b/pyatlan/model/assets/cognos_exploration.py @@ -49,7 +49,9 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship + cognos_folder: Optional[CognosFolder] = Field( + default=None, description="" + ) # relationship attributes: CognosExploration.Attributes = Field( default_factory=lambda: CognosExploration.Attributes(), diff --git a/pyatlan/model/assets/cognos_file.py b/pyatlan/model/assets/cognos_file.py index 882d47f80..fed312a15 100644 --- a/pyatlan/model/assets/cognos_file.py +++ b/pyatlan/model/assets/cognos_file.py @@ -49,7 +49,9 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship + cognos_folder: Optional[CognosFolder] = Field( + default=None, description="" + ) # relationship attributes: CognosFile.Attributes = Field( default_factory=lambda: CognosFile.Attributes(), diff --git a/pyatlan/model/assets/cognos_folder.py b/pyatlan/model/assets/cognos_folder.py index b0749d555..bf3d74f2e 100644 --- a/pyatlan/model/assets/cognos_folder.py +++ b/pyatlan/model/assets/cognos_folder.py @@ -90,23 +90,37 @@ def __setattr__(self, name, value): @property def cognos_folder_sub_folder_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.cognos_folder_sub_folder_count + return ( + None + if self.attributes is None + else self.attributes.cognos_folder_sub_folder_count + ) @cognos_folder_sub_folder_count.setter - def cognos_folder_sub_folder_count(self, cognos_folder_sub_folder_count: Optional[int]): + def cognos_folder_sub_folder_count( + self, cognos_folder_sub_folder_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cognos_folder_sub_folder_count = cognos_folder_sub_folder_count @property def cognos_folder_child_objects_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.cognos_folder_child_objects_count + return ( + None + if self.attributes is None + else self.attributes.cognos_folder_child_objects_count + ) @cognos_folder_child_objects_count.setter - def cognos_folder_child_objects_count(self, cognos_folder_child_objects_count: Optional[int]): + def cognos_folder_child_objects_count( + self, cognos_folder_child_objects_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cognos_folder_child_objects_count = cognos_folder_child_objects_count + self.attributes.cognos_folder_child_objects_count = ( + cognos_folder_child_objects_count + ) @property def cognos_packages(self) -> Optional[List[CognosPackage]]: @@ -183,22 +197,44 @@ def cognos_explorations(self) -> Optional[List[CognosExploration]]: return None if self.attributes is None else self.attributes.cognos_explorations @cognos_explorations.setter - def cognos_explorations(self, cognos_explorations: Optional[List[CognosExploration]]): + def cognos_explorations( + self, cognos_explorations: Optional[List[CognosExploration]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cognos_explorations = cognos_explorations class Attributes(Cognos.Attributes): - cognos_folder_sub_folder_count: Optional[int] = Field(default=None, description="") - cognos_folder_child_objects_count: Optional[int] = Field(default=None, description="") - cognos_packages: Optional[List[CognosPackage]] = Field(default=None, description="") # relationship - cognos_reports: Optional[List[CognosReport]] = Field(default=None, description="") # relationship - cognos_dashboards: Optional[List[CognosDashboard]] = Field(default=None, description="") # relationship - cognos_sub_folders: Optional[List[CognosFolder]] = Field(default=None, description="") # relationship - cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship - cognos_modules: Optional[List[CognosModule]] = Field(default=None, description="") # relationship - cognos_files: Optional[List[CognosFile]] = Field(default=None, description="") # relationship - cognos_explorations: Optional[List[CognosExploration]] = Field(default=None, description="") # relationship + cognos_folder_sub_folder_count: Optional[int] = Field( + default=None, description="" + ) + cognos_folder_child_objects_count: Optional[int] = Field( + default=None, description="" + ) + cognos_packages: Optional[List[CognosPackage]] = Field( + default=None, description="" + ) # relationship + cognos_reports: Optional[List[CognosReport]] = Field( + default=None, description="" + ) # relationship + cognos_dashboards: Optional[List[CognosDashboard]] = Field( + default=None, description="" + ) # relationship + cognos_sub_folders: Optional[List[CognosFolder]] = Field( + default=None, description="" + ) # relationship + cognos_folder: Optional[CognosFolder] = Field( + default=None, description="" + ) # relationship + cognos_modules: Optional[List[CognosModule]] = Field( + default=None, description="" + ) # relationship + cognos_files: Optional[List[CognosFile]] = Field( + default=None, description="" + ) # relationship + cognos_explorations: Optional[List[CognosExploration]] = Field( + default=None, description="" + ) # relationship attributes: CognosFolder.Attributes = Field( default_factory=lambda: CognosFolder.Attributes(), diff --git a/pyatlan/model/assets/cognos_module.py b/pyatlan/model/assets/cognos_module.py index 8faab9c32..b0e037d2b 100644 --- a/pyatlan/model/assets/cognos_module.py +++ b/pyatlan/model/assets/cognos_module.py @@ -49,7 +49,9 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship + cognos_folder: Optional[CognosFolder] = Field( + default=None, description="" + ) # relationship attributes: CognosModule.Attributes = Field( default_factory=lambda: CognosModule.Attributes(), diff --git a/pyatlan/model/assets/cognos_package.py b/pyatlan/model/assets/cognos_package.py index f5a49dd03..7cfadf8bb 100644 --- a/pyatlan/model/assets/cognos_package.py +++ b/pyatlan/model/assets/cognos_package.py @@ -49,7 +49,9 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship + cognos_folder: Optional[CognosFolder] = Field( + default=None, description="" + ) # relationship attributes: CognosPackage.Attributes = Field( default_factory=lambda: CognosPackage.Attributes(), diff --git a/pyatlan/model/assets/cognos_report.py b/pyatlan/model/assets/cognos_report.py index 7a7cd5d54..b901e1354 100644 --- a/pyatlan/model/assets/cognos_report.py +++ b/pyatlan/model/assets/cognos_report.py @@ -49,7 +49,9 @@ def cognos_folder(self, cognos_folder: Optional[CognosFolder]): self.attributes.cognos_folder = cognos_folder class Attributes(Cognos.Attributes): - cognos_folder: Optional[CognosFolder] = Field(default=None, description="") # relationship + cognos_folder: Optional[CognosFolder] = Field( + default=None, description="" + ) # relationship attributes: CognosReport.Attributes = Field( default_factory=lambda: CognosReport.Attributes(), diff --git a/pyatlan/model/assets/collection.py b/pyatlan/model/assets/collection.py index d91f73c5e..1c3086424 100644 --- a/pyatlan/model/assets/collection.py +++ b/pyatlan/model/assets/collection.py @@ -40,7 +40,9 @@ def _generate_qualified_name(cls, client: AtlanClient): username = client.user.get_current().username return f"default/collection/{username}/{uuid4()}" except AtlanError as e: - raise ErrorCode.UNABLE_TO_GENERATE_QN.exception_with_parameters(cls.__name__, e) from e + raise ErrorCode.UNABLE_TO_GENERATE_QN.exception_with_parameters( + cls.__name__, e + ) from e type_name: str = Field(default="Collection", allow_mutation=False) diff --git a/pyatlan/model/assets/connection.py b/pyatlan/model/assets/connection.py index eb0f06a3d..8a38f76e8 100644 --- a/pyatlan/model/assets/connection.py +++ b/pyatlan/model/assets/connection.py @@ -40,7 +40,9 @@ def creator( ) -> Connection: validate_required_fields(["name", "connector_type"], [name, connector_type]) if not admin_users and not admin_groups and not admin_roles: - raise ValueError("One of admin_user, admin_groups or admin_roles is required") + raise ValueError( + "One of admin_user, admin_groups or admin_roles is required" + ) attr = cls.Attributes( name=name, qualified_name=connector_type.to_qualified_name(), @@ -66,7 +68,9 @@ def create( admin_roles: Optional[List[str]] = None, ) -> Connection: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -111,11 +115,15 @@ def __setattr__(self, name, value): """ Whether using this connection to run queries on the source is allowed (true) or not (false). """ - ALLOW_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("allowQueryPreview", "allowQueryPreview") + ALLOW_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( + "allowQueryPreview", "allowQueryPreview" + ) """ Whether using this connection to run preview queries on the source is allowed (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( + "queryPreviewConfig", "queryPreviewConfig" + ) """ Configuration for preview queries. """ @@ -123,7 +131,9 @@ def __setattr__(self, name, value): """ Query config for this connection. """ - CREDENTIAL_STRATEGY: ClassVar[TextField] = TextField("credentialStrategy", "credentialStrategy") + CREDENTIAL_STRATEGY: ClassVar[TextField] = TextField( + "credentialStrategy", "credentialStrategy" + ) """ Credential strategy to use for this connection for queries. """ @@ -133,7 +143,9 @@ def __setattr__(self, name, value): """ Credential strategy to use for this connection for preview queries. """ - POLICY_STRATEGY: ClassVar[KeywordField] = KeywordField("policyStrategy", "policyStrategy") + POLICY_STRATEGY: ClassVar[KeywordField] = KeywordField( + "policyStrategy", "policyStrategy" + ) """ Policy strategy is a configuration that determines whether the Atlan policy will be applied to the results of insight queries and whether the query will be rewritten, applicable for stream api call made from insight screen """ # noqa: E501 @@ -143,7 +155,9 @@ def __setattr__(self, name, value): """ Policy strategy is a configuration that determines whether the Atlan policy will be applied to the results of insight queries and whether the query will be rewritten. policyStrategyForSamplePreview config is applicable for sample preview call from assets screen """ # noqa: E501 - QUERY_USERNAME_STRATEGY: ClassVar[KeywordField] = KeywordField("queryUsernameStrategy", "queryUsernameStrategy") + QUERY_USERNAME_STRATEGY: ClassVar[KeywordField] = KeywordField( + "queryUsernameStrategy", "queryUsernameStrategy" + ) """ Username strategy to use for this connection for queries. """ @@ -155,7 +169,9 @@ def __setattr__(self, name, value): """ Maximum time a query should be allowed to run before timing out. """ - DEFAULT_CREDENTIAL_GUID: ClassVar[TextField] = TextField("defaultCredentialGuid", "defaultCredentialGuid") + DEFAULT_CREDENTIAL_GUID: ClassVar[TextField] = TextField( + "defaultCredentialGuid", "defaultCredentialGuid" + ) """ Unique identifier (GUID) for the default credentials to use for this connection. """ @@ -183,7 +199,9 @@ def __setattr__(self, name, value): """ Number of days over which popularity is calculated, for example 30 days. """ - HAS_POPULARITY_INSIGHTS: ClassVar[BooleanField] = BooleanField("hasPopularityInsights", "hasPopularityInsights") + HAS_POPULARITY_INSIGHTS: ClassVar[BooleanField] = BooleanField( + "hasPopularityInsights", "hasPopularityInsights" + ) """ Whether this connection has popularity insights (true) or not (false). """ @@ -199,7 +217,9 @@ def __setattr__(self, name, value): """ Unique identifier (GUID) for the SSO credentials to use for this connection. """ - USE_OBJECT_STORAGE: ClassVar[BooleanField] = BooleanField("useObjectStorage", "useObjectStorage") + USE_OBJECT_STORAGE: ClassVar[BooleanField] = BooleanField( + "useObjectStorage", "useObjectStorage" + ) """ Whether to upload to S3, GCP, or another storage location (true) or not (false). """ @@ -345,7 +365,11 @@ def credential_strategy(self, credential_strategy: Optional[str]): @property def preview_credential_strategy(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.preview_credential_strategy + return ( + None + if self.attributes is None + else self.attributes.preview_credential_strategy + ) @preview_credential_strategy.setter def preview_credential_strategy(self, preview_credential_strategy: Optional[str]): @@ -365,20 +389,32 @@ def policy_strategy(self, policy_strategy: Optional[str]): @property def policy_strategy_for_sample_preview(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.policy_strategy_for_sample_preview + return ( + None + if self.attributes is None + else self.attributes.policy_strategy_for_sample_preview + ) @policy_strategy_for_sample_preview.setter - def policy_strategy_for_sample_preview(self, policy_strategy_for_sample_preview: Optional[str]): + def policy_strategy_for_sample_preview( + self, policy_strategy_for_sample_preview: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.policy_strategy_for_sample_preview = policy_strategy_for_sample_preview + self.attributes.policy_strategy_for_sample_preview = ( + policy_strategy_for_sample_preview + ) @property def query_username_strategy(self) -> Optional[QueryUsernameStrategy]: - return None if self.attributes is None else self.attributes.query_username_strategy + return ( + None if self.attributes is None else self.attributes.query_username_strategy + ) @query_username_strategy.setter - def query_username_strategy(self, query_username_strategy: Optional[QueryUsernameStrategy]): + def query_username_strategy( + self, query_username_strategy: Optional[QueryUsernameStrategy] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.query_username_strategy = query_username_strategy @@ -405,7 +441,9 @@ def query_timeout(self, query_timeout: Optional[int]): @property def default_credential_guid(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.default_credential_guid + return ( + None if self.attributes is None else self.attributes.default_credential_guid + ) @default_credential_guid.setter def default_credential_guid(self, default_credential_guid: Optional[str]): @@ -445,27 +483,41 @@ def source_logo(self, source_logo: Optional[str]): @property def is_sample_data_preview_enabled(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.is_sample_data_preview_enabled + return ( + None + if self.attributes is None + else self.attributes.is_sample_data_preview_enabled + ) @is_sample_data_preview_enabled.setter - def is_sample_data_preview_enabled(self, is_sample_data_preview_enabled: Optional[bool]): + def is_sample_data_preview_enabled( + self, is_sample_data_preview_enabled: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.is_sample_data_preview_enabled = is_sample_data_preview_enabled @property def popularity_insights_timeframe(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.popularity_insights_timeframe + return ( + None + if self.attributes is None + else self.attributes.popularity_insights_timeframe + ) @popularity_insights_timeframe.setter - def popularity_insights_timeframe(self, popularity_insights_timeframe: Optional[int]): + def popularity_insights_timeframe( + self, popularity_insights_timeframe: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.popularity_insights_timeframe = popularity_insights_timeframe @property def has_popularity_insights(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.has_popularity_insights + return ( + None if self.attributes is None else self.attributes.has_popularity_insights + ) @has_popularity_insights.setter def has_popularity_insights(self, has_popularity_insights: Optional[bool]): @@ -475,23 +527,37 @@ def has_popularity_insights(self, has_popularity_insights: Optional[bool]): @property def connection_dbt_environments(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.connection_dbt_environments + return ( + None + if self.attributes is None + else self.attributes.connection_dbt_environments + ) @connection_dbt_environments.setter - def connection_dbt_environments(self, connection_dbt_environments: Optional[Set[str]]): + def connection_dbt_environments( + self, connection_dbt_environments: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.connection_dbt_environments = connection_dbt_environments @property def connection_s_s_o_credential_guid(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.connection_s_s_o_credential_guid + return ( + None + if self.attributes is None + else self.attributes.connection_s_s_o_credential_guid + ) @connection_s_s_o_credential_guid.setter - def connection_s_s_o_credential_guid(self, connection_s_s_o_credential_guid: Optional[str]): + def connection_s_s_o_credential_guid( + self, connection_s_s_o_credential_guid: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.connection_s_s_o_credential_guid = connection_s_s_o_credential_guid + self.attributes.connection_s_s_o_credential_guid = ( + connection_s_s_o_credential_guid + ) @property def use_object_storage(self) -> Optional[bool]: @@ -505,17 +571,29 @@ def use_object_storage(self, use_object_storage: Optional[bool]): @property def object_storage_upload_threshold(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.object_storage_upload_threshold + return ( + None + if self.attributes is None + else self.attributes.object_storage_upload_threshold + ) @object_storage_upload_threshold.setter - def object_storage_upload_threshold(self, object_storage_upload_threshold: Optional[int]): + def object_storage_upload_threshold( + self, object_storage_upload_threshold: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.object_storage_upload_threshold = object_storage_upload_threshold + self.attributes.object_storage_upload_threshold = ( + object_storage_upload_threshold + ) @property def vector_embeddings_enabled(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.vector_embeddings_enabled + return ( + None + if self.attributes is None + else self.attributes.vector_embeddings_enabled + ) @vector_embeddings_enabled.setter def vector_embeddings_enabled(self, vector_embeddings_enabled: Optional[bool]): @@ -525,10 +603,16 @@ def vector_embeddings_enabled(self, vector_embeddings_enabled: Optional[bool]): @property def vector_embeddings_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.vector_embeddings_updated_at + return ( + None + if self.attributes is None + else self.attributes.vector_embeddings_updated_at + ) @vector_embeddings_updated_at.setter - def vector_embeddings_updated_at(self, vector_embeddings_updated_at: Optional[datetime]): + def vector_embeddings_updated_at( + self, vector_embeddings_updated_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.vector_embeddings_updated_at = vector_embeddings_updated_at @@ -540,28 +624,46 @@ class Attributes(Asset.Attributes): port: Optional[int] = Field(default=None, description="") allow_query: Optional[bool] = Field(default=None, description="") allow_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") + query_preview_config: Optional[Dict[str, str]] = Field( + default=None, description="" + ) query_config: Optional[str] = Field(default=None, description="") credential_strategy: Optional[str] = Field(default=None, description="") preview_credential_strategy: Optional[str] = Field(default=None, description="") policy_strategy: Optional[str] = Field(default=None, description="") - policy_strategy_for_sample_preview: Optional[str] = Field(default=None, description="") - query_username_strategy: Optional[QueryUsernameStrategy] = Field(default=None, description="") + policy_strategy_for_sample_preview: Optional[str] = Field( + default=None, description="" + ) + query_username_strategy: Optional[QueryUsernameStrategy] = Field( + default=None, description="" + ) row_limit: Optional[int] = Field(default=None, description="") query_timeout: Optional[int] = Field(default=None, description="") default_credential_guid: Optional[str] = Field(default=None, description="") connector_icon: Optional[str] = Field(default=None, description="") connector_image: Optional[str] = Field(default=None, description="") source_logo: Optional[str] = Field(default=None, description="") - is_sample_data_preview_enabled: Optional[bool] = Field(default=None, description="") - popularity_insights_timeframe: Optional[int] = Field(default=None, description="") + is_sample_data_preview_enabled: Optional[bool] = Field( + default=None, description="" + ) + popularity_insights_timeframe: Optional[int] = Field( + default=None, description="" + ) has_popularity_insights: Optional[bool] = Field(default=None, description="") - connection_dbt_environments: Optional[Set[str]] = Field(default=None, description="") - connection_s_s_o_credential_guid: Optional[str] = Field(default=None, description="") + connection_dbt_environments: Optional[Set[str]] = Field( + default=None, description="" + ) + connection_s_s_o_credential_guid: Optional[str] = Field( + default=None, description="" + ) use_object_storage: Optional[bool] = Field(default=None, description="") - object_storage_upload_threshold: Optional[int] = Field(default=None, description="") + object_storage_upload_threshold: Optional[int] = Field( + default=None, description="" + ) vector_embeddings_enabled: Optional[bool] = Field(default=None, description="") - vector_embeddings_updated_at: Optional[datetime] = Field(default=None, description="") + vector_embeddings_updated_at: Optional[datetime] = Field( + default=None, description="" + ) is_loaded: bool = Field(default=True) diff --git a/pyatlan/model/assets/core/a_d_f.py b/pyatlan/model/assets/core/a_d_f.py index 89a8121b6..6806470ff 100644 --- a/pyatlan/model/assets/core/a_d_f.py +++ b/pyatlan/model/assets/core/a_d_f.py @@ -29,11 +29,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ADF_FACTORY_NAME: ClassVar[TextField] = TextField("adfFactoryName", "adfFactoryName") + ADF_FACTORY_NAME: ClassVar[TextField] = TextField( + "adfFactoryName", "adfFactoryName" + ) """ Defines the name of the factory in which this asset exists. """ - ADF_ASSET_FOLDER_PATH: ClassVar[TextField] = TextField("adfAssetFolderPath", "adfAssetFolderPath") + ADF_ASSET_FOLDER_PATH: ClassVar[TextField] = TextField( + "adfAssetFolderPath", "adfAssetFolderPath" + ) """ Defines the folder path in which this ADF asset exists. """ @@ -55,7 +59,9 @@ def adf_factory_name(self, adf_factory_name: Optional[str]): @property def adf_asset_folder_path(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_asset_folder_path + return ( + None if self.attributes is None else self.attributes.adf_asset_folder_path + ) @adf_asset_folder_path.setter def adf_asset_folder_path(self, adf_asset_folder_path: Optional[str]): diff --git a/pyatlan/model/assets/core/access_control.py b/pyatlan/model/assets/core/access_control.py index fd26a983d..f0cf58cae 100644 --- a/pyatlan/model/assets/core/access_control.py +++ b/pyatlan/model/assets/core/access_control.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - IS_ACCESS_CONTROL_ENABLED: ClassVar[BooleanField] = BooleanField("isAccessControlEnabled", "isAccessControlEnabled") + IS_ACCESS_CONTROL_ENABLED: ClassVar[BooleanField] = BooleanField( + "isAccessControlEnabled", "isAccessControlEnabled" + ) """ TBC """ @@ -44,11 +46,15 @@ def __setattr__(self, name, value): """ TBC """ - DENY_ASSET_TABS: ClassVar[KeywordField] = KeywordField("denyAssetTabs", "denyAssetTabs") + DENY_ASSET_TABS: ClassVar[KeywordField] = KeywordField( + "denyAssetTabs", "denyAssetTabs" + ) """ TBC """ - DENY_ASSET_FILTERS: ClassVar[TextField] = TextField("denyAssetFilters", "denyAssetFilters") + DENY_ASSET_FILTERS: ClassVar[TextField] = TextField( + "denyAssetFilters", "denyAssetFilters" + ) """ TBC """ @@ -56,19 +62,27 @@ def __setattr__(self, name, value): """ TBC """ - DENY_ASSET_TYPES: ClassVar[TextField] = TextField("denyAssetTypes", "denyAssetTypes") + DENY_ASSET_TYPES: ClassVar[TextField] = TextField( + "denyAssetTypes", "denyAssetTypes" + ) """ TBC """ - DENY_NAVIGATION_PAGES: ClassVar[TextField] = TextField("denyNavigationPages", "denyNavigationPages") + DENY_NAVIGATION_PAGES: ClassVar[TextField] = TextField( + "denyNavigationPages", "denyNavigationPages" + ) """ TBC """ - DEFAULT_NAVIGATION: ClassVar[TextField] = TextField("defaultNavigation", "defaultNavigation") + DEFAULT_NAVIGATION: ClassVar[TextField] = TextField( + "defaultNavigation", "defaultNavigation" + ) """ TBC """ - DISPLAY_PREFERENCES: ClassVar[KeywordField] = KeywordField("displayPreferences", "displayPreferences") + DISPLAY_PREFERENCES: ClassVar[KeywordField] = KeywordField( + "displayPreferences", "displayPreferences" + ) """ TBC """ @@ -93,7 +107,11 @@ def __setattr__(self, name, value): @property def is_access_control_enabled(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.is_access_control_enabled + return ( + None + if self.attributes is None + else self.attributes.is_access_control_enabled + ) @is_access_control_enabled.setter def is_access_control_enabled(self, is_access_control_enabled: Optional[bool]): @@ -103,10 +121,16 @@ def is_access_control_enabled(self, is_access_control_enabled: Optional[bool]): @property def deny_custom_metadata_guids(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.deny_custom_metadata_guids + return ( + None + if self.attributes is None + else self.attributes.deny_custom_metadata_guids + ) @deny_custom_metadata_guids.setter - def deny_custom_metadata_guids(self, deny_custom_metadata_guids: Optional[Set[str]]): + def deny_custom_metadata_guids( + self, deny_custom_metadata_guids: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.deny_custom_metadata_guids = deny_custom_metadata_guids @@ -153,7 +177,9 @@ def deny_asset_types(self, deny_asset_types: Optional[Set[str]]): @property def deny_navigation_pages(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.deny_navigation_pages + return ( + None if self.attributes is None else self.attributes.deny_navigation_pages + ) @deny_navigation_pages.setter def deny_navigation_pages(self, deny_navigation_pages: Optional[Set[str]]): @@ -193,7 +219,9 @@ def policies(self, policies: Optional[List[AuthPolicy]]): class Attributes(Asset.Attributes): is_access_control_enabled: Optional[bool] = Field(default=None, description="") - deny_custom_metadata_guids: Optional[Set[str]] = Field(default=None, description="") + deny_custom_metadata_guids: Optional[Set[str]] = Field( + default=None, description="" + ) deny_asset_tabs: Optional[Set[str]] = Field(default=None, description="") deny_asset_filters: Optional[Set[str]] = Field(default=None, description="") channel_link: Optional[str] = Field(default=None, description="") @@ -201,7 +229,9 @@ class Attributes(Asset.Attributes): deny_navigation_pages: Optional[Set[str]] = Field(default=None, description="") default_navigation: Optional[str] = Field(default=None, description="") display_preferences: Optional[Set[str]] = Field(default=None, description="") - policies: Optional[List[AuthPolicy]] = Field(default=None, description="") # relationship + policies: Optional[List[AuthPolicy]] = Field( + default=None, description="" + ) # relationship attributes: AccessControl.Attributes = Field( default_factory=lambda: AccessControl.Attributes(), diff --git a/pyatlan/model/assets/core/adf_activity.py b/pyatlan/model/assets/core/adf_activity.py index 03a68a189..5852c0c31 100644 --- a/pyatlan/model/assets/core/adf_activity.py +++ b/pyatlan/model/assets/core/adf_activity.py @@ -37,7 +37,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ADF_ACTIVITY_TYPE: ClassVar[KeywordField] = KeywordField("adfActivityType", "adfActivityType") + ADF_ACTIVITY_TYPE: ClassVar[KeywordField] = KeywordField( + "adfActivityType", "adfActivityType" + ) """ The type of the ADF activity. """ @@ -47,7 +49,9 @@ def __setattr__(self, name, value): """ The list of ADF activities on which this ADF activity depends on. """ - ADF_ACTIVITY_POLICY_TIMEOUT: ClassVar[TextField] = TextField("adfActivityPolicyTimeout", "adfActivityPolicyTimeout") + ADF_ACTIVITY_POLICY_TIMEOUT: ClassVar[TextField] = TextField( + "adfActivityPolicyTimeout", "adfActivityPolicyTimeout" + ) """ The timout defined for the ADF activity. """ @@ -57,31 +61,45 @@ def __setattr__(self, name, value): """ The retry interval in seconds for the ADF activity. """ - ADF_ACTIVITY_STATE: ClassVar[KeywordField] = KeywordField("adfActivityState", "adfActivityState") + ADF_ACTIVITY_STATE: ClassVar[KeywordField] = KeywordField( + "adfActivityState", "adfActivityState" + ) """ Defines the state (Active or Inactive) of an ADF activity whether it is active or not. """ - ADF_ACTIVITY_SOURCES: ClassVar[TextField] = TextField("adfActivitySources", "adfActivitySources") + ADF_ACTIVITY_SOURCES: ClassVar[TextField] = TextField( + "adfActivitySources", "adfActivitySources" + ) """ The list of names of sources for the ADF activity. """ - ADF_ACTIVITY_SINKS: ClassVar[TextField] = TextField("adfActivitySinks", "adfActivitySinks") + ADF_ACTIVITY_SINKS: ClassVar[TextField] = TextField( + "adfActivitySinks", "adfActivitySinks" + ) """ The list of names of sinks for the ADF activity. """ - ADF_ACTIVITY_SOURCE_TYPE: ClassVar[TextField] = TextField("adfActivitySourceType", "adfActivitySourceType") + ADF_ACTIVITY_SOURCE_TYPE: ClassVar[TextField] = TextField( + "adfActivitySourceType", "adfActivitySourceType" + ) """ Defines the type of the source of the ADF activtity. """ - ADF_ACTIVITY_SINK_TYPE: ClassVar[TextField] = TextField("adfActivitySinkType", "adfActivitySinkType") + ADF_ACTIVITY_SINK_TYPE: ClassVar[TextField] = TextField( + "adfActivitySinkType", "adfActivitySinkType" + ) """ Defines the type of the sink of the ADF activtity. """ - ADF_ACTIVITY_RUNS: ClassVar[KeywordField] = KeywordField("adfActivityRuns", "adfActivityRuns") + ADF_ACTIVITY_RUNS: ClassVar[KeywordField] = KeywordField( + "adfActivityRuns", "adfActivityRuns" + ) """ List of objects of activity runs for a particular activity. """ - ADF_ACTIVITY_NOTEBOOK_PATH: ClassVar[TextField] = TextField("adfActivityNotebookPath", "adfActivityNotebookPath") + ADF_ACTIVITY_NOTEBOOK_PATH: ClassVar[TextField] = TextField( + "adfActivityNotebookPath", "adfActivityNotebookPath" + ) """ Defines the path of the notebook in the databricks notebook activity. """ @@ -103,7 +121,9 @@ def __setattr__(self, name, value): """ Indicates whether to import only first row only or not in Lookup activity. """ - ADF_ACTIVITY_BATCH_COUNT: ClassVar[NumericField] = NumericField("adfActivityBatchCount", "adfActivityBatchCount") + ADF_ACTIVITY_BATCH_COUNT: ClassVar[NumericField] = NumericField( + "adfActivityBatchCount", "adfActivityBatchCount" + ) """ Defines the batch count of activity to runs in ForEach activity. """ @@ -113,7 +133,9 @@ def __setattr__(self, name, value): """ Indicates whether the activity processing is sequential or not inside the ForEach activity. """ - ADF_ACTIVITY_SUB_ACTIVITIES: ClassVar[TextField] = TextField("adfActivitySubActivities", "adfActivitySubActivities") + ADF_ACTIVITY_SUB_ACTIVITIES: ClassVar[TextField] = TextField( + "adfActivitySubActivities", "adfActivitySubActivities" + ) """ The list of activities to be run inside a ForEach activity. """ @@ -192,17 +214,29 @@ def adf_activity_type(self, adf_activity_type: Optional[str]): @property def adf_activity_preceding_dependency(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.adf_activity_preceding_dependency + return ( + None + if self.attributes is None + else self.attributes.adf_activity_preceding_dependency + ) @adf_activity_preceding_dependency.setter - def adf_activity_preceding_dependency(self, adf_activity_preceding_dependency: Optional[Set[str]]): + def adf_activity_preceding_dependency( + self, adf_activity_preceding_dependency: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_activity_preceding_dependency = adf_activity_preceding_dependency + self.attributes.adf_activity_preceding_dependency = ( + adf_activity_preceding_dependency + ) @property def adf_activity_policy_timeout(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_activity_policy_timeout + return ( + None + if self.attributes is None + else self.attributes.adf_activity_policy_timeout + ) @adf_activity_policy_timeout.setter def adf_activity_policy_timeout(self, adf_activity_policy_timeout: Optional[str]): @@ -212,13 +246,21 @@ def adf_activity_policy_timeout(self, adf_activity_policy_timeout: Optional[str] @property def adf_activity_polict_retry_interval(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.adf_activity_polict_retry_interval + return ( + None + if self.attributes is None + else self.attributes.adf_activity_polict_retry_interval + ) @adf_activity_polict_retry_interval.setter - def adf_activity_polict_retry_interval(self, adf_activity_polict_retry_interval: Optional[int]): + def adf_activity_polict_retry_interval( + self, adf_activity_polict_retry_interval: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_activity_polict_retry_interval = adf_activity_polict_retry_interval + self.attributes.adf_activity_polict_retry_interval = ( + adf_activity_polict_retry_interval + ) @property def adf_activity_state(self) -> Optional[AdfActivityState]: @@ -252,7 +294,11 @@ def adf_activity_sinks(self, adf_activity_sinks: Optional[Set[str]]): @property def adf_activity_source_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_activity_source_type + return ( + None + if self.attributes is None + else self.attributes.adf_activity_source_type + ) @adf_activity_source_type.setter def adf_activity_source_type(self, adf_activity_source_type: Optional[str]): @@ -262,7 +308,9 @@ def adf_activity_source_type(self, adf_activity_source_type: Optional[str]): @property def adf_activity_sink_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_activity_sink_type + return ( + None if self.attributes is None else self.attributes.adf_activity_sink_type + ) @adf_activity_sink_type.setter def adf_activity_sink_type(self, adf_activity_sink_type: Optional[str]): @@ -282,7 +330,11 @@ def adf_activity_runs(self, adf_activity_runs: Optional[List[Dict[str, str]]]): @property def adf_activity_notebook_path(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_activity_notebook_path + return ( + None + if self.attributes is None + else self.attributes.adf_activity_notebook_path + ) @adf_activity_notebook_path.setter def adf_activity_notebook_path(self, adf_activity_notebook_path: Optional[str]): @@ -292,7 +344,11 @@ def adf_activity_notebook_path(self, adf_activity_notebook_path: Optional[str]): @property def adf_activity_main_class_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_activity_main_class_name + return ( + None + if self.attributes is None + else self.attributes.adf_activity_main_class_name + ) @adf_activity_main_class_name.setter def adf_activity_main_class_name(self, adf_activity_main_class_name: Optional[str]): @@ -302,17 +358,27 @@ def adf_activity_main_class_name(self, adf_activity_main_class_name: Optional[st @property def adf_activity_python_file_path(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_activity_python_file_path + return ( + None + if self.attributes is None + else self.attributes.adf_activity_python_file_path + ) @adf_activity_python_file_path.setter - def adf_activity_python_file_path(self, adf_activity_python_file_path: Optional[str]): + def adf_activity_python_file_path( + self, adf_activity_python_file_path: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adf_activity_python_file_path = adf_activity_python_file_path @property def adf_activity_first_row_only(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.adf_activity_first_row_only + return ( + None + if self.attributes is None + else self.attributes.adf_activity_first_row_only + ) @adf_activity_first_row_only.setter def adf_activity_first_row_only(self, adf_activity_first_row_only: Optional[bool]): @@ -322,7 +388,11 @@ def adf_activity_first_row_only(self, adf_activity_first_row_only: Optional[bool @property def adf_activity_batch_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.adf_activity_batch_count + return ( + None + if self.attributes is None + else self.attributes.adf_activity_batch_count + ) @adf_activity_batch_count.setter def adf_activity_batch_count(self, adf_activity_batch_count: Optional[int]): @@ -332,7 +402,11 @@ def adf_activity_batch_count(self, adf_activity_batch_count: Optional[int]): @property def adf_activity_is_sequential(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.adf_activity_is_sequential + return ( + None + if self.attributes is None + else self.attributes.adf_activity_is_sequential + ) @adf_activity_is_sequential.setter def adf_activity_is_sequential(self, adf_activity_is_sequential: Optional[bool]): @@ -342,27 +416,45 @@ def adf_activity_is_sequential(self, adf_activity_is_sequential: Optional[bool]) @property def adf_activity_sub_activities(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.adf_activity_sub_activities + return ( + None + if self.attributes is None + else self.attributes.adf_activity_sub_activities + ) @adf_activity_sub_activities.setter - def adf_activity_sub_activities(self, adf_activity_sub_activities: Optional[Set[str]]): + def adf_activity_sub_activities( + self, adf_activity_sub_activities: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adf_activity_sub_activities = adf_activity_sub_activities @property def adf_activity_reference_dataflow(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_activity_reference_dataflow + return ( + None + if self.attributes is None + else self.attributes.adf_activity_reference_dataflow + ) @adf_activity_reference_dataflow.setter - def adf_activity_reference_dataflow(self, adf_activity_reference_dataflow: Optional[str]): + def adf_activity_reference_dataflow( + self, adf_activity_reference_dataflow: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_activity_reference_dataflow = adf_activity_reference_dataflow + self.attributes.adf_activity_reference_dataflow = ( + adf_activity_reference_dataflow + ) @property def adf_pipeline_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_pipeline_qualified_name + return ( + None + if self.attributes is None + else self.attributes.adf_pipeline_qualified_name + ) @adf_pipeline_qualified_name.setter def adf_pipeline_qualified_name(self, adf_pipeline_qualified_name: Optional[str]): @@ -422,29 +514,57 @@ def adf_dataflow(self, adf_dataflow: Optional[AdfDataflow]): class Attributes(ADF.Attributes): adf_activity_type: Optional[str] = Field(default=None, description="") - adf_activity_preceding_dependency: Optional[Set[str]] = Field(default=None, description="") + adf_activity_preceding_dependency: Optional[Set[str]] = Field( + default=None, description="" + ) adf_activity_policy_timeout: Optional[str] = Field(default=None, description="") - adf_activity_polict_retry_interval: Optional[int] = Field(default=None, description="") - adf_activity_state: Optional[AdfActivityState] = Field(default=None, description="") + adf_activity_polict_retry_interval: Optional[int] = Field( + default=None, description="" + ) + adf_activity_state: Optional[AdfActivityState] = Field( + default=None, description="" + ) adf_activity_sources: Optional[Set[str]] = Field(default=None, description="") adf_activity_sinks: Optional[Set[str]] = Field(default=None, description="") adf_activity_source_type: Optional[str] = Field(default=None, description="") adf_activity_sink_type: Optional[str] = Field(default=None, description="") - adf_activity_runs: Optional[List[Dict[str, str]]] = Field(default=None, description="") + adf_activity_runs: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) adf_activity_notebook_path: Optional[str] = Field(default=None, description="") - adf_activity_main_class_name: Optional[str] = Field(default=None, description="") - adf_activity_python_file_path: Optional[str] = Field(default=None, description="") - adf_activity_first_row_only: Optional[bool] = Field(default=None, description="") + adf_activity_main_class_name: Optional[str] = Field( + default=None, description="" + ) + adf_activity_python_file_path: Optional[str] = Field( + default=None, description="" + ) + adf_activity_first_row_only: Optional[bool] = Field( + default=None, description="" + ) adf_activity_batch_count: Optional[int] = Field(default=None, description="") adf_activity_is_sequential: Optional[bool] = Field(default=None, description="") - adf_activity_sub_activities: Optional[Set[str]] = Field(default=None, description="") - adf_activity_reference_dataflow: Optional[str] = Field(default=None, description="") + adf_activity_sub_activities: Optional[Set[str]] = Field( + default=None, description="" + ) + adf_activity_reference_dataflow: Optional[str] = Field( + default=None, description="" + ) adf_pipeline_qualified_name: Optional[str] = Field(default=None, description="") - adf_linkedservices: Optional[List[AdfLinkedservice]] = Field(default=None, description="") # relationship - adf_datasets: Optional[List[AdfDataset]] = Field(default=None, description="") # relationship - processes: Optional[List[Process]] = Field(default=None, description="") # relationship - adf_pipeline: Optional[AdfPipeline] = Field(default=None, description="") # relationship - adf_dataflow: Optional[AdfDataflow] = Field(default=None, description="") # relationship + adf_linkedservices: Optional[List[AdfLinkedservice]] = Field( + default=None, description="" + ) # relationship + adf_datasets: Optional[List[AdfDataset]] = Field( + default=None, description="" + ) # relationship + processes: Optional[List[Process]] = Field( + default=None, description="" + ) # relationship + adf_pipeline: Optional[AdfPipeline] = Field( + default=None, description="" + ) # relationship + adf_dataflow: Optional[AdfDataflow] = Field( + default=None, description="" + ) # relationship attributes: AdfActivity.Attributes = Field( default_factory=lambda: AdfActivity.Attributes(), diff --git a/pyatlan/model/assets/core/adf_dataflow.py b/pyatlan/model/assets/core/adf_dataflow.py index 0d3ac81f5..99eb7a46a 100644 --- a/pyatlan/model/assets/core/adf_dataflow.py +++ b/pyatlan/model/assets/core/adf_dataflow.py @@ -29,15 +29,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ADF_DATAFLOW_SOURCES: ClassVar[TextField] = TextField("adfDataflowSources", "adfDataflowSources") + ADF_DATAFLOW_SOURCES: ClassVar[TextField] = TextField( + "adfDataflowSources", "adfDataflowSources" + ) """ The list of names of sources for this dataflow. """ - ADF_DATAFLOW_SINKS: ClassVar[TextField] = TextField("adfDataflowSinks", "adfDataflowSinks") + ADF_DATAFLOW_SINKS: ClassVar[TextField] = TextField( + "adfDataflowSinks", "adfDataflowSinks" + ) """ The list of names of sinks for this dataflow. """ - ADF_DATAFLOW_SCRIPT: ClassVar[TextField] = TextField("adfDataflowScript", "adfDataflowScript") + ADF_DATAFLOW_SCRIPT: ClassVar[TextField] = TextField( + "adfDataflowScript", "adfDataflowScript" + ) """ The gererated script for the dataflow. """ @@ -143,10 +149,18 @@ class Attributes(ADF.Attributes): adf_dataflow_sources: Optional[Set[str]] = Field(default=None, description="") adf_dataflow_sinks: Optional[Set[str]] = Field(default=None, description="") adf_dataflow_script: Optional[str] = Field(default=None, description="") - adf_linkedservices: Optional[List[AdfLinkedservice]] = Field(default=None, description="") # relationship - adf_datasets: Optional[List[AdfDataset]] = Field(default=None, description="") # relationship - adf_activities: Optional[List[AdfActivity]] = Field(default=None, description="") # relationship - adf_pipelines: Optional[List[AdfPipeline]] = Field(default=None, description="") # relationship + adf_linkedservices: Optional[List[AdfLinkedservice]] = Field( + default=None, description="" + ) # relationship + adf_datasets: Optional[List[AdfDataset]] = Field( + default=None, description="" + ) # relationship + adf_activities: Optional[List[AdfActivity]] = Field( + default=None, description="" + ) # relationship + adf_pipelines: Optional[List[AdfPipeline]] = Field( + default=None, description="" + ) # relationship attributes: AdfDataflow.Attributes = Field( default_factory=lambda: AdfDataflow.Attributes(), diff --git a/pyatlan/model/assets/core/adf_dataset.py b/pyatlan/model/assets/core/adf_dataset.py index d5845b5d4..fbe1c1e68 100644 --- a/pyatlan/model/assets/core/adf_dataset.py +++ b/pyatlan/model/assets/core/adf_dataset.py @@ -29,11 +29,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ADF_DATASET_TYPE: ClassVar[KeywordField] = KeywordField("adfDatasetType", "adfDatasetType") + ADF_DATASET_TYPE: ClassVar[KeywordField] = KeywordField( + "adfDatasetType", "adfDatasetType" + ) """ Defines the type of the dataset. """ - ADF_DATASET_ANNOTATIONS: ClassVar[TextField] = TextField("adfDatasetAnnotations", "adfDatasetAnnotations") + ADF_DATASET_ANNOTATIONS: ClassVar[TextField] = TextField( + "adfDatasetAnnotations", "adfDatasetAnnotations" + ) """ The list of annotation assigned to a dataset. """ @@ -43,15 +47,21 @@ def __setattr__(self, name, value): """ Defines the name of the linked service used to create this dataset. """ - ADF_DATASET_COLLECTION_NAME: ClassVar[TextField] = TextField("adfDatasetCollectionName", "adfDatasetCollectionName") + ADF_DATASET_COLLECTION_NAME: ClassVar[TextField] = TextField( + "adfDatasetCollectionName", "adfDatasetCollectionName" + ) """ Defines the name collection in the cosmos dataset. """ - ADF_DATASET_STORAGE_TYPE: ClassVar[TextField] = TextField("adfDatasetStorageType", "adfDatasetStorageType") + ADF_DATASET_STORAGE_TYPE: ClassVar[TextField] = TextField( + "adfDatasetStorageType", "adfDatasetStorageType" + ) """ Defines the storage type of storage file system dataset. """ - ADF_DATASET_FILE_NAME: ClassVar[TextField] = TextField("adfDatasetFileName", "adfDatasetFileName") + ADF_DATASET_FILE_NAME: ClassVar[TextField] = TextField( + "adfDatasetFileName", "adfDatasetFileName" + ) """ Defines the name of the file in the storage file system dataset. """ @@ -61,19 +71,27 @@ def __setattr__(self, name, value): """ Defines the folder path of the file in the storage file system dataset. """ - ADF_DATASET_CONTAINER_NAME: ClassVar[TextField] = TextField("adfDatasetContainerName", "adfDatasetContainerName") + ADF_DATASET_CONTAINER_NAME: ClassVar[TextField] = TextField( + "adfDatasetContainerName", "adfDatasetContainerName" + ) """ Defines the container or bucket name in the storage file system dataset. """ - ADF_DATASET_SCHEMA_NAME: ClassVar[TextField] = TextField("adfDatasetSchemaName", "adfDatasetSchemaName") + ADF_DATASET_SCHEMA_NAME: ClassVar[TextField] = TextField( + "adfDatasetSchemaName", "adfDatasetSchemaName" + ) """ Defines the name of the schema used in the snowflake, mssql, azure sql database type of dataset. """ - ADF_DATASET_TABLE_NAME: ClassVar[TextField] = TextField("adfDatasetTableName", "adfDatasetTableName") + ADF_DATASET_TABLE_NAME: ClassVar[TextField] = TextField( + "adfDatasetTableName", "adfDatasetTableName" + ) """ Defines the name of the table used in the snowflake, mssql, azure sql database type of dataset. """ - ADF_DATASET_DATABASE_NAME: ClassVar[TextField] = TextField("adfDatasetDatabaseName", "adfDatasetDatabaseName") + ADF_DATASET_DATABASE_NAME: ClassVar[TextField] = TextField( + "adfDatasetDatabaseName", "adfDatasetDatabaseName" + ) """ Defines the name of the database used in the azure delta lake type of dataset. """ @@ -125,7 +143,9 @@ def adf_dataset_type(self, adf_dataset_type: Optional[str]): @property def adf_dataset_annotations(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.adf_dataset_annotations + return ( + None if self.attributes is None else self.attributes.adf_dataset_annotations + ) @adf_dataset_annotations.setter def adf_dataset_annotations(self, adf_dataset_annotations: Optional[Set[str]]): @@ -135,7 +155,11 @@ def adf_dataset_annotations(self, adf_dataset_annotations: Optional[Set[str]]): @property def adf_dataset_linked_service(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_dataset_linked_service + return ( + None + if self.attributes is None + else self.attributes.adf_dataset_linked_service + ) @adf_dataset_linked_service.setter def adf_dataset_linked_service(self, adf_dataset_linked_service: Optional[str]): @@ -145,7 +169,11 @@ def adf_dataset_linked_service(self, adf_dataset_linked_service: Optional[str]): @property def adf_dataset_collection_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_dataset_collection_name + return ( + None + if self.attributes is None + else self.attributes.adf_dataset_collection_name + ) @adf_dataset_collection_name.setter def adf_dataset_collection_name(self, adf_dataset_collection_name: Optional[str]): @@ -155,7 +183,11 @@ def adf_dataset_collection_name(self, adf_dataset_collection_name: Optional[str] @property def adf_dataset_storage_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_dataset_storage_type + return ( + None + if self.attributes is None + else self.attributes.adf_dataset_storage_type + ) @adf_dataset_storage_type.setter def adf_dataset_storage_type(self, adf_dataset_storage_type: Optional[str]): @@ -165,7 +197,9 @@ def adf_dataset_storage_type(self, adf_dataset_storage_type: Optional[str]): @property def adf_dataset_file_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_dataset_file_name + return ( + None if self.attributes is None else self.attributes.adf_dataset_file_name + ) @adf_dataset_file_name.setter def adf_dataset_file_name(self, adf_dataset_file_name: Optional[str]): @@ -175,7 +209,11 @@ def adf_dataset_file_name(self, adf_dataset_file_name: Optional[str]): @property def adf_dataset_file_folder_path(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_dataset_file_folder_path + return ( + None + if self.attributes is None + else self.attributes.adf_dataset_file_folder_path + ) @adf_dataset_file_folder_path.setter def adf_dataset_file_folder_path(self, adf_dataset_file_folder_path: Optional[str]): @@ -185,7 +223,11 @@ def adf_dataset_file_folder_path(self, adf_dataset_file_folder_path: Optional[st @property def adf_dataset_container_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_dataset_container_name + return ( + None + if self.attributes is None + else self.attributes.adf_dataset_container_name + ) @adf_dataset_container_name.setter def adf_dataset_container_name(self, adf_dataset_container_name: Optional[str]): @@ -195,7 +237,9 @@ def adf_dataset_container_name(self, adf_dataset_container_name: Optional[str]): @property def adf_dataset_schema_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_dataset_schema_name + return ( + None if self.attributes is None else self.attributes.adf_dataset_schema_name + ) @adf_dataset_schema_name.setter def adf_dataset_schema_name(self, adf_dataset_schema_name: Optional[str]): @@ -205,7 +249,9 @@ def adf_dataset_schema_name(self, adf_dataset_schema_name: Optional[str]): @property def adf_dataset_table_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_dataset_table_name + return ( + None if self.attributes is None else self.attributes.adf_dataset_table_name + ) @adf_dataset_table_name.setter def adf_dataset_table_name(self, adf_dataset_table_name: Optional[str]): @@ -215,7 +261,11 @@ def adf_dataset_table_name(self, adf_dataset_table_name: Optional[str]): @property def adf_dataset_database_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_dataset_database_name + return ( + None + if self.attributes is None + else self.attributes.adf_dataset_database_name + ) @adf_dataset_database_name.setter def adf_dataset_database_name(self, adf_dataset_database_name: Optional[str]): @@ -265,20 +315,32 @@ def adf_pipelines(self, adf_pipelines: Optional[List[AdfPipeline]]): class Attributes(ADF.Attributes): adf_dataset_type: Optional[str] = Field(default=None, description="") - adf_dataset_annotations: Optional[Set[str]] = Field(default=None, description="") + adf_dataset_annotations: Optional[Set[str]] = Field( + default=None, description="" + ) adf_dataset_linked_service: Optional[str] = Field(default=None, description="") adf_dataset_collection_name: Optional[str] = Field(default=None, description="") adf_dataset_storage_type: Optional[str] = Field(default=None, description="") adf_dataset_file_name: Optional[str] = Field(default=None, description="") - adf_dataset_file_folder_path: Optional[str] = Field(default=None, description="") + adf_dataset_file_folder_path: Optional[str] = Field( + default=None, description="" + ) adf_dataset_container_name: Optional[str] = Field(default=None, description="") adf_dataset_schema_name: Optional[str] = Field(default=None, description="") adf_dataset_table_name: Optional[str] = Field(default=None, description="") adf_dataset_database_name: Optional[str] = Field(default=None, description="") - adf_linkedservice: Optional[AdfLinkedservice] = Field(default=None, description="") # relationship - adf_activities: Optional[List[AdfActivity]] = Field(default=None, description="") # relationship - adf_dataflows: Optional[List[AdfDataflow]] = Field(default=None, description="") # relationship - adf_pipelines: Optional[List[AdfPipeline]] = Field(default=None, description="") # relationship + adf_linkedservice: Optional[AdfLinkedservice] = Field( + default=None, description="" + ) # relationship + adf_activities: Optional[List[AdfActivity]] = Field( + default=None, description="" + ) # relationship + adf_dataflows: Optional[List[AdfDataflow]] = Field( + default=None, description="" + ) # relationship + adf_pipelines: Optional[List[AdfPipeline]] = Field( + default=None, description="" + ) # relationship attributes: AdfDataset.Attributes = Field( default_factory=lambda: AdfDataset.Attributes(), diff --git a/pyatlan/model/assets/core/adf_linkedservice.py b/pyatlan/model/assets/core/adf_linkedservice.py index ac72d16d4..36356fff5 100644 --- a/pyatlan/model/assets/core/adf_linkedservice.py +++ b/pyatlan/model/assets/core/adf_linkedservice.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - ADF_LINKEDSERVICE_TYPE: ClassVar[KeywordField] = KeywordField("adfLinkedserviceType", "adfLinkedserviceType") + ADF_LINKEDSERVICE_TYPE: ClassVar[KeywordField] = KeywordField( + "adfLinkedserviceType", "adfLinkedserviceType" + ) """ Defines the type of the linked service. """ @@ -62,7 +64,9 @@ def __setattr__(self, name, value): """ Indicates whether the service version is above 3.2 or not in the cosmos linked service. """ - ADF_LINKEDSERVICE_VERSION: ClassVar[TextField] = TextField("adfLinkedserviceVersion", "adfLinkedserviceVersion") + ADF_LINKEDSERVICE_VERSION: ClassVar[TextField] = TextField( + "adfLinkedserviceVersion", "adfLinkedserviceVersion" + ) """ Defines the version of the linked service in the cosmos linked service. """ @@ -78,7 +82,9 @@ def __setattr__(self, name, value): """ Defines the type of credential, authentication being used in the ADLS, snowflake, azure sql linked service. """ - ADF_LINKEDSERVICE_TENANT: ClassVar[TextField] = TextField("adfLinkedserviceTenant", "adfLinkedserviceTenant") + ADF_LINKEDSERVICE_TENANT: ClassVar[TextField] = TextField( + "adfLinkedserviceTenant", "adfLinkedserviceTenant" + ) """ Defines the tenant of cloud being used in the ADLS linked service. """ @@ -100,7 +106,9 @@ def __setattr__(self, name, value): """ Defines the resource id in the Azure databricks delta lake linked service. """ - ADF_LINKEDSERVICE_USER_NAME: ClassVar[TextField] = TextField("adfLinkedserviceUserName", "adfLinkedserviceUserName") + ADF_LINKEDSERVICE_USER_NAME: ClassVar[TextField] = TextField( + "adfLinkedserviceUserName", "adfLinkedserviceUserName" + ) """ Defines the name of the db user in the snowflake linked service. """ @@ -110,7 +118,9 @@ def __setattr__(self, name, value): """ Defines the name of the warehouse in the snowflake linked service. """ - ADF_LINKEDSERVICE_ROLE_NAME: ClassVar[TextField] = TextField("adfLinkedserviceRoleName", "adfLinkedserviceRoleName") + ADF_LINKEDSERVICE_ROLE_NAME: ClassVar[TextField] = TextField( + "adfLinkedserviceRoleName", "adfLinkedserviceRoleName" + ) """ Defines the name of the role in the snowflake linked service. """ @@ -156,7 +166,9 @@ def __setattr__(self, name, value): @property def adf_linkedservice_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_type + return ( + None if self.attributes is None else self.attributes.adf_linkedservice_type + ) @adf_linkedservice_type.setter def adf_linkedservice_type(self, adf_linkedservice_type: Optional[str]): @@ -166,47 +178,79 @@ def adf_linkedservice_type(self, adf_linkedservice_type: Optional[str]): @property def adf_linkedservice_annotations(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.adf_linkedservice_annotations + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_annotations + ) @adf_linkedservice_annotations.setter - def adf_linkedservice_annotations(self, adf_linkedservice_annotations: Optional[Set[str]]): + def adf_linkedservice_annotations( + self, adf_linkedservice_annotations: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adf_linkedservice_annotations = adf_linkedservice_annotations @property def adf_linkedservice_account_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_account_name + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_account_name + ) @adf_linkedservice_account_name.setter - def adf_linkedservice_account_name(self, adf_linkedservice_account_name: Optional[str]): + def adf_linkedservice_account_name( + self, adf_linkedservice_account_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adf_linkedservice_account_name = adf_linkedservice_account_name @property def adf_linkedservice_database_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_database_name + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_database_name + ) @adf_linkedservice_database_name.setter - def adf_linkedservice_database_name(self, adf_linkedservice_database_name: Optional[str]): + def adf_linkedservice_database_name( + self, adf_linkedservice_database_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_database_name = adf_linkedservice_database_name + self.attributes.adf_linkedservice_database_name = ( + adf_linkedservice_database_name + ) @property def adf_linkedservice_version_above(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.adf_linkedservice_version_above + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_version_above + ) @adf_linkedservice_version_above.setter - def adf_linkedservice_version_above(self, adf_linkedservice_version_above: Optional[bool]): + def adf_linkedservice_version_above( + self, adf_linkedservice_version_above: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_version_above = adf_linkedservice_version_above + self.attributes.adf_linkedservice_version_above = ( + adf_linkedservice_version_above + ) @property def adf_linkedservice_version(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_version + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_version + ) @adf_linkedservice_version.setter def adf_linkedservice_version(self, adf_linkedservice_version: Optional[str]): @@ -216,27 +260,47 @@ def adf_linkedservice_version(self, adf_linkedservice_version: Optional[str]): @property def adf_linkedservice_azure_cloud_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_azure_cloud_type + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_azure_cloud_type + ) @adf_linkedservice_azure_cloud_type.setter - def adf_linkedservice_azure_cloud_type(self, adf_linkedservice_azure_cloud_type: Optional[str]): + def adf_linkedservice_azure_cloud_type( + self, adf_linkedservice_azure_cloud_type: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_azure_cloud_type = adf_linkedservice_azure_cloud_type + self.attributes.adf_linkedservice_azure_cloud_type = ( + adf_linkedservice_azure_cloud_type + ) @property def adf_linkedservice_credential_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_credential_type + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_credential_type + ) @adf_linkedservice_credential_type.setter - def adf_linkedservice_credential_type(self, adf_linkedservice_credential_type: Optional[str]): + def adf_linkedservice_credential_type( + self, adf_linkedservice_credential_type: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_credential_type = adf_linkedservice_credential_type + self.attributes.adf_linkedservice_credential_type = ( + adf_linkedservice_credential_type + ) @property def adf_linkedservice_tenant(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_tenant + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_tenant + ) @adf_linkedservice_tenant.setter def adf_linkedservice_tenant(self, adf_linkedservice_tenant: Optional[str]): @@ -246,17 +310,29 @@ def adf_linkedservice_tenant(self, adf_linkedservice_tenant: Optional[str]): @property def adf_linkedservice_domain_endpoint(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_domain_endpoint + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_domain_endpoint + ) @adf_linkedservice_domain_endpoint.setter - def adf_linkedservice_domain_endpoint(self, adf_linkedservice_domain_endpoint: Optional[str]): + def adf_linkedservice_domain_endpoint( + self, adf_linkedservice_domain_endpoint: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_domain_endpoint = adf_linkedservice_domain_endpoint + self.attributes.adf_linkedservice_domain_endpoint = ( + adf_linkedservice_domain_endpoint + ) @property def adf_linkedservice_cluster_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_cluster_id + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_cluster_id + ) @adf_linkedservice_cluster_id.setter def adf_linkedservice_cluster_id(self, adf_linkedservice_cluster_id: Optional[str]): @@ -266,17 +342,27 @@ def adf_linkedservice_cluster_id(self, adf_linkedservice_cluster_id: Optional[st @property def adf_linkedservice_resource_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_resource_id + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_resource_id + ) @adf_linkedservice_resource_id.setter - def adf_linkedservice_resource_id(self, adf_linkedservice_resource_id: Optional[str]): + def adf_linkedservice_resource_id( + self, adf_linkedservice_resource_id: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.adf_linkedservice_resource_id = adf_linkedservice_resource_id @property def adf_linkedservice_user_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_user_name + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_user_name + ) @adf_linkedservice_user_name.setter def adf_linkedservice_user_name(self, adf_linkedservice_user_name: Optional[str]): @@ -286,17 +372,29 @@ def adf_linkedservice_user_name(self, adf_linkedservice_user_name: Optional[str] @property def adf_linkedservice_warehouse_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_warehouse_name + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_warehouse_name + ) @adf_linkedservice_warehouse_name.setter - def adf_linkedservice_warehouse_name(self, adf_linkedservice_warehouse_name: Optional[str]): + def adf_linkedservice_warehouse_name( + self, adf_linkedservice_warehouse_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.adf_linkedservice_warehouse_name = adf_linkedservice_warehouse_name + self.attributes.adf_linkedservice_warehouse_name = ( + adf_linkedservice_warehouse_name + ) @property def adf_linkedservice_role_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.adf_linkedservice_role_name + return ( + None + if self.attributes is None + else self.attributes.adf_linkedservice_role_name + ) @adf_linkedservice_role_name.setter def adf_linkedservice_role_name(self, adf_linkedservice_role_name: Optional[str]): @@ -346,24 +444,52 @@ def adf_pipelines(self, adf_pipelines: Optional[List[AdfPipeline]]): class Attributes(ADF.Attributes): adf_linkedservice_type: Optional[str] = Field(default=None, description="") - adf_linkedservice_annotations: Optional[Set[str]] = Field(default=None, description="") - adf_linkedservice_account_name: Optional[str] = Field(default=None, description="") - adf_linkedservice_database_name: Optional[str] = Field(default=None, description="") - adf_linkedservice_version_above: Optional[bool] = Field(default=None, description="") + adf_linkedservice_annotations: Optional[Set[str]] = Field( + default=None, description="" + ) + adf_linkedservice_account_name: Optional[str] = Field( + default=None, description="" + ) + adf_linkedservice_database_name: Optional[str] = Field( + default=None, description="" + ) + adf_linkedservice_version_above: Optional[bool] = Field( + default=None, description="" + ) adf_linkedservice_version: Optional[str] = Field(default=None, description="") - adf_linkedservice_azure_cloud_type: Optional[str] = Field(default=None, description="") - adf_linkedservice_credential_type: Optional[str] = Field(default=None, description="") + adf_linkedservice_azure_cloud_type: Optional[str] = Field( + default=None, description="" + ) + adf_linkedservice_credential_type: Optional[str] = Field( + default=None, description="" + ) adf_linkedservice_tenant: Optional[str] = Field(default=None, description="") - adf_linkedservice_domain_endpoint: Optional[str] = Field(default=None, description="") - adf_linkedservice_cluster_id: Optional[str] = Field(default=None, description="") - adf_linkedservice_resource_id: Optional[str] = Field(default=None, description="") + adf_linkedservice_domain_endpoint: Optional[str] = Field( + default=None, description="" + ) + adf_linkedservice_cluster_id: Optional[str] = Field( + default=None, description="" + ) + adf_linkedservice_resource_id: Optional[str] = Field( + default=None, description="" + ) adf_linkedservice_user_name: Optional[str] = Field(default=None, description="") - adf_linkedservice_warehouse_name: Optional[str] = Field(default=None, description="") + adf_linkedservice_warehouse_name: Optional[str] = Field( + default=None, description="" + ) adf_linkedservice_role_name: Optional[str] = Field(default=None, description="") - adf_datasets: Optional[List[AdfDataset]] = Field(default=None, description="") # relationship - adf_activities: Optional[List[AdfActivity]] = Field(default=None, description="") # relationship - adf_dataflows: Optional[List[AdfDataflow]] = Field(default=None, description="") # relationship - adf_pipelines: Optional[List[AdfPipeline]] = Field(default=None, description="") # relationship + adf_datasets: Optional[List[AdfDataset]] = Field( + default=None, description="" + ) # relationship + adf_activities: Optional[List[AdfActivity]] = Field( + default=None, description="" + ) # relationship + adf_dataflows: Optional[List[AdfDataflow]] = Field( + default=None, description="" + ) # relationship + adf_pipelines: Optional[List[AdfPipeline]] = Field( + default=None, description="" + ) # relationship attributes: AdfLinkedservice.Attributes = Field( default_factory=lambda: AdfLinkedservice.Attributes(), diff --git a/pyatlan/model/assets/core/adf_pipeline.py b/pyatlan/model/assets/core/adf_pipeline.py index 4cd82d152..74a5e3425 100644 --- a/pyatlan/model/assets/core/adf_pipeline.py +++ b/pyatlan/model/assets/core/adf_pipeline.py @@ -40,11 +40,15 @@ def __setattr__(self, name, value): """ Defines the count of activities in the pipline. """ - ADF_PIPELINE_RUNS: ClassVar[KeywordField] = KeywordField("adfPipelineRuns", "adfPipelineRuns") + ADF_PIPELINE_RUNS: ClassVar[KeywordField] = KeywordField( + "adfPipelineRuns", "adfPipelineRuns" + ) """ List of objects of pipeline runs for a particular pipeline. """ - ADF_PIPELINE_ANNOTATIONS: ClassVar[TextField] = TextField("adfPipelineAnnotations", "adfPipelineAnnotations") + ADF_PIPELINE_ANNOTATIONS: ClassVar[TextField] = TextField( + "adfPipelineAnnotations", "adfPipelineAnnotations" + ) """ The list of annotation assigned to a pipeline. """ @@ -78,7 +82,11 @@ def __setattr__(self, name, value): @property def adf_pipeline_activity_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.adf_pipeline_activity_count + return ( + None + if self.attributes is None + else self.attributes.adf_pipeline_activity_count + ) @adf_pipeline_activity_count.setter def adf_pipeline_activity_count(self, adf_pipeline_activity_count: Optional[int]): @@ -98,7 +106,11 @@ def adf_pipeline_runs(self, adf_pipeline_runs: Optional[List[Dict[str, str]]]): @property def adf_pipeline_annotations(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.adf_pipeline_annotations + return ( + None + if self.attributes is None + else self.attributes.adf_pipeline_annotations + ) @adf_pipeline_annotations.setter def adf_pipeline_annotations(self, adf_pipeline_annotations: Optional[Set[str]]): @@ -148,12 +160,24 @@ def adf_dataflows(self, adf_dataflows: Optional[List[AdfDataflow]]): class Attributes(ADF.Attributes): adf_pipeline_activity_count: Optional[int] = Field(default=None, description="") - adf_pipeline_runs: Optional[List[Dict[str, str]]] = Field(default=None, description="") - adf_pipeline_annotations: Optional[Set[str]] = Field(default=None, description="") - adf_linkedservices: Optional[List[AdfLinkedservice]] = Field(default=None, description="") # relationship - adf_datasets: Optional[List[AdfDataset]] = Field(default=None, description="") # relationship - adf_activities: Optional[List[AdfActivity]] = Field(default=None, description="") # relationship - adf_dataflows: Optional[List[AdfDataflow]] = Field(default=None, description="") # relationship + adf_pipeline_runs: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + adf_pipeline_annotations: Optional[Set[str]] = Field( + default=None, description="" + ) + adf_linkedservices: Optional[List[AdfLinkedservice]] = Field( + default=None, description="" + ) # relationship + adf_datasets: Optional[List[AdfDataset]] = Field( + default=None, description="" + ) # relationship + adf_activities: Optional[List[AdfActivity]] = Field( + default=None, description="" + ) # relationship + adf_dataflows: Optional[List[AdfDataflow]] = Field( + default=None, description="" + ) # relationship attributes: AdfPipeline.Attributes = Field( default_factory=lambda: AdfPipeline.Attributes(), diff --git a/pyatlan/model/assets/core/airflow.py b/pyatlan/model/assets/core/airflow.py index 7a83a92a4..811b624d6 100644 --- a/pyatlan/model/assets/core/airflow.py +++ b/pyatlan/model/assets/core/airflow.py @@ -35,7 +35,9 @@ def __setattr__(self, name, value): """ Tags assigned to the asset in Airflow. """ - AIRFLOW_RUN_VERSION: ClassVar[KeywordField] = KeywordField("airflowRunVersion", "airflowRunVersion") + AIRFLOW_RUN_VERSION: ClassVar[KeywordField] = KeywordField( + "airflowRunVersion", "airflowRunVersion" + ) """ Version of the run in Airflow. """ @@ -45,19 +47,27 @@ def __setattr__(self, name, value): """ Version of the run in OpenLineage. """ - AIRFLOW_RUN_NAME: ClassVar[KeywordField] = KeywordField("airflowRunName", "airflowRunName") + AIRFLOW_RUN_NAME: ClassVar[KeywordField] = KeywordField( + "airflowRunName", "airflowRunName" + ) """ Name of the run. """ - AIRFLOW_RUN_TYPE: ClassVar[KeywordField] = KeywordField("airflowRunType", "airflowRunType") + AIRFLOW_RUN_TYPE: ClassVar[KeywordField] = KeywordField( + "airflowRunType", "airflowRunType" + ) """ Type of the run. """ - AIRFLOW_RUN_START_TIME: ClassVar[NumericField] = NumericField("airflowRunStartTime", "airflowRunStartTime") + AIRFLOW_RUN_START_TIME: ClassVar[NumericField] = NumericField( + "airflowRunStartTime", "airflowRunStartTime" + ) """ Start time of the run. """ - AIRFLOW_RUN_END_TIME: ClassVar[NumericField] = NumericField("airflowRunEndTime", "airflowRunEndTime") + AIRFLOW_RUN_END_TIME: ClassVar[NumericField] = NumericField( + "airflowRunEndTime", "airflowRunEndTime" + ) """ End time of the run. """ @@ -101,13 +111,21 @@ def airflow_run_version(self, airflow_run_version: Optional[str]): @property def airflow_run_open_lineage_version(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.airflow_run_open_lineage_version + return ( + None + if self.attributes is None + else self.attributes.airflow_run_open_lineage_version + ) @airflow_run_open_lineage_version.setter - def airflow_run_open_lineage_version(self, airflow_run_open_lineage_version: Optional[str]): + def airflow_run_open_lineage_version( + self, airflow_run_open_lineage_version: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.airflow_run_open_lineage_version = airflow_run_open_lineage_version + self.attributes.airflow_run_open_lineage_version = ( + airflow_run_open_lineage_version + ) @property def airflow_run_name(self) -> Optional[str]: @@ -131,7 +149,9 @@ def airflow_run_type(self, airflow_run_type: Optional[str]): @property def airflow_run_start_time(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.airflow_run_start_time + return ( + None if self.attributes is None else self.attributes.airflow_run_start_time + ) @airflow_run_start_time.setter def airflow_run_start_time(self, airflow_run_start_time: Optional[datetime]): @@ -151,10 +171,16 @@ def airflow_run_end_time(self, airflow_run_end_time: Optional[datetime]): @property def airflow_run_open_lineage_state(self) -> Optional[OpenLineageRunState]: - return None if self.attributes is None else self.attributes.airflow_run_open_lineage_state + return ( + None + if self.attributes is None + else self.attributes.airflow_run_open_lineage_state + ) @airflow_run_open_lineage_state.setter - def airflow_run_open_lineage_state(self, airflow_run_open_lineage_state: Optional[OpenLineageRunState]): + def airflow_run_open_lineage_state( + self, airflow_run_open_lineage_state: Optional[OpenLineageRunState] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.airflow_run_open_lineage_state = airflow_run_open_lineage_state @@ -162,12 +188,16 @@ def airflow_run_open_lineage_state(self, airflow_run_open_lineage_state: Optiona class Attributes(Catalog.Attributes): airflow_tags: Optional[Set[str]] = Field(default=None, description="") airflow_run_version: Optional[str] = Field(default=None, description="") - airflow_run_open_lineage_version: Optional[str] = Field(default=None, description="") + airflow_run_open_lineage_version: Optional[str] = Field( + default=None, description="" + ) airflow_run_name: Optional[str] = Field(default=None, description="") airflow_run_type: Optional[str] = Field(default=None, description="") airflow_run_start_time: Optional[datetime] = Field(default=None, description="") airflow_run_end_time: Optional[datetime] = Field(default=None, description="") - airflow_run_open_lineage_state: Optional[OpenLineageRunState] = Field(default=None, description="") + airflow_run_open_lineage_state: Optional[OpenLineageRunState] = Field( + default=None, description="" + ) attributes: Airflow.Attributes = Field( default_factory=lambda: Airflow.Attributes(), diff --git a/pyatlan/model/assets/core/airflow_dag.py b/pyatlan/model/assets/core/airflow_dag.py index 15fd7053d..63eeaeece 100644 --- a/pyatlan/model/assets/core/airflow_dag.py +++ b/pyatlan/model/assets/core/airflow_dag.py @@ -49,7 +49,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - AIRFLOW_DAG_SCHEDULE: ClassVar[KeywordField] = KeywordField("airflowDagSchedule", "airflowDagSchedule") + AIRFLOW_DAG_SCHEDULE: ClassVar[KeywordField] = KeywordField( + "airflowDagSchedule", "airflowDagSchedule" + ) """ Schedule for the DAG. """ @@ -83,7 +85,11 @@ def airflow_dag_schedule(self, airflow_dag_schedule: Optional[str]): @property def airflow_dag_schedule_delta(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.airflow_dag_schedule_delta + return ( + None + if self.attributes is None + else self.attributes.airflow_dag_schedule_delta + ) @airflow_dag_schedule_delta.setter def airflow_dag_schedule_delta(self, airflow_dag_schedule_delta: Optional[int]): @@ -104,7 +110,9 @@ def airflow_tasks(self, airflow_tasks: Optional[List[AirflowTask]]): class Attributes(Airflow.Attributes): airflow_dag_schedule: Optional[str] = Field(default=None, description="") airflow_dag_schedule_delta: Optional[int] = Field(default=None, description="") - airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship + airflow_tasks: Optional[List[AirflowTask]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -114,12 +122,16 @@ def creator( name: str, connection_qualified_name: str, ) -> AirflowDag.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return AirflowDag.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: AirflowDag.Attributes = Field( diff --git a/pyatlan/model/assets/core/airflow_task.py b/pyatlan/model/assets/core/airflow_task.py index 37de54293..9c1ec11c7 100644 --- a/pyatlan/model/assets/core/airflow_task.py +++ b/pyatlan/model/assets/core/airflow_task.py @@ -104,23 +104,33 @@ def __setattr__(self, name, value): """ Identifier for the connection this task accesses. """ - AIRFLOW_TASK_SQL: ClassVar[TextField] = TextField("airflowTaskSql", "airflowTaskSql") + AIRFLOW_TASK_SQL: ClassVar[TextField] = TextField( + "airflowTaskSql", "airflowTaskSql" + ) """ SQL code that executes through this task. """ - AIRFLOW_TASK_RETRY_NUMBER: ClassVar[NumericField] = NumericField("airflowTaskRetryNumber", "airflowTaskRetryNumber") + AIRFLOW_TASK_RETRY_NUMBER: ClassVar[NumericField] = NumericField( + "airflowTaskRetryNumber", "airflowTaskRetryNumber" + ) """ Retry count for this task running. """ - AIRFLOW_TASK_POOL: ClassVar[KeywordField] = KeywordField("airflowTaskPool", "airflowTaskPool") + AIRFLOW_TASK_POOL: ClassVar[KeywordField] = KeywordField( + "airflowTaskPool", "airflowTaskPool" + ) """ Pool on which this run happened. """ - AIRFLOW_TASK_POOL_SLOTS: ClassVar[NumericField] = NumericField("airflowTaskPoolSlots", "airflowTaskPoolSlots") + AIRFLOW_TASK_POOL_SLOTS: ClassVar[NumericField] = NumericField( + "airflowTaskPoolSlots", "airflowTaskPoolSlots" + ) """ Pool slots used for the run. """ - AIRFLOW_TASK_QUEUE: ClassVar[KeywordField] = KeywordField("airflowTaskQueue", "airflowTaskQueue") + AIRFLOW_TASK_QUEUE: ClassVar[KeywordField] = KeywordField( + "airflowTaskQueue", "airflowTaskQueue" + ) """ Queue on which this run happened. """ @@ -130,11 +140,15 @@ def __setattr__(self, name, value): """ Priority of the run. """ - AIRFLOW_TASK_TRIGGER_RULE: ClassVar[KeywordField] = KeywordField("airflowTaskTriggerRule", "airflowTaskTriggerRule") + AIRFLOW_TASK_TRIGGER_RULE: ClassVar[KeywordField] = KeywordField( + "airflowTaskTriggerRule", "airflowTaskTriggerRule" + ) """ Trigger for the run. """ - AIRFLOW_TASK_GROUP_NAME: ClassVar[KeywordField] = KeywordField("airflowTaskGroupName", "airflowTaskGroupName") + AIRFLOW_TASK_GROUP_NAME: ClassVar[KeywordField] = KeywordField( + "airflowTaskGroupName", "airflowTaskGroupName" + ) """ Group name for the task. """ @@ -177,7 +191,11 @@ def __setattr__(self, name, value): @property def airflow_task_operator_class(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.airflow_task_operator_class + return ( + None + if self.attributes is None + else self.attributes.airflow_task_operator_class + ) @airflow_task_operator_class.setter def airflow_task_operator_class(self, airflow_task_operator_class: Optional[str]): @@ -197,7 +215,11 @@ def airflow_dag_name(self, airflow_dag_name: Optional[str]): @property def airflow_dag_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.airflow_dag_qualified_name + return ( + None + if self.attributes is None + else self.attributes.airflow_dag_qualified_name + ) @airflow_dag_qualified_name.setter def airflow_dag_qualified_name(self, airflow_dag_qualified_name: Optional[str]): @@ -207,7 +229,11 @@ def airflow_dag_qualified_name(self, airflow_dag_qualified_name: Optional[str]): @property def airflow_task_connection_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.airflow_task_connection_id + return ( + None + if self.attributes is None + else self.attributes.airflow_task_connection_id + ) @airflow_task_connection_id.setter def airflow_task_connection_id(self, airflow_task_connection_id: Optional[str]): @@ -227,7 +253,11 @@ def airflow_task_sql(self, airflow_task_sql: Optional[str]): @property def airflow_task_retry_number(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.airflow_task_retry_number + return ( + None + if self.attributes is None + else self.attributes.airflow_task_retry_number + ) @airflow_task_retry_number.setter def airflow_task_retry_number(self, airflow_task_retry_number: Optional[int]): @@ -247,7 +277,9 @@ def airflow_task_pool(self, airflow_task_pool: Optional[str]): @property def airflow_task_pool_slots(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.airflow_task_pool_slots + return ( + None if self.attributes is None else self.attributes.airflow_task_pool_slots + ) @airflow_task_pool_slots.setter def airflow_task_pool_slots(self, airflow_task_pool_slots: Optional[int]): @@ -267,7 +299,11 @@ def airflow_task_queue(self, airflow_task_queue: Optional[str]): @property def airflow_task_priority_weight(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.airflow_task_priority_weight + return ( + None + if self.attributes is None + else self.attributes.airflow_task_priority_weight + ) @airflow_task_priority_weight.setter def airflow_task_priority_weight(self, airflow_task_priority_weight: Optional[int]): @@ -277,7 +313,11 @@ def airflow_task_priority_weight(self, airflow_task_priority_weight: Optional[in @property def airflow_task_trigger_rule(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.airflow_task_trigger_rule + return ( + None + if self.attributes is None + else self.attributes.airflow_task_trigger_rule + ) @airflow_task_trigger_rule.setter def airflow_task_trigger_rule(self, airflow_task_trigger_rule: Optional[str]): @@ -287,7 +327,9 @@ def airflow_task_trigger_rule(self, airflow_task_trigger_rule: Optional[str]): @property def airflow_task_group_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.airflow_task_group_name + return ( + None if self.attributes is None else self.attributes.airflow_task_group_name + ) @airflow_task_group_name.setter def airflow_task_group_name(self, airflow_task_group_name: Optional[str]): @@ -345,13 +387,21 @@ class Attributes(Airflow.Attributes): airflow_task_pool: Optional[str] = Field(default=None, description="") airflow_task_pool_slots: Optional[int] = Field(default=None, description="") airflow_task_queue: Optional[str] = Field(default=None, description="") - airflow_task_priority_weight: Optional[int] = Field(default=None, description="") + airflow_task_priority_weight: Optional[int] = Field( + default=None, description="" + ) airflow_task_trigger_rule: Optional[str] = Field(default=None, description="") airflow_task_group_name: Optional[str] = Field(default=None, description="") - outputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship - inputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship + outputs: Optional[List[Catalog]] = Field( + default=None, description="" + ) # relationship + inputs: Optional[List[Catalog]] = Field( + default=None, description="" + ) # relationship process: Optional[Process] = Field(default=None, description="") # relationship - airflow_dag: Optional[AirflowDag] = Field(default=None, description="") # relationship + airflow_dag: Optional[AirflowDag] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -367,7 +417,9 @@ def creator( [name, airflow_dag_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( airflow_dag_qualified_name, "airflow_dag_qualified_name", 4 @@ -379,7 +431,9 @@ def creator( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{airflow_dag_qualified_name}/{name}", connector_name=connector_name, - airflow_dag=AirflowDag.ref_by_qualified_name(airflow_dag_qualified_name), + airflow_dag=AirflowDag.ref_by_qualified_name( + airflow_dag_qualified_name + ), ) attributes: AirflowTask.Attributes = Field( diff --git a/pyatlan/model/assets/core/anomalo_check.py b/pyatlan/model/assets/core/anomalo_check.py index 5439cd0ad..203ce870d 100644 --- a/pyatlan/model/assets/core/anomalo_check.py +++ b/pyatlan/model/assets/core/anomalo_check.py @@ -48,7 +48,9 @@ def __setattr__(self, name, value): """ Category type of the check in Anomalo """ - ANOMALO_CHECK_TYPE: ClassVar[KeywordField] = KeywordField("anomaloCheckType", "anomaloCheckType") + ANOMALO_CHECK_TYPE: ClassVar[KeywordField] = KeywordField( + "anomaloCheckType", "anomaloCheckType" + ) """ Type of check in Anomalo """ @@ -64,7 +66,9 @@ def __setattr__(self, name, value): """ Flag to indicate if the check is an out of the box available check """ - ANOMALO_CHECK_STATUS: ClassVar[KeywordField] = KeywordField("anomaloCheckStatus", "anomaloCheckStatus") + ANOMALO_CHECK_STATUS: ClassVar[KeywordField] = KeywordField( + "anomaloCheckStatus", "anomaloCheckStatus" + ) """ Status of the check in Anomalo """ @@ -86,7 +90,9 @@ def __setattr__(self, name, value): """ Evaluated message of the latest check run. """ - ANOMALO_CHECK_LAST_RUN_URL: ClassVar[TextField] = TextField("anomaloCheckLastRunUrl", "anomaloCheckLastRunUrl") + ANOMALO_CHECK_LAST_RUN_URL: ClassVar[TextField] = TextField( + "anomaloCheckLastRunUrl", "anomaloCheckLastRunUrl" + ) """ URL to the latest check run. """ @@ -119,17 +125,29 @@ def __setattr__(self, name, value): @property def anomalo_check_linked_asset_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anomalo_check_linked_asset_qualified_name + return ( + None + if self.attributes is None + else self.attributes.anomalo_check_linked_asset_qualified_name + ) @anomalo_check_linked_asset_qualified_name.setter - def anomalo_check_linked_asset_qualified_name(self, anomalo_check_linked_asset_qualified_name: Optional[str]): + def anomalo_check_linked_asset_qualified_name( + self, anomalo_check_linked_asset_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anomalo_check_linked_asset_qualified_name = anomalo_check_linked_asset_qualified_name + self.attributes.anomalo_check_linked_asset_qualified_name = ( + anomalo_check_linked_asset_qualified_name + ) @property def anomalo_check_category_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anomalo_check_category_type + return ( + None + if self.attributes is None + else self.attributes.anomalo_check_category_type + ) @anomalo_check_category_type.setter def anomalo_check_category_type(self, anomalo_check_category_type: Optional[str]): @@ -149,7 +167,11 @@ def anomalo_check_type(self, anomalo_check_type: Optional[str]): @property def anomalo_check_priority_level(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anomalo_check_priority_level + return ( + None + if self.attributes is None + else self.attributes.anomalo_check_priority_level + ) @anomalo_check_priority_level.setter def anomalo_check_priority_level(self, anomalo_check_priority_level: Optional[str]): @@ -159,10 +181,16 @@ def anomalo_check_priority_level(self, anomalo_check_priority_level: Optional[st @property def anomalo_check_is_system_added(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.anomalo_check_is_system_added + return ( + None + if self.attributes is None + else self.attributes.anomalo_check_is_system_added + ) @anomalo_check_is_system_added.setter - def anomalo_check_is_system_added(self, anomalo_check_is_system_added: Optional[bool]): + def anomalo_check_is_system_added( + self, anomalo_check_is_system_added: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anomalo_check_is_system_added = anomalo_check_is_system_added @@ -179,37 +207,63 @@ def anomalo_check_status(self, anomalo_check_status: Optional[str]): @property def anomalo_check_status_image_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anomalo_check_status_image_url + return ( + None + if self.attributes is None + else self.attributes.anomalo_check_status_image_url + ) @anomalo_check_status_image_url.setter - def anomalo_check_status_image_url(self, anomalo_check_status_image_url: Optional[str]): + def anomalo_check_status_image_url( + self, anomalo_check_status_image_url: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.anomalo_check_status_image_url = anomalo_check_status_image_url @property def anomalo_check_last_run_completed_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.anomalo_check_last_run_completed_at + return ( + None + if self.attributes is None + else self.attributes.anomalo_check_last_run_completed_at + ) @anomalo_check_last_run_completed_at.setter - def anomalo_check_last_run_completed_at(self, anomalo_check_last_run_completed_at: Optional[datetime]): + def anomalo_check_last_run_completed_at( + self, anomalo_check_last_run_completed_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anomalo_check_last_run_completed_at = anomalo_check_last_run_completed_at + self.attributes.anomalo_check_last_run_completed_at = ( + anomalo_check_last_run_completed_at + ) @property def anomalo_check_last_run_evaluated_message(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anomalo_check_last_run_evaluated_message + return ( + None + if self.attributes is None + else self.attributes.anomalo_check_last_run_evaluated_message + ) @anomalo_check_last_run_evaluated_message.setter - def anomalo_check_last_run_evaluated_message(self, anomalo_check_last_run_evaluated_message: Optional[str]): + def anomalo_check_last_run_evaluated_message( + self, anomalo_check_last_run_evaluated_message: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anomalo_check_last_run_evaluated_message = anomalo_check_last_run_evaluated_message + self.attributes.anomalo_check_last_run_evaluated_message = ( + anomalo_check_last_run_evaluated_message + ) @property def anomalo_check_last_run_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anomalo_check_last_run_url + return ( + None + if self.attributes is None + else self.attributes.anomalo_check_last_run_url + ) @anomalo_check_last_run_url.setter def anomalo_check_last_run_url(self, anomalo_check_last_run_url: Optional[str]): @@ -219,13 +273,21 @@ def anomalo_check_last_run_url(self, anomalo_check_last_run_url: Optional[str]): @property def anomalo_check_historic_run_status(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.anomalo_check_historic_run_status + return ( + None + if self.attributes is None + else self.attributes.anomalo_check_historic_run_status + ) @anomalo_check_historic_run_status.setter - def anomalo_check_historic_run_status(self, anomalo_check_historic_run_status: Optional[str]): + def anomalo_check_historic_run_status( + self, anomalo_check_historic_run_status: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.anomalo_check_historic_run_status = anomalo_check_historic_run_status + self.attributes.anomalo_check_historic_run_status = ( + anomalo_check_historic_run_status + ) @property def anomalo_check_asset(self) -> Optional[Asset]: @@ -238,18 +300,34 @@ def anomalo_check_asset(self, anomalo_check_asset: Optional[Asset]): self.attributes.anomalo_check_asset = anomalo_check_asset class Attributes(Anomalo.Attributes): - anomalo_check_linked_asset_qualified_name: Optional[str] = Field(default=None, description="") + anomalo_check_linked_asset_qualified_name: Optional[str] = Field( + default=None, description="" + ) anomalo_check_category_type: Optional[str] = Field(default=None, description="") anomalo_check_type: Optional[str] = Field(default=None, description="") - anomalo_check_priority_level: Optional[str] = Field(default=None, description="") - anomalo_check_is_system_added: Optional[bool] = Field(default=None, description="") + anomalo_check_priority_level: Optional[str] = Field( + default=None, description="" + ) + anomalo_check_is_system_added: Optional[bool] = Field( + default=None, description="" + ) anomalo_check_status: Optional[str] = Field(default=None, description="") - anomalo_check_status_image_url: Optional[str] = Field(default=None, description="") - anomalo_check_last_run_completed_at: Optional[datetime] = Field(default=None, description="") - anomalo_check_last_run_evaluated_message: Optional[str] = Field(default=None, description="") + anomalo_check_status_image_url: Optional[str] = Field( + default=None, description="" + ) + anomalo_check_last_run_completed_at: Optional[datetime] = Field( + default=None, description="" + ) + anomalo_check_last_run_evaluated_message: Optional[str] = Field( + default=None, description="" + ) anomalo_check_last_run_url: Optional[str] = Field(default=None, description="") - anomalo_check_historic_run_status: Optional[str] = Field(default=None, description="") - anomalo_check_asset: Optional[Asset] = Field(default=None, description="") # relationship + anomalo_check_historic_run_status: Optional[str] = Field( + default=None, description="" + ) + anomalo_check_asset: Optional[Asset] = Field( + default=None, description="" + ) # relationship attributes: AnomaloCheck.Attributes = Field( default_factory=lambda: AnomaloCheck.Attributes(), diff --git a/pyatlan/model/assets/core/application.py b/pyatlan/model/assets/core/application.py index 89590f64c..241c9fd36 100644 --- a/pyatlan/model/assets/core/application.py +++ b/pyatlan/model/assets/core/application.py @@ -26,7 +26,9 @@ def creator( name: str, connection_qualified_name: str, ) -> Application: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) attributes = Application.Attributes.creator( name=name, connection_qualified_name=connection_qualified_name, @@ -46,11 +48,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - APPLICATION_OWNED_ASSETS: ClassVar[RelationField] = RelationField("applicationOwnedAssets") + APPLICATION_OWNED_ASSETS: ClassVar[RelationField] = RelationField( + "applicationOwnedAssets" + ) """ TBC """ - APPLICATION_CHILD_FIELDS: ClassVar[RelationField] = RelationField("applicationChildFields") + APPLICATION_CHILD_FIELDS: ClassVar[RelationField] = RelationField( + "applicationChildFields" + ) """ TBC """ @@ -62,7 +68,11 @@ def __setattr__(self, name, value): @property def application_owned_assets(self) -> Optional[List[Asset]]: - return None if self.attributes is None else self.attributes.application_owned_assets + return ( + None + if self.attributes is None + else self.attributes.application_owned_assets + ) @application_owned_assets.setter def application_owned_assets(self, application_owned_assets: Optional[List[Asset]]): @@ -72,17 +82,27 @@ def application_owned_assets(self, application_owned_assets: Optional[List[Asset @property def application_child_fields(self) -> Optional[List[ApplicationField]]: - return None if self.attributes is None else self.attributes.application_child_fields + return ( + None + if self.attributes is None + else self.attributes.application_child_fields + ) @application_child_fields.setter - def application_child_fields(self, application_child_fields: Optional[List[ApplicationField]]): + def application_child_fields( + self, application_child_fields: Optional[List[ApplicationField]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.application_child_fields = application_child_fields class Attributes(App.Attributes): - application_owned_assets: Optional[List[Asset]] = Field(default=None, description="") # relationship - application_child_fields: Optional[List[ApplicationField]] = Field(default=None, description="") # relationship + application_owned_assets: Optional[List[Asset]] = Field( + default=None, description="" + ) # relationship + application_child_fields: Optional[List[ApplicationField]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -92,12 +112,16 @@ def creator( name: str, connection_qualified_name: str, ) -> Application.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return Application.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: Application.Attributes = Field( diff --git a/pyatlan/model/assets/core/application_field.py b/pyatlan/model/assets/core/application_field.py index 2baaa8db5..8354700df 100644 --- a/pyatlan/model/assets/core/application_field.py +++ b/pyatlan/model/assets/core/application_field.py @@ -46,7 +46,9 @@ def creator( application_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> ApplicationField: - validate_required_fields(["name", "application_qualified_name"], [name, application_qualified_name]) + validate_required_fields( + ["name", "application_qualified_name"], [name, application_qualified_name] + ) attributes = ApplicationField.Attributes.create( name=name, application_qualified_name=application_qualified_name, @@ -78,7 +80,9 @@ def __setattr__(self, name, value): """ TBC """ - APPLICATION_FIELD_OWNED_ASSETS: ClassVar[RelationField] = RelationField("applicationFieldOwnedAssets") + APPLICATION_FIELD_OWNED_ASSETS: ClassVar[RelationField] = RelationField( + "applicationFieldOwnedAssets" + ) """ TBC """ @@ -91,13 +95,21 @@ def __setattr__(self, name, value): @property def application_parent_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.application_parent_qualified_name + return ( + None + if self.attributes is None + else self.attributes.application_parent_qualified_name + ) @application_parent_qualified_name.setter - def application_parent_qualified_name(self, application_parent_qualified_name: Optional[str]): + def application_parent_qualified_name( + self, application_parent_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.application_parent_qualified_name = application_parent_qualified_name + self.attributes.application_parent_qualified_name = ( + application_parent_qualified_name + ) @property def application_parent(self) -> Optional[Application]: @@ -111,18 +123,30 @@ def application_parent(self, application_parent: Optional[Application]): @property def application_field_owned_assets(self) -> Optional[List[Asset]]: - return None if self.attributes is None else self.attributes.application_field_owned_assets + return ( + None + if self.attributes is None + else self.attributes.application_field_owned_assets + ) @application_field_owned_assets.setter - def application_field_owned_assets(self, application_field_owned_assets: Optional[List[Asset]]): + def application_field_owned_assets( + self, application_field_owned_assets: Optional[List[Asset]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.application_field_owned_assets = application_field_owned_assets class Attributes(App.Attributes): - application_parent_qualified_name: Optional[str] = Field(default=None, description="") - application_parent: Optional[Application] = Field(default=None, description="") # relationship - application_field_owned_assets: Optional[List[Asset]] = Field(default=None, description="") # relationship + application_parent_qualified_name: Optional[str] = Field( + default=None, description="" + ) + application_parent: Optional[Application] = Field( + default=None, description="" + ) # relationship + application_field_owned_assets: Optional[List[Asset]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -138,7 +162,9 @@ def create( [name, application_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( application_qualified_name, "application_qualified_name", 4 @@ -150,7 +176,9 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, connector_name=connector_name, application_parent_qualified_name=application_qualified_name, - application_parent=Application.ref_by_qualified_name(application_qualified_name), + application_parent=Application.ref_by_qualified_name( + application_qualified_name + ), ) attributes: ApplicationField.Attributes = Field( diff --git a/pyatlan/model/assets/core/asset.py b/pyatlan/model/assets/core/asset.py index 154a13d15..3f3c4a890 100644 --- a/pyatlan/model/assets/core/asset.py +++ b/pyatlan/model/assets/core/asset.py @@ -46,7 +46,9 @@ def __init_subclass__(cls, type_name=None): cls._subtypes_[type_name or cls.__name__.lower()] = cls def trim_to_required(self: SelfAsset) -> SelfAsset: - return self.create_for_modification(qualified_name=self.qualified_name or "", name=self.name or "") + return self.create_for_modification( + qualified_name=self.qualified_name or "", name=self.name or "" + ) def trim_to_reference(self: SelfAsset) -> SelfAsset: if self.guid and self.guid.strip(): @@ -75,7 +77,9 @@ def creator(cls: Type[SelfAsset], *args, **kwargs) -> SelfAsset: @init_guid def create(cls: Type[SelfAsset], *args, **kwargs) -> SelfAsset: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -83,7 +87,9 @@ def create(cls: Type[SelfAsset], *args, **kwargs) -> SelfAsset: @classmethod @init_guid - def updater(cls: type[SelfAsset], qualified_name: str = "", name: str = "") -> SelfAsset: + def updater( + cls: type[SelfAsset], qualified_name: str = "", name: str = "" + ) -> SelfAsset: if cls.__name__ == "Asset": raise ErrorCode.METHOD_CAN_NOT_BE_INVOKED_ON_ASSET.exception_with_parameters() validate_required_fields( @@ -93,16 +99,22 @@ def updater(cls: type[SelfAsset], qualified_name: str = "", name: str = "") -> S return cls(attributes=cls.Attributes(qualified_name=qualified_name, name=name)) @classmethod - def create_for_modification(cls: type[SelfAsset], qualified_name: str = "", name: str = "") -> SelfAsset: + def create_for_modification( + cls: type[SelfAsset], qualified_name: str = "", name: str = "" + ) -> SelfAsset: warn( - ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'updater' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) return cls.updater(qualified_name=qualified_name, name=name) @classmethod - def ref_by_guid(cls: type[SelfAsset], guid: str, semantic: SaveSemantic = SaveSemantic.REPLACE) -> SelfAsset: + def ref_by_guid( + cls: type[SelfAsset], guid: str, semantic: SaveSemantic = SaveSemantic.REPLACE + ) -> SelfAsset: retval: SelfAsset = cls(attributes=cls.Attributes()) retval.guid = guid retval.semantic = semantic @@ -114,7 +126,9 @@ def ref_by_qualified_name( qualified_name: str, semantic: SaveSemantic = SaveSemantic.REPLACE, ) -> SelfAsset: - ret_value: SelfAsset = cls(attributes=cls.Attributes(name="", qualified_name=qualified_name)) + ret_value: SelfAsset = cls( + attributes=cls.Attributes(name="", qualified_name=qualified_name) + ) ret_value.unique_attributes = {"qualifiedName": qualified_name} ret_value.semantic = semantic return ret_value @@ -132,7 +146,9 @@ def _convert_to_real_type_(cls, data): if isinstance(data, list): # Recursively process lists return [cls._convert_to_real_type_(item) for item in data] - data_type = data.get("type_name") if "type_name" in data else data.get("typeName") + data_type = ( + data.get("type_name") if "type_name" in data else data.get("typeName") + ) if not data_type: if issubclass(cls, Asset): return cls(**data) @@ -172,7 +188,12 @@ def lineage(cls, guid: str, include_archived: bool = False) -> "FluentLineage": return FluentLineage(starting_guid=guid) def has_announcement(self) -> bool: - return bool(self.attributes and (self.attributes.announcement_title or self.attributes.announcement_type)) + return bool( + self.attributes + and ( + self.attributes.announcement_title or self.attributes.announcement_type + ) + ) def set_announcement(self, announcement: Announcement) -> None: self.attributes.announcement_type = announcement.announcement_type.value @@ -182,7 +203,9 @@ def set_announcement(self, announcement: Announcement) -> None: def get_announcment(self) -> Optional[Announcement]: if self.attributes.announcement_type and self.attributes.announcement_title: return Announcement( - announcement_type=AnnouncementType[self.attributes.announcement_type.upper()], + announcement_type=AnnouncementType[ + self.attributes.announcement_type.upper() + ], announcement_title=self.attributes.announcement_title, announcement_message=self.attributes.announcement_message, ) @@ -216,15 +239,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField("name", "name.keyword", "name", "name.stemmed") + NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( + "name", "name.keyword", "name", "name.stemmed" + ) """ Name of this asset. Fallback for display purposes, if displayName is empty. """ - DISPLAY_NAME: ClassVar[KeywordTextField] = KeywordTextField("displayName", "displayName.keyword", "displayName") + DISPLAY_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "displayName", "displayName.keyword", "displayName" + ) """ Human-readable name of this asset used for display purposes (in user interface). """ - DESCRIPTION: ClassVar[KeywordTextField] = KeywordTextField("description", "description.keyword", "description") + DESCRIPTION: ClassVar[KeywordTextField] = KeywordTextField( + "description", "description.keyword", "description" + ) """ Description of this asset, for example as crawled from a source. Fallback for display purposes, if userDescription is empty. """ # noqa: E501 @@ -244,35 +273,51 @@ def __setattr__(self, name, value): """ Status of this asset's certification. """ - CERTIFICATE_STATUS_MESSAGE: ClassVar[TextField] = TextField("certificateStatusMessage", "certificateStatusMessage") + CERTIFICATE_STATUS_MESSAGE: ClassVar[TextField] = TextField( + "certificateStatusMessage", "certificateStatusMessage" + ) """ Human-readable descriptive message used to provide further detail to certificateStatus. """ - CERTIFICATE_UPDATED_BY: ClassVar[KeywordField] = KeywordField("certificateUpdatedBy", "certificateUpdatedBy") + CERTIFICATE_UPDATED_BY: ClassVar[KeywordField] = KeywordField( + "certificateUpdatedBy", "certificateUpdatedBy" + ) """ Name of the user who last updated the certification of this asset. """ - CERTIFICATE_UPDATED_AT: ClassVar[NumericField] = NumericField("certificateUpdatedAt", "certificateUpdatedAt") + CERTIFICATE_UPDATED_AT: ClassVar[NumericField] = NumericField( + "certificateUpdatedAt", "certificateUpdatedAt" + ) """ Time (epoch) at which the certification was last updated, in milliseconds. """ - ANNOUNCEMENT_TITLE: ClassVar[TextField] = TextField("announcementTitle", "announcementTitle") + ANNOUNCEMENT_TITLE: ClassVar[TextField] = TextField( + "announcementTitle", "announcementTitle" + ) """ Brief title for the announcement on this asset. Required when announcementType is specified. """ - ANNOUNCEMENT_MESSAGE: ClassVar[TextField] = TextField("announcementMessage", "announcementMessage") + ANNOUNCEMENT_MESSAGE: ClassVar[TextField] = TextField( + "announcementMessage", "announcementMessage" + ) """ Detailed message to include in the announcement on this asset. """ - ANNOUNCEMENT_TYPE: ClassVar[KeywordField] = KeywordField("announcementType", "announcementType") + ANNOUNCEMENT_TYPE: ClassVar[KeywordField] = KeywordField( + "announcementType", "announcementType" + ) """ Type of announcement on this asset. """ - ANNOUNCEMENT_UPDATED_AT: ClassVar[NumericField] = NumericField("announcementUpdatedAt", "announcementUpdatedAt") + ANNOUNCEMENT_UPDATED_AT: ClassVar[NumericField] = NumericField( + "announcementUpdatedAt", "announcementUpdatedAt" + ) """ Time (epoch) at which the announcement was last updated, in milliseconds. """ - ANNOUNCEMENT_UPDATED_BY: ClassVar[KeywordField] = KeywordField("announcementUpdatedBy", "announcementUpdatedBy") + ANNOUNCEMENT_UPDATED_BY: ClassVar[KeywordField] = KeywordField( + "announcementUpdatedBy", "announcementUpdatedBy" + ) """ Name of the user who last updated the announcement. """ @@ -300,7 +345,9 @@ def __setattr__(self, name, value): """ List of groups who can view assets contained in a collection. (This is only used for certain asset types.) """ - CONNECTOR_NAME: ClassVar[KeywordField] = KeywordField("connectorName", "connectorName") + CONNECTOR_NAME: ClassVar[KeywordField] = KeywordField( + "connectorName", "connectorName" + ) """ Type of the connector through which this asset is accessible. """ @@ -322,7 +369,9 @@ def __setattr__(self, name, value): """ Whether this asset has lineage (true) or not (false). """ - IS_DISCOVERABLE: ClassVar[BooleanField] = BooleanField("isDiscoverable", "isDiscoverable") + IS_DISCOVERABLE: ClassVar[BooleanField] = BooleanField( + "isDiscoverable", "isDiscoverable" + ) """ Whether this asset is discoverable through the UI (true) or not (false). """ @@ -334,7 +383,9 @@ def __setattr__(self, name, value): """ Subtype of this asset. """ - VIEW_SCORE: ClassVar[NumericRankField] = NumericRankField("viewScore", "viewScore", "viewScore.rank_feature") + VIEW_SCORE: ClassVar[NumericRankField] = NumericRankField( + "viewScore", "viewScore", "viewScore.rank_feature" + ) """ View score for this asset. """ @@ -348,19 +399,27 @@ def __setattr__(self, name, value): """ List of owners of this asset, in the source system. """ - SOURCE_CREATED_BY: ClassVar[KeywordField] = KeywordField("sourceCreatedBy", "sourceCreatedBy") + SOURCE_CREATED_BY: ClassVar[KeywordField] = KeywordField( + "sourceCreatedBy", "sourceCreatedBy" + ) """ Name of the user who created this asset, in the source system. """ - SOURCE_CREATED_AT: ClassVar[NumericField] = NumericField("sourceCreatedAt", "sourceCreatedAt") + SOURCE_CREATED_AT: ClassVar[NumericField] = NumericField( + "sourceCreatedAt", "sourceCreatedAt" + ) """ Time (epoch) at which this asset was created in the source system, in milliseconds. """ - SOURCE_UPDATED_AT: ClassVar[NumericField] = NumericField("sourceUpdatedAt", "sourceUpdatedAt") + SOURCE_UPDATED_AT: ClassVar[NumericField] = NumericField( + "sourceUpdatedAt", "sourceUpdatedAt" + ) """ Time (epoch) at which this asset was last updated in the source system, in milliseconds. """ - SOURCE_UPDATED_BY: ClassVar[KeywordField] = KeywordField("sourceUpdatedBy", "sourceUpdatedBy") + SOURCE_UPDATED_BY: ClassVar[KeywordField] = KeywordField( + "sourceUpdatedBy", "sourceUpdatedBy" + ) """ Name of the user who last updated this asset, in the source system. """ @@ -368,15 +427,21 @@ def __setattr__(self, name, value): """ URL to the resource within the source application, used to create a button to view this asset in the source application. """ # noqa: E501 - SOURCE_EMBED_URL: ClassVar[KeywordField] = KeywordField("sourceEmbedURL", "sourceEmbedURL") + SOURCE_EMBED_URL: ClassVar[KeywordField] = KeywordField( + "sourceEmbedURL", "sourceEmbedURL" + ) """ URL to create an embed for a resource (for example, an image of a dashboard) within Atlan. """ - LAST_SYNC_WORKFLOW_NAME: ClassVar[KeywordField] = KeywordField("lastSyncWorkflowName", "lastSyncWorkflowName") + LAST_SYNC_WORKFLOW_NAME: ClassVar[KeywordField] = KeywordField( + "lastSyncWorkflowName", "lastSyncWorkflowName" + ) """ Name of the crawler that last synchronized this asset. """ - LAST_SYNC_RUN_AT: ClassVar[NumericField] = NumericField("lastSyncRunAt", "lastSyncRunAt") + LAST_SYNC_RUN_AT: ClassVar[NumericField] = NumericField( + "lastSyncRunAt", "lastSyncRunAt" + ) """ Time (epoch) at which this asset was last crawled, in milliseconds. """ @@ -388,31 +453,45 @@ def __setattr__(self, name, value): """ List of roles who administer this asset. (This is only used for Connection assets.) """ - SOURCE_READ_COUNT: ClassVar[NumericField] = NumericField("sourceReadCount", "sourceReadCount") + SOURCE_READ_COUNT: ClassVar[NumericField] = NumericField( + "sourceReadCount", "sourceReadCount" + ) """ Total count of all read operations at source. """ - SOURCE_READ_USER_COUNT: ClassVar[NumericField] = NumericField("sourceReadUserCount", "sourceReadUserCount") + SOURCE_READ_USER_COUNT: ClassVar[NumericField] = NumericField( + "sourceReadUserCount", "sourceReadUserCount" + ) """ Total number of unique users that read data from asset. """ - SOURCE_LAST_READ_AT: ClassVar[NumericField] = NumericField("sourceLastReadAt", "sourceLastReadAt") + SOURCE_LAST_READ_AT: ClassVar[NumericField] = NumericField( + "sourceLastReadAt", "sourceLastReadAt" + ) """ Timestamp of most recent read operation. """ - LAST_ROW_CHANGED_AT: ClassVar[NumericField] = NumericField("lastRowChangedAt", "lastRowChangedAt") + LAST_ROW_CHANGED_AT: ClassVar[NumericField] = NumericField( + "lastRowChangedAt", "lastRowChangedAt" + ) """ Time (epoch) of the last operation that inserted, updated, or deleted rows, in milliseconds. """ - SOURCE_TOTAL_COST: ClassVar[NumericField] = NumericField("sourceTotalCost", "sourceTotalCost") + SOURCE_TOTAL_COST: ClassVar[NumericField] = NumericField( + "sourceTotalCost", "sourceTotalCost" + ) """ Total cost of all operations at source. """ - SOURCE_COST_UNIT: ClassVar[KeywordField] = KeywordField("sourceCostUnit", "sourceCostUnit") + SOURCE_COST_UNIT: ClassVar[KeywordField] = KeywordField( + "sourceCostUnit", "sourceCostUnit" + ) """ The unit of measure for sourceTotalCost. """ - SOURCE_READ_QUERY_COST: ClassVar[NumericField] = NumericField("sourceReadQueryCost", "sourceReadQueryCost") + SOURCE_READ_QUERY_COST: ClassVar[NumericField] = NumericField( + "sourceReadQueryCost", "sourceReadQueryCost" + ) """ Total cost of read queries at source. """ @@ -428,7 +507,9 @@ def __setattr__(self, name, value): """ List of usernames with extra insights for the most recent users who read this asset. """ - SOURCE_READ_TOP_USER_LIST: ClassVar[KeywordField] = KeywordField("sourceReadTopUserList", "sourceReadTopUserList") + SOURCE_READ_TOP_USER_LIST: ClassVar[KeywordField] = KeywordField( + "sourceReadTopUserList", "sourceReadTopUserList" + ) """ List of usernames of the users who read this asset the most. """ @@ -520,15 +601,21 @@ def __setattr__(self, name, value): """ Name of the job that materialized this asset in dbt. """ - ASSET_DBT_JOB_SCHEDULE: ClassVar[KeywordField] = KeywordField("assetDbtJobSchedule", "assetDbtJobSchedule") + ASSET_DBT_JOB_SCHEDULE: ClassVar[KeywordField] = KeywordField( + "assetDbtJobSchedule", "assetDbtJobSchedule" + ) """ Schedule of the job that materialized this asset in dbt. """ - ASSET_DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("assetDbtJobStatus", "assetDbtJobStatus") + ASSET_DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( + "assetDbtJobStatus", "assetDbtJobStatus" + ) """ Status of the job that materialized this asset in dbt. """ - ASSET_DBT_TEST_STATUS: ClassVar[KeywordField] = KeywordField("assetDbtTestStatus", "assetDbtTestStatus") + ASSET_DBT_TEST_STATUS: ClassVar[KeywordField] = KeywordField( + "assetDbtTestStatus", "assetDbtTestStatus" + ) """ All associated dbt test statuses. """ @@ -538,11 +625,15 @@ def __setattr__(self, name, value): """ Human-readable cron schedule of the job that materialized this asset in dbt. """ - ASSET_DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("assetDbtJobLastRun", "assetDbtJobLastRun") + ASSET_DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( + "assetDbtJobLastRun", "assetDbtJobLastRun" + ) """ Time (epoch) at which the job that materialized this asset in dbt last ran, in milliseconds. """ - ASSET_DBT_JOB_LAST_RUN_URL: ClassVar[KeywordField] = KeywordField("assetDbtJobLastRunUrl", "assetDbtJobLastRunUrl") + ASSET_DBT_JOB_LAST_RUN_URL: ClassVar[KeywordField] = KeywordField( + "assetDbtJobLastRunUrl", "assetDbtJobLastRunUrl" + ) """ URL of the last run of the job that materialized this asset in dbt. """ @@ -589,9 +680,11 @@ def __setattr__(self, name, value): """ Total duration the job that materialized this asset in dbt spent being queued. """ - ASSET_DBT_JOB_LAST_RUN_QUEUED_DURATION_HUMANIZED: ClassVar[KeywordField] = KeywordField( - "assetDbtJobLastRunQueuedDurationHumanized", - "assetDbtJobLastRunQueuedDurationHumanized", + ASSET_DBT_JOB_LAST_RUN_QUEUED_DURATION_HUMANIZED: ClassVar[KeywordField] = ( + KeywordField( + "assetDbtJobLastRunQueuedDurationHumanized", + "assetDbtJobLastRunQueuedDurationHumanized", + ) ) """ Human-readable total duration of the last run of the job that materialized this asset in dbt spend being queued. @@ -602,9 +695,11 @@ def __setattr__(self, name, value): """ Run duration of the last run of the job that materialized this asset in dbt. """ - ASSET_DBT_JOB_LAST_RUN_RUN_DURATION_HUMANIZED: ClassVar[KeywordField] = KeywordField( - "assetDbtJobLastRunRunDurationHumanized", - "assetDbtJobLastRunRunDurationHumanized", + ASSET_DBT_JOB_LAST_RUN_RUN_DURATION_HUMANIZED: ClassVar[KeywordField] = ( + KeywordField( + "assetDbtJobLastRunRunDurationHumanized", + "assetDbtJobLastRunRunDurationHumanized", + ) ) """ Human-readable run duration of the last run of the job that materialized this asset in dbt. @@ -623,10 +718,12 @@ def __setattr__(self, name, value): """ SHA hash in git for the last run of the job that materialized this asset in dbt. """ - ASSET_DBT_JOB_LAST_RUN_STATUS_MESSAGE: ClassVar[KeywordTextField] = KeywordTextField( - "assetDbtJobLastRunStatusMessage", - "assetDbtJobLastRunStatusMessage.keyword", - "assetDbtJobLastRunStatusMessage", + ASSET_DBT_JOB_LAST_RUN_STATUS_MESSAGE: ClassVar[KeywordTextField] = ( + KeywordTextField( + "assetDbtJobLastRunStatusMessage", + "assetDbtJobLastRunStatusMessage.keyword", + "assetDbtJobLastRunStatusMessage", + ) ) """ Status message of the last run of the job that materialized this asset in dbt. @@ -673,7 +770,9 @@ def __setattr__(self, name, value): """ Whether notifications were sent from the last run of the job that materialized this asset in dbt (true) or not (false). """ # noqa: E501 - ASSET_DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("assetDbtJobNextRun", "assetDbtJobNextRun") + ASSET_DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( + "assetDbtJobNextRun", "assetDbtJobNextRun" + ) """ Time (epoch) when the next run of the job that materializes this asset in dbt is scheduled. """ @@ -699,7 +798,9 @@ def __setattr__(self, name, value): """ Version of the environment in which this asset is materialized in dbt. """ - ASSET_DBT_TAGS: ClassVar[KeywordTextField] = KeywordTextField("assetDbtTags", "assetDbtTags", "assetDbtTags.text") + ASSET_DBT_TAGS: ClassVar[KeywordTextField] = KeywordTextField( + "assetDbtTags", "assetDbtTags", "assetDbtTags.text" + ) """ List of tags attached to this asset in dbt. """ @@ -721,7 +822,9 @@ def __setattr__(self, name, value): """ URL for sample data for this asset. """ - ASSET_TAGS: ClassVar[KeywordTextField] = KeywordTextField("assetTags", "assetTags", "assetTags.text") + ASSET_TAGS: ClassVar[KeywordTextField] = KeywordTextField( + "assetTags", "assetTags", "assetTags.text" + ) """ List of tags attached to this asset. """ @@ -761,11 +864,15 @@ def __setattr__(self, name, value): """ List of unique Monte Carlo monitor names attached to this asset. """ - ASSET_MC_MONITOR_STATUSES: ClassVar[KeywordField] = KeywordField("assetMcMonitorStatuses", "assetMcMonitorStatuses") + ASSET_MC_MONITOR_STATUSES: ClassVar[KeywordField] = KeywordField( + "assetMcMonitorStatuses", "assetMcMonitorStatuses" + ) """ Statuses of all associated Monte Carlo monitors. """ - ASSET_MC_MONITOR_TYPES: ClassVar[KeywordField] = KeywordField("assetMcMonitorTypes", "assetMcMonitorTypes") + ASSET_MC_MONITOR_TYPES: ClassVar[KeywordField] = KeywordField( + "assetMcMonitorTypes", "assetMcMonitorTypes" + ) """ Types of all associated Monte Carlo monitors. """ @@ -775,7 +882,9 @@ def __setattr__(self, name, value): """ Schedules of all associated Monte Carlo monitors. """ - ASSET_MC_INCIDENT_TYPES: ClassVar[KeywordField] = KeywordField("assetMcIncidentTypes", "assetMcIncidentTypes") + ASSET_MC_INCIDENT_TYPES: ClassVar[KeywordField] = KeywordField( + "assetMcIncidentTypes", "assetMcIncidentTypes" + ) """ List of Monte Carlo incident types associated with this asset. """ @@ -797,15 +906,21 @@ def __setattr__(self, name, value): """ List of Monte Carlo incident priorities associated with this asset. """ - ASSET_MC_INCIDENT_STATES: ClassVar[KeywordField] = KeywordField("assetMcIncidentStates", "assetMcIncidentStates") + ASSET_MC_INCIDENT_STATES: ClassVar[KeywordField] = KeywordField( + "assetMcIncidentStates", "assetMcIncidentStates" + ) """ List of Monte Carlo incident states associated with this asset. """ - ASSET_MC_IS_MONITORED: ClassVar[BooleanField] = BooleanField("assetMcIsMonitored", "assetMcIsMonitored") + ASSET_MC_IS_MONITORED: ClassVar[BooleanField] = BooleanField( + "assetMcIsMonitored", "assetMcIsMonitored" + ) """ Tracks whether this asset is monitored by MC or not """ - ASSET_MC_LAST_SYNC_RUN_AT: ClassVar[NumericField] = NumericField("assetMcLastSyncRunAt", "assetMcLastSyncRunAt") + ASSET_MC_LAST_SYNC_RUN_AT: ClassVar[NumericField] = NumericField( + "assetMcLastSyncRunAt", "assetMcLastSyncRunAt" + ) """ Time (epoch) at which this asset was last synced from Monte Carlo. """ @@ -813,7 +928,9 @@ def __setattr__(self, name, value): """ Users who have starred this asset. """ - STARRED_DETAILS_LIST: ClassVar[KeywordField] = KeywordField("starredDetailsList", "starredDetailsList") + STARRED_DETAILS_LIST: ClassVar[KeywordField] = KeywordField( + "starredDetailsList", "starredDetailsList" + ) """ List of usernames with extra information of the users who have starred an asset. """ @@ -821,11 +938,15 @@ def __setattr__(self, name, value): """ Number of users who have starred this asset. """ - ASSET_ANOMALO_DQ_STATUS: ClassVar[KeywordField] = KeywordField("assetAnomaloDQStatus", "assetAnomaloDQStatus") + ASSET_ANOMALO_DQ_STATUS: ClassVar[KeywordField] = KeywordField( + "assetAnomaloDQStatus", "assetAnomaloDQStatus" + ) """ Status of data quality from Anomalo. """ - ASSET_ANOMALO_CHECK_COUNT: ClassVar[NumericField] = NumericField("assetAnomaloCheckCount", "assetAnomaloCheckCount") + ASSET_ANOMALO_CHECK_COUNT: ClassVar[NumericField] = NumericField( + "assetAnomaloCheckCount", "assetAnomaloCheckCount" + ) """ Total number of checks present in Anomalo for this asset. """ @@ -859,15 +980,21 @@ def __setattr__(self, name, value): """ All associated Anomalo failed check types. """ - ASSET_ANOMALO_SOURCE_URL: ClassVar[TextField] = TextField("assetAnomaloSourceUrl", "assetAnomaloSourceUrl") + ASSET_ANOMALO_SOURCE_URL: ClassVar[TextField] = TextField( + "assetAnomaloSourceUrl", "assetAnomaloSourceUrl" + ) """ URL of the source in Anomalo. """ - ASSET_SODA_DQ_STATUS: ClassVar[KeywordField] = KeywordField("assetSodaDQStatus", "assetSodaDQStatus") + ASSET_SODA_DQ_STATUS: ClassVar[KeywordField] = KeywordField( + "assetSodaDQStatus", "assetSodaDQStatus" + ) """ Status of data quality from Soda. """ - ASSET_SODA_CHECK_COUNT: ClassVar[NumericField] = NumericField("assetSodaCheckCount", "assetSodaCheckCount") + ASSET_SODA_CHECK_COUNT: ClassVar[NumericField] = NumericField( + "assetSodaCheckCount", "assetSodaCheckCount" + ) """ Number of checks done via Soda. """ @@ -877,15 +1004,21 @@ def __setattr__(self, name, value): """ """ - ASSET_SODA_LAST_SCAN_AT: ClassVar[NumericField] = NumericField("assetSodaLastScanAt", "assetSodaLastScanAt") + ASSET_SODA_LAST_SCAN_AT: ClassVar[NumericField] = NumericField( + "assetSodaLastScanAt", "assetSodaLastScanAt" + ) """ """ - ASSET_SODA_CHECK_STATUSES: ClassVar[TextField] = TextField("assetSodaCheckStatuses", "assetSodaCheckStatuses") + ASSET_SODA_CHECK_STATUSES: ClassVar[TextField] = TextField( + "assetSodaCheckStatuses", "assetSodaCheckStatuses" + ) """ All associated Soda check statuses. """ - ASSET_SODA_SOURCE_URL: ClassVar[KeywordField] = KeywordField("assetSodaSourceURL", "assetSodaSourceURL") + ASSET_SODA_SOURCE_URL: ClassVar[KeywordField] = KeywordField( + "assetSodaSourceURL", "assetSodaSourceURL" + ) """ """ @@ -897,11 +1030,15 @@ def __setattr__(self, name, value): """ TBC """ - IS_AI_GENERATED: ClassVar[BooleanField] = BooleanField("isAIGenerated", "isAIGenerated") + IS_AI_GENERATED: ClassVar[BooleanField] = BooleanField( + "isAIGenerated", "isAIGenerated" + ) """ """ - ASSET_COVER_IMAGE: ClassVar[TextField] = TextField("assetCoverImage", "assetCoverImage") + ASSET_COVER_IMAGE: ClassVar[TextField] = TextField( + "assetCoverImage", "assetCoverImage" + ) """ TBC """ @@ -919,11 +1056,15 @@ def __setattr__(self, name, value): """ Whether this asset has contract (true) or not (false). """ - ASSET_POLICY_GUIDS: ClassVar[KeywordField] = KeywordField("assetPolicyGUIDs", "assetPolicyGUIDs") + ASSET_POLICY_GUIDS: ClassVar[KeywordField] = KeywordField( + "assetPolicyGUIDs", "assetPolicyGUIDs" + ) """ Array of policy ids governing this asset """ - ASSET_POLICIES_COUNT: ClassVar[NumericField] = NumericField("assetPoliciesCount", "assetPoliciesCount") + ASSET_POLICIES_COUNT: ClassVar[NumericField] = NumericField( + "assetPoliciesCount", "assetPoliciesCount" + ) """ Count of policies inside the asset """ @@ -950,11 +1091,15 @@ def __setattr__(self, name, value): Qualified name of the ApplicationField that contains this asset. """ - SCHEMA_REGISTRY_SUBJECTS: ClassVar[RelationField] = RelationField("schemaRegistrySubjects") + SCHEMA_REGISTRY_SUBJECTS: ClassVar[RelationField] = RelationField( + "schemaRegistrySubjects" + ) """ TBC """ - DATA_CONTRACT_LATEST_CERTIFIED: ClassVar[RelationField] = RelationField("dataContractLatestCertified") + DATA_CONTRACT_LATEST_CERTIFIED: ClassVar[RelationField] = RelationField( + "dataContractLatestCertified" + ) """ TBC """ @@ -962,15 +1107,21 @@ def __setattr__(self, name, value): """ TBC """ - USER_DEF_RELATIONSHIP_TO: ClassVar[RelationField] = RelationField("userDefRelationshipTo") + USER_DEF_RELATIONSHIP_TO: ClassVar[RelationField] = RelationField( + "userDefRelationshipTo" + ) """ TBC """ - OUTPUT_PORT_DATA_PRODUCTS: ClassVar[RelationField] = RelationField("outputPortDataProducts") + OUTPUT_PORT_DATA_PRODUCTS: ClassVar[RelationField] = RelationField( + "outputPortDataProducts" + ) """ TBC """ - USER_DEF_RELATIONSHIP_FROM: ClassVar[RelationField] = RelationField("userDefRelationshipFrom") + USER_DEF_RELATIONSHIP_FROM: ClassVar[RelationField] = RelationField( + "userDefRelationshipFrom" + ) """ TBC """ @@ -1010,7 +1161,9 @@ def __setattr__(self, name, value): """ TBC """ - INPUT_PORT_DATA_PRODUCTS: ClassVar[RelationField] = RelationField("inputPortDataProducts") + INPUT_PORT_DATA_PRODUCTS: ClassVar[RelationField] = RelationField( + "inputPortDataProducts" + ) """ TBC """ @@ -1247,7 +1400,11 @@ def certificate_status(self, certificate_status: Optional[CertificateStatus]): @property def certificate_status_message(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.certificate_status_message + return ( + None + if self.attributes is None + else self.attributes.certificate_status_message + ) @certificate_status_message.setter def certificate_status_message(self, certificate_status_message: Optional[str]): @@ -1257,7 +1414,9 @@ def certificate_status_message(self, certificate_status_message: Optional[str]): @property def certificate_updated_by(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.certificate_updated_by + return ( + None if self.attributes is None else self.attributes.certificate_updated_by + ) @certificate_updated_by.setter def certificate_updated_by(self, certificate_updated_by: Optional[str]): @@ -1267,7 +1426,9 @@ def certificate_updated_by(self, certificate_updated_by: Optional[str]): @property def certificate_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.certificate_updated_at + return ( + None if self.attributes is None else self.attributes.certificate_updated_at + ) @certificate_updated_at.setter def certificate_updated_at(self, certificate_updated_at: Optional[datetime]): @@ -1307,7 +1468,9 @@ def announcement_type(self, announcement_type: Optional[str]): @property def announcement_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.announcement_updated_at + return ( + None if self.attributes is None else self.attributes.announcement_updated_at + ) @announcement_updated_at.setter def announcement_updated_at(self, announcement_updated_at: Optional[datetime]): @@ -1317,7 +1480,9 @@ def announcement_updated_at(self, announcement_updated_at: Optional[datetime]): @property def announcement_updated_by(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.announcement_updated_by + return ( + None if self.attributes is None else self.attributes.announcement_updated_by + ) @announcement_updated_by.setter def announcement_updated_by(self, announcement_updated_by: Optional[str]): @@ -1407,7 +1572,11 @@ def connection_name(self, connection_name: Optional[str]): @property def connection_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.connection_qualified_name + return ( + None + if self.attributes is None + else self.attributes.connection_qualified_name + ) @connection_qualified_name.setter def connection_qualified_name(self, connection_qualified_name: Optional[str]): @@ -1547,7 +1716,9 @@ def source_embed_url(self, source_embed_url: Optional[str]): @property def last_sync_workflow_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.last_sync_workflow_name + return ( + None if self.attributes is None else self.attributes.last_sync_workflow_name + ) @last_sync_workflow_name.setter def last_sync_workflow_name(self, last_sync_workflow_name: Optional[str]): @@ -1597,7 +1768,9 @@ def source_read_count(self, source_read_count: Optional[int]): @property def source_read_user_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.source_read_user_count + return ( + None if self.attributes is None else self.attributes.source_read_user_count + ) @source_read_user_count.setter def source_read_user_count(self, source_read_user_count: Optional[int]): @@ -1647,7 +1820,9 @@ def source_cost_unit(self, source_cost_unit: Optional[SourceCostUnitType]): @property def source_read_query_cost(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.source_read_query_cost + return ( + None if self.attributes is None else self.attributes.source_read_query_cost + ) @source_read_query_cost.setter def source_read_query_cost(self, source_read_query_cost: Optional[float]): @@ -1657,17 +1832,27 @@ def source_read_query_cost(self, source_read_query_cost: Optional[float]): @property def source_read_recent_user_list(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.source_read_recent_user_list + return ( + None + if self.attributes is None + else self.attributes.source_read_recent_user_list + ) @source_read_recent_user_list.setter - def source_read_recent_user_list(self, source_read_recent_user_list: Optional[Set[str]]): + def source_read_recent_user_list( + self, source_read_recent_user_list: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.source_read_recent_user_list = source_read_recent_user_list @property def source_read_recent_user_record_list(self) -> Optional[List[PopularityInsights]]: - return None if self.attributes is None else self.attributes.source_read_recent_user_record_list + return ( + None + if self.attributes is None + else self.attributes.source_read_recent_user_record_list + ) @source_read_recent_user_record_list.setter def source_read_recent_user_record_list( @@ -1675,11 +1860,17 @@ def source_read_recent_user_record_list( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_read_recent_user_record_list = source_read_recent_user_record_list + self.attributes.source_read_recent_user_record_list = ( + source_read_recent_user_record_list + ) @property def source_read_top_user_list(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.source_read_top_user_list + return ( + None + if self.attributes is None + else self.attributes.source_read_top_user_list + ) @source_read_top_user_list.setter def source_read_top_user_list(self, source_read_top_user_list: Optional[Set[str]]): @@ -1689,19 +1880,31 @@ def source_read_top_user_list(self, source_read_top_user_list: Optional[Set[str] @property def source_read_top_user_record_list(self) -> Optional[List[PopularityInsights]]: - return None if self.attributes is None else self.attributes.source_read_top_user_record_list + return ( + None + if self.attributes is None + else self.attributes.source_read_top_user_record_list + ) @source_read_top_user_record_list.setter - def source_read_top_user_record_list(self, source_read_top_user_record_list: Optional[List[PopularityInsights]]): + def source_read_top_user_record_list( + self, source_read_top_user_record_list: Optional[List[PopularityInsights]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_read_top_user_record_list = source_read_top_user_record_list + self.attributes.source_read_top_user_record_list = ( + source_read_top_user_record_list + ) @property def source_read_popular_query_record_list( self, ) -> Optional[List[PopularityInsights]]: - return None if self.attributes is None else self.attributes.source_read_popular_query_record_list + return ( + None + if self.attributes is None + else self.attributes.source_read_popular_query_record_list + ) @source_read_popular_query_record_list.setter def source_read_popular_query_record_list( @@ -1709,13 +1912,19 @@ def source_read_popular_query_record_list( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_read_popular_query_record_list = source_read_popular_query_record_list + self.attributes.source_read_popular_query_record_list = ( + source_read_popular_query_record_list + ) @property def source_read_expensive_query_record_list( self, ) -> Optional[List[PopularityInsights]]: - return None if self.attributes is None else self.attributes.source_read_expensive_query_record_list + return ( + None + if self.attributes is None + else self.attributes.source_read_expensive_query_record_list + ) @source_read_expensive_query_record_list.setter def source_read_expensive_query_record_list( @@ -1724,11 +1933,17 @@ def source_read_expensive_query_record_list( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_read_expensive_query_record_list = source_read_expensive_query_record_list + self.attributes.source_read_expensive_query_record_list = ( + source_read_expensive_query_record_list + ) @property def source_read_slow_query_record_list(self) -> Optional[List[PopularityInsights]]: - return None if self.attributes is None else self.attributes.source_read_slow_query_record_list + return ( + None + if self.attributes is None + else self.attributes.source_read_slow_query_record_list + ) @source_read_slow_query_record_list.setter def source_read_slow_query_record_list( @@ -1736,14 +1951,22 @@ def source_read_slow_query_record_list( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_read_slow_query_record_list = source_read_slow_query_record_list + self.attributes.source_read_slow_query_record_list = ( + source_read_slow_query_record_list + ) @property def source_query_compute_cost_list(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.source_query_compute_cost_list + return ( + None + if self.attributes is None + else self.attributes.source_query_compute_cost_list + ) @source_query_compute_cost_list.setter - def source_query_compute_cost_list(self, source_query_compute_cost_list: Optional[Set[str]]): + def source_query_compute_cost_list( + self, source_query_compute_cost_list: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.source_query_compute_cost_list = source_query_compute_cost_list @@ -1752,7 +1975,11 @@ def source_query_compute_cost_list(self, source_query_compute_cost_list: Optiona def source_query_compute_cost_record_list( self, ) -> Optional[List[PopularityInsights]]: - return None if self.attributes is None else self.attributes.source_query_compute_cost_record_list + return ( + None + if self.attributes is None + else self.attributes.source_query_compute_cost_record_list + ) @source_query_compute_cost_record_list.setter def source_query_compute_cost_record_list( @@ -1760,7 +1987,9 @@ def source_query_compute_cost_record_list( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.source_query_compute_cost_record_list = source_query_compute_cost_record_list + self.attributes.source_query_compute_cost_record_list = ( + source_query_compute_cost_record_list + ) @property def dbt_qualified_name(self) -> Optional[str]: @@ -1774,13 +2003,21 @@ def dbt_qualified_name(self, dbt_qualified_name: Optional[str]): @property def asset_dbt_workflow_last_updated(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_workflow_last_updated + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_workflow_last_updated + ) @asset_dbt_workflow_last_updated.setter - def asset_dbt_workflow_last_updated(self, asset_dbt_workflow_last_updated: Optional[str]): + def asset_dbt_workflow_last_updated( + self, asset_dbt_workflow_last_updated: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_workflow_last_updated = asset_dbt_workflow_last_updated + self.attributes.asset_dbt_workflow_last_updated = ( + asset_dbt_workflow_last_updated + ) @property def asset_dbt_alias(self) -> Optional[str]: @@ -1814,7 +2051,9 @@ def asset_dbt_unique_id(self, asset_dbt_unique_id: Optional[str]): @property def asset_dbt_account_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_account_name + return ( + None if self.attributes is None else self.attributes.asset_dbt_account_name + ) @asset_dbt_account_name.setter def asset_dbt_account_name(self, asset_dbt_account_name: Optional[str]): @@ -1824,7 +2063,9 @@ def asset_dbt_account_name(self, asset_dbt_account_name: Optional[str]): @property def asset_dbt_project_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_project_name + return ( + None if self.attributes is None else self.attributes.asset_dbt_project_name + ) @asset_dbt_project_name.setter def asset_dbt_project_name(self, asset_dbt_project_name: Optional[str]): @@ -1834,7 +2075,9 @@ def asset_dbt_project_name(self, asset_dbt_project_name: Optional[str]): @property def asset_dbt_package_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_package_name + return ( + None if self.attributes is None else self.attributes.asset_dbt_package_name + ) @asset_dbt_package_name.setter def asset_dbt_package_name(self, asset_dbt_package_name: Optional[str]): @@ -1854,7 +2097,9 @@ def asset_dbt_job_name(self, asset_dbt_job_name: Optional[str]): @property def asset_dbt_job_schedule(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_schedule + return ( + None if self.attributes is None else self.attributes.asset_dbt_job_schedule + ) @asset_dbt_job_schedule.setter def asset_dbt_job_schedule(self, asset_dbt_job_schedule: Optional[str]): @@ -1874,7 +2119,9 @@ def asset_dbt_job_status(self, asset_dbt_job_status: Optional[str]): @property def asset_dbt_test_status(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_test_status + return ( + None if self.attributes is None else self.attributes.asset_dbt_test_status + ) @asset_dbt_test_status.setter def asset_dbt_test_status(self, asset_dbt_test_status: Optional[str]): @@ -1884,17 +2131,27 @@ def asset_dbt_test_status(self, asset_dbt_test_status: Optional[str]): @property def asset_dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_schedule_cron_humanized + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_schedule_cron_humanized + ) @asset_dbt_job_schedule_cron_humanized.setter - def asset_dbt_job_schedule_cron_humanized(self, asset_dbt_job_schedule_cron_humanized: Optional[str]): + def asset_dbt_job_schedule_cron_humanized( + self, asset_dbt_job_schedule_cron_humanized: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_schedule_cron_humanized = asset_dbt_job_schedule_cron_humanized + self.attributes.asset_dbt_job_schedule_cron_humanized = ( + asset_dbt_job_schedule_cron_humanized + ) @property def asset_dbt_job_last_run(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run + return ( + None if self.attributes is None else self.attributes.asset_dbt_job_last_run + ) @asset_dbt_job_last_run.setter def asset_dbt_job_last_run(self, asset_dbt_job_last_run: Optional[datetime]): @@ -1904,7 +2161,11 @@ def asset_dbt_job_last_run(self, asset_dbt_job_last_run: Optional[datetime]): @property def asset_dbt_job_last_run_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_url + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_url + ) @asset_dbt_job_last_run_url.setter def asset_dbt_job_last_run_url(self, asset_dbt_job_last_run_url: Optional[str]): @@ -1914,57 +2175,101 @@ def asset_dbt_job_last_run_url(self, asset_dbt_job_last_run_url: Optional[str]): @property def asset_dbt_job_last_run_created_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_created_at + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_created_at + ) @asset_dbt_job_last_run_created_at.setter - def asset_dbt_job_last_run_created_at(self, asset_dbt_job_last_run_created_at: Optional[datetime]): + def asset_dbt_job_last_run_created_at( + self, asset_dbt_job_last_run_created_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_created_at = asset_dbt_job_last_run_created_at + self.attributes.asset_dbt_job_last_run_created_at = ( + asset_dbt_job_last_run_created_at + ) @property def asset_dbt_job_last_run_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_updated_at + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_updated_at + ) @asset_dbt_job_last_run_updated_at.setter - def asset_dbt_job_last_run_updated_at(self, asset_dbt_job_last_run_updated_at: Optional[datetime]): + def asset_dbt_job_last_run_updated_at( + self, asset_dbt_job_last_run_updated_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_updated_at = asset_dbt_job_last_run_updated_at + self.attributes.asset_dbt_job_last_run_updated_at = ( + asset_dbt_job_last_run_updated_at + ) @property def asset_dbt_job_last_run_dequed_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_dequed_at + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_dequed_at + ) @asset_dbt_job_last_run_dequed_at.setter - def asset_dbt_job_last_run_dequed_at(self, asset_dbt_job_last_run_dequed_at: Optional[datetime]): + def asset_dbt_job_last_run_dequed_at( + self, asset_dbt_job_last_run_dequed_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_dequed_at = asset_dbt_job_last_run_dequed_at + self.attributes.asset_dbt_job_last_run_dequed_at = ( + asset_dbt_job_last_run_dequed_at + ) @property def asset_dbt_job_last_run_started_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_started_at + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_started_at + ) @asset_dbt_job_last_run_started_at.setter - def asset_dbt_job_last_run_started_at(self, asset_dbt_job_last_run_started_at: Optional[datetime]): + def asset_dbt_job_last_run_started_at( + self, asset_dbt_job_last_run_started_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_started_at = asset_dbt_job_last_run_started_at + self.attributes.asset_dbt_job_last_run_started_at = ( + asset_dbt_job_last_run_started_at + ) @property def asset_dbt_job_last_run_total_duration(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_total_duration + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_total_duration + ) @asset_dbt_job_last_run_total_duration.setter - def asset_dbt_job_last_run_total_duration(self, asset_dbt_job_last_run_total_duration: Optional[str]): + def asset_dbt_job_last_run_total_duration( + self, asset_dbt_job_last_run_total_duration: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_total_duration = asset_dbt_job_last_run_total_duration + self.attributes.asset_dbt_job_last_run_total_duration = ( + asset_dbt_job_last_run_total_duration + ) @property def asset_dbt_job_last_run_total_duration_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_total_duration_humanized + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_total_duration_humanized + ) @asset_dbt_job_last_run_total_duration_humanized.setter def asset_dbt_job_last_run_total_duration_humanized( @@ -1978,17 +2283,29 @@ def asset_dbt_job_last_run_total_duration_humanized( @property def asset_dbt_job_last_run_queued_duration(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_queued_duration + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_queued_duration + ) @asset_dbt_job_last_run_queued_duration.setter - def asset_dbt_job_last_run_queued_duration(self, asset_dbt_job_last_run_queued_duration: Optional[str]): + def asset_dbt_job_last_run_queued_duration( + self, asset_dbt_job_last_run_queued_duration: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_queued_duration = asset_dbt_job_last_run_queued_duration + self.attributes.asset_dbt_job_last_run_queued_duration = ( + asset_dbt_job_last_run_queued_duration + ) @property def asset_dbt_job_last_run_queued_duration_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_queued_duration_humanized + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_queued_duration_humanized + ) @asset_dbt_job_last_run_queued_duration_humanized.setter def asset_dbt_job_last_run_queued_duration_humanized( @@ -2002,17 +2319,29 @@ def asset_dbt_job_last_run_queued_duration_humanized( @property def asset_dbt_job_last_run_run_duration(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_run_duration + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_run_duration + ) @asset_dbt_job_last_run_run_duration.setter - def asset_dbt_job_last_run_run_duration(self, asset_dbt_job_last_run_run_duration: Optional[str]): + def asset_dbt_job_last_run_run_duration( + self, asset_dbt_job_last_run_run_duration: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_run_duration = asset_dbt_job_last_run_run_duration + self.attributes.asset_dbt_job_last_run_run_duration = ( + asset_dbt_job_last_run_run_duration + ) @property def asset_dbt_job_last_run_run_duration_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_run_duration_humanized + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_run_duration_humanized + ) @asset_dbt_job_last_run_run_duration_humanized.setter def asset_dbt_job_last_run_run_duration_humanized( @@ -2020,91 +2349,159 @@ def asset_dbt_job_last_run_run_duration_humanized( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_run_duration_humanized = asset_dbt_job_last_run_run_duration_humanized + self.attributes.asset_dbt_job_last_run_run_duration_humanized = ( + asset_dbt_job_last_run_run_duration_humanized + ) @property def asset_dbt_job_last_run_git_branch(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_git_branch + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_git_branch + ) @asset_dbt_job_last_run_git_branch.setter - def asset_dbt_job_last_run_git_branch(self, asset_dbt_job_last_run_git_branch: Optional[str]): + def asset_dbt_job_last_run_git_branch( + self, asset_dbt_job_last_run_git_branch: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_git_branch = asset_dbt_job_last_run_git_branch + self.attributes.asset_dbt_job_last_run_git_branch = ( + asset_dbt_job_last_run_git_branch + ) @property def asset_dbt_job_last_run_git_sha(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_git_sha + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_git_sha + ) @asset_dbt_job_last_run_git_sha.setter - def asset_dbt_job_last_run_git_sha(self, asset_dbt_job_last_run_git_sha: Optional[str]): + def asset_dbt_job_last_run_git_sha( + self, asset_dbt_job_last_run_git_sha: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_dbt_job_last_run_git_sha = asset_dbt_job_last_run_git_sha @property def asset_dbt_job_last_run_status_message(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_status_message + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_status_message + ) @asset_dbt_job_last_run_status_message.setter - def asset_dbt_job_last_run_status_message(self, asset_dbt_job_last_run_status_message: Optional[str]): + def asset_dbt_job_last_run_status_message( + self, asset_dbt_job_last_run_status_message: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_status_message = asset_dbt_job_last_run_status_message + self.attributes.asset_dbt_job_last_run_status_message = ( + asset_dbt_job_last_run_status_message + ) @property def asset_dbt_job_last_run_owner_thread_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_owner_thread_id + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_owner_thread_id + ) @asset_dbt_job_last_run_owner_thread_id.setter - def asset_dbt_job_last_run_owner_thread_id(self, asset_dbt_job_last_run_owner_thread_id: Optional[str]): + def asset_dbt_job_last_run_owner_thread_id( + self, asset_dbt_job_last_run_owner_thread_id: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_owner_thread_id = asset_dbt_job_last_run_owner_thread_id + self.attributes.asset_dbt_job_last_run_owner_thread_id = ( + asset_dbt_job_last_run_owner_thread_id + ) @property def asset_dbt_job_last_run_executed_by_thread_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_executed_by_thread_id + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_executed_by_thread_id + ) @asset_dbt_job_last_run_executed_by_thread_id.setter - def asset_dbt_job_last_run_executed_by_thread_id(self, asset_dbt_job_last_run_executed_by_thread_id: Optional[str]): + def asset_dbt_job_last_run_executed_by_thread_id( + self, asset_dbt_job_last_run_executed_by_thread_id: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_executed_by_thread_id = asset_dbt_job_last_run_executed_by_thread_id + self.attributes.asset_dbt_job_last_run_executed_by_thread_id = ( + asset_dbt_job_last_run_executed_by_thread_id + ) @property def asset_dbt_job_last_run_artifacts_saved(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_artifacts_saved + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_artifacts_saved + ) @asset_dbt_job_last_run_artifacts_saved.setter - def asset_dbt_job_last_run_artifacts_saved(self, asset_dbt_job_last_run_artifacts_saved: Optional[bool]): + def asset_dbt_job_last_run_artifacts_saved( + self, asset_dbt_job_last_run_artifacts_saved: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_artifacts_saved = asset_dbt_job_last_run_artifacts_saved + self.attributes.asset_dbt_job_last_run_artifacts_saved = ( + asset_dbt_job_last_run_artifacts_saved + ) @property def asset_dbt_job_last_run_artifact_s3_path(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_artifact_s3_path + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_artifact_s3_path + ) @asset_dbt_job_last_run_artifact_s3_path.setter - def asset_dbt_job_last_run_artifact_s3_path(self, asset_dbt_job_last_run_artifact_s3_path: Optional[str]): + def asset_dbt_job_last_run_artifact_s3_path( + self, asset_dbt_job_last_run_artifact_s3_path: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_artifact_s3_path = asset_dbt_job_last_run_artifact_s3_path + self.attributes.asset_dbt_job_last_run_artifact_s3_path = ( + asset_dbt_job_last_run_artifact_s3_path + ) @property def asset_dbt_job_last_run_has_docs_generated(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_has_docs_generated + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_has_docs_generated + ) @asset_dbt_job_last_run_has_docs_generated.setter - def asset_dbt_job_last_run_has_docs_generated(self, asset_dbt_job_last_run_has_docs_generated: Optional[bool]): + def asset_dbt_job_last_run_has_docs_generated( + self, asset_dbt_job_last_run_has_docs_generated: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_has_docs_generated = asset_dbt_job_last_run_has_docs_generated + self.attributes.asset_dbt_job_last_run_has_docs_generated = ( + asset_dbt_job_last_run_has_docs_generated + ) @property def asset_dbt_job_last_run_has_sources_generated(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_has_sources_generated + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_has_sources_generated + ) @asset_dbt_job_last_run_has_sources_generated.setter def asset_dbt_job_last_run_has_sources_generated( @@ -2112,21 +2509,33 @@ def asset_dbt_job_last_run_has_sources_generated( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_has_sources_generated = asset_dbt_job_last_run_has_sources_generated + self.attributes.asset_dbt_job_last_run_has_sources_generated = ( + asset_dbt_job_last_run_has_sources_generated + ) @property def asset_dbt_job_last_run_notifications_sent(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.asset_dbt_job_last_run_notifications_sent + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_last_run_notifications_sent + ) @asset_dbt_job_last_run_notifications_sent.setter - def asset_dbt_job_last_run_notifications_sent(self, asset_dbt_job_last_run_notifications_sent: Optional[bool]): + def asset_dbt_job_last_run_notifications_sent( + self, asset_dbt_job_last_run_notifications_sent: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_last_run_notifications_sent = asset_dbt_job_last_run_notifications_sent + self.attributes.asset_dbt_job_last_run_notifications_sent = ( + asset_dbt_job_last_run_notifications_sent + ) @property def asset_dbt_job_next_run(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.asset_dbt_job_next_run + return ( + None if self.attributes is None else self.attributes.asset_dbt_job_next_run + ) @asset_dbt_job_next_run.setter def asset_dbt_job_next_run(self, asset_dbt_job_next_run: Optional[datetime]): @@ -2136,17 +2545,29 @@ def asset_dbt_job_next_run(self, asset_dbt_job_next_run: Optional[datetime]): @property def asset_dbt_job_next_run_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_job_next_run_humanized + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_job_next_run_humanized + ) @asset_dbt_job_next_run_humanized.setter - def asset_dbt_job_next_run_humanized(self, asset_dbt_job_next_run_humanized: Optional[str]): + def asset_dbt_job_next_run_humanized( + self, asset_dbt_job_next_run_humanized: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_job_next_run_humanized = asset_dbt_job_next_run_humanized + self.attributes.asset_dbt_job_next_run_humanized = ( + asset_dbt_job_next_run_humanized + ) @property def asset_dbt_environment_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_environment_name + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_environment_name + ) @asset_dbt_environment_name.setter def asset_dbt_environment_name(self, asset_dbt_environment_name: Optional[str]): @@ -2156,13 +2577,21 @@ def asset_dbt_environment_name(self, asset_dbt_environment_name: Optional[str]): @property def asset_dbt_environment_dbt_version(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_environment_dbt_version + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_environment_dbt_version + ) @asset_dbt_environment_dbt_version.setter - def asset_dbt_environment_dbt_version(self, asset_dbt_environment_dbt_version: Optional[str]): + def asset_dbt_environment_dbt_version( + self, asset_dbt_environment_dbt_version: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_environment_dbt_version = asset_dbt_environment_dbt_version + self.attributes.asset_dbt_environment_dbt_version = ( + asset_dbt_environment_dbt_version + ) @property def asset_dbt_tags(self) -> Optional[Set[str]]: @@ -2176,23 +2605,39 @@ def asset_dbt_tags(self, asset_dbt_tags: Optional[Set[str]]): @property def asset_dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_semantic_layer_proxy_url + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_semantic_layer_proxy_url + ) @asset_dbt_semantic_layer_proxy_url.setter - def asset_dbt_semantic_layer_proxy_url(self, asset_dbt_semantic_layer_proxy_url: Optional[str]): + def asset_dbt_semantic_layer_proxy_url( + self, asset_dbt_semantic_layer_proxy_url: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_semantic_layer_proxy_url = asset_dbt_semantic_layer_proxy_url + self.attributes.asset_dbt_semantic_layer_proxy_url = ( + asset_dbt_semantic_layer_proxy_url + ) @property def asset_dbt_source_freshness_criteria(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_dbt_source_freshness_criteria + return ( + None + if self.attributes is None + else self.attributes.asset_dbt_source_freshness_criteria + ) @asset_dbt_source_freshness_criteria.setter - def asset_dbt_source_freshness_criteria(self, asset_dbt_source_freshness_criteria: Optional[str]): + def asset_dbt_source_freshness_criteria( + self, asset_dbt_source_freshness_criteria: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_dbt_source_freshness_criteria = asset_dbt_source_freshness_criteria + self.attributes.asset_dbt_source_freshness_criteria = ( + asset_dbt_source_freshness_criteria + ) @property def sample_data_url(self) -> Optional[str]: @@ -2216,7 +2661,9 @@ def asset_tags(self, asset_tags: Optional[Set[str]]): @property def asset_mc_incident_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_incident_names + return ( + None if self.attributes is None else self.attributes.asset_mc_incident_names + ) @asset_mc_incident_names.setter def asset_mc_incident_names(self, asset_mc_incident_names: Optional[Set[str]]): @@ -2226,27 +2673,43 @@ def asset_mc_incident_names(self, asset_mc_incident_names: Optional[Set[str]]): @property def asset_mc_incident_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_incident_qualified_names + return ( + None + if self.attributes is None + else self.attributes.asset_mc_incident_qualified_names + ) @asset_mc_incident_qualified_names.setter - def asset_mc_incident_qualified_names(self, asset_mc_incident_qualified_names: Optional[Set[str]]): + def asset_mc_incident_qualified_names( + self, asset_mc_incident_qualified_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_mc_incident_qualified_names = asset_mc_incident_qualified_names + self.attributes.asset_mc_incident_qualified_names = ( + asset_mc_incident_qualified_names + ) @property def asset_mc_alert_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_alert_qualified_names + return ( + None + if self.attributes is None + else self.attributes.asset_mc_alert_qualified_names + ) @asset_mc_alert_qualified_names.setter - def asset_mc_alert_qualified_names(self, asset_mc_alert_qualified_names: Optional[Set[str]]): + def asset_mc_alert_qualified_names( + self, asset_mc_alert_qualified_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_mc_alert_qualified_names = asset_mc_alert_qualified_names @property def asset_mc_monitor_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_monitor_names + return ( + None if self.attributes is None else self.attributes.asset_mc_monitor_names + ) @asset_mc_monitor_names.setter def asset_mc_monitor_names(self, asset_mc_monitor_names: Optional[Set[str]]): @@ -2256,17 +2719,29 @@ def asset_mc_monitor_names(self, asset_mc_monitor_names: Optional[Set[str]]): @property def asset_mc_monitor_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_monitor_qualified_names + return ( + None + if self.attributes is None + else self.attributes.asset_mc_monitor_qualified_names + ) @asset_mc_monitor_qualified_names.setter - def asset_mc_monitor_qualified_names(self, asset_mc_monitor_qualified_names: Optional[Set[str]]): + def asset_mc_monitor_qualified_names( + self, asset_mc_monitor_qualified_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_mc_monitor_qualified_names = asset_mc_monitor_qualified_names + self.attributes.asset_mc_monitor_qualified_names = ( + asset_mc_monitor_qualified_names + ) @property def asset_mc_monitor_statuses(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_monitor_statuses + return ( + None + if self.attributes is None + else self.attributes.asset_mc_monitor_statuses + ) @asset_mc_monitor_statuses.setter def asset_mc_monitor_statuses(self, asset_mc_monitor_statuses: Optional[Set[str]]): @@ -2276,7 +2751,9 @@ def asset_mc_monitor_statuses(self, asset_mc_monitor_statuses: Optional[Set[str] @property def asset_mc_monitor_types(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_monitor_types + return ( + None if self.attributes is None else self.attributes.asset_mc_monitor_types + ) @asset_mc_monitor_types.setter def asset_mc_monitor_types(self, asset_mc_monitor_types: Optional[Set[str]]): @@ -2286,17 +2763,27 @@ def asset_mc_monitor_types(self, asset_mc_monitor_types: Optional[Set[str]]): @property def asset_mc_monitor_schedule_types(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_monitor_schedule_types + return ( + None + if self.attributes is None + else self.attributes.asset_mc_monitor_schedule_types + ) @asset_mc_monitor_schedule_types.setter - def asset_mc_monitor_schedule_types(self, asset_mc_monitor_schedule_types: Optional[Set[str]]): + def asset_mc_monitor_schedule_types( + self, asset_mc_monitor_schedule_types: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_mc_monitor_schedule_types = asset_mc_monitor_schedule_types + self.attributes.asset_mc_monitor_schedule_types = ( + asset_mc_monitor_schedule_types + ) @property def asset_mc_incident_types(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_incident_types + return ( + None if self.attributes is None else self.attributes.asset_mc_incident_types + ) @asset_mc_incident_types.setter def asset_mc_incident_types(self, asset_mc_incident_types: Optional[Set[str]]): @@ -2306,37 +2793,59 @@ def asset_mc_incident_types(self, asset_mc_incident_types: Optional[Set[str]]): @property def asset_mc_incident_sub_types(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_incident_sub_types + return ( + None + if self.attributes is None + else self.attributes.asset_mc_incident_sub_types + ) @asset_mc_incident_sub_types.setter - def asset_mc_incident_sub_types(self, asset_mc_incident_sub_types: Optional[Set[str]]): + def asset_mc_incident_sub_types( + self, asset_mc_incident_sub_types: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_mc_incident_sub_types = asset_mc_incident_sub_types @property def asset_mc_incident_severities(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_incident_severities + return ( + None + if self.attributes is None + else self.attributes.asset_mc_incident_severities + ) @asset_mc_incident_severities.setter - def asset_mc_incident_severities(self, asset_mc_incident_severities: Optional[Set[str]]): + def asset_mc_incident_severities( + self, asset_mc_incident_severities: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_mc_incident_severities = asset_mc_incident_severities @property def asset_mc_incident_priorities(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_incident_priorities + return ( + None + if self.attributes is None + else self.attributes.asset_mc_incident_priorities + ) @asset_mc_incident_priorities.setter - def asset_mc_incident_priorities(self, asset_mc_incident_priorities: Optional[Set[str]]): + def asset_mc_incident_priorities( + self, asset_mc_incident_priorities: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_mc_incident_priorities = asset_mc_incident_priorities @property def asset_mc_incident_states(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_mc_incident_states + return ( + None + if self.attributes is None + else self.attributes.asset_mc_incident_states + ) @asset_mc_incident_states.setter def asset_mc_incident_states(self, asset_mc_incident_states: Optional[Set[str]]): @@ -2346,7 +2855,9 @@ def asset_mc_incident_states(self, asset_mc_incident_states: Optional[Set[str]]) @property def asset_mc_is_monitored(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.asset_mc_is_monitored + return ( + None if self.attributes is None else self.attributes.asset_mc_is_monitored + ) @asset_mc_is_monitored.setter def asset_mc_is_monitored(self, asset_mc_is_monitored: Optional[bool]): @@ -2356,7 +2867,11 @@ def asset_mc_is_monitored(self, asset_mc_is_monitored: Optional[bool]): @property def asset_mc_last_sync_run_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.asset_mc_last_sync_run_at + return ( + None + if self.attributes is None + else self.attributes.asset_mc_last_sync_run_at + ) @asset_mc_last_sync_run_at.setter def asset_mc_last_sync_run_at(self, asset_mc_last_sync_run_at: Optional[datetime]): @@ -2379,7 +2894,9 @@ def starred_details_list(self) -> Optional[List[StarredDetails]]: return None if self.attributes is None else self.attributes.starred_details_list @starred_details_list.setter - def starred_details_list(self, starred_details_list: Optional[List[StarredDetails]]): + def starred_details_list( + self, starred_details_list: Optional[List[StarredDetails]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.starred_details_list = starred_details_list @@ -2396,7 +2913,11 @@ def starred_count(self, starred_count: Optional[int]): @property def asset_anomalo_d_q_status(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_anomalo_d_q_status + return ( + None + if self.attributes is None + else self.attributes.asset_anomalo_d_q_status + ) @asset_anomalo_d_q_status.setter def asset_anomalo_d_q_status(self, asset_anomalo_d_q_status: Optional[str]): @@ -2406,7 +2927,11 @@ def asset_anomalo_d_q_status(self, asset_anomalo_d_q_status: Optional[str]): @property def asset_anomalo_check_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.asset_anomalo_check_count + return ( + None + if self.attributes is None + else self.attributes.asset_anomalo_check_count + ) @asset_anomalo_check_count.setter def asset_anomalo_check_count(self, asset_anomalo_check_count: Optional[int]): @@ -2416,17 +2941,29 @@ def asset_anomalo_check_count(self, asset_anomalo_check_count: Optional[int]): @property def asset_anomalo_failed_check_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.asset_anomalo_failed_check_count + return ( + None + if self.attributes is None + else self.attributes.asset_anomalo_failed_check_count + ) @asset_anomalo_failed_check_count.setter - def asset_anomalo_failed_check_count(self, asset_anomalo_failed_check_count: Optional[int]): + def asset_anomalo_failed_check_count( + self, asset_anomalo_failed_check_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_anomalo_failed_check_count = asset_anomalo_failed_check_count + self.attributes.asset_anomalo_failed_check_count = ( + asset_anomalo_failed_check_count + ) @property def asset_anomalo_check_statuses(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_anomalo_check_statuses + return ( + None + if self.attributes is None + else self.attributes.asset_anomalo_check_statuses + ) @asset_anomalo_check_statuses.setter def asset_anomalo_check_statuses(self, asset_anomalo_check_statuses: Optional[str]): @@ -2436,37 +2973,65 @@ def asset_anomalo_check_statuses(self, asset_anomalo_check_statuses: Optional[st @property def asset_anomalo_last_check_run_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.asset_anomalo_last_check_run_at + return ( + None + if self.attributes is None + else self.attributes.asset_anomalo_last_check_run_at + ) @asset_anomalo_last_check_run_at.setter - def asset_anomalo_last_check_run_at(self, asset_anomalo_last_check_run_at: Optional[datetime]): + def asset_anomalo_last_check_run_at( + self, asset_anomalo_last_check_run_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_anomalo_last_check_run_at = asset_anomalo_last_check_run_at + self.attributes.asset_anomalo_last_check_run_at = ( + asset_anomalo_last_check_run_at + ) @property def asset_anomalo_applied_check_types(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_anomalo_applied_check_types + return ( + None + if self.attributes is None + else self.attributes.asset_anomalo_applied_check_types + ) @asset_anomalo_applied_check_types.setter - def asset_anomalo_applied_check_types(self, asset_anomalo_applied_check_types: Optional[Set[str]]): + def asset_anomalo_applied_check_types( + self, asset_anomalo_applied_check_types: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_anomalo_applied_check_types = asset_anomalo_applied_check_types + self.attributes.asset_anomalo_applied_check_types = ( + asset_anomalo_applied_check_types + ) @property def asset_anomalo_failed_check_types(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_anomalo_failed_check_types + return ( + None + if self.attributes is None + else self.attributes.asset_anomalo_failed_check_types + ) @asset_anomalo_failed_check_types.setter - def asset_anomalo_failed_check_types(self, asset_anomalo_failed_check_types: Optional[Set[str]]): + def asset_anomalo_failed_check_types( + self, asset_anomalo_failed_check_types: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.asset_anomalo_failed_check_types = asset_anomalo_failed_check_types + self.attributes.asset_anomalo_failed_check_types = ( + asset_anomalo_failed_check_types + ) @property def asset_anomalo_source_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_anomalo_source_url + return ( + None + if self.attributes is None + else self.attributes.asset_anomalo_source_url + ) @asset_anomalo_source_url.setter def asset_anomalo_source_url(self, asset_anomalo_source_url: Optional[str]): @@ -2476,7 +3041,9 @@ def asset_anomalo_source_url(self, asset_anomalo_source_url: Optional[str]): @property def asset_soda_d_q_status(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_soda_d_q_status + return ( + None if self.attributes is None else self.attributes.asset_soda_d_q_status + ) @asset_soda_d_q_status.setter def asset_soda_d_q_status(self, asset_soda_d_q_status: Optional[str]): @@ -2486,7 +3053,9 @@ def asset_soda_d_q_status(self, asset_soda_d_q_status: Optional[str]): @property def asset_soda_check_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.asset_soda_check_count + return ( + None if self.attributes is None else self.attributes.asset_soda_check_count + ) @asset_soda_check_count.setter def asset_soda_check_count(self, asset_soda_check_count: Optional[int]): @@ -2496,17 +3065,25 @@ def asset_soda_check_count(self, asset_soda_check_count: Optional[int]): @property def asset_soda_last_sync_run_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.asset_soda_last_sync_run_at + return ( + None + if self.attributes is None + else self.attributes.asset_soda_last_sync_run_at + ) @asset_soda_last_sync_run_at.setter - def asset_soda_last_sync_run_at(self, asset_soda_last_sync_run_at: Optional[datetime]): + def asset_soda_last_sync_run_at( + self, asset_soda_last_sync_run_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.asset_soda_last_sync_run_at = asset_soda_last_sync_run_at @property def asset_soda_last_scan_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.asset_soda_last_scan_at + return ( + None if self.attributes is None else self.attributes.asset_soda_last_scan_at + ) @asset_soda_last_scan_at.setter def asset_soda_last_scan_at(self, asset_soda_last_scan_at: Optional[datetime]): @@ -2516,7 +3093,11 @@ def asset_soda_last_scan_at(self, asset_soda_last_scan_at: Optional[datetime]): @property def asset_soda_check_statuses(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_soda_check_statuses + return ( + None + if self.attributes is None + else self.attributes.asset_soda_check_statuses + ) @asset_soda_check_statuses.setter def asset_soda_check_statuses(self, asset_soda_check_statuses: Optional[str]): @@ -2526,7 +3107,9 @@ def asset_soda_check_statuses(self, asset_soda_check_statuses: Optional[str]): @property def asset_soda_source_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.asset_soda_source_url + return ( + None if self.attributes is None else self.attributes.asset_soda_source_url + ) @asset_soda_source_url.setter def asset_soda_source_url(self, asset_soda_source_url: Optional[str]): @@ -2586,7 +3169,11 @@ def asset_theme_hex(self, asset_theme_hex: Optional[str]): @property def lexicographical_sort_order(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.lexicographical_sort_order + return ( + None + if self.attributes is None + else self.attributes.lexicographical_sort_order + ) @lexicographical_sort_order.setter def lexicographical_sort_order(self, lexicographical_sort_order: Optional[str]): @@ -2606,7 +3193,9 @@ def has_contract(self, has_contract: Optional[bool]): @property def asset_policy_g_u_i_ds(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.asset_policy_g_u_i_ds + return ( + None if self.attributes is None else self.attributes.asset_policy_g_u_i_ds + ) @asset_policy_g_u_i_ds.setter def asset_policy_g_u_i_ds(self, asset_policy_g_u_i_ds: Optional[Set[str]]): @@ -2636,17 +3225,29 @@ def domain_g_u_i_ds(self, domain_g_u_i_ds: Optional[Set[str]]): @property def non_compliant_asset_policy_g_u_i_ds(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.non_compliant_asset_policy_g_u_i_ds + return ( + None + if self.attributes is None + else self.attributes.non_compliant_asset_policy_g_u_i_ds + ) @non_compliant_asset_policy_g_u_i_ds.setter - def non_compliant_asset_policy_g_u_i_ds(self, non_compliant_asset_policy_g_u_i_ds: Optional[Set[str]]): + def non_compliant_asset_policy_g_u_i_ds( + self, non_compliant_asset_policy_g_u_i_ds: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.non_compliant_asset_policy_g_u_i_ds = non_compliant_asset_policy_g_u_i_ds + self.attributes.non_compliant_asset_policy_g_u_i_ds = ( + non_compliant_asset_policy_g_u_i_ds + ) @property def application_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.application_qualified_name + return ( + None + if self.attributes is None + else self.attributes.application_qualified_name + ) @application_qualified_name.setter def application_qualified_name(self, application_qualified_name: Optional[str]): @@ -2656,30 +3257,50 @@ def application_qualified_name(self, application_qualified_name: Optional[str]): @property def application_field_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.application_field_qualified_name + return ( + None + if self.attributes is None + else self.attributes.application_field_qualified_name + ) @application_field_qualified_name.setter - def application_field_qualified_name(self, application_field_qualified_name: Optional[str]): + def application_field_qualified_name( + self, application_field_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.application_field_qualified_name = application_field_qualified_name + self.attributes.application_field_qualified_name = ( + application_field_qualified_name + ) @property def schema_registry_subjects(self) -> Optional[List[SchemaRegistrySubject]]: - return None if self.attributes is None else self.attributes.schema_registry_subjects + return ( + None + if self.attributes is None + else self.attributes.schema_registry_subjects + ) @schema_registry_subjects.setter - def schema_registry_subjects(self, schema_registry_subjects: Optional[List[SchemaRegistrySubject]]): + def schema_registry_subjects( + self, schema_registry_subjects: Optional[List[SchemaRegistrySubject]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.schema_registry_subjects = schema_registry_subjects @property def data_contract_latest_certified(self) -> Optional[DataContract]: - return None if self.attributes is None else self.attributes.data_contract_latest_certified + return ( + None + if self.attributes is None + else self.attributes.data_contract_latest_certified + ) @data_contract_latest_certified.setter - def data_contract_latest_certified(self, data_contract_latest_certified: Optional[DataContract]): + def data_contract_latest_certified( + self, data_contract_latest_certified: Optional[DataContract] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_contract_latest_certified = data_contract_latest_certified @@ -2696,30 +3317,48 @@ def anomalo_checks(self, anomalo_checks: Optional[List[AnomaloCheck]]): @property def user_def_relationship_to(self) -> Optional[List[Referenceable]]: - return None if self.attributes is None else self.attributes.user_def_relationship_to + return ( + None + if self.attributes is None + else self.attributes.user_def_relationship_to + ) @user_def_relationship_to.setter - def user_def_relationship_to(self, user_def_relationship_to: Optional[List[Referenceable]]): + def user_def_relationship_to( + self, user_def_relationship_to: Optional[List[Referenceable]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.user_def_relationship_to = user_def_relationship_to @property def output_port_data_products(self) -> Optional[List[DataProduct]]: - return None if self.attributes is None else self.attributes.output_port_data_products + return ( + None + if self.attributes is None + else self.attributes.output_port_data_products + ) @output_port_data_products.setter - def output_port_data_products(self, output_port_data_products: Optional[List[DataProduct]]): + def output_port_data_products( + self, output_port_data_products: Optional[List[DataProduct]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.output_port_data_products = output_port_data_products @property def user_def_relationship_from(self) -> Optional[List[Referenceable]]: - return None if self.attributes is None else self.attributes.user_def_relationship_from + return ( + None + if self.attributes is None + else self.attributes.user_def_relationship_from + ) @user_def_relationship_from.setter - def user_def_relationship_from(self, user_def_relationship_from: Optional[List[Referenceable]]): + def user_def_relationship_from( + self, user_def_relationship_from: Optional[List[Referenceable]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.user_def_relationship_from = user_def_relationship_from @@ -2826,10 +3465,16 @@ def metrics(self, metrics: Optional[List[Metric]]): @property def input_port_data_products(self) -> Optional[List[DataProduct]]: - return None if self.attributes is None else self.attributes.input_port_data_products + return ( + None + if self.attributes is None + else self.attributes.input_port_data_products + ) @input_port_data_products.setter - def input_port_data_products(self, input_port_data_products: Optional[List[DataProduct]]): + def input_port_data_products( + self, input_port_data_products: Optional[List[DataProduct]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.input_port_data_products = input_port_data_products @@ -2850,14 +3495,18 @@ class Attributes(Referenceable.Attributes): description: Optional[str] = Field(default=None, description="") user_description: Optional[str] = Field(default=None, description="") tenant_id: Optional[str] = Field(default=None, description="") - certificate_status: Optional[CertificateStatus] = Field(default=None, description="") + certificate_status: Optional[CertificateStatus] = Field( + default=None, description="" + ) certificate_status_message: Optional[str] = Field(default=None, description="") certificate_updated_by: Optional[str] = Field(default=None, description="") certificate_updated_at: Optional[datetime] = Field(default=None, description="") announcement_title: Optional[str] = Field(default=None, description="") announcement_message: Optional[str] = Field(default=None, description="") announcement_type: Optional[str] = Field(default=None, description="") - announcement_updated_at: Optional[datetime] = Field(default=None, description="") + announcement_updated_at: Optional[datetime] = Field( + default=None, description="" + ) announcement_updated_by: Optional[str] = Field(default=None, description="") owner_users: Optional[Set[str]] = Field(default=None, description="") owner_groups: Optional[Set[str]] = Field(default=None, description="") @@ -2890,21 +3539,41 @@ class Attributes(Referenceable.Attributes): source_last_read_at: Optional[datetime] = Field(default=None, description="") last_row_changed_at: Optional[datetime] = Field(default=None, description="") source_total_cost: Optional[float] = Field(default=None, description="") - source_cost_unit: Optional[SourceCostUnitType] = Field(default=None, description="") + source_cost_unit: Optional[SourceCostUnitType] = Field( + default=None, description="" + ) source_read_query_cost: Optional[float] = Field(default=None, description="") - source_read_recent_user_list: Optional[Set[str]] = Field(default=None, description="") - source_read_recent_user_record_list: Optional[List[PopularityInsights]] = Field(default=None, description="") - source_read_top_user_list: Optional[Set[str]] = Field(default=None, description="") - source_read_top_user_record_list: Optional[List[PopularityInsights]] = Field(default=None, description="") - source_read_popular_query_record_list: Optional[List[PopularityInsights]] = Field(default=None, description="") - source_read_expensive_query_record_list: Optional[List[PopularityInsights]] = Field( + source_read_recent_user_list: Optional[Set[str]] = Field( + default=None, description="" + ) + source_read_recent_user_record_list: Optional[List[PopularityInsights]] = Field( + default=None, description="" + ) + source_read_top_user_list: Optional[Set[str]] = Field( + default=None, description="" + ) + source_read_top_user_record_list: Optional[List[PopularityInsights]] = Field( default=None, description="" ) - source_read_slow_query_record_list: Optional[List[PopularityInsights]] = Field(default=None, description="") - source_query_compute_cost_list: Optional[Set[str]] = Field(default=None, description="") - source_query_compute_cost_record_list: Optional[List[PopularityInsights]] = Field(default=None, description="") + source_read_popular_query_record_list: Optional[List[PopularityInsights]] = ( + Field(default=None, description="") + ) + source_read_expensive_query_record_list: Optional[List[PopularityInsights]] = ( + Field(default=None, description="") + ) + source_read_slow_query_record_list: Optional[List[PopularityInsights]] = Field( + default=None, description="" + ) + source_query_compute_cost_list: Optional[Set[str]] = Field( + default=None, description="" + ) + source_query_compute_cost_record_list: Optional[List[PopularityInsights]] = ( + Field(default=None, description="") + ) dbt_qualified_name: Optional[str] = Field(default=None, description="") - asset_dbt_workflow_last_updated: Optional[str] = Field(default=None, description="") + asset_dbt_workflow_last_updated: Optional[str] = Field( + default=None, description="" + ) asset_dbt_alias: Optional[str] = Field(default=None, description="") asset_dbt_meta: Optional[str] = Field(default=None, description="") asset_dbt_unique_id: Optional[str] = Field(default=None, description="") @@ -2915,68 +3584,158 @@ class Attributes(Referenceable.Attributes): asset_dbt_job_schedule: Optional[str] = Field(default=None, description="") asset_dbt_job_status: Optional[str] = Field(default=None, description="") asset_dbt_test_status: Optional[str] = Field(default=None, description="") - asset_dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") + asset_dbt_job_schedule_cron_humanized: Optional[str] = Field( + default=None, description="" + ) asset_dbt_job_last_run: Optional[datetime] = Field(default=None, description="") asset_dbt_job_last_run_url: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_created_at: Optional[datetime] = Field(default=None, description="") - asset_dbt_job_last_run_updated_at: Optional[datetime] = Field(default=None, description="") - asset_dbt_job_last_run_dequed_at: Optional[datetime] = Field(default=None, description="") - asset_dbt_job_last_run_started_at: Optional[datetime] = Field(default=None, description="") - asset_dbt_job_last_run_total_duration: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_total_duration_humanized: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_queued_duration: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_queued_duration_humanized: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_run_duration: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_run_duration_humanized: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_git_branch: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_git_sha: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_status_message: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_owner_thread_id: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_executed_by_thread_id: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_artifacts_saved: Optional[bool] = Field(default=None, description="") - asset_dbt_job_last_run_artifact_s3_path: Optional[str] = Field(default=None, description="") - asset_dbt_job_last_run_has_docs_generated: Optional[bool] = Field(default=None, description="") - asset_dbt_job_last_run_has_sources_generated: Optional[bool] = Field(default=None, description="") - asset_dbt_job_last_run_notifications_sent: Optional[bool] = Field(default=None, description="") + asset_dbt_job_last_run_created_at: Optional[datetime] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_updated_at: Optional[datetime] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_dequed_at: Optional[datetime] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_started_at: Optional[datetime] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_total_duration: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_total_duration_humanized: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_queued_duration: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_queued_duration_humanized: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_run_duration: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_run_duration_humanized: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_git_branch: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_git_sha: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_status_message: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_owner_thread_id: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_executed_by_thread_id: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_artifacts_saved: Optional[bool] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_artifact_s3_path: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_has_docs_generated: Optional[bool] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_has_sources_generated: Optional[bool] = Field( + default=None, description="" + ) + asset_dbt_job_last_run_notifications_sent: Optional[bool] = Field( + default=None, description="" + ) asset_dbt_job_next_run: Optional[datetime] = Field(default=None, description="") - asset_dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") + asset_dbt_job_next_run_humanized: Optional[str] = Field( + default=None, description="" + ) asset_dbt_environment_name: Optional[str] = Field(default=None, description="") - asset_dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") + asset_dbt_environment_dbt_version: Optional[str] = Field( + default=None, description="" + ) asset_dbt_tags: Optional[Set[str]] = Field(default=None, description="") - asset_dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") - asset_dbt_source_freshness_criteria: Optional[str] = Field(default=None, description="") + asset_dbt_semantic_layer_proxy_url: Optional[str] = Field( + default=None, description="" + ) + asset_dbt_source_freshness_criteria: Optional[str] = Field( + default=None, description="" + ) sample_data_url: Optional[str] = Field(default=None, description="") asset_tags: Optional[Set[str]] = Field(default=None, description="") - asset_mc_incident_names: Optional[Set[str]] = Field(default=None, description="") - asset_mc_incident_qualified_names: Optional[Set[str]] = Field(default=None, description="") - asset_mc_alert_qualified_names: Optional[Set[str]] = Field(default=None, description="") + asset_mc_incident_names: Optional[Set[str]] = Field( + default=None, description="" + ) + asset_mc_incident_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) + asset_mc_alert_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) asset_mc_monitor_names: Optional[Set[str]] = Field(default=None, description="") - asset_mc_monitor_qualified_names: Optional[Set[str]] = Field(default=None, description="") - asset_mc_monitor_statuses: Optional[Set[str]] = Field(default=None, description="") + asset_mc_monitor_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) + asset_mc_monitor_statuses: Optional[Set[str]] = Field( + default=None, description="" + ) asset_mc_monitor_types: Optional[Set[str]] = Field(default=None, description="") - asset_mc_monitor_schedule_types: Optional[Set[str]] = Field(default=None, description="") - asset_mc_incident_types: Optional[Set[str]] = Field(default=None, description="") - asset_mc_incident_sub_types: Optional[Set[str]] = Field(default=None, description="") - asset_mc_incident_severities: Optional[Set[str]] = Field(default=None, description="") - asset_mc_incident_priorities: Optional[Set[str]] = Field(default=None, description="") - asset_mc_incident_states: Optional[Set[str]] = Field(default=None, description="") + asset_mc_monitor_schedule_types: Optional[Set[str]] = Field( + default=None, description="" + ) + asset_mc_incident_types: Optional[Set[str]] = Field( + default=None, description="" + ) + asset_mc_incident_sub_types: Optional[Set[str]] = Field( + default=None, description="" + ) + asset_mc_incident_severities: Optional[Set[str]] = Field( + default=None, description="" + ) + asset_mc_incident_priorities: Optional[Set[str]] = Field( + default=None, description="" + ) + asset_mc_incident_states: Optional[Set[str]] = Field( + default=None, description="" + ) asset_mc_is_monitored: Optional[bool] = Field(default=None, description="") - asset_mc_last_sync_run_at: Optional[datetime] = Field(default=None, description="") + asset_mc_last_sync_run_at: Optional[datetime] = Field( + default=None, description="" + ) starred_by: Optional[Set[str]] = Field(default=None, description="") - starred_details_list: Optional[List[StarredDetails]] = Field(default=None, description="") + starred_details_list: Optional[List[StarredDetails]] = Field( + default=None, description="" + ) starred_count: Optional[int] = Field(default=None, description="") asset_anomalo_d_q_status: Optional[str] = Field(default=None, description="") asset_anomalo_check_count: Optional[int] = Field(default=None, description="") - asset_anomalo_failed_check_count: Optional[int] = Field(default=None, description="") - asset_anomalo_check_statuses: Optional[str] = Field(default=None, description="") - asset_anomalo_last_check_run_at: Optional[datetime] = Field(default=None, description="") - asset_anomalo_applied_check_types: Optional[Set[str]] = Field(default=None, description="") - asset_anomalo_failed_check_types: Optional[Set[str]] = Field(default=None, description="") + asset_anomalo_failed_check_count: Optional[int] = Field( + default=None, description="" + ) + asset_anomalo_check_statuses: Optional[str] = Field( + default=None, description="" + ) + asset_anomalo_last_check_run_at: Optional[datetime] = Field( + default=None, description="" + ) + asset_anomalo_applied_check_types: Optional[Set[str]] = Field( + default=None, description="" + ) + asset_anomalo_failed_check_types: Optional[Set[str]] = Field( + default=None, description="" + ) asset_anomalo_source_url: Optional[str] = Field(default=None, description="") asset_soda_d_q_status: Optional[str] = Field(default=None, description="") asset_soda_check_count: Optional[int] = Field(default=None, description="") - asset_soda_last_sync_run_at: Optional[datetime] = Field(default=None, description="") - asset_soda_last_scan_at: Optional[datetime] = Field(default=None, description="") + asset_soda_last_sync_run_at: Optional[datetime] = Field( + default=None, description="" + ) + asset_soda_last_scan_at: Optional[datetime] = Field( + default=None, description="" + ) asset_soda_check_statuses: Optional[str] = Field(default=None, description="") asset_soda_source_url: Optional[str] = Field(default=None, description="") asset_icon: Optional[str] = Field(default=None, description="") @@ -2989,29 +3748,65 @@ class Attributes(Referenceable.Attributes): asset_policy_g_u_i_ds: Optional[Set[str]] = Field(default=None, description="") asset_policies_count: Optional[int] = Field(default=None, description="") domain_g_u_i_ds: Optional[Set[str]] = Field(default=None, description="") - non_compliant_asset_policy_g_u_i_ds: Optional[Set[str]] = Field(default=None, description="") + non_compliant_asset_policy_g_u_i_ds: Optional[Set[str]] = Field( + default=None, description="" + ) application_qualified_name: Optional[str] = Field(default=None, description="") - application_field_qualified_name: Optional[str] = Field(default=None, description="") + application_field_qualified_name: Optional[str] = Field( + default=None, description="" + ) schema_registry_subjects: Optional[List[SchemaRegistrySubject]] = Field( default=None, description="" ) # relationship - data_contract_latest_certified: Optional[DataContract] = Field(default=None, description="") # relationship - anomalo_checks: Optional[List[AnomaloCheck]] = Field(default=None, description="") # relationship - user_def_relationship_to: Optional[List[Referenceable]] = Field(default=None, description="") # relationship - output_port_data_products: Optional[List[DataProduct]] = Field(default=None, description="") # relationship - user_def_relationship_from: Optional[List[Referenceable]] = Field(default=None, description="") # relationship + data_contract_latest_certified: Optional[DataContract] = Field( + default=None, description="" + ) # relationship + anomalo_checks: Optional[List[AnomaloCheck]] = Field( + default=None, description="" + ) # relationship + user_def_relationship_to: Optional[List[Referenceable]] = Field( + default=None, description="" + ) # relationship + output_port_data_products: Optional[List[DataProduct]] = Field( + default=None, description="" + ) # relationship + user_def_relationship_from: Optional[List[Referenceable]] = Field( + default=None, description="" + ) # relationship readme: Optional[Readme] = Field(default=None, description="") # relationship - application_field: Optional[ApplicationField] = Field(default=None, description="") # relationship - data_contract_latest: Optional[DataContract] = Field(default=None, description="") # relationship - meanings: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - mc_monitors: Optional[List[MCMonitor]] = Field(default=None, description="") # relationship - application: Optional[Application] = Field(default=None, description="") # relationship - files: Optional[List[File]] = Field(default=None, description="") # relationship - mc_incidents: Optional[List[MCIncident]] = Field(default=None, description="") # relationship - links: Optional[List[Link]] = Field(default=None, description="") # relationship - metrics: Optional[List[Metric]] = Field(default=None, description="") # relationship - input_port_data_products: Optional[List[DataProduct]] = Field(default=None, description="") # relationship - soda_checks: Optional[List[SodaCheck]] = Field(default=None, description="") # relationship + application_field: Optional[ApplicationField] = Field( + default=None, description="" + ) # relationship + data_contract_latest: Optional[DataContract] = Field( + default=None, description="" + ) # relationship + meanings: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + mc_monitors: Optional[List[MCMonitor]] = Field( + default=None, description="" + ) # relationship + application: Optional[Application] = Field( + default=None, description="" + ) # relationship + files: Optional[List[File]] = Field( + default=None, description="" + ) # relationship + mc_incidents: Optional[List[MCIncident]] = Field( + default=None, description="" + ) # relationship + links: Optional[List[Link]] = Field( + default=None, description="" + ) # relationship + metrics: Optional[List[Metric]] = Field( + default=None, description="" + ) # relationship + input_port_data_products: Optional[List[DataProduct]] = Field( + default=None, description="" + ) # relationship + soda_checks: Optional[List[SodaCheck]] = Field( + default=None, description="" + ) # relationship def remove_description(self): self.description = None diff --git a/pyatlan/model/assets/core/atlas_glossary.py b/pyatlan/model/assets/core/atlas_glossary.py index 6e4218d83..5c320f23f 100644 --- a/pyatlan/model/assets/core/atlas_glossary.py +++ b/pyatlan/model/assets/core/atlas_glossary.py @@ -29,20 +29,30 @@ def _set_qualified_name_fallback(cls, values): # unique attributes (in case of a related entity) # Otherwise, set the qualified name to the GUID # to avoid collisions when creating glossary object - attributes.qualified_name = (unique_attributes and unique_attributes.get("qualifiedName")) or guid + attributes.qualified_name = ( + unique_attributes and unique_attributes.get("qualifiedName") + ) or guid return values @classmethod @init_guid - def creator(cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None) -> AtlasGlossary: + def creator( + cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None + ) -> AtlasGlossary: validate_required_fields(["name"], [name]) - return AtlasGlossary(attributes=AtlasGlossary.Attributes.create(name=name, icon=icon)) + return AtlasGlossary( + attributes=AtlasGlossary.Attributes.create(name=name, icon=icon) + ) @classmethod @init_guid - def create(cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None) -> AtlasGlossary: + def create( + cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None + ) -> AtlasGlossary: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -61,11 +71,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SHORT_DESCRIPTION: ClassVar[TextField] = TextField("shortDescription", "shortDescription") + SHORT_DESCRIPTION: ClassVar[TextField] = TextField( + "shortDescription", "shortDescription" + ) """ Unused. A short definition of the glossary. See 'description' and 'userDescription' instead. """ - LONG_DESCRIPTION: ClassVar[TextField] = TextField("longDescription", "longDescription") + LONG_DESCRIPTION: ClassVar[TextField] = TextField( + "longDescription", "longDescription" + ) """ Unused. A longer description of the glossary. See 'readme' instead. """ @@ -77,7 +91,9 @@ def __setattr__(self, name, value): """ Unused. Inteded usage for the glossary. """ - ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("additionalAttributes", "additionalAttributes") + ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( + "additionalAttributes", "additionalAttributes" + ) """ Unused. Arbitrary set of additional attributes associated with this glossary. """ @@ -148,7 +164,9 @@ def usage(self, usage: Optional[str]): @property def additional_attributes(self) -> Optional[Dict[str, str]]: - return None if self.attributes is None else self.attributes.additional_attributes + return ( + None if self.attributes is None else self.attributes.additional_attributes + ) @additional_attributes.setter def additional_attributes(self, additional_attributes: Optional[Dict[str, str]]): @@ -191,17 +209,27 @@ class Attributes(Asset.Attributes): long_description: Optional[str] = Field(default=None, description="") language: Optional[str] = Field(default=None, description="") usage: Optional[str] = Field(default=None, description="") - additional_attributes: Optional[Dict[str, str]] = Field(default=None, description="") + additional_attributes: Optional[Dict[str, str]] = Field( + default=None, description="" + ) glossary_type: Optional[AtlasGlossaryType] = Field(default=None, description="") - terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - categories: Optional[List[AtlasGlossaryCategory]] = Field(default=None, description="") # relationship + terms: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + categories: Optional[List[AtlasGlossaryCategory]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def create(cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None) -> AtlasGlossary.Attributes: + def create( + cls, *, name: StrictStr, icon: Optional[AtlanIcon] = None + ) -> AtlasGlossary.Attributes: validate_required_fields(["name"], [name]) icon_str = icon.value if icon is not None else None - return AtlasGlossary.Attributes(name=name, qualified_name=next_id(), asset_icon=icon_str) + return AtlasGlossary.Attributes( + name=name, qualified_name=next_id(), asset_icon=icon_str + ) attributes: AtlasGlossary.Attributes = Field( default_factory=lambda: AtlasGlossary.Attributes(), diff --git a/pyatlan/model/assets/core/atlas_glossary_category.py b/pyatlan/model/assets/core/atlas_glossary_category.py index 225d8c0bc..c405b375c 100644 --- a/pyatlan/model/assets/core/atlas_glossary_category.py +++ b/pyatlan/model/assets/core/atlas_glossary_category.py @@ -37,7 +37,9 @@ def _set_qualified_name_fallback(cls, values): # unique attributes (in case of a related entity) # Otherwise, set the qualified name to the GUID # to avoid collisions when creating glossary object - attributes.qualified_name = (unique_attributes and unique_attributes.get("qualifiedName")) or guid + attributes.qualified_name = ( + unique_attributes and unique_attributes.get("qualifiedName") + ) or guid return values @classmethod @@ -66,7 +68,9 @@ def create( parent_category: Optional[AtlasGlossaryCategory] = None, ) -> AtlasGlossaryCategory: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -96,7 +100,11 @@ def updater( [name, qualified_name, glossary_guid], ) glossary = AtlasGlossary.ref_by_guid(glossary_guid) - return cls(attributes=cls.Attributes(qualified_name=qualified_name, name=name, anchor=glossary)) + return cls( + attributes=cls.Attributes( + qualified_name=qualified_name, name=name, anchor=glossary + ) + ) @classmethod def create_for_modification( @@ -106,16 +114,22 @@ def create_for_modification( glossary_guid: str = "", ) -> AtlasGlossaryCategory: warn( - ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'updater' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.updater(qualified_name=qualified_name, name=name, glossary_guid=glossary_guid) + return cls.updater( + qualified_name=qualified_name, name=name, glossary_guid=glossary_guid + ) ANCHOR: ClassVar[KeywordField] = KeywordField("anchor", "__glossary") """Glossary in which the category is contained, searchable by the qualifiedName of the glossary.""" - PARENT_CATEGORY: ClassVar[KeywordField] = KeywordField("parentCategory", "__parentCategory") + PARENT_CATEGORY: ClassVar[KeywordField] = KeywordField( + "parentCategory", "__parentCategory" + ) """Parent category in which a subcategory is contained, searchable by the qualifiedName of the category.""" type_name: str = Field(default="AtlasGlossaryCategory", allow_mutation=False) @@ -131,15 +145,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SHORT_DESCRIPTION: ClassVar[TextField] = TextField("shortDescription", "shortDescription") + SHORT_DESCRIPTION: ClassVar[TextField] = TextField( + "shortDescription", "shortDescription" + ) """ Unused. Brief summary of the category. See 'description' and 'userDescription' instead. """ - LONG_DESCRIPTION: ClassVar[TextField] = TextField("longDescription", "longDescription") + LONG_DESCRIPTION: ClassVar[TextField] = TextField( + "longDescription", "longDescription" + ) """ Unused. Detailed description of the category. See 'readme' instead. """ - ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("additionalAttributes", "additionalAttributes") + ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( + "additionalAttributes", "additionalAttributes" + ) """ Unused. Arbitrary set of additional attributes associated with the category. """ @@ -190,7 +210,9 @@ def long_description(self, long_description: Optional[str]): @property def additional_attributes(self) -> Optional[Dict[str, str]]: - return None if self.attributes is None else self.attributes.additional_attributes + return ( + None if self.attributes is None else self.attributes.additional_attributes + ) @additional_attributes.setter def additional_attributes(self, additional_attributes: Optional[Dict[str, str]]): @@ -245,7 +267,9 @@ def children_categories(self) -> Optional[List[AtlasGlossaryCategory]]: return None if self.attributes is None else self.attributes.children_categories @children_categories.setter - def children_categories(self, children_categories: Optional[List[AtlasGlossaryCategory]]): + def children_categories( + self, children_categories: Optional[List[AtlasGlossaryCategory]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.children_categories = children_categories @@ -253,12 +277,24 @@ def children_categories(self, children_categories: Optional[List[AtlasGlossaryCa class Attributes(Asset.Attributes): short_description: Optional[str] = Field(default=None, description="") long_description: Optional[str] = Field(default=None, description="") - additional_attributes: Optional[Dict[str, str]] = Field(default=None, description="") - category_type: Optional[AtlasGlossaryCategoryType] = Field(default=None, description="") - terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - anchor: Optional[AtlasGlossary] = Field(default=None, description="") # relationship - parent_category: Optional[AtlasGlossaryCategory] = Field(default=None, description="") # relationship - children_categories: Optional[List[AtlasGlossaryCategory]] = Field(default=None, description="") # relationship + additional_attributes: Optional[Dict[str, str]] = Field( + default=None, description="" + ) + category_type: Optional[AtlasGlossaryCategoryType] = Field( + default=None, description="" + ) + terms: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + anchor: Optional[AtlasGlossary] = Field( + default=None, description="" + ) # relationship + parent_category: Optional[AtlasGlossaryCategory] = Field( + default=None, description="" + ) # relationship + children_categories: Optional[List[AtlasGlossaryCategory]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid diff --git a/pyatlan/model/assets/core/atlas_glossary_term.py b/pyatlan/model/assets/core/atlas_glossary_term.py index 57c637575..789be60c8 100644 --- a/pyatlan/model/assets/core/atlas_glossary_term.py +++ b/pyatlan/model/assets/core/atlas_glossary_term.py @@ -34,7 +34,9 @@ def _set_qualified_name_fallback(cls, values): # unique attributes (in case of a related entity) # Otherwise, set the qualified name to the GUID # to avoid collisions when creating glossary object - attributes.qualified_name = (unique_attributes and unique_attributes.get("qualifiedName")) or guid + attributes.qualified_name = ( + unique_attributes and unique_attributes.get("qualifiedName") + ) or guid return values @classmethod @@ -71,7 +73,9 @@ def create( categories: Optional[List[AtlasGlossaryCategory]] = None, ) -> AtlasGlossaryTerm: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -106,7 +110,11 @@ def updater( ) glossary = AtlasGlossary() glossary.guid = glossary_guid - return cls(attributes=cls.Attributes(qualified_name=qualified_name, name=name, anchor=glossary)) + return cls( + attributes=cls.Attributes( + qualified_name=qualified_name, name=name, anchor=glossary + ) + ) @classmethod def create_for_modification( @@ -116,11 +124,15 @@ def create_for_modification( glossary_guid: str = "", ) -> AtlasGlossaryTerm: warn( - ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'updater' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.updater(qualified_name=qualified_name, name=name, glossary_guid=glossary_guid) + return cls.updater( + qualified_name=qualified_name, name=name, glossary_guid=glossary_guid + ) ANCHOR: ClassVar[KeywordField] = KeywordField("anchor", "__glossary") """Glossary in which the term is contained, searchable by the qualifiedName of the glossary.""" @@ -141,11 +153,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SHORT_DESCRIPTION: ClassVar[TextField] = TextField("shortDescription", "shortDescription") + SHORT_DESCRIPTION: ClassVar[TextField] = TextField( + "shortDescription", "shortDescription" + ) """ Unused. Brief summary of the term. See 'description' and 'userDescription' instead. """ - LONG_DESCRIPTION: ClassVar[TextField] = TextField("longDescription", "longDescription") + LONG_DESCRIPTION: ClassVar[TextField] = TextField( + "longDescription", "longDescription" + ) """ Unused. Detailed definition of the term. See 'readme' instead. """ @@ -161,7 +177,9 @@ def __setattr__(self, name, value): """ Unused. Intended usage for the term. """ - ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("additionalAttributes", "additionalAttributes") + ADDITIONAL_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( + "additionalAttributes", "additionalAttributes" + ) """ Unused. Arbitrary set of additional attributes for the terrm. """ @@ -305,7 +323,9 @@ def usage(self, usage: Optional[str]): @property def additional_attributes(self) -> Optional[Dict[str, str]]: - return None if self.attributes is None else self.attributes.additional_attributes + return ( + None if self.attributes is None else self.attributes.additional_attributes + ) @additional_attributes.setter def additional_attributes(self, additional_attributes: Optional[Dict[str, str]]): @@ -489,24 +509,58 @@ class Attributes(Asset.Attributes): examples: Optional[Set[str]] = Field(default=None, description="") abbreviation: Optional[str] = Field(default=None, description="") usage: Optional[str] = Field(default=None, description="") - additional_attributes: Optional[Dict[str, str]] = Field(default=None, description="") + additional_attributes: Optional[Dict[str, str]] = Field( + default=None, description="" + ) term_type: Optional[AtlasGlossaryTermType] = Field(default=None, description="") - valid_values_for: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - valid_values: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - see_also: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - is_a: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - antonyms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - assigned_entities: Optional[List[Referenceable]] = Field(default=None, description="") # relationship - classifies: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - categories: Optional[List[AtlasGlossaryCategory]] = Field(default=None, description="") # relationship - preferred_to_terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - preferred_terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - translation_terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - synonyms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - replaced_by: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - replacement_terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - translated_terms: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship - anchor: Optional[AtlasGlossary] = Field(default=None, description="") # relationship + valid_values_for: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + valid_values: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + see_also: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + is_a: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + antonyms: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + assigned_entities: Optional[List[Referenceable]] = Field( + default=None, description="" + ) # relationship + classifies: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + categories: Optional[List[AtlasGlossaryCategory]] = Field( + default=None, description="" + ) # relationship + preferred_to_terms: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + preferred_terms: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + translation_terms: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + synonyms: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + replaced_by: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + replacement_terms: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + translated_terms: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship + anchor: Optional[AtlasGlossary] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid diff --git a/pyatlan/model/assets/core/auth_policy.py b/pyatlan/model/assets/core/auth_policy.py index 729555eaf..f19da5529 100644 --- a/pyatlan/model/assets/core/auth_policy.py +++ b/pyatlan/model/assets/core/auth_policy.py @@ -58,7 +58,9 @@ def create_for_modification( """, ) -> SelfAsset: warn( - ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'updater' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -81,15 +83,21 @@ def __setattr__(self, name, value): """ TBC """ - POLICY_SERVICE_NAME: ClassVar[KeywordField] = KeywordField("policyServiceName", "policyServiceName") + POLICY_SERVICE_NAME: ClassVar[KeywordField] = KeywordField( + "policyServiceName", "policyServiceName" + ) """ TBC """ - POLICY_CATEGORY: ClassVar[KeywordField] = KeywordField("policyCategory", "policyCategory") + POLICY_CATEGORY: ClassVar[KeywordField] = KeywordField( + "policyCategory", "policyCategory" + ) """ TBC """ - POLICY_SUB_CATEGORY: ClassVar[KeywordField] = KeywordField("policySubCategory", "policySubCategory") + POLICY_SUB_CATEGORY: ClassVar[KeywordField] = KeywordField( + "policySubCategory", "policySubCategory" + ) """ TBC """ @@ -105,31 +113,45 @@ def __setattr__(self, name, value): """ TBC """ - POLICY_ACTIONS: ClassVar[KeywordField] = KeywordField("policyActions", "policyActions") + POLICY_ACTIONS: ClassVar[KeywordField] = KeywordField( + "policyActions", "policyActions" + ) """ TBC """ - POLICY_RESOURCES: ClassVar[KeywordField] = KeywordField("policyResources", "policyResources") + POLICY_RESOURCES: ClassVar[KeywordField] = KeywordField( + "policyResources", "policyResources" + ) """ TBC """ - POLICY_RESOURCE_CATEGORY: ClassVar[KeywordField] = KeywordField("policyResourceCategory", "policyResourceCategory") + POLICY_RESOURCE_CATEGORY: ClassVar[KeywordField] = KeywordField( + "policyResourceCategory", "policyResourceCategory" + ) """ TBC """ - POLICY_PRIORITY: ClassVar[NumericField] = NumericField("policyPriority", "policyPriority") + POLICY_PRIORITY: ClassVar[NumericField] = NumericField( + "policyPriority", "policyPriority" + ) """ TBC """ - IS_POLICY_ENABLED: ClassVar[BooleanField] = BooleanField("isPolicyEnabled", "isPolicyEnabled") + IS_POLICY_ENABLED: ClassVar[BooleanField] = BooleanField( + "isPolicyEnabled", "isPolicyEnabled" + ) """ TBC """ - POLICY_MASK_TYPE: ClassVar[KeywordField] = KeywordField("policyMaskType", "policyMaskType") + POLICY_MASK_TYPE: ClassVar[KeywordField] = KeywordField( + "policyMaskType", "policyMaskType" + ) """ TBC """ - POLICY_VALIDITY_SCHEDULE: ClassVar[KeywordField] = KeywordField("policyValiditySchedule", "policyValiditySchedule") + POLICY_VALIDITY_SCHEDULE: ClassVar[KeywordField] = KeywordField( + "policyValiditySchedule", "policyValiditySchedule" + ) """ TBC """ @@ -139,11 +161,15 @@ def __setattr__(self, name, value): """ TBC """ - POLICY_DELEGATE_ADMIN: ClassVar[BooleanField] = BooleanField("policyDelegateAdmin", "policyDelegateAdmin") + POLICY_DELEGATE_ADMIN: ClassVar[BooleanField] = BooleanField( + "policyDelegateAdmin", "policyDelegateAdmin" + ) """ TBC """ - POLICY_CONDITIONS: ClassVar[KeywordField] = KeywordField("policyConditions", "policyConditions") + POLICY_CONDITIONS: ClassVar[KeywordField] = KeywordField( + "policyConditions", "policyConditions" + ) """ TBC """ @@ -266,7 +292,11 @@ def policy_resources(self, policy_resources: Optional[Set[str]]): @property def policy_resource_category(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.policy_resource_category + return ( + None + if self.attributes is None + else self.attributes.policy_resource_category + ) @policy_resource_category.setter def policy_resource_category(self, policy_resource_category: Optional[str]): @@ -306,17 +336,27 @@ def policy_mask_type(self, policy_mask_type: Optional[str]): @property def policy_validity_schedule(self) -> Optional[List[AuthPolicyValiditySchedule]]: - return None if self.attributes is None else self.attributes.policy_validity_schedule + return ( + None + if self.attributes is None + else self.attributes.policy_validity_schedule + ) @policy_validity_schedule.setter - def policy_validity_schedule(self, policy_validity_schedule: Optional[List[AuthPolicyValiditySchedule]]): + def policy_validity_schedule( + self, policy_validity_schedule: Optional[List[AuthPolicyValiditySchedule]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.policy_validity_schedule = policy_validity_schedule @property def policy_resource_signature(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.policy_resource_signature + return ( + None + if self.attributes is None + else self.attributes.policy_resource_signature + ) @policy_resource_signature.setter def policy_resource_signature(self, policy_resource_signature: Optional[str]): @@ -326,7 +366,9 @@ def policy_resource_signature(self, policy_resource_signature: Optional[str]): @property def policy_delegate_admin(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.policy_delegate_admin + return ( + None if self.attributes is None else self.attributes.policy_delegate_admin + ) @policy_delegate_admin.setter def policy_delegate_admin(self, policy_delegate_admin: Optional[bool]): @@ -368,16 +410,24 @@ class Attributes(Asset.Attributes): policy_priority: Optional[int] = Field(default=None, description="") is_policy_enabled: Optional[bool] = Field(default=None, description="") policy_mask_type: Optional[str] = Field(default=None, description="") - policy_validity_schedule: Optional[List[AuthPolicyValiditySchedule]] = Field(default=None, description="") + policy_validity_schedule: Optional[List[AuthPolicyValiditySchedule]] = Field( + default=None, description="" + ) policy_resource_signature: Optional[str] = Field(default=None, description="") policy_delegate_admin: Optional[bool] = Field(default=None, description="") - policy_conditions: Optional[List[AuthPolicyCondition]] = Field(default=None, description="") - access_control: Optional[AccessControl] = Field(default=None, description="") # relationship + policy_conditions: Optional[List[AuthPolicyCondition]] = Field( + default=None, description="" + ) + access_control: Optional[AccessControl] = Field( + default=None, description="" + ) # relationship @classmethod def __create(cls, name: str) -> AuthPolicy.Attributes: validate_required_fields(["name"], [name]) - return AuthPolicy.Attributes(qualified_name=name, name=name, display_name="") + return AuthPolicy.Attributes( + qualified_name=name, name=name, display_name="" + ) attributes: AuthPolicy.Attributes = Field( default_factory=lambda: AuthPolicy.Attributes(), diff --git a/pyatlan/model/assets/core/b_i_process.py b/pyatlan/model/assets/core/b_i_process.py index 437f9666f..328ce778e 100644 --- a/pyatlan/model/assets/core/b_i_process.py +++ b/pyatlan/model/assets/core/b_i_process.py @@ -64,8 +64,12 @@ def inputs(self, inputs: Optional[List[Catalog]]): self.attributes.inputs = inputs class Attributes(Process.Attributes): - outputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship - inputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship + outputs: Optional[List[Catalog]] = Field( + default=None, description="" + ) # relationship + inputs: Optional[List[Catalog]] = Field( + default=None, description="" + ) # relationship attributes: BIProcess.Attributes = Field( default_factory=lambda: BIProcess.Attributes(), diff --git a/pyatlan/model/assets/core/calculation_view.py b/pyatlan/model/assets/core/calculation_view.py index 3278380c9..f79b31a38 100644 --- a/pyatlan/model/assets/core/calculation_view.py +++ b/pyatlan/model/assets/core/calculation_view.py @@ -90,7 +90,11 @@ def column_count(self, column_count: Optional[int]): @property def calculation_view_version_id(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.calculation_view_version_id + return ( + None + if self.attributes is None + else self.attributes.calculation_view_version_id + ) @calculation_view_version_id.setter def calculation_view_version_id(self, calculation_view_version_id: Optional[int]): @@ -100,27 +104,43 @@ def calculation_view_version_id(self, calculation_view_version_id: Optional[int] @property def calculation_view_activated_by(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_activated_by + return ( + None + if self.attributes is None + else self.attributes.calculation_view_activated_by + ) @calculation_view_activated_by.setter - def calculation_view_activated_by(self, calculation_view_activated_by: Optional[str]): + def calculation_view_activated_by( + self, calculation_view_activated_by: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.calculation_view_activated_by = calculation_view_activated_by @property def calculation_view_activated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.calculation_view_activated_at + return ( + None + if self.attributes is None + else self.attributes.calculation_view_activated_at + ) @calculation_view_activated_at.setter - def calculation_view_activated_at(self, calculation_view_activated_at: Optional[datetime]): + def calculation_view_activated_at( + self, calculation_view_activated_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.calculation_view_activated_at = calculation_view_activated_at @property def calculation_view_package_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_package_id + return ( + None + if self.attributes is None + else self.attributes.calculation_view_package_id + ) @calculation_view_package_id.setter def calculation_view_package_id(self, calculation_view_package_id: Optional[str]): @@ -151,11 +171,19 @@ def atlan_schema(self, atlan_schema: Optional[Schema]): class Attributes(SQL.Attributes): column_count: Optional[int] = Field(default=None, description="") calculation_view_version_id: Optional[int] = Field(default=None, description="") - calculation_view_activated_by: Optional[str] = Field(default=None, description="") - calculation_view_activated_at: Optional[datetime] = Field(default=None, description="") + calculation_view_activated_by: Optional[str] = Field( + default=None, description="" + ) + calculation_view_activated_at: Optional[datetime] = Field( + default=None, description="" + ) calculation_view_package_id: Optional[str] = Field(default=None, description="") - columns: Optional[List[Column]] = Field(default=None, description="") # relationship - atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship + columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship + atlan_schema: Optional[Schema] = Field( + default=None, description="" + ) # relationship attributes: CalculationView.Attributes = Field( default_factory=lambda: CalculationView.Attributes(), diff --git a/pyatlan/model/assets/core/catalog.py b/pyatlan/model/assets/core/catalog.py index 6edbfd6b8..e15dfed84 100644 --- a/pyatlan/model/assets/core/catalog.py +++ b/pyatlan/model/assets/core/catalog.py @@ -33,7 +33,9 @@ def __setattr__(self, name, value): """ TBC """ - INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("inputToAirflowTasks") + INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( + "inputToAirflowTasks" + ) """ TBC """ @@ -41,23 +43,33 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelImplementedAttributes") + MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField( + "modelImplementedAttributes" + ) """ TBC """ - OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("outputFromAirflowTasks") + OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( + "outputFromAirflowTasks" + ) """ TBC """ - OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField("outputFromSparkJobs") + OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField( + "outputFromSparkJobs" + ) """ TBC """ - MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField("modelImplementedEntities") + MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField( + "modelImplementedEntities" + ) """ TBC """ - OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField("outputFromProcesses") + OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField( + "outputFromProcesses" + ) """ TBC """ @@ -85,10 +97,14 @@ def input_to_spark_jobs(self, input_to_spark_jobs: Optional[List[SparkJob]]): @property def input_to_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return None if self.attributes is None else self.attributes.input_to_airflow_tasks + return ( + None if self.attributes is None else self.attributes.input_to_airflow_tasks + ) @input_to_airflow_tasks.setter - def input_to_airflow_tasks(self, input_to_airflow_tasks: Optional[List[AirflowTask]]): + def input_to_airflow_tasks( + self, input_to_airflow_tasks: Optional[List[AirflowTask]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.input_to_airflow_tasks = input_to_airflow_tasks @@ -105,27 +121,41 @@ def input_to_processes(self, input_to_processes: Optional[List[Process]]): @property def model_implemented_attributes(self) -> Optional[List[ModelAttribute]]: - return None if self.attributes is None else self.attributes.model_implemented_attributes + return ( + None + if self.attributes is None + else self.attributes.model_implemented_attributes + ) @model_implemented_attributes.setter - def model_implemented_attributes(self, model_implemented_attributes: Optional[List[ModelAttribute]]): + def model_implemented_attributes( + self, model_implemented_attributes: Optional[List[ModelAttribute]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_attributes = model_implemented_attributes @property def output_from_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return None if self.attributes is None else self.attributes.output_from_airflow_tasks + return ( + None + if self.attributes is None + else self.attributes.output_from_airflow_tasks + ) @output_from_airflow_tasks.setter - def output_from_airflow_tasks(self, output_from_airflow_tasks: Optional[List[AirflowTask]]): + def output_from_airflow_tasks( + self, output_from_airflow_tasks: Optional[List[AirflowTask]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.output_from_airflow_tasks = output_from_airflow_tasks @property def output_from_spark_jobs(self) -> Optional[List[SparkJob]]: - return None if self.attributes is None else self.attributes.output_from_spark_jobs + return ( + None if self.attributes is None else self.attributes.output_from_spark_jobs + ) @output_from_spark_jobs.setter def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob]]): @@ -135,17 +165,25 @@ def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob] @property def model_implemented_entities(self) -> Optional[List[ModelEntity]]: - return None if self.attributes is None else self.attributes.model_implemented_entities + return ( + None + if self.attributes is None + else self.attributes.model_implemented_entities + ) @model_implemented_entities.setter - def model_implemented_entities(self, model_implemented_entities: Optional[List[ModelEntity]]): + def model_implemented_entities( + self, model_implemented_entities: Optional[List[ModelEntity]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_entities = model_implemented_entities @property def output_from_processes(self) -> Optional[List[Process]]: - return None if self.attributes is None else self.attributes.output_from_processes + return ( + None if self.attributes is None else self.attributes.output_from_processes + ) @output_from_processes.setter def output_from_processes(self, output_from_processes: Optional[List[Process]]): @@ -154,16 +192,30 @@ def output_from_processes(self, output_from_processes: Optional[List[Process]]): self.attributes.output_from_processes = output_from_processes class Attributes(Asset.Attributes): - input_to_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship - input_to_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship - input_to_processes: Optional[List[Process]] = Field(default=None, description="") # relationship + input_to_spark_jobs: Optional[List[SparkJob]] = Field( + default=None, description="" + ) # relationship + input_to_airflow_tasks: Optional[List[AirflowTask]] = Field( + default=None, description="" + ) # relationship + input_to_processes: Optional[List[Process]] = Field( + default=None, description="" + ) # relationship model_implemented_attributes: Optional[List[ModelAttribute]] = Field( default=None, description="" ) # relationship - output_from_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship - output_from_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship - model_implemented_entities: Optional[List[ModelEntity]] = Field(default=None, description="") # relationship - output_from_processes: Optional[List[Process]] = Field(default=None, description="") # relationship + output_from_airflow_tasks: Optional[List[AirflowTask]] = Field( + default=None, description="" + ) # relationship + output_from_spark_jobs: Optional[List[SparkJob]] = Field( + default=None, description="" + ) # relationship + model_implemented_entities: Optional[List[ModelEntity]] = Field( + default=None, description="" + ) # relationship + output_from_processes: Optional[List[Process]] = Field( + default=None, description="" + ) # relationship attributes: Catalog.Attributes = Field( default_factory=lambda: Catalog.Attributes(), diff --git a/pyatlan/model/assets/core/column.py b/pyatlan/model/assets/core/column.py index 39a1339a2..6fb8d0b20 100644 --- a/pyatlan/model/assets/core/column.py +++ b/pyatlan/model/assets/core/column.py @@ -135,7 +135,9 @@ def creator( ) if table_qualified_name: warn( - ("`table_qualified_name` is deprecated, please use `parent_qualified_name` instead"), + ( + "`table_qualified_name` is deprecated, please use `parent_qualified_name` instead" + ), DeprecationWarning, stacklevel=2, ) @@ -158,9 +160,13 @@ def creator( @classmethod @init_guid - def create(cls, *, name: str, parent_qualified_name: str, parent_type: type, order: int) -> Column: + def create( + cls, *, name: str, parent_qualified_name: str, parent_type: type, order: int + ) -> Column: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -184,7 +190,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATA_TYPE: ClassVar[KeywordTextField] = KeywordTextField("dataType", "dataType", "dataType.text") + DATA_TYPE: ClassVar[KeywordTextField] = KeywordTextField( + "dataType", "dataType", "dataType.text" + ) """ Data type of values in this column. """ @@ -192,7 +200,9 @@ def __setattr__(self, name, value): """ Sub-data type of this column. """ - RAW_DATA_TYPE_DEFINITION: ClassVar[TextField] = TextField("rawDataTypeDefinition", "rawDataTypeDefinition") + RAW_DATA_TYPE_DEFINITION: ClassVar[TextField] = TextField( + "rawDataTypeDefinition", "rawDataTypeDefinition" + ) """ """ @@ -200,15 +210,21 @@ def __setattr__(self, name, value): """ Order (position) in which this column appears in the table (starting at 1). """ - NESTED_COLUMN_ORDER: ClassVar[KeywordField] = KeywordField("nestedColumnOrder", "nestedColumnOrder") + NESTED_COLUMN_ORDER: ClassVar[KeywordField] = KeywordField( + "nestedColumnOrder", "nestedColumnOrder" + ) """ Order (position) in which this column appears in the nested Column (nest level starts at 1). """ - NESTED_COLUMN_COUNT: ClassVar[NumericField] = NumericField("nestedColumnCount", "nestedColumnCount") + NESTED_COLUMN_COUNT: ClassVar[NumericField] = NumericField( + "nestedColumnCount", "nestedColumnCount" + ) """ Number of columns nested within this (STRUCT or NESTED) column. """ - COLUMN_HIERARCHY: ClassVar[KeywordField] = KeywordField("columnHierarchy", "columnHierarchy") + COLUMN_HIERARCHY: ClassVar[KeywordField] = KeywordField( + "columnHierarchy", "columnHierarchy" + ) """ List of top-level upstream nested columns. """ @@ -216,7 +232,9 @@ def __setattr__(self, name, value): """ Whether this column is a partition column (true) or not (false). """ - PARTITION_ORDER: ClassVar[NumericField] = NumericField("partitionOrder", "partitionOrder") + PARTITION_ORDER: ClassVar[NumericField] = NumericField( + "partitionOrder", "partitionOrder" + ) """ Order (position) of this partition column in the table. """ @@ -306,7 +324,9 @@ def __setattr__(self, name, value): """ Number of rows that contain distinct values. """ - COLUMN_HISTOGRAM: ClassVar[KeywordField] = KeywordField("columnHistogram", "columnHistogram") + COLUMN_HISTOGRAM: ClassVar[KeywordField] = KeywordField( + "columnHistogram", "columnHistogram" + ) """ List of values in a histogram that represents the contents of this column. """ @@ -348,11 +368,15 @@ def __setattr__(self, name, value): """ Number of rows in which a value in this column appears only once. """ - COLUMN_AVERAGE: ClassVar[NumericField] = NumericField("columnAverage", "columnAverage") + COLUMN_AVERAGE: ClassVar[NumericField] = NumericField( + "columnAverage", "columnAverage" + ) """ Average value in this column. """ - COLUMN_AVERAGE_LENGTH: ClassVar[NumericField] = NumericField("columnAverageLength", "columnAverageLength") + COLUMN_AVERAGE_LENGTH: ClassVar[NumericField] = NumericField( + "columnAverageLength", "columnAverageLength" + ) """ Average length of values in a string column. """ @@ -412,15 +436,21 @@ def __setattr__(self, name, value): """ Ratio indicating how unique data in this column is: 0 indicates that all values are the same, 100 indicates that all values in this column are unique. """ # noqa: E501 - COLUMN_VARIANCE: ClassVar[NumericField] = NumericField("columnVariance", "columnVariance") + COLUMN_VARIANCE: ClassVar[NumericField] = NumericField( + "columnVariance", "columnVariance" + ) """ Calculated variance of the values in a numeric column. """ - COLUMN_TOP_VALUES: ClassVar[KeywordField] = KeywordField("columnTopValues", "columnTopValues") + COLUMN_TOP_VALUES: ClassVar[KeywordField] = KeywordField( + "columnTopValues", "columnTopValues" + ) """ List of top values in this column. """ - COLUMN_DEPTH_LEVEL: ClassVar[NumericField] = NumericField("columnDepthLevel", "columnDepthLevel") + COLUMN_DEPTH_LEVEL: ClassVar[NumericField] = NumericField( + "columnDepthLevel", "columnDepthLevel" + ) """ Level of nesting of this column, used for STRUCT and NESTED columns. """ @@ -437,7 +467,9 @@ def __setattr__(self, name, value): Unique name of the cosmos/mongo collection in which this SQL asset (column) exists, or empty if it does not exist within a cosmos/mongo collection. """ # noqa: E501 - SNOWFLAKE_DYNAMIC_TABLE: ClassVar[RelationField] = RelationField("snowflakeDynamicTable") + SNOWFLAKE_DYNAMIC_TABLE: ClassVar[RelationField] = RelationField( + "snowflakeDynamicTable" + ) """ TBC """ @@ -449,7 +481,9 @@ def __setattr__(self, name, value): """ TBC """ - DATA_QUALITY_METRIC_DIMENSIONS: ClassVar[RelationField] = RelationField("dataQualityMetricDimensions") + DATA_QUALITY_METRIC_DIMENSIONS: ClassVar[RelationField] = RelationField( + "dataQualityMetricDimensions" + ) """ TBC """ @@ -461,7 +495,9 @@ def __setattr__(self, name, value): """ TBC """ - COLUMN_DBT_MODEL_COLUMNS: ClassVar[RelationField] = RelationField("columnDbtModelColumns") + COLUMN_DBT_MODEL_COLUMNS: ClassVar[RelationField] = RelationField( + "columnDbtModelColumns" + ) """ TBC """ @@ -489,7 +525,9 @@ def __setattr__(self, name, value): """ TBC """ - COSMOS_MONGO_DB_COLLECTION: ClassVar[RelationField] = RelationField("cosmosMongoDBCollection") + COSMOS_MONGO_DB_COLLECTION: ClassVar[RelationField] = RelationField( + "cosmosMongoDBCollection" + ) """ TBC """ @@ -602,7 +640,11 @@ def sub_data_type(self, sub_data_type: Optional[str]): @property def raw_data_type_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.raw_data_type_definition + return ( + None + if self.attributes is None + else self.attributes.raw_data_type_definition + ) @raw_data_type_definition.setter def raw_data_type_definition(self, raw_data_type_definition: Optional[str]): @@ -822,7 +864,11 @@ def validations(self, validations: Optional[Dict[str, str]]): @property def parent_column_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.parent_column_qualified_name + return ( + None + if self.attributes is None + else self.attributes.parent_column_qualified_name + ) @parent_column_qualified_name.setter def parent_column_qualified_name(self, parent_column_qualified_name: Optional[str]): @@ -842,7 +888,11 @@ def parent_column_name(self, parent_column_name: Optional[str]): @property def column_distinct_values_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.column_distinct_values_count + return ( + None + if self.attributes is None + else self.attributes.column_distinct_values_count + ) @column_distinct_values_count.setter def column_distinct_values_count(self, column_distinct_values_count: Optional[int]): @@ -852,13 +902,21 @@ def column_distinct_values_count(self, column_distinct_values_count: Optional[in @property def column_distinct_values_count_long(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.column_distinct_values_count_long + return ( + None + if self.attributes is None + else self.attributes.column_distinct_values_count_long + ) @column_distinct_values_count_long.setter - def column_distinct_values_count_long(self, column_distinct_values_count_long: Optional[int]): + def column_distinct_values_count_long( + self, column_distinct_values_count_long: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.column_distinct_values_count_long = column_distinct_values_count_long + self.attributes.column_distinct_values_count_long = ( + column_distinct_values_count_long + ) @property def column_histogram(self) -> Optional[Histogram]: @@ -922,7 +980,11 @@ def column_median(self, column_median: Optional[float]): @property def column_standard_deviation(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.column_standard_deviation + return ( + None + if self.attributes is None + else self.attributes.column_standard_deviation + ) @column_standard_deviation.setter def column_standard_deviation(self, column_standard_deviation: Optional[float]): @@ -932,7 +994,11 @@ def column_standard_deviation(self, column_standard_deviation: Optional[float]): @property def column_unique_values_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.column_unique_values_count + return ( + None + if self.attributes is None + else self.attributes.column_unique_values_count + ) @column_unique_values_count.setter def column_unique_values_count(self, column_unique_values_count: Optional[int]): @@ -942,13 +1008,21 @@ def column_unique_values_count(self, column_unique_values_count: Optional[int]): @property def column_unique_values_count_long(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.column_unique_values_count_long + return ( + None + if self.attributes is None + else self.attributes.column_unique_values_count_long + ) @column_unique_values_count_long.setter - def column_unique_values_count_long(self, column_unique_values_count_long: Optional[int]): + def column_unique_values_count_long( + self, column_unique_values_count_long: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.column_unique_values_count_long = column_unique_values_count_long + self.attributes.column_unique_values_count_long = ( + column_unique_values_count_long + ) @property def column_average(self) -> Optional[float]: @@ -962,7 +1036,9 @@ def column_average(self, column_average: Optional[float]): @property def column_average_length(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.column_average_length + return ( + None if self.attributes is None else self.attributes.column_average_length + ) @column_average_length.setter def column_average_length(self, column_average_length: Optional[float]): @@ -972,27 +1048,45 @@ def column_average_length(self, column_average_length: Optional[float]): @property def column_duplicate_values_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.column_duplicate_values_count + return ( + None + if self.attributes is None + else self.attributes.column_duplicate_values_count + ) @column_duplicate_values_count.setter - def column_duplicate_values_count(self, column_duplicate_values_count: Optional[int]): + def column_duplicate_values_count( + self, column_duplicate_values_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.column_duplicate_values_count = column_duplicate_values_count @property def column_duplicate_values_count_long(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.column_duplicate_values_count_long + return ( + None + if self.attributes is None + else self.attributes.column_duplicate_values_count_long + ) @column_duplicate_values_count_long.setter - def column_duplicate_values_count_long(self, column_duplicate_values_count_long: Optional[int]): + def column_duplicate_values_count_long( + self, column_duplicate_values_count_long: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.column_duplicate_values_count_long = column_duplicate_values_count_long + self.attributes.column_duplicate_values_count_long = ( + column_duplicate_values_count_long + ) @property def column_maximum_string_length(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.column_maximum_string_length + return ( + None + if self.attributes is None + else self.attributes.column_maximum_string_length + ) @column_maximum_string_length.setter def column_maximum_string_length(self, column_maximum_string_length: Optional[int]): @@ -1012,7 +1106,11 @@ def column_maxs(self, column_maxs: Optional[Set[str]]): @property def column_minimum_string_length(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.column_minimum_string_length + return ( + None + if self.attributes is None + else self.attributes.column_minimum_string_length + ) @column_minimum_string_length.setter def column_minimum_string_length(self, column_minimum_string_length: Optional[int]): @@ -1032,7 +1130,11 @@ def column_mins(self, column_mins: Optional[Set[str]]): @property def column_missing_values_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.column_missing_values_count + return ( + None + if self.attributes is None + else self.attributes.column_missing_values_count + ) @column_missing_values_count.setter def column_missing_values_count(self, column_missing_values_count: Optional[int]): @@ -1042,30 +1144,52 @@ def column_missing_values_count(self, column_missing_values_count: Optional[int] @property def column_missing_values_count_long(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.column_missing_values_count_long + return ( + None + if self.attributes is None + else self.attributes.column_missing_values_count_long + ) @column_missing_values_count_long.setter - def column_missing_values_count_long(self, column_missing_values_count_long: Optional[int]): + def column_missing_values_count_long( + self, column_missing_values_count_long: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.column_missing_values_count_long = column_missing_values_count_long + self.attributes.column_missing_values_count_long = ( + column_missing_values_count_long + ) @property def column_missing_values_percentage(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.column_missing_values_percentage + return ( + None + if self.attributes is None + else self.attributes.column_missing_values_percentage + ) @column_missing_values_percentage.setter - def column_missing_values_percentage(self, column_missing_values_percentage: Optional[float]): + def column_missing_values_percentage( + self, column_missing_values_percentage: Optional[float] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.column_missing_values_percentage = column_missing_values_percentage + self.attributes.column_missing_values_percentage = ( + column_missing_values_percentage + ) @property def column_uniqueness_percentage(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.column_uniqueness_percentage + return ( + None + if self.attributes is None + else self.attributes.column_uniqueness_percentage + ) @column_uniqueness_percentage.setter - def column_uniqueness_percentage(self, column_uniqueness_percentage: Optional[float]): + def column_uniqueness_percentage( + self, column_uniqueness_percentage: Optional[float] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.column_uniqueness_percentage = column_uniqueness_percentage @@ -1085,7 +1209,9 @@ def column_top_values(self) -> Optional[List[ColumnValueFrequencyMap]]: return None if self.attributes is None else self.attributes.column_top_values @column_top_values.setter - def column_top_values(self, column_top_values: Optional[List[ColumnValueFrequencyMap]]): + def column_top_values( + self, column_top_values: Optional[List[ColumnValueFrequencyMap]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.column_top_values = column_top_values @@ -1102,7 +1228,9 @@ def column_depth_level(self, column_depth_level: Optional[int]): @property def nosql_collection_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.nosql_collection_name + return ( + None if self.attributes is None else self.attributes.nosql_collection_name + ) @nosql_collection_name.setter def nosql_collection_name(self, nosql_collection_name: Optional[str]): @@ -1112,20 +1240,32 @@ def nosql_collection_name(self, nosql_collection_name: Optional[str]): @property def nosql_collection_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.nosql_collection_qualified_name + return ( + None + if self.attributes is None + else self.attributes.nosql_collection_qualified_name + ) @nosql_collection_qualified_name.setter - def nosql_collection_qualified_name(self, nosql_collection_qualified_name: Optional[str]): + def nosql_collection_qualified_name( + self, nosql_collection_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.nosql_collection_qualified_name = nosql_collection_qualified_name + self.attributes.nosql_collection_qualified_name = ( + nosql_collection_qualified_name + ) @property def snowflake_dynamic_table(self) -> Optional[SnowflakeDynamicTable]: - return None if self.attributes is None else self.attributes.snowflake_dynamic_table + return ( + None if self.attributes is None else self.attributes.snowflake_dynamic_table + ) @snowflake_dynamic_table.setter - def snowflake_dynamic_table(self, snowflake_dynamic_table: Optional[SnowflakeDynamicTable]): + def snowflake_dynamic_table( + self, snowflake_dynamic_table: Optional[SnowflakeDynamicTable] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.snowflake_dynamic_table = snowflake_dynamic_table @@ -1152,10 +1292,16 @@ def nested_columns(self, nested_columns: Optional[List[Column]]): @property def data_quality_metric_dimensions(self) -> Optional[List[Metric]]: - return None if self.attributes is None else self.attributes.data_quality_metric_dimensions + return ( + None + if self.attributes is None + else self.attributes.data_quality_metric_dimensions + ) @data_quality_metric_dimensions.setter - def data_quality_metric_dimensions(self, data_quality_metric_dimensions: Optional[List[Metric]]): + def data_quality_metric_dimensions( + self, data_quality_metric_dimensions: Optional[List[Metric]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_quality_metric_dimensions = data_quality_metric_dimensions @@ -1182,10 +1328,16 @@ def table(self, table: Optional[Table]): @property def column_dbt_model_columns(self) -> Optional[List[DbtModelColumn]]: - return None if self.attributes is None else self.attributes.column_dbt_model_columns + return ( + None + if self.attributes is None + else self.attributes.column_dbt_model_columns + ) @column_dbt_model_columns.setter - def column_dbt_model_columns(self, column_dbt_model_columns: Optional[List[DbtModelColumn]]): + def column_dbt_model_columns( + self, column_dbt_model_columns: Optional[List[DbtModelColumn]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.column_dbt_model_columns = column_dbt_model_columns @@ -1252,10 +1404,16 @@ def foreign_key_to(self, foreign_key_to: Optional[List[Column]]): @property def cosmos_mongo_d_b_collection(self) -> Optional[CosmosMongoDBCollection]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_collection + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_collection + ) @cosmos_mongo_d_b_collection.setter - def cosmos_mongo_d_b_collection(self, cosmos_mongo_d_b_collection: Optional[CosmosMongoDBCollection]): + def cosmos_mongo_d_b_collection( + self, cosmos_mongo_d_b_collection: Optional[CosmosMongoDBCollection] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_collection = cosmos_mongo_d_b_collection @@ -1297,7 +1455,9 @@ class Attributes(SQL.Attributes): order: Optional[int] = Field(default=None, description="") nested_column_order: Optional[str] = Field(default=None, description="") nested_column_count: Optional[int] = Field(default=None, description="") - column_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + column_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) is_partition: Optional[bool] = Field(default=None, description="") partition_order: Optional[int] = Field(default=None, description="") is_clustered: Optional[bool] = Field(default=None, description="") @@ -1315,10 +1475,16 @@ class Attributes(SQL.Attributes): numeric_scale: Optional[float] = Field(default=None, description="") max_length: Optional[int] = Field(default=None, description="") validations: Optional[Dict[str, str]] = Field(default=None, description="") - parent_column_qualified_name: Optional[str] = Field(default=None, description="") + parent_column_qualified_name: Optional[str] = Field( + default=None, description="" + ) parent_column_name: Optional[str] = Field(default=None, description="") - column_distinct_values_count: Optional[int] = Field(default=None, description="") - column_distinct_values_count_long: Optional[int] = Field(default=None, description="") + column_distinct_values_count: Optional[int] = Field( + default=None, description="" + ) + column_distinct_values_count_long: Optional[int] = Field( + default=None, description="" + ) column_histogram: Optional[Histogram] = Field(default=None, description="") column_max: Optional[float] = Field(default=None, description="") column_min: Optional[float] = Field(default=None, description="") @@ -1327,43 +1493,91 @@ class Attributes(SQL.Attributes): column_median: Optional[float] = Field(default=None, description="") column_standard_deviation: Optional[float] = Field(default=None, description="") column_unique_values_count: Optional[int] = Field(default=None, description="") - column_unique_values_count_long: Optional[int] = Field(default=None, description="") + column_unique_values_count_long: Optional[int] = Field( + default=None, description="" + ) column_average: Optional[float] = Field(default=None, description="") column_average_length: Optional[float] = Field(default=None, description="") - column_duplicate_values_count: Optional[int] = Field(default=None, description="") - column_duplicate_values_count_long: Optional[int] = Field(default=None, description="") - column_maximum_string_length: Optional[int] = Field(default=None, description="") + column_duplicate_values_count: Optional[int] = Field( + default=None, description="" + ) + column_duplicate_values_count_long: Optional[int] = Field( + default=None, description="" + ) + column_maximum_string_length: Optional[int] = Field( + default=None, description="" + ) column_maxs: Optional[Set[str]] = Field(default=None, description="") - column_minimum_string_length: Optional[int] = Field(default=None, description="") + column_minimum_string_length: Optional[int] = Field( + default=None, description="" + ) column_mins: Optional[Set[str]] = Field(default=None, description="") column_missing_values_count: Optional[int] = Field(default=None, description="") - column_missing_values_count_long: Optional[int] = Field(default=None, description="") - column_missing_values_percentage: Optional[float] = Field(default=None, description="") - column_uniqueness_percentage: Optional[float] = Field(default=None, description="") + column_missing_values_count_long: Optional[int] = Field( + default=None, description="" + ) + column_missing_values_percentage: Optional[float] = Field( + default=None, description="" + ) + column_uniqueness_percentage: Optional[float] = Field( + default=None, description="" + ) column_variance: Optional[float] = Field(default=None, description="") - column_top_values: Optional[List[ColumnValueFrequencyMap]] = Field(default=None, description="") + column_top_values: Optional[List[ColumnValueFrequencyMap]] = Field( + default=None, description="" + ) column_depth_level: Optional[int] = Field(default=None, description="") nosql_collection_name: Optional[str] = Field(default=None, description="") - nosql_collection_qualified_name: Optional[str] = Field(default=None, description="") - snowflake_dynamic_table: Optional[SnowflakeDynamicTable] = Field(default=None, description="") # relationship + nosql_collection_qualified_name: Optional[str] = Field( + default=None, description="" + ) + snowflake_dynamic_table: Optional[SnowflakeDynamicTable] = Field( + default=None, description="" + ) # relationship view: Optional[View] = Field(default=None, description="") # relationship - nested_columns: Optional[List[Column]] = Field(default=None, description="") # relationship - data_quality_metric_dimensions: Optional[List[Metric]] = Field(default=None, description="") # relationship - dbt_model_columns: Optional[List[DbtModelColumn]] = Field(default=None, description="") # relationship + nested_columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship + data_quality_metric_dimensions: Optional[List[Metric]] = Field( + default=None, description="" + ) # relationship + dbt_model_columns: Optional[List[DbtModelColumn]] = Field( + default=None, description="" + ) # relationship table: Optional[Table] = Field(default=None, description="") # relationship - column_dbt_model_columns: Optional[List[DbtModelColumn]] = Field(default=None, description="") # relationship - materialised_view: Optional[MaterialisedView] = Field(default=None, description="") # relationship - calculation_view: Optional[CalculationView] = Field(default=None, description="") # relationship - parent_column: Optional[Column] = Field(default=None, description="") # relationship - queries: Optional[List[Query]] = Field(default=None, description="") # relationship - metric_timestamps: Optional[List[Metric]] = Field(default=None, description="") # relationship - foreign_key_to: Optional[List[Column]] = Field(default=None, description="") # relationship + column_dbt_model_columns: Optional[List[DbtModelColumn]] = Field( + default=None, description="" + ) # relationship + materialised_view: Optional[MaterialisedView] = Field( + default=None, description="" + ) # relationship + calculation_view: Optional[CalculationView] = Field( + default=None, description="" + ) # relationship + parent_column: Optional[Column] = Field( + default=None, description="" + ) # relationship + queries: Optional[List[Query]] = Field( + default=None, description="" + ) # relationship + metric_timestamps: Optional[List[Metric]] = Field( + default=None, description="" + ) # relationship + foreign_key_to: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship cosmos_mongo_d_b_collection: Optional[CosmosMongoDBCollection] = Field( default=None, description="" ) # relationship - foreign_key_from: Optional[Column] = Field(default=None, description="") # relationship - dbt_metrics: Optional[List[DbtMetric]] = Field(default=None, description="") # relationship - table_partition: Optional[TablePartition] = Field(default=None, description="") # relationship + foreign_key_from: Optional[Column] = Field( + default=None, description="" + ) # relationship + dbt_metrics: Optional[List[DbtMetric]] = Field( + default=None, description="" + ) # relationship + table_partition: Optional[TablePartition] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -1408,7 +1622,9 @@ def create( [name, parent_qualified_name, parent_type, order], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( parent_qualified_name, "parent_qualified_name", 6 @@ -1422,8 +1638,13 @@ def create( database_name = database_name or fields[3] schema_name = schema_name or fields[4] parent_name = parent_name or fields[5] - database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" - schema_qualified_name = schema_qualified_name or f"{database_qualified_name}/{schema_name}" + database_qualified_name = ( + database_qualified_name + or f"{connection_qualified_name}/{database_name}" + ) + schema_qualified_name = ( + schema_qualified_name or f"{database_qualified_name}/{schema_name}" + ) column = Column.Attributes( name=name, @@ -1447,15 +1668,21 @@ def create( column.view_name = parent_name elif parent_type == MaterialisedView: column.view_qualified_name = parent_qualified_name - column.materialised_view = MaterialisedView.ref_by_qualified_name(parent_qualified_name) + column.materialised_view = MaterialisedView.ref_by_qualified_name( + parent_qualified_name + ) column.view_name = parent_name elif parent_type == TablePartition: column.table_qualified_name = parent_qualified_name - column.table_partition = TablePartition.ref_by_qualified_name(parent_qualified_name) + column.table_partition = TablePartition.ref_by_qualified_name( + parent_qualified_name + ) column.table_name = parent_name elif parent_type == SnowflakeDynamicTable: column.table_qualified_name = parent_qualified_name - column.snowflake_dynamic_table = SnowflakeDynamicTable.ref_by_qualified_name(parent_qualified_name) + column.snowflake_dynamic_table = ( + SnowflakeDynamicTable.ref_by_qualified_name(parent_qualified_name) + ) column.table_name = parent_name else: raise ValueError( diff --git a/pyatlan/model/assets/core/column_process.py b/pyatlan/model/assets/core/column_process.py index 6fafa41f8..b24c7fccd 100644 --- a/pyatlan/model/assets/core/column_process.py +++ b/pyatlan/model/assets/core/column_process.py @@ -52,7 +52,9 @@ def create( process_id: Optional[str] = None, ) -> ColumnProcess: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -128,8 +130,12 @@ def process(self, process: Optional[Process]): self.attributes.process = process class Attributes(Process.Attributes): - outputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship - inputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship + outputs: Optional[List[Catalog]] = Field( + default=None, description="" + ) # relationship + inputs: Optional[List[Catalog]] = Field( + default=None, description="" + ) # relationship process: Optional[Process] = Field(default=None, description="") # relationship @classmethod diff --git a/pyatlan/model/assets/core/cosmos_mongo_d_b_account.py b/pyatlan/model/assets/core/cosmos_mongo_d_b_account.py index 58da7882a..5b8f580ca 100644 --- a/pyatlan/model/assets/core/cosmos_mongo_d_b_account.py +++ b/pyatlan/model/assets/core/cosmos_mongo_d_b_account.py @@ -84,28 +84,36 @@ def __setattr__(self, name, value): """ The status of public network access for the Cosmos MongoDB account. """ - COSMOS_MONGO_DB_ACCOUNT_ENABLE_AUTOMATIC_FAILOVER: ClassVar[BooleanField] = BooleanField( - "cosmosMongoDBAccountEnableAutomaticFailover", - "cosmosMongoDBAccountEnableAutomaticFailover", + COSMOS_MONGO_DB_ACCOUNT_ENABLE_AUTOMATIC_FAILOVER: ClassVar[BooleanField] = ( + BooleanField( + "cosmosMongoDBAccountEnableAutomaticFailover", + "cosmosMongoDBAccountEnableAutomaticFailover", + ) ) """ Indicates whether automatic failover is enabled for the Cosmos MongoDB account. """ - COSMOS_MONGO_DB_ACCOUNT_ENABLE_MULTIPLE_WRITE_LOCATIONS: ClassVar[BooleanField] = BooleanField( - "cosmosMongoDBAccountEnableMultipleWriteLocations", - "cosmosMongoDBAccountEnableMultipleWriteLocations", + COSMOS_MONGO_DB_ACCOUNT_ENABLE_MULTIPLE_WRITE_LOCATIONS: ClassVar[BooleanField] = ( + BooleanField( + "cosmosMongoDBAccountEnableMultipleWriteLocations", + "cosmosMongoDBAccountEnableMultipleWriteLocations", + ) ) """ Indicates whether multiple write locations are enabled for the Cosmos MongoDB account. """ - COSMOS_MONGO_DB_ACCOUNT_ENABLE_PARTITION_KEY_MONITOR: ClassVar[BooleanField] = BooleanField( - "cosmosMongoDBAccountEnablePartitionKeyMonitor", - "cosmosMongoDBAccountEnablePartitionKeyMonitor", + COSMOS_MONGO_DB_ACCOUNT_ENABLE_PARTITION_KEY_MONITOR: ClassVar[BooleanField] = ( + BooleanField( + "cosmosMongoDBAccountEnablePartitionKeyMonitor", + "cosmosMongoDBAccountEnablePartitionKeyMonitor", + ) ) """ Indicates whether partition key monitoring is enabled for the Cosmos MongoDB account. """ - COSMOS_MONGO_DB_ACCOUNT_IS_VIRTUAL_NETWORK_FILTER_ENABLED: ClassVar[BooleanField] = BooleanField( + COSMOS_MONGO_DB_ACCOUNT_IS_VIRTUAL_NETWORK_FILTER_ENABLED: ClassVar[ + BooleanField + ] = BooleanField( "cosmosMongoDBAccountIsVirtualNetworkFilterEnabled", "cosmosMongoDBAccountIsVirtualNetworkFilterEnabled", ) @@ -137,7 +145,9 @@ def __setattr__(self, name, value): The write locations configured for the Cosmos MongoDB account. """ - COSMOS_MONGO_DB_DATABASES: ClassVar[RelationField] = RelationField("cosmosMongoDBDatabases") + COSMOS_MONGO_DB_DATABASES: ClassVar[RelationField] = RelationField( + "cosmosMongoDBDatabases" + ) """ TBC """ @@ -164,77 +174,135 @@ def __setattr__(self, name, value): @property def cosmos_mongo_d_b_account_instance_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_instance_id + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_instance_id + ) @cosmos_mongo_d_b_account_instance_id.setter - def cosmos_mongo_d_b_account_instance_id(self, cosmos_mongo_d_b_account_instance_id: Optional[str]): + def cosmos_mongo_d_b_account_instance_id( + self, cosmos_mongo_d_b_account_instance_id: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_instance_id = cosmos_mongo_d_b_account_instance_id + self.attributes.cosmos_mongo_d_b_account_instance_id = ( + cosmos_mongo_d_b_account_instance_id + ) @property def cosmos_mongo_d_b_database_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_database_count + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_database_count + ) @cosmos_mongo_d_b_database_count.setter - def cosmos_mongo_d_b_database_count(self, cosmos_mongo_d_b_database_count: Optional[int]): + def cosmos_mongo_d_b_database_count( + self, cosmos_mongo_d_b_database_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_database_count = cosmos_mongo_d_b_database_count + self.attributes.cosmos_mongo_d_b_database_count = ( + cosmos_mongo_d_b_database_count + ) @property def cosmos_mongo_d_b_account_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_type + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_type + ) @cosmos_mongo_d_b_account_type.setter - def cosmos_mongo_d_b_account_type(self, cosmos_mongo_d_b_account_type: Optional[str]): + def cosmos_mongo_d_b_account_type( + self, cosmos_mongo_d_b_account_type: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_account_type = cosmos_mongo_d_b_account_type @property def cosmos_mongo_d_b_account_subscription_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_subscription_id + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_subscription_id + ) @cosmos_mongo_d_b_account_subscription_id.setter - def cosmos_mongo_d_b_account_subscription_id(self, cosmos_mongo_d_b_account_subscription_id: Optional[str]): + def cosmos_mongo_d_b_account_subscription_id( + self, cosmos_mongo_d_b_account_subscription_id: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_subscription_id = cosmos_mongo_d_b_account_subscription_id + self.attributes.cosmos_mongo_d_b_account_subscription_id = ( + cosmos_mongo_d_b_account_subscription_id + ) @property def cosmos_mongo_d_b_account_resource_group(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_resource_group + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_resource_group + ) @cosmos_mongo_d_b_account_resource_group.setter - def cosmos_mongo_d_b_account_resource_group(self, cosmos_mongo_d_b_account_resource_group: Optional[str]): + def cosmos_mongo_d_b_account_resource_group( + self, cosmos_mongo_d_b_account_resource_group: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_resource_group = cosmos_mongo_d_b_account_resource_group + self.attributes.cosmos_mongo_d_b_account_resource_group = ( + cosmos_mongo_d_b_account_resource_group + ) @property def cosmos_mongo_d_b_account_document_endpoint(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_document_endpoint + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_document_endpoint + ) @cosmos_mongo_d_b_account_document_endpoint.setter - def cosmos_mongo_d_b_account_document_endpoint(self, cosmos_mongo_d_b_account_document_endpoint: Optional[str]): + def cosmos_mongo_d_b_account_document_endpoint( + self, cosmos_mongo_d_b_account_document_endpoint: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_document_endpoint = cosmos_mongo_d_b_account_document_endpoint + self.attributes.cosmos_mongo_d_b_account_document_endpoint = ( + cosmos_mongo_d_b_account_document_endpoint + ) @property def cosmos_mongo_d_b_account_mongo_endpoint(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_mongo_endpoint + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_mongo_endpoint + ) @cosmos_mongo_d_b_account_mongo_endpoint.setter - def cosmos_mongo_d_b_account_mongo_endpoint(self, cosmos_mongo_d_b_account_mongo_endpoint: Optional[str]): + def cosmos_mongo_d_b_account_mongo_endpoint( + self, cosmos_mongo_d_b_account_mongo_endpoint: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_mongo_endpoint = cosmos_mongo_d_b_account_mongo_endpoint + self.attributes.cosmos_mongo_d_b_account_mongo_endpoint = ( + cosmos_mongo_d_b_account_mongo_endpoint + ) @property def cosmos_mongo_d_b_account_public_network_access(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_public_network_access + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_public_network_access + ) @cosmos_mongo_d_b_account_public_network_access.setter def cosmos_mongo_d_b_account_public_network_access( @@ -242,11 +310,17 @@ def cosmos_mongo_d_b_account_public_network_access( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_public_network_access = cosmos_mongo_d_b_account_public_network_access + self.attributes.cosmos_mongo_d_b_account_public_network_access = ( + cosmos_mongo_d_b_account_public_network_access + ) @property def cosmos_mongo_d_b_account_enable_automatic_failover(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_enable_automatic_failover + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_enable_automatic_failover + ) @cosmos_mongo_d_b_account_enable_automatic_failover.setter def cosmos_mongo_d_b_account_enable_automatic_failover( @@ -281,7 +355,9 @@ def cosmos_mongo_d_b_account_enable_multiple_write_locations( @property def cosmos_mongo_d_b_account_enable_partition_key_monitor(self) -> Optional[bool]: return ( - None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_enable_partition_key_monitor + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_enable_partition_key_monitor ) @cosmos_mongo_d_b_account_enable_partition_key_monitor.setter @@ -316,71 +392,141 @@ def cosmos_mongo_d_b_account_is_virtual_network_filter_enabled( @property def cosmos_mongo_d_b_account_consistency_policy(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_consistency_policy + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_consistency_policy + ) @cosmos_mongo_d_b_account_consistency_policy.setter - def cosmos_mongo_d_b_account_consistency_policy(self, cosmos_mongo_d_b_account_consistency_policy: Optional[str]): + def cosmos_mongo_d_b_account_consistency_policy( + self, cosmos_mongo_d_b_account_consistency_policy: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_consistency_policy = cosmos_mongo_d_b_account_consistency_policy + self.attributes.cosmos_mongo_d_b_account_consistency_policy = ( + cosmos_mongo_d_b_account_consistency_policy + ) @property def cosmos_mongo_d_b_account_locations(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_locations + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_locations + ) @cosmos_mongo_d_b_account_locations.setter - def cosmos_mongo_d_b_account_locations(self, cosmos_mongo_d_b_account_locations: Optional[Set[str]]): + def cosmos_mongo_d_b_account_locations( + self, cosmos_mongo_d_b_account_locations: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_locations = cosmos_mongo_d_b_account_locations + self.attributes.cosmos_mongo_d_b_account_locations = ( + cosmos_mongo_d_b_account_locations + ) @property def cosmos_mongo_d_b_account_read_locations(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_read_locations + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_read_locations + ) @cosmos_mongo_d_b_account_read_locations.setter - def cosmos_mongo_d_b_account_read_locations(self, cosmos_mongo_d_b_account_read_locations: Optional[Set[str]]): + def cosmos_mongo_d_b_account_read_locations( + self, cosmos_mongo_d_b_account_read_locations: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_read_locations = cosmos_mongo_d_b_account_read_locations + self.attributes.cosmos_mongo_d_b_account_read_locations = ( + cosmos_mongo_d_b_account_read_locations + ) @property def cosmos_mongo_d_b_account_write_locations(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_write_locations + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_write_locations + ) @cosmos_mongo_d_b_account_write_locations.setter - def cosmos_mongo_d_b_account_write_locations(self, cosmos_mongo_d_b_account_write_locations: Optional[Set[str]]): + def cosmos_mongo_d_b_account_write_locations( + self, cosmos_mongo_d_b_account_write_locations: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_write_locations = cosmos_mongo_d_b_account_write_locations + self.attributes.cosmos_mongo_d_b_account_write_locations = ( + cosmos_mongo_d_b_account_write_locations + ) @property def cosmos_mongo_d_b_databases(self) -> Optional[List[CosmosMongoDBDatabase]]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_databases + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_databases + ) @cosmos_mongo_d_b_databases.setter - def cosmos_mongo_d_b_databases(self, cosmos_mongo_d_b_databases: Optional[List[CosmosMongoDBDatabase]]): + def cosmos_mongo_d_b_databases( + self, cosmos_mongo_d_b_databases: Optional[List[CosmosMongoDBDatabase]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_databases = cosmos_mongo_d_b_databases class Attributes(CosmosMongoDB.Attributes): - cosmos_mongo_d_b_account_instance_id: Optional[str] = Field(default=None, description="") - cosmos_mongo_d_b_database_count: Optional[int] = Field(default=None, description="") - cosmos_mongo_d_b_account_type: Optional[str] = Field(default=None, description="") - cosmos_mongo_d_b_account_subscription_id: Optional[str] = Field(default=None, description="") - cosmos_mongo_d_b_account_resource_group: Optional[str] = Field(default=None, description="") - cosmos_mongo_d_b_account_document_endpoint: Optional[str] = Field(default=None, description="") - cosmos_mongo_d_b_account_mongo_endpoint: Optional[str] = Field(default=None, description="") - cosmos_mongo_d_b_account_public_network_access: Optional[str] = Field(default=None, description="") - cosmos_mongo_d_b_account_enable_automatic_failover: Optional[bool] = Field(default=None, description="") - cosmos_mongo_d_b_account_enable_multiple_write_locations: Optional[bool] = Field(default=None, description="") - cosmos_mongo_d_b_account_enable_partition_key_monitor: Optional[bool] = Field(default=None, description="") - cosmos_mongo_d_b_account_is_virtual_network_filter_enabled: Optional[bool] = Field(default=None, description="") - cosmos_mongo_d_b_account_consistency_policy: Optional[str] = Field(default=None, description="") - cosmos_mongo_d_b_account_locations: Optional[Set[str]] = Field(default=None, description="") - cosmos_mongo_d_b_account_read_locations: Optional[Set[str]] = Field(default=None, description="") - cosmos_mongo_d_b_account_write_locations: Optional[Set[str]] = Field(default=None, description="") + cosmos_mongo_d_b_account_instance_id: Optional[str] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_database_count: Optional[int] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_type: Optional[str] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_subscription_id: Optional[str] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_resource_group: Optional[str] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_document_endpoint: Optional[str] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_mongo_endpoint: Optional[str] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_public_network_access: Optional[str] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_enable_automatic_failover: Optional[bool] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_enable_multiple_write_locations: Optional[bool] = ( + Field(default=None, description="") + ) + cosmos_mongo_d_b_account_enable_partition_key_monitor: Optional[bool] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_is_virtual_network_filter_enabled: Optional[bool] = ( + Field(default=None, description="") + ) + cosmos_mongo_d_b_account_consistency_policy: Optional[str] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_locations: Optional[Set[str]] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_read_locations: Optional[Set[str]] = Field( + default=None, description="" + ) + cosmos_mongo_d_b_account_write_locations: Optional[Set[str]] = Field( + default=None, description="" + ) cosmos_mongo_d_b_databases: Optional[List[CosmosMongoDBDatabase]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/core/cosmos_mongo_d_b_collection.py b/pyatlan/model/assets/core/cosmos_mongo_d_b_collection.py index d2a036e3f..142fb1c5a 100644 --- a/pyatlan/model/assets/core/cosmos_mongo_d_b_collection.py +++ b/pyatlan/model/assets/core/cosmos_mongo_d_b_collection.py @@ -38,15 +38,19 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - COSMOS_MONGO_DB_DATABASE_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "cosmosMongoDBDatabaseQualifiedName", - "cosmosMongoDBDatabaseQualifiedName", - "cosmosMongoDBDatabaseQualifiedName.text", + COSMOS_MONGO_DB_DATABASE_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( + KeywordTextField( + "cosmosMongoDBDatabaseQualifiedName", + "cosmosMongoDBDatabaseQualifiedName", + "cosmosMongoDBDatabaseQualifiedName.text", + ) ) """ Unique name of the database in which this collection exists. """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( + "noSQLSchemaDefinition", "noSQLSchemaDefinition" + ) """ Represents attributes for describing the key schema for the table and indexes. """ @@ -144,35 +148,51 @@ def __setattr__(self, name, value): """ Whether this table is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( + "isQueryPreview", "isQueryPreview" + ) """ Whether preview queries are allowed for this table (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( + "queryPreviewConfig", "queryPreviewConfig" + ) """ Configuration for preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") + EXTERNAL_LOCATION: ClassVar[TextField] = TextField( + "externalLocation", "externalLocation" + ) """ External location of this table, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( + "externalLocationRegion", "externalLocationRegion" + ) """ Region of the external location of this table, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( + "externalLocationFormat", "externalLocationFormat" + ) """ Format of the external location of this table, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( + "isPartitioned", "isPartitioned" + ) """ Whether this table is partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( + "partitionStrategy", "partitionStrategy" + ) """ Partition strategy for this table. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") + PARTITION_COUNT: ClassVar[NumericField] = NumericField( + "partitionCount", "partitionCount" + ) """ Number of partitions in this table. """ @@ -188,15 +208,21 @@ def __setattr__(self, name, value): """ Type of the table. """ - ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField("icebergCatalogName", "icebergCatalogName") + ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField( + "icebergCatalogName", "icebergCatalogName" + ) """ iceberg table catalog name (can be any user defined name) """ - ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField("icebergTableType", "icebergTableType") + ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField( + "icebergTableType", "icebergTableType" + ) """ iceberg table type (managed vs unmanaged) """ - ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField("icebergCatalogSource", "icebergCatalogSource") + ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField( + "icebergCatalogSource", "icebergCatalogSource" + ) """ iceberg table catalog type (glue, polaris, snowflake) """ @@ -224,7 +250,9 @@ def __setattr__(self, name, value): """ iceberg table base location inside the external volume. """ - TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField("tableRetentionTime", "tableRetentionTime") + TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField( + "tableRetentionTime", "tableRetentionTime" + ) """ Data retention time in days. """ @@ -232,47 +260,69 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( + "queryUserCount", "queryUserCount" + ) """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( + "queryUserMap", "queryUserMap" + ) """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( + "queryCountUpdatedAt", "queryCountUpdatedAt" + ) """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "databaseName", "databaseName.keyword", "databaseName" + ) """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "databaseQualifiedName", "databaseQualifiedName" + ) """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "schemaName", "schemaName.keyword", "schemaName" + ) """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "schemaQualifiedName", "schemaQualifiedName" + ) """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "tableName", "tableName.keyword", "tableName" + ) """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "tableQualifiedName", "tableQualifiedName" + ) """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "viewName", "viewName.keyword", "viewName" + ) """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "viewQualifiedName", "viewQualifiedName" + ) """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -292,7 +342,9 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( + "lastProfiledAt", "lastProfiledAt" + ) """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -325,7 +377,9 @@ def __setattr__(self, name, value): """ TBC """ - COSMOS_MONGO_DB_DATABASE: ClassVar[RelationField] = RelationField("cosmosMongoDBDatabase") + COSMOS_MONGO_DB_DATABASE: ClassVar[RelationField] = RelationField( + "cosmosMongoDBDatabase" + ) """ TBC """ @@ -422,17 +476,29 @@ def __setattr__(self, name, value): @property def cosmos_mongo_d_b_database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_database_qualified_name + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_database_qualified_name + ) @cosmos_mongo_d_b_database_qualified_name.setter - def cosmos_mongo_d_b_database_qualified_name(self, cosmos_mongo_d_b_database_qualified_name: Optional[str]): + def cosmos_mongo_d_b_database_qualified_name( + self, cosmos_mongo_d_b_database_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_database_qualified_name = cosmos_mongo_d_b_database_qualified_name + self.attributes.cosmos_mongo_d_b_database_qualified_name = ( + cosmos_mongo_d_b_database_qualified_name + ) @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition + return ( + None + if self.attributes is None + else self.attributes.no_s_q_l_schema_definition + ) @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -442,7 +508,11 @@ def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @property def mongo_d_b_collection_subtype(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_subtype + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_subtype + ) @mongo_d_b_collection_subtype.setter def mongo_d_b_collection_subtype(self, mongo_d_b_collection_subtype: Optional[str]): @@ -452,113 +522,197 @@ def mongo_d_b_collection_subtype(self, mongo_d_b_collection_subtype: Optional[st @property def mongo_d_b_collection_is_capped(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_is_capped + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_is_capped + ) @mongo_d_b_collection_is_capped.setter - def mongo_d_b_collection_is_capped(self, mongo_d_b_collection_is_capped: Optional[bool]): + def mongo_d_b_collection_is_capped( + self, mongo_d_b_collection_is_capped: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collection_is_capped = mongo_d_b_collection_is_capped @property def mongo_d_b_collection_time_field(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_time_field + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_time_field + ) @mongo_d_b_collection_time_field.setter - def mongo_d_b_collection_time_field(self, mongo_d_b_collection_time_field: Optional[str]): + def mongo_d_b_collection_time_field( + self, mongo_d_b_collection_time_field: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_time_field = mongo_d_b_collection_time_field + self.attributes.mongo_d_b_collection_time_field = ( + mongo_d_b_collection_time_field + ) @property def mongo_d_b_collection_time_granularity(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_time_granularity + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_time_granularity + ) @mongo_d_b_collection_time_granularity.setter - def mongo_d_b_collection_time_granularity(self, mongo_d_b_collection_time_granularity: Optional[str]): + def mongo_d_b_collection_time_granularity( + self, mongo_d_b_collection_time_granularity: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_time_granularity = mongo_d_b_collection_time_granularity + self.attributes.mongo_d_b_collection_time_granularity = ( + mongo_d_b_collection_time_granularity + ) @property def mongo_d_b_collection_expire_after_seconds(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_expire_after_seconds + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_expire_after_seconds + ) @mongo_d_b_collection_expire_after_seconds.setter - def mongo_d_b_collection_expire_after_seconds(self, mongo_d_b_collection_expire_after_seconds: Optional[int]): + def mongo_d_b_collection_expire_after_seconds( + self, mongo_d_b_collection_expire_after_seconds: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_expire_after_seconds = mongo_d_b_collection_expire_after_seconds + self.attributes.mongo_d_b_collection_expire_after_seconds = ( + mongo_d_b_collection_expire_after_seconds + ) @property def mongo_d_b_collection_maximum_document_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_maximum_document_count + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_maximum_document_count + ) @mongo_d_b_collection_maximum_document_count.setter - def mongo_d_b_collection_maximum_document_count(self, mongo_d_b_collection_maximum_document_count: Optional[int]): + def mongo_d_b_collection_maximum_document_count( + self, mongo_d_b_collection_maximum_document_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_maximum_document_count = mongo_d_b_collection_maximum_document_count + self.attributes.mongo_d_b_collection_maximum_document_count = ( + mongo_d_b_collection_maximum_document_count + ) @property def mongo_d_b_collection_max_size(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_max_size + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_max_size + ) @mongo_d_b_collection_max_size.setter - def mongo_d_b_collection_max_size(self, mongo_d_b_collection_max_size: Optional[int]): + def mongo_d_b_collection_max_size( + self, mongo_d_b_collection_max_size: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collection_max_size = mongo_d_b_collection_max_size @property def mongo_d_b_collection_num_orphan_docs(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_num_orphan_docs + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_num_orphan_docs + ) @mongo_d_b_collection_num_orphan_docs.setter - def mongo_d_b_collection_num_orphan_docs(self, mongo_d_b_collection_num_orphan_docs: Optional[int]): + def mongo_d_b_collection_num_orphan_docs( + self, mongo_d_b_collection_num_orphan_docs: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_num_orphan_docs = mongo_d_b_collection_num_orphan_docs + self.attributes.mongo_d_b_collection_num_orphan_docs = ( + mongo_d_b_collection_num_orphan_docs + ) @property def mongo_d_b_collection_num_indexes(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_num_indexes + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_num_indexes + ) @mongo_d_b_collection_num_indexes.setter - def mongo_d_b_collection_num_indexes(self, mongo_d_b_collection_num_indexes: Optional[int]): + def mongo_d_b_collection_num_indexes( + self, mongo_d_b_collection_num_indexes: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_num_indexes = mongo_d_b_collection_num_indexes + self.attributes.mongo_d_b_collection_num_indexes = ( + mongo_d_b_collection_num_indexes + ) @property def mongo_d_b_collection_total_index_size(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_total_index_size + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_total_index_size + ) @mongo_d_b_collection_total_index_size.setter - def mongo_d_b_collection_total_index_size(self, mongo_d_b_collection_total_index_size: Optional[int]): + def mongo_d_b_collection_total_index_size( + self, mongo_d_b_collection_total_index_size: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_total_index_size = mongo_d_b_collection_total_index_size + self.attributes.mongo_d_b_collection_total_index_size = ( + mongo_d_b_collection_total_index_size + ) @property def mongo_d_b_collection_average_object_size(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_average_object_size + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_average_object_size + ) @mongo_d_b_collection_average_object_size.setter - def mongo_d_b_collection_average_object_size(self, mongo_d_b_collection_average_object_size: Optional[int]): + def mongo_d_b_collection_average_object_size( + self, mongo_d_b_collection_average_object_size: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_average_object_size = mongo_d_b_collection_average_object_size + self.attributes.mongo_d_b_collection_average_object_size = ( + mongo_d_b_collection_average_object_size + ) @property def mongo_d_b_collection_schema_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_schema_definition + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_schema_definition + ) @mongo_d_b_collection_schema_definition.setter - def mongo_d_b_collection_schema_definition(self, mongo_d_b_collection_schema_definition: Optional[str]): + def mongo_d_b_collection_schema_definition( + self, mongo_d_b_collection_schema_definition: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_schema_definition = mongo_d_b_collection_schema_definition + self.attributes.mongo_d_b_collection_schema_definition = ( + mongo_d_b_collection_schema_definition + ) @property def column_count(self) -> Optional[int]: @@ -642,7 +796,11 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_region + return ( + None + if self.attributes is None + else self.attributes.external_location_region + ) @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -652,7 +810,11 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_format + return ( + None + if self.attributes is None + else self.attributes.external_location_format + ) @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -742,7 +904,9 @@ def iceberg_table_type(self, iceberg_table_type: Optional[str]): @property def iceberg_catalog_source(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_source + return ( + None if self.attributes is None else self.attributes.iceberg_catalog_source + ) @iceberg_catalog_source.setter def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @@ -752,7 +916,11 @@ def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @property def iceberg_catalog_table_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_table_name + return ( + None + if self.attributes is None + else self.attributes.iceberg_catalog_table_name + ) @iceberg_catalog_table_name.setter def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @@ -762,17 +930,29 @@ def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @property def iceberg_catalog_table_namespace(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_table_namespace + return ( + None + if self.attributes is None + else self.attributes.iceberg_catalog_table_namespace + ) @iceberg_catalog_table_namespace.setter - def iceberg_catalog_table_namespace(self, iceberg_catalog_table_namespace: Optional[str]): + def iceberg_catalog_table_namespace( + self, iceberg_catalog_table_namespace: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.iceberg_catalog_table_namespace = iceberg_catalog_table_namespace + self.attributes.iceberg_catalog_table_namespace = ( + iceberg_catalog_table_namespace + ) @property def table_external_volume_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.table_external_volume_name + return ( + None + if self.attributes is None + else self.attributes.table_external_volume_name + ) @table_external_volume_name.setter def table_external_volume_name(self, table_external_volume_name: Optional[str]): @@ -782,7 +962,11 @@ def table_external_volume_name(self, table_external_volume_name: Optional[str]): @property def iceberg_table_base_location(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_table_base_location + return ( + None + if self.attributes is None + else self.attributes.iceberg_table_base_location + ) @iceberg_table_base_location.setter def iceberg_table_base_location(self, iceberg_table_base_location: Optional[str]): @@ -832,7 +1016,9 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.query_count_updated_at + return ( + None if self.attributes is None else self.attributes.query_count_updated_at + ) @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -852,7 +1038,9 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.database_qualified_name + return ( + None if self.attributes is None else self.attributes.database_qualified_name + ) @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -872,7 +1060,9 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_qualified_name + return ( + None if self.attributes is None else self.attributes.schema_qualified_name + ) @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -922,7 +1112,9 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_name + return ( + None if self.attributes is None else self.attributes.calculation_view_name + ) @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -932,13 +1124,21 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.calculation_view_qualified_name + ) @calculation_view_qualified_name.setter - def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): + def calculation_view_qualified_name( + self, calculation_view_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = calculation_view_qualified_name + self.attributes.calculation_view_qualified_name = ( + calculation_view_qualified_name + ) @property def is_profiled(self) -> Optional[bool]: @@ -1032,10 +1232,16 @@ def partitions(self, partitions: Optional[List[TablePartition]]): @property def cosmos_mongo_d_b_database(self) -> Optional[CosmosMongoDBDatabase]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_database + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_database + ) @cosmos_mongo_d_b_database.setter - def cosmos_mongo_d_b_database(self, cosmos_mongo_d_b_database: Optional[CosmosMongoDBDatabase]): + def cosmos_mongo_d_b_database( + self, cosmos_mongo_d_b_database: Optional[CosmosMongoDBDatabase] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_database = cosmos_mongo_d_b_database @@ -1091,27 +1297,55 @@ def dimensions(self, dimensions: Optional[List[Table]]): self.attributes.dimensions = dimensions class Attributes(CosmosMongoDB.Attributes): - cosmos_mongo_d_b_database_qualified_name: Optional[str] = Field(default=None, description="") + cosmos_mongo_d_b_database_qualified_name: Optional[str] = Field( + default=None, description="" + ) no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") - mongo_d_b_collection_subtype: Optional[str] = Field(default=None, description="") - mongo_d_b_collection_is_capped: Optional[bool] = Field(default=None, description="") - mongo_d_b_collection_time_field: Optional[str] = Field(default=None, description="") - mongo_d_b_collection_time_granularity: Optional[str] = Field(default=None, description="") - mongo_d_b_collection_expire_after_seconds: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_maximum_document_count: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_max_size: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_num_orphan_docs: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_num_indexes: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_total_index_size: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_average_object_size: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_schema_definition: Optional[str] = Field(default=None, description="") + mongo_d_b_collection_subtype: Optional[str] = Field( + default=None, description="" + ) + mongo_d_b_collection_is_capped: Optional[bool] = Field( + default=None, description="" + ) + mongo_d_b_collection_time_field: Optional[str] = Field( + default=None, description="" + ) + mongo_d_b_collection_time_granularity: Optional[str] = Field( + default=None, description="" + ) + mongo_d_b_collection_expire_after_seconds: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_maximum_document_count: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_max_size: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_num_orphan_docs: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_num_indexes: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_total_index_size: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_average_object_size: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_schema_definition: Optional[str] = Field( + default=None, description="" + ) column_count: Optional[int] = Field(default=None, description="") row_count: Optional[int] = Field(default=None, description="") size_bytes: Optional[int] = Field(default=None, description="") alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") + query_preview_config: Optional[Dict[str, str]] = Field( + default=None, description="" + ) external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -1125,7 +1359,9 @@ class Attributes(CosmosMongoDB.Attributes): iceberg_table_type: Optional[str] = Field(default=None, description="") iceberg_catalog_source: Optional[str] = Field(default=None, description="") iceberg_catalog_table_name: Optional[str] = Field(default=None, description="") - iceberg_catalog_table_namespace: Optional[str] = Field(default=None, description="") + iceberg_catalog_table_namespace: Optional[str] = Field( + default=None, description="" + ) table_external_volume_name: Optional[str] = Field(default=None, description="") iceberg_table_base_location: Optional[str] = Field(default=None, description="") table_retention_time: Optional[int] = Field(default=None, description="") @@ -1142,22 +1378,50 @@ class Attributes(CosmosMongoDB.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field(default=None, description="") + calculation_view_qualified_name: Optional[str] = Field( + default=None, description="" + ) is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - columns: Optional[List[Column]] = Field(default=None, description="") # relationship - facts: Optional[List[Table]] = Field(default=None, description="") # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship - dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship - atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship - partitions: Optional[List[TablePartition]] = Field(default=None, description="") # relationship - cosmos_mongo_d_b_database: Optional[CosmosMongoDBDatabase] = Field(default=None, description="") # relationship - queries: Optional[List[Query]] = Field(default=None, description="") # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship - mongo_d_b_database: Optional[MongoDBDatabase] = Field(default=None, description="") # relationship - dimensions: Optional[List[Table]] = Field(default=None, description="") # relationship + dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship + facts: Optional[List[Table]] = Field( + default=None, description="" + ) # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship + dbt_tests: Optional[List[DbtTest]] = Field( + default=None, description="" + ) # relationship + atlan_schema: Optional[Schema] = Field( + default=None, description="" + ) # relationship + partitions: Optional[List[TablePartition]] = Field( + default=None, description="" + ) # relationship + cosmos_mongo_d_b_database: Optional[CosmosMongoDBDatabase] = Field( + default=None, description="" + ) # relationship + queries: Optional[List[Query]] = Field( + default=None, description="" + ) # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship + mongo_d_b_database: Optional[MongoDBDatabase] = Field( + default=None, description="" + ) # relationship + dimensions: Optional[List[Table]] = Field( + default=None, description="" + ) # relationship attributes: CosmosMongoDBCollection.Attributes = Field( default_factory=lambda: CosmosMongoDBCollection.Attributes(), diff --git a/pyatlan/model/assets/core/cosmos_mongo_d_b_database.py b/pyatlan/model/assets/core/cosmos_mongo_d_b_database.py index 77f59e4ff..b378ae861 100644 --- a/pyatlan/model/assets/core/cosmos_mongo_d_b_database.py +++ b/pyatlan/model/assets/core/cosmos_mongo_d_b_database.py @@ -37,15 +37,19 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - COSMOS_MONGO_DB_ACCOUNT_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "cosmosMongoDBAccountQualifiedName", - "cosmosMongoDBAccountQualifiedName", - "cosmosMongoDBAccountQualifiedName.text", + COSMOS_MONGO_DB_ACCOUNT_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( + KeywordTextField( + "cosmosMongoDBAccountQualifiedName", + "cosmosMongoDBAccountQualifiedName", + "cosmosMongoDBAccountQualifiedName.text", + ) ) """ Unique name of the account in which this database exists. """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( + "noSQLSchemaDefinition", "noSQLSchemaDefinition" + ) """ Represents attributes for describing the key schema for the table and indexes. """ @@ -63,47 +67,69 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( + "queryUserCount", "queryUserCount" + ) """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( + "queryUserMap", "queryUserMap" + ) """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( + "queryCountUpdatedAt", "queryCountUpdatedAt" + ) """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "databaseName", "databaseName.keyword", "databaseName" + ) """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "databaseQualifiedName", "databaseQualifiedName" + ) """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "schemaName", "schemaName.keyword", "schemaName" + ) """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "schemaQualifiedName", "schemaQualifiedName" + ) """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "tableName", "tableName.keyword", "tableName" + ) """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "tableQualifiedName", "tableQualifiedName" + ) """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "viewName", "viewName.keyword", "viewName" + ) """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "viewQualifiedName", "viewQualifiedName" + ) """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -123,7 +149,9 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( + "lastProfiledAt", "lastProfiledAt" + ) """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -132,7 +160,9 @@ def __setattr__(self, name, value): """ TBC """ - COSMOS_MONGO_DB_ACCOUNT: ClassVar[RelationField] = RelationField("cosmosMongoDBAccount") + COSMOS_MONGO_DB_ACCOUNT: ClassVar[RelationField] = RelationField( + "cosmosMongoDBAccount" + ) """ TBC """ @@ -160,7 +190,9 @@ def __setattr__(self, name, value): """ TBC """ - COSMOS_MONGO_DB_COLLECTIONS: ClassVar[RelationField] = RelationField("cosmosMongoDBCollections") + COSMOS_MONGO_DB_COLLECTIONS: ClassVar[RelationField] = RelationField( + "cosmosMongoDBCollections" + ) """ TBC """ @@ -199,17 +231,29 @@ def __setattr__(self, name, value): @property def cosmos_mongo_d_b_account_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account_qualified_name + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account_qualified_name + ) @cosmos_mongo_d_b_account_qualified_name.setter - def cosmos_mongo_d_b_account_qualified_name(self, cosmos_mongo_d_b_account_qualified_name: Optional[str]): + def cosmos_mongo_d_b_account_qualified_name( + self, cosmos_mongo_d_b_account_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cosmos_mongo_d_b_account_qualified_name = cosmos_mongo_d_b_account_qualified_name + self.attributes.cosmos_mongo_d_b_account_qualified_name = ( + cosmos_mongo_d_b_account_qualified_name + ) @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition + return ( + None + if self.attributes is None + else self.attributes.no_s_q_l_schema_definition + ) @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -219,13 +263,21 @@ def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @property def mongo_d_b_database_collection_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_database_collection_count + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_database_collection_count + ) @mongo_d_b_database_collection_count.setter - def mongo_d_b_database_collection_count(self, mongo_d_b_database_collection_count: Optional[int]): + def mongo_d_b_database_collection_count( + self, mongo_d_b_database_collection_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_database_collection_count = mongo_d_b_database_collection_count + self.attributes.mongo_d_b_database_collection_count = ( + mongo_d_b_database_collection_count + ) @property def schema_count(self) -> Optional[int]: @@ -269,7 +321,9 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.query_count_updated_at + return ( + None if self.attributes is None else self.attributes.query_count_updated_at + ) @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -289,7 +343,9 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.database_qualified_name + return ( + None if self.attributes is None else self.attributes.database_qualified_name + ) @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -309,7 +365,9 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_qualified_name + return ( + None if self.attributes is None else self.attributes.schema_qualified_name + ) @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -359,7 +417,9 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_name + return ( + None if self.attributes is None else self.attributes.calculation_view_name + ) @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -369,13 +429,21 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.calculation_view_qualified_name + ) @calculation_view_qualified_name.setter - def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): + def calculation_view_qualified_name( + self, calculation_view_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = calculation_view_qualified_name + self.attributes.calculation_view_qualified_name = ( + calculation_view_qualified_name + ) @property def is_profiled(self) -> Optional[bool]: @@ -409,10 +477,16 @@ def dbt_sources(self, dbt_sources: Optional[List[DbtSource]]): @property def cosmos_mongo_d_b_account(self) -> Optional[CosmosMongoDBAccount]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_account + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_account + ) @cosmos_mongo_d_b_account.setter - def cosmos_mongo_d_b_account(self, cosmos_mongo_d_b_account: Optional[CosmosMongoDBAccount]): + def cosmos_mongo_d_b_account( + self, cosmos_mongo_d_b_account: Optional[CosmosMongoDBAccount] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_account = cosmos_mongo_d_b_account @@ -439,10 +513,14 @@ def dbt_tests(self, dbt_tests: Optional[List[DbtTest]]): @property def mongo_d_b_collections(self) -> Optional[List[MongoDBCollection]]: - return None if self.attributes is None else self.attributes.mongo_d_b_collections + return ( + None if self.attributes is None else self.attributes.mongo_d_b_collections + ) @mongo_d_b_collections.setter - def mongo_d_b_collections(self, mongo_d_b_collections: Optional[List[MongoDBCollection]]): + def mongo_d_b_collections( + self, mongo_d_b_collections: Optional[List[MongoDBCollection]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collections = mongo_d_b_collections @@ -479,18 +557,28 @@ def schemas(self, schemas: Optional[List[Schema]]): @property def cosmos_mongo_d_b_collections(self) -> Optional[List[CosmosMongoDBCollection]]: - return None if self.attributes is None else self.attributes.cosmos_mongo_d_b_collections + return ( + None + if self.attributes is None + else self.attributes.cosmos_mongo_d_b_collections + ) @cosmos_mongo_d_b_collections.setter - def cosmos_mongo_d_b_collections(self, cosmos_mongo_d_b_collections: Optional[List[CosmosMongoDBCollection]]): + def cosmos_mongo_d_b_collections( + self, cosmos_mongo_d_b_collections: Optional[List[CosmosMongoDBCollection]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cosmos_mongo_d_b_collections = cosmos_mongo_d_b_collections class Attributes(CosmosMongoDB.Attributes): - cosmos_mongo_d_b_account_qualified_name: Optional[str] = Field(default=None, description="") + cosmos_mongo_d_b_account_qualified_name: Optional[str] = Field( + default=None, description="" + ) no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") - mongo_d_b_database_collection_count: Optional[int] = Field(default=None, description="") + mongo_d_b_database_collection_count: Optional[int] = Field( + default=None, description="" + ) schema_count: Optional[int] = Field(default=None, description="") query_count: Optional[int] = Field(default=None, description="") query_user_count: Optional[int] = Field(default=None, description="") @@ -505,17 +593,35 @@ class Attributes(CosmosMongoDB.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field(default=None, description="") + calculation_view_qualified_name: Optional[str] = Field( + default=None, description="" + ) is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - cosmos_mongo_d_b_account: Optional[CosmosMongoDBAccount] = Field(default=None, description="") # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship - dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship - mongo_d_b_collections: Optional[List[MongoDBCollection]] = Field(default=None, description="") # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship - schemas: Optional[List[Schema]] = Field(default=None, description="") # relationship + dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + cosmos_mongo_d_b_account: Optional[CosmosMongoDBAccount] = Field( + default=None, description="" + ) # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship + dbt_tests: Optional[List[DbtTest]] = Field( + default=None, description="" + ) # relationship + mongo_d_b_collections: Optional[List[MongoDBCollection]] = Field( + default=None, description="" + ) # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship + schemas: Optional[List[Schema]] = Field( + default=None, description="" + ) # relationship cosmos_mongo_d_b_collections: Optional[List[CosmosMongoDBCollection]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/core/data_contract.py b/pyatlan/model/assets/core/data_contract.py index 9b6b752be..78eb6ac89 100644 --- a/pyatlan/model/assets/core/data_contract.py +++ b/pyatlan/model/assets/core/data_contract.py @@ -31,7 +31,9 @@ def creator(cls, asset_qualified_name: str, contract_json: str) -> DataContract: @overload @classmethod - def creator(cls, asset_qualified_name: str, contract_spec: Union[DataContractSpec, str]) -> DataContract: ... + def creator( + cls, asset_qualified_name: str, contract_spec: Union[DataContractSpec, str] + ) -> DataContract: ... @classmethod @init_guid @@ -66,36 +68,52 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATA_CONTRACT_JSON: ClassVar[TextField] = TextField("dataContractJson", "dataContractJson") + DATA_CONTRACT_JSON: ClassVar[TextField] = TextField( + "dataContractJson", "dataContractJson" + ) """ (Deprecated) Replaced by dataContractSpec attribute. """ - DATA_CONTRACT_SPEC: ClassVar[TextField] = TextField("dataContractSpec", "dataContractSpec") + DATA_CONTRACT_SPEC: ClassVar[TextField] = TextField( + "dataContractSpec", "dataContractSpec" + ) """ Actual content of the contract in YAML string format. Any changes to this string should create a new instance (with new sequential version number). """ # noqa: E501 - DATA_CONTRACT_VERSION: ClassVar[NumericField] = NumericField("dataContractVersion", "dataContractVersion") + DATA_CONTRACT_VERSION: ClassVar[NumericField] = NumericField( + "dataContractVersion", "dataContractVersion" + ) """ Version of the contract. """ - DATA_CONTRACT_ASSET_GUID: ClassVar[KeywordField] = KeywordField("dataContractAssetGuid", "dataContractAssetGuid") + DATA_CONTRACT_ASSET_GUID: ClassVar[KeywordField] = KeywordField( + "dataContractAssetGuid", "dataContractAssetGuid" + ) """ Unique identifier of the asset associated with this data contract. """ - DATA_CONTRACT_ASSET_CERTIFIED: ClassVar[RelationField] = RelationField("dataContractAssetCertified") + DATA_CONTRACT_ASSET_CERTIFIED: ClassVar[RelationField] = RelationField( + "dataContractAssetCertified" + ) """ TBC """ - DATA_CONTRACT_NEXT_VERSION: ClassVar[RelationField] = RelationField("dataContractNextVersion") + DATA_CONTRACT_NEXT_VERSION: ClassVar[RelationField] = RelationField( + "dataContractNextVersion" + ) """ TBC """ - DATA_CONTRACT_ASSET_LATEST: ClassVar[RelationField] = RelationField("dataContractAssetLatest") + DATA_CONTRACT_ASSET_LATEST: ClassVar[RelationField] = RelationField( + "dataContractAssetLatest" + ) """ TBC """ - DATA_CONTRACT_PREVIOUS_VERSION: ClassVar[RelationField] = RelationField("dataContractPreviousVersion") + DATA_CONTRACT_PREVIOUS_VERSION: ClassVar[RelationField] = RelationField( + "dataContractPreviousVersion" + ) """ TBC """ @@ -133,7 +151,9 @@ def data_contract_spec(self, data_contract_spec: Optional[str]): @property def data_contract_version(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.data_contract_version + return ( + None if self.attributes is None else self.attributes.data_contract_version + ) @data_contract_version.setter def data_contract_version(self, data_contract_version: Optional[int]): @@ -143,7 +163,11 @@ def data_contract_version(self, data_contract_version: Optional[int]): @property def data_contract_asset_guid(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.data_contract_asset_guid + return ( + None + if self.attributes is None + else self.attributes.data_contract_asset_guid + ) @data_contract_asset_guid.setter def data_contract_asset_guid(self, data_contract_asset_guid: Optional[str]): @@ -153,27 +177,43 @@ def data_contract_asset_guid(self, data_contract_asset_guid: Optional[str]): @property def data_contract_asset_certified(self) -> Optional[Asset]: - return None if self.attributes is None else self.attributes.data_contract_asset_certified + return ( + None + if self.attributes is None + else self.attributes.data_contract_asset_certified + ) @data_contract_asset_certified.setter - def data_contract_asset_certified(self, data_contract_asset_certified: Optional[Asset]): + def data_contract_asset_certified( + self, data_contract_asset_certified: Optional[Asset] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_contract_asset_certified = data_contract_asset_certified @property def data_contract_next_version(self) -> Optional[DataContract]: - return None if self.attributes is None else self.attributes.data_contract_next_version + return ( + None + if self.attributes is None + else self.attributes.data_contract_next_version + ) @data_contract_next_version.setter - def data_contract_next_version(self, data_contract_next_version: Optional[DataContract]): + def data_contract_next_version( + self, data_contract_next_version: Optional[DataContract] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_contract_next_version = data_contract_next_version @property def data_contract_asset_latest(self) -> Optional[Asset]: - return None if self.attributes is None else self.attributes.data_contract_asset_latest + return ( + None + if self.attributes is None + else self.attributes.data_contract_asset_latest + ) @data_contract_asset_latest.setter def data_contract_asset_latest(self, data_contract_asset_latest: Optional[Asset]): @@ -183,10 +223,16 @@ def data_contract_asset_latest(self, data_contract_asset_latest: Optional[Asset] @property def data_contract_previous_version(self) -> Optional[DataContract]: - return None if self.attributes is None else self.attributes.data_contract_previous_version + return ( + None + if self.attributes is None + else self.attributes.data_contract_previous_version + ) @data_contract_previous_version.setter - def data_contract_previous_version(self, data_contract_previous_version: Optional[DataContract]): + def data_contract_previous_version( + self, data_contract_previous_version: Optional[DataContract] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_contract_previous_version = data_contract_previous_version @@ -196,10 +242,18 @@ class Attributes(Catalog.Attributes): data_contract_spec: Optional[str] = Field(default=None, description="") data_contract_version: Optional[int] = Field(default=None, description="") data_contract_asset_guid: Optional[str] = Field(default=None, description="") - data_contract_asset_certified: Optional[Asset] = Field(default=None, description="") # relationship - data_contract_next_version: Optional[DataContract] = Field(default=None, description="") # relationship - data_contract_asset_latest: Optional[Asset] = Field(default=None, description="") # relationship - data_contract_previous_version: Optional[DataContract] = Field(default=None, description="") # relationship + data_contract_asset_certified: Optional[Asset] = Field( + default=None, description="" + ) # relationship + data_contract_next_version: Optional[DataContract] = Field( + default=None, description="" + ) # relationship + data_contract_asset_latest: Optional[Asset] = Field( + default=None, description="" + ) # relationship + data_contract_previous_version: Optional[DataContract] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -240,7 +294,9 @@ def creator( ) contract_spec = contract_spec.to_yaml() else: - is_dataset_found = search(r"dataset:\s*([^\s#]+)", contract_spec or default_dataset) + is_dataset_found = search( + r"dataset:\s*([^\s#]+)", contract_spec or default_dataset + ) dataset = None if is_dataset_found: dataset = is_dataset_found.group(1) diff --git a/pyatlan/model/assets/core/data_domain.py b/pyatlan/model/assets/core/data_domain.py index 5f180dc07..061eecdc9 100644 --- a/pyatlan/model/assets/core/data_domain.py +++ b/pyatlan/model/assets/core/data_domain.py @@ -43,7 +43,9 @@ def create( parent_domain_qualified_name: Optional[StrictStr] = None, ) -> DataDomain: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -77,7 +79,9 @@ def create_for_modification( name: str = "", ) -> SelfAsset: warn( - ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'updater' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -164,10 +168,18 @@ def sub_domains(self, sub_domains: Optional[List[DataDomain]]): self.attributes.sub_domains = sub_domains class Attributes(DataMesh.Attributes): - stakeholders: Optional[List[Stakeholder]] = Field(default=None, description="") # relationship - parent_domain: Optional[DataDomain] = Field(default=None, description="") # relationship - data_products: Optional[List[DataProduct]] = Field(default=None, description="") # relationship - sub_domains: Optional[List[DataDomain]] = Field(default=None, description="") # relationship + stakeholders: Optional[List[Stakeholder]] = Field( + default=None, description="" + ) # relationship + parent_domain: Optional[DataDomain] = Field( + default=None, description="" + ) # relationship + data_products: Optional[List[DataProduct]] = Field( + default=None, description="" + ) # relationship + sub_domains: Optional[List[DataDomain]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -183,8 +195,12 @@ def create( # In case of sub-domain if parent_domain_qualified_name: - parent_domain = DataDomain.ref_by_qualified_name(parent_domain_qualified_name) - super_domain_qualified_name = DataMesh.get_super_domain_qualified_name(parent_domain_qualified_name) + parent_domain = DataDomain.ref_by_qualified_name( + parent_domain_qualified_name + ) + super_domain_qualified_name = DataMesh.get_super_domain_qualified_name( + parent_domain_qualified_name + ) return DataDomain.Attributes( name=name, diff --git a/pyatlan/model/assets/core/data_mesh.py b/pyatlan/model/assets/core/data_mesh.py index 6b21f1c92..487296d26 100644 --- a/pyatlan/model/assets/core/data_mesh.py +++ b/pyatlan/model/assets/core/data_mesh.py @@ -73,7 +73,11 @@ def __setattr__(self, name, value): @property def parent_domain_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.parent_domain_qualified_name + return ( + None + if self.attributes is None + else self.attributes.parent_domain_qualified_name + ) @parent_domain_qualified_name.setter def parent_domain_qualified_name(self, parent_domain_qualified_name: Optional[str]): @@ -83,7 +87,11 @@ def parent_domain_qualified_name(self, parent_domain_qualified_name: Optional[st @property def super_domain_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.super_domain_qualified_name + return ( + None + if self.attributes is None + else self.attributes.super_domain_qualified_name + ) @super_domain_qualified_name.setter def super_domain_qualified_name(self, super_domain_qualified_name: Optional[str]): @@ -92,7 +100,9 @@ def super_domain_qualified_name(self, super_domain_qualified_name: Optional[str] self.attributes.super_domain_qualified_name = super_domain_qualified_name class Attributes(Catalog.Attributes): - parent_domain_qualified_name: Optional[str] = Field(default=None, description="") + parent_domain_qualified_name: Optional[str] = Field( + default=None, description="" + ) super_domain_qualified_name: Optional[str] = Field(default=None, description="") attributes: DataMesh.Attributes = Field( diff --git a/pyatlan/model/assets/core/data_product.py b/pyatlan/model/assets/core/data_product.py index 104322c1f..69fbe31e1 100644 --- a/pyatlan/model/assets/core/data_product.py +++ b/pyatlan/model/assets/core/data_product.py @@ -59,7 +59,9 @@ def create( asset_selection: IndexSearchRequest, ) -> DataProduct: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -92,7 +94,9 @@ def updater( ) ) if asset_selection: - product.data_product_assets_d_s_l = DataProductsAssetsDSL.get_asset_selection(asset_selection) + product.data_product_assets_d_s_l = ( + DataProductsAssetsDSL.get_asset_selection(asset_selection) + ) return product @classmethod @@ -102,7 +106,9 @@ def create_for_modification( name: str = "", ) -> SelfAsset: warn( - ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'updater' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -124,7 +130,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATA_PRODUCT_STATUS: ClassVar[KeywordField] = KeywordField("dataProductStatus", "dataProductStatus") + DATA_PRODUCT_STATUS: ClassVar[KeywordField] = KeywordField( + "dataProductStatus", "dataProductStatus" + ) """ Status of this data product. """ @@ -132,31 +140,45 @@ def __setattr__(self, name, value): """ Status of this data product. """ - DATA_PRODUCT_CRITICALITY: ClassVar[KeywordField] = KeywordField("dataProductCriticality", "dataProductCriticality") + DATA_PRODUCT_CRITICALITY: ClassVar[KeywordField] = KeywordField( + "dataProductCriticality", "dataProductCriticality" + ) """ Criticality of this data product. """ - DAAP_CRITICALITY: ClassVar[KeywordField] = KeywordField("daapCriticality", "daapCriticality") + DAAP_CRITICALITY: ClassVar[KeywordField] = KeywordField( + "daapCriticality", "daapCriticality" + ) """ Criticality of this data product. """ - DATA_PRODUCT_SENSITIVITY: ClassVar[KeywordField] = KeywordField("dataProductSensitivity", "dataProductSensitivity") + DATA_PRODUCT_SENSITIVITY: ClassVar[KeywordField] = KeywordField( + "dataProductSensitivity", "dataProductSensitivity" + ) """ Information sensitivity of this data product. """ - DAAP_SENSITIVITY: ClassVar[KeywordField] = KeywordField("daapSensitivity", "daapSensitivity") + DAAP_SENSITIVITY: ClassVar[KeywordField] = KeywordField( + "daapSensitivity", "daapSensitivity" + ) """ Information sensitivity of this data product. """ - DATA_PRODUCT_VISIBILITY: ClassVar[KeywordField] = KeywordField("dataProductVisibility", "dataProductVisibility") + DATA_PRODUCT_VISIBILITY: ClassVar[KeywordField] = KeywordField( + "dataProductVisibility", "dataProductVisibility" + ) """ Visibility of a data product. """ - DAAP_VISIBILITY: ClassVar[KeywordField] = KeywordField("daapVisibility", "daapVisibility") + DAAP_VISIBILITY: ClassVar[KeywordField] = KeywordField( + "daapVisibility", "daapVisibility" + ) """ Visibility of a data product. """ - DATA_PRODUCT_ASSETS_DSL: ClassVar[TextField] = TextField("dataProductAssetsDSL", "dataProductAssetsDSL") + DATA_PRODUCT_ASSETS_DSL: ClassVar[TextField] = TextField( + "dataProductAssetsDSL", "dataProductAssetsDSL" + ) """ Search DSL used to define which assets are part of this data product. """ @@ -166,7 +188,9 @@ def __setattr__(self, name, value): """ Playbook filter to define which assets are part of this data product. """ - DATA_PRODUCT_SCORE_VALUE: ClassVar[NumericField] = NumericField("dataProductScoreValue", "dataProductScoreValue") + DATA_PRODUCT_SCORE_VALUE: ClassVar[NumericField] = NumericField( + "dataProductScoreValue", "dataProductScoreValue" + ) """ Score of this data product. """ @@ -176,19 +200,27 @@ def __setattr__(self, name, value): """ Timestamp when the score of this data product was last updated. """ - DAAP_VISIBILITY_USERS: ClassVar[KeywordField] = KeywordField("daapVisibilityUsers", "daapVisibilityUsers") + DAAP_VISIBILITY_USERS: ClassVar[KeywordField] = KeywordField( + "daapVisibilityUsers", "daapVisibilityUsers" + ) """ list of users for product visibility control """ - DAAP_VISIBILITY_GROUPS: ClassVar[KeywordField] = KeywordField("daapVisibilityGroups", "daapVisibilityGroups") + DAAP_VISIBILITY_GROUPS: ClassVar[KeywordField] = KeywordField( + "daapVisibilityGroups", "daapVisibilityGroups" + ) """ list of groups for product visibility control """ - DAAP_OUTPUT_PORT_GUIDS: ClassVar[KeywordField] = KeywordField("daapOutputPortGuids", "daapOutputPortGuids") + DAAP_OUTPUT_PORT_GUIDS: ClassVar[KeywordField] = KeywordField( + "daapOutputPortGuids", "daapOutputPortGuids" + ) """ Output ports guids for this data product. """ - DAAP_INPUT_PORT_GUIDS: ClassVar[KeywordField] = KeywordField("daapInputPortGuids", "daapInputPortGuids") + DAAP_INPUT_PORT_GUIDS: ClassVar[KeywordField] = KeywordField( + "daapInputPortGuids", "daapInputPortGuids" + ) """ Input ports guids for this data product. """ @@ -250,10 +282,16 @@ def daap_status(self, daap_status: Optional[DataProductStatus]): @property def data_product_criticality(self) -> Optional[DataProductCriticality]: - return None if self.attributes is None else self.attributes.data_product_criticality + return ( + None + if self.attributes is None + else self.attributes.data_product_criticality + ) @data_product_criticality.setter - def data_product_criticality(self, data_product_criticality: Optional[DataProductCriticality]): + def data_product_criticality( + self, data_product_criticality: Optional[DataProductCriticality] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_product_criticality = data_product_criticality @@ -270,10 +308,16 @@ def daap_criticality(self, daap_criticality: Optional[DataProductCriticality]): @property def data_product_sensitivity(self) -> Optional[DataProductSensitivity]: - return None if self.attributes is None else self.attributes.data_product_sensitivity + return ( + None + if self.attributes is None + else self.attributes.data_product_sensitivity + ) @data_product_sensitivity.setter - def data_product_sensitivity(self, data_product_sensitivity: Optional[DataProductSensitivity]): + def data_product_sensitivity( + self, data_product_sensitivity: Optional[DataProductSensitivity] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_product_sensitivity = data_product_sensitivity @@ -290,10 +334,14 @@ def daap_sensitivity(self, daap_sensitivity: Optional[DataProductSensitivity]): @property def data_product_visibility(self) -> Optional[DataProductVisibility]: - return None if self.attributes is None else self.attributes.data_product_visibility + return ( + None if self.attributes is None else self.attributes.data_product_visibility + ) @data_product_visibility.setter - def data_product_visibility(self, data_product_visibility: Optional[DataProductVisibility]): + def data_product_visibility( + self, data_product_visibility: Optional[DataProductVisibility] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_product_visibility = data_product_visibility @@ -310,7 +358,11 @@ def daap_visibility(self, daap_visibility: Optional[DataProductVisibility]): @property def data_product_assets_d_s_l(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.data_product_assets_d_s_l + return ( + None + if self.attributes is None + else self.attributes.data_product_assets_d_s_l + ) @data_product_assets_d_s_l.setter def data_product_assets_d_s_l(self, data_product_assets_d_s_l: Optional[str]): @@ -320,17 +372,29 @@ def data_product_assets_d_s_l(self, data_product_assets_d_s_l: Optional[str]): @property def data_product_assets_playbook_filter(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.data_product_assets_playbook_filter + return ( + None + if self.attributes is None + else self.attributes.data_product_assets_playbook_filter + ) @data_product_assets_playbook_filter.setter - def data_product_assets_playbook_filter(self, data_product_assets_playbook_filter: Optional[str]): + def data_product_assets_playbook_filter( + self, data_product_assets_playbook_filter: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.data_product_assets_playbook_filter = data_product_assets_playbook_filter + self.attributes.data_product_assets_playbook_filter = ( + data_product_assets_playbook_filter + ) @property def data_product_score_value(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.data_product_score_value + return ( + None + if self.attributes is None + else self.attributes.data_product_score_value + ) @data_product_score_value.setter def data_product_score_value(self, data_product_score_value: Optional[float]): @@ -340,17 +404,25 @@ def data_product_score_value(self, data_product_score_value: Optional[float]): @property def data_product_score_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.data_product_score_updated_at + return ( + None + if self.attributes is None + else self.attributes.data_product_score_updated_at + ) @data_product_score_updated_at.setter - def data_product_score_updated_at(self, data_product_score_updated_at: Optional[datetime]): + def data_product_score_updated_at( + self, data_product_score_updated_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_product_score_updated_at = data_product_score_updated_at @property def daap_visibility_users(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.daap_visibility_users + return ( + None if self.attributes is None else self.attributes.daap_visibility_users + ) @daap_visibility_users.setter def daap_visibility_users(self, daap_visibility_users: Optional[Set[str]]): @@ -360,7 +432,9 @@ def daap_visibility_users(self, daap_visibility_users: Optional[Set[str]]): @property def daap_visibility_groups(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.daap_visibility_groups + return ( + None if self.attributes is None else self.attributes.daap_visibility_groups + ) @daap_visibility_groups.setter def daap_visibility_groups(self, daap_visibility_groups: Optional[Set[str]]): @@ -370,7 +444,9 @@ def daap_visibility_groups(self, daap_visibility_groups: Optional[Set[str]]): @property def daap_output_port_guids(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.daap_output_port_guids + return ( + None if self.attributes is None else self.attributes.daap_output_port_guids + ) @daap_output_port_guids.setter def daap_output_port_guids(self, daap_output_port_guids: Optional[Set[str]]): @@ -380,7 +456,9 @@ def daap_output_port_guids(self, daap_output_port_guids: Optional[Set[str]]): @property def daap_input_port_guids(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.daap_input_port_guids + return ( + None if self.attributes is None else self.attributes.daap_input_port_guids + ) @daap_input_port_guids.setter def daap_input_port_guids(self, daap_input_port_guids: Optional[Set[str]]): @@ -419,25 +497,49 @@ def input_ports(self, input_ports: Optional[List[Asset]]): self.attributes.input_ports = input_ports class Attributes(DataMesh.Attributes): - data_product_status: Optional[DataProductStatus] = Field(default=None, description="") + data_product_status: Optional[DataProductStatus] = Field( + default=None, description="" + ) daap_status: Optional[DataProductStatus] = Field(default=None, description="") - data_product_criticality: Optional[DataProductCriticality] = Field(default=None, description="") - daap_criticality: Optional[DataProductCriticality] = Field(default=None, description="") - data_product_sensitivity: Optional[DataProductSensitivity] = Field(default=None, description="") - daap_sensitivity: Optional[DataProductSensitivity] = Field(default=None, description="") - data_product_visibility: Optional[DataProductVisibility] = Field(default=None, description="") - daap_visibility: Optional[DataProductVisibility] = Field(default=None, description="") + data_product_criticality: Optional[DataProductCriticality] = Field( + default=None, description="" + ) + daap_criticality: Optional[DataProductCriticality] = Field( + default=None, description="" + ) + data_product_sensitivity: Optional[DataProductSensitivity] = Field( + default=None, description="" + ) + daap_sensitivity: Optional[DataProductSensitivity] = Field( + default=None, description="" + ) + data_product_visibility: Optional[DataProductVisibility] = Field( + default=None, description="" + ) + daap_visibility: Optional[DataProductVisibility] = Field( + default=None, description="" + ) data_product_assets_d_s_l: Optional[str] = Field(default=None, description="") - data_product_assets_playbook_filter: Optional[str] = Field(default=None, description="") + data_product_assets_playbook_filter: Optional[str] = Field( + default=None, description="" + ) data_product_score_value: Optional[float] = Field(default=None, description="") - data_product_score_updated_at: Optional[datetime] = Field(default=None, description="") + data_product_score_updated_at: Optional[datetime] = Field( + default=None, description="" + ) daap_visibility_users: Optional[Set[str]] = Field(default=None, description="") daap_visibility_groups: Optional[Set[str]] = Field(default=None, description="") daap_output_port_guids: Optional[Set[str]] = Field(default=None, description="") daap_input_port_guids: Optional[Set[str]] = Field(default=None, description="") - output_ports: Optional[List[Asset]] = Field(default=None, description="") # relationship - data_domain: Optional[DataDomain] = Field(default=None, description="") # relationship - input_ports: Optional[List[Asset]] = Field(default=None, description="") # relationship + output_ports: Optional[List[Asset]] = Field( + default=None, description="" + ) # relationship + data_domain: Optional[DataDomain] = Field( + default=None, description="" + ) # relationship + input_ports: Optional[List[Asset]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -452,15 +554,21 @@ def create( ["name", "domain_qualified_name", "asset_selection"], [name, domain_qualified_name, asset_selection], ) - ASSETS_PLAYBOOK_FILTER = '{"condition":"AND","isGroupLocked":false,"rules":[]}' + ASSETS_PLAYBOOK_FILTER = ( + '{"condition":"AND","isGroupLocked":false,"rules":[]}' + ) return DataProduct.Attributes( name=name, - data_product_assets_d_s_l=DataProductsAssetsDSL.get_asset_selection(asset_selection), + data_product_assets_d_s_l=DataProductsAssetsDSL.get_asset_selection( + asset_selection + ), data_domain=DataDomain.ref_by_qualified_name(domain_qualified_name), qualified_name=f"{domain_qualified_name}/product/{name}", data_product_assets_playbook_filter=ASSETS_PLAYBOOK_FILTER, parent_domain_qualified_name=domain_qualified_name, - super_domain_qualified_name=DataMesh.get_super_domain_qualified_name(domain_qualified_name), + super_domain_qualified_name=DataMesh.get_super_domain_qualified_name( + domain_qualified_name + ), daap_status=DataProductStatus.ACTIVE, ) diff --git a/pyatlan/model/assets/core/database.py b/pyatlan/model/assets/core/database.py index 9f6e26171..50c11ea9a 100644 --- a/pyatlan/model/assets/core/database.py +++ b/pyatlan/model/assets/core/database.py @@ -22,12 +22,16 @@ class Database(SQL): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> Database: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) attributes = Database.Attributes( name=name, connection_qualified_name=connection_qualified_name, qualified_name=f"{connection_qualified_name}/{name}", - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) return cls(attributes=attributes) @@ -35,11 +39,15 @@ def creator(cls, *, name: str, connection_qualified_name: str) -> Database: @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> Database: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, connection_qualified_name=connection_qualified_name) + return cls.creator( + name=name, connection_qualified_name=connection_qualified_name + ) type_name: str = Field(default="Database", allow_mutation=False) @@ -91,17 +99,25 @@ def schemas(self, schemas: Optional[List[Schema]]): class Attributes(SQL.Attributes): schema_count: Optional[int] = Field(default=None, description="") - schemas: Optional[List[Schema]] = Field(default=None, description="") # relationship + schemas: Optional[List[Schema]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def create(cls, name: str, connection_qualified_name: str) -> Database.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + def create( + cls, name: str, connection_qualified_name: str + ) -> Database.Attributes: + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return Database.Attributes( name=name, connection_qualified_name=connection_qualified_name, qualified_name=f"{connection_qualified_name}/{name}", - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: Database.Attributes = Field( diff --git a/pyatlan/model/assets/core/databricks_unity_catalog_tag.py b/pyatlan/model/assets/core/databricks_unity_catalog_tag.py index a0ac1a7c3..bd9428f81 100644 --- a/pyatlan/model/assets/core/databricks_unity_catalog_tag.py +++ b/pyatlan/model/assets/core/databricks_unity_catalog_tag.py @@ -41,7 +41,9 @@ def __setattr__(self, name, value): """ Unique identifier of the tag in the source system. """ - TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("tagAttributes", "tagAttributes") + TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( + "tagAttributes", "tagAttributes" + ) """ Attributes associated with the tag in the source system. """ @@ -61,47 +63,69 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( + "queryUserCount", "queryUserCount" + ) """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( + "queryUserMap", "queryUserMap" + ) """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( + "queryCountUpdatedAt", "queryCountUpdatedAt" + ) """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "databaseName", "databaseName.keyword", "databaseName" + ) """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "databaseQualifiedName", "databaseQualifiedName" + ) """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "schemaName", "schemaName.keyword", "schemaName" + ) """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "schemaQualifiedName", "schemaQualifiedName" + ) """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "tableName", "tableName.keyword", "tableName" + ) """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "tableQualifiedName", "tableQualifiedName" + ) """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "viewName", "viewName.keyword", "viewName" + ) """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "viewQualifiedName", "viewQualifiedName" + ) """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -121,7 +145,9 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( + "lastProfiledAt", "lastProfiledAt" + ) """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -207,7 +233,9 @@ def tag_allowed_values(self, tag_allowed_values: Optional[Set[str]]): @property def mapped_atlan_tag_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mapped_atlan_tag_name + return ( + None if self.attributes is None else self.attributes.mapped_atlan_tag_name + ) @mapped_atlan_tag_name.setter def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): @@ -247,7 +275,9 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.query_count_updated_at + return ( + None if self.attributes is None else self.attributes.query_count_updated_at + ) @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -267,7 +297,9 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.database_qualified_name + return ( + None if self.attributes is None else self.attributes.database_qualified_name + ) @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -287,7 +319,9 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_qualified_name + return ( + None if self.attributes is None else self.attributes.schema_qualified_name + ) @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -337,7 +371,9 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_name + return ( + None if self.attributes is None else self.attributes.calculation_view_name + ) @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -347,13 +383,21 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.calculation_view_qualified_name + ) @calculation_view_qualified_name.setter - def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): + def calculation_view_qualified_name( + self, calculation_view_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = calculation_view_qualified_name + self.attributes.calculation_view_qualified_name = ( + calculation_view_qualified_name + ) @property def is_profiled(self) -> Optional[bool]: @@ -427,7 +471,9 @@ def dbt_models(self, dbt_models: Optional[List[DbtModel]]): class Attributes(Tag.Attributes): tag_id: Optional[str] = Field(default=None, description="") - tag_attributes: Optional[List[SourceTagAttribute]] = Field(default=None, description="") + tag_attributes: Optional[List[SourceTagAttribute]] = Field( + default=None, description="" + ) tag_allowed_values: Optional[Set[str]] = Field(default=None, description="") mapped_atlan_tag_name: Optional[str] = Field(default=None, description="") query_count: Optional[int] = Field(default=None, description="") @@ -443,14 +489,26 @@ class Attributes(Tag.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field(default=None, description="") + calculation_view_qualified_name: Optional[str] = Field( + default=None, description="" + ) is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship - dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship + dbt_tests: Optional[List[DbtTest]] = Field( + default=None, description="" + ) # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship attributes: DatabricksUnityCatalogTag.Attributes = Field( default_factory=lambda: DatabricksUnityCatalogTag.Attributes(), diff --git a/pyatlan/model/assets/core/dbt.py b/pyatlan/model/assets/core/dbt.py index f3e5ad539..4f2b02d63 100644 --- a/pyatlan/model/assets/core/dbt.py +++ b/pyatlan/model/assets/core/dbt.py @@ -36,7 +36,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField("dbtAlias", "dbtAlias.keyword", "dbtAlias") + DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField( + "dbtAlias", "dbtAlias.keyword", "dbtAlias" + ) """ """ @@ -44,7 +46,9 @@ def __setattr__(self, name, value): """ """ - DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField("dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId") + DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField( + "dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId" + ) """ """ @@ -66,15 +70,21 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField("dbtJobName", "dbtJobName.keyword", "dbtJobName") + DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "dbtJobName", "dbtJobName.keyword", "dbtJobName" + ) """ """ - DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField("dbtJobSchedule", "dbtJobSchedule") + DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField( + "dbtJobSchedule", "dbtJobSchedule" + ) """ """ - DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtJobStatus", "dbtJobStatus") + DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( + "dbtJobStatus", "dbtJobStatus" + ) """ """ @@ -86,11 +96,15 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("dbtJobLastRun", "dbtJobLastRun") + DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( + "dbtJobLastRun", "dbtJobLastRun" + ) """ """ - DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("dbtJobNextRun", "dbtJobNextRun") + DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( + "dbtJobNextRun", "dbtJobNextRun" + ) """ """ @@ -120,7 +134,9 @@ def __setattr__(self, name, value): """ """ - DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField("dbtConnectionContext", "dbtConnectionContext") + DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField( + "dbtConnectionContext", "dbtConnectionContext" + ) """ """ @@ -249,13 +265,21 @@ def dbt_job_status(self, dbt_job_status: Optional[str]): @property def dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_job_schedule_cron_humanized + return ( + None + if self.attributes is None + else self.attributes.dbt_job_schedule_cron_humanized + ) @dbt_job_schedule_cron_humanized.setter - def dbt_job_schedule_cron_humanized(self, dbt_job_schedule_cron_humanized: Optional[str]): + def dbt_job_schedule_cron_humanized( + self, dbt_job_schedule_cron_humanized: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dbt_job_schedule_cron_humanized = dbt_job_schedule_cron_humanized + self.attributes.dbt_job_schedule_cron_humanized = ( + dbt_job_schedule_cron_humanized + ) @property def dbt_job_last_run(self) -> Optional[datetime]: @@ -279,7 +303,11 @@ def dbt_job_next_run(self, dbt_job_next_run: Optional[datetime]): @property def dbt_job_next_run_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_job_next_run_humanized + return ( + None + if self.attributes is None + else self.attributes.dbt_job_next_run_humanized + ) @dbt_job_next_run_humanized.setter def dbt_job_next_run_humanized(self, dbt_job_next_run_humanized: Optional[str]): @@ -299,7 +327,11 @@ def dbt_environment_name(self, dbt_environment_name: Optional[str]): @property def dbt_environment_dbt_version(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_environment_dbt_version + return ( + None + if self.attributes is None + else self.attributes.dbt_environment_dbt_version + ) @dbt_environment_dbt_version.setter def dbt_environment_dbt_version(self, dbt_environment_dbt_version: Optional[str]): @@ -319,7 +351,9 @@ def dbt_tags(self, dbt_tags: Optional[Set[str]]): @property def dbt_connection_context(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_connection_context + return ( + None if self.attributes is None else self.attributes.dbt_connection_context + ) @dbt_connection_context.setter def dbt_connection_context(self, dbt_connection_context: Optional[str]): @@ -329,7 +363,11 @@ def dbt_connection_context(self, dbt_connection_context: Optional[str]): @property def dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_semantic_layer_proxy_url + return ( + None + if self.attributes is None + else self.attributes.dbt_semantic_layer_proxy_url + ) @dbt_semantic_layer_proxy_url.setter def dbt_semantic_layer_proxy_url(self, dbt_semantic_layer_proxy_url: Optional[str]): @@ -357,7 +395,9 @@ class Attributes(Catalog.Attributes): dbt_job_name: Optional[str] = Field(default=None, description="") dbt_job_schedule: Optional[str] = Field(default=None, description="") dbt_job_status: Optional[str] = Field(default=None, description="") - dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") + dbt_job_schedule_cron_humanized: Optional[str] = Field( + default=None, description="" + ) dbt_job_last_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") @@ -365,7 +405,9 @@ class Attributes(Catalog.Attributes): dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") dbt_tags: Optional[Set[str]] = Field(default=None, description="") dbt_connection_context: Optional[str] = Field(default=None, description="") - dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") + dbt_semantic_layer_proxy_url: Optional[str] = Field( + default=None, description="" + ) dbt_job_runs: Optional[List[DbtJobRun]] = Field(default=None, description="") attributes: Dbt.Attributes = Field( diff --git a/pyatlan/model/assets/core/dbt_metric.py b/pyatlan/model/assets/core/dbt_metric.py index 25399ac68..49a22b866 100644 --- a/pyatlan/model/assets/core/dbt_metric.py +++ b/pyatlan/model/assets/core/dbt_metric.py @@ -37,11 +37,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DBT_METRIC_FILTERS: ClassVar[KeywordField] = KeywordField("dbtMetricFilters", "dbtMetricFilters") + DBT_METRIC_FILTERS: ClassVar[KeywordField] = KeywordField( + "dbtMetricFilters", "dbtMetricFilters" + ) """ """ - DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField("dbtAlias", "dbtAlias.keyword", "dbtAlias") + DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField( + "dbtAlias", "dbtAlias.keyword", "dbtAlias" + ) """ """ @@ -49,7 +53,9 @@ def __setattr__(self, name, value): """ """ - DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField("dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId") + DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField( + "dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId" + ) """ """ @@ -71,15 +77,21 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField("dbtJobName", "dbtJobName.keyword", "dbtJobName") + DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "dbtJobName", "dbtJobName.keyword", "dbtJobName" + ) """ """ - DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField("dbtJobSchedule", "dbtJobSchedule") + DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField( + "dbtJobSchedule", "dbtJobSchedule" + ) """ """ - DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtJobStatus", "dbtJobStatus") + DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( + "dbtJobStatus", "dbtJobStatus" + ) """ """ @@ -91,11 +103,15 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("dbtJobLastRun", "dbtJobLastRun") + DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( + "dbtJobLastRun", "dbtJobLastRun" + ) """ """ - DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("dbtJobNextRun", "dbtJobNextRun") + DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( + "dbtJobNextRun", "dbtJobNextRun" + ) """ """ @@ -125,7 +141,9 @@ def __setattr__(self, name, value): """ """ - DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField("dbtConnectionContext", "dbtConnectionContext") + DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField( + "dbtConnectionContext", "dbtConnectionContext" + ) """ """ @@ -151,12 +169,16 @@ def __setattr__(self, name, value): """ Filters to be applied to the metric query. """ - METRIC_TIME_GRAINS: ClassVar[TextField] = TextField("metricTimeGrains", "metricTimeGrains") + METRIC_TIME_GRAINS: ClassVar[TextField] = TextField( + "metricTimeGrains", "metricTimeGrains" + ) """ List of time grains to be applied to the metric query. """ - METRIC_TIMESTAMP_COLUMN: ClassVar[RelationField] = RelationField("metricTimestampColumn") + METRIC_TIMESTAMP_COLUMN: ClassVar[RelationField] = RelationField( + "metricTimestampColumn" + ) """ TBC """ @@ -168,11 +190,15 @@ def __setattr__(self, name, value): """ TBC """ - METRIC_DIMENSION_COLUMNS: ClassVar[RelationField] = RelationField("metricDimensionColumns") + METRIC_DIMENSION_COLUMNS: ClassVar[RelationField] = RelationField( + "metricDimensionColumns" + ) """ TBC """ - DBT_METRIC_FILTER_COLUMNS: ClassVar[RelationField] = RelationField("dbtMetricFilterColumns") + DBT_METRIC_FILTER_COLUMNS: ClassVar[RelationField] = RelationField( + "dbtMetricFilterColumns" + ) """ TBC """ @@ -311,13 +337,21 @@ def dbt_job_status(self, dbt_job_status: Optional[str]): @property def dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_job_schedule_cron_humanized + return ( + None + if self.attributes is None + else self.attributes.dbt_job_schedule_cron_humanized + ) @dbt_job_schedule_cron_humanized.setter - def dbt_job_schedule_cron_humanized(self, dbt_job_schedule_cron_humanized: Optional[str]): + def dbt_job_schedule_cron_humanized( + self, dbt_job_schedule_cron_humanized: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dbt_job_schedule_cron_humanized = dbt_job_schedule_cron_humanized + self.attributes.dbt_job_schedule_cron_humanized = ( + dbt_job_schedule_cron_humanized + ) @property def dbt_job_last_run(self) -> Optional[datetime]: @@ -341,7 +375,11 @@ def dbt_job_next_run(self, dbt_job_next_run: Optional[datetime]): @property def dbt_job_next_run_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_job_next_run_humanized + return ( + None + if self.attributes is None + else self.attributes.dbt_job_next_run_humanized + ) @dbt_job_next_run_humanized.setter def dbt_job_next_run_humanized(self, dbt_job_next_run_humanized: Optional[str]): @@ -361,7 +399,11 @@ def dbt_environment_name(self, dbt_environment_name: Optional[str]): @property def dbt_environment_dbt_version(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_environment_dbt_version + return ( + None + if self.attributes is None + else self.attributes.dbt_environment_dbt_version + ) @dbt_environment_dbt_version.setter def dbt_environment_dbt_version(self, dbt_environment_dbt_version: Optional[str]): @@ -381,7 +423,9 @@ def dbt_tags(self, dbt_tags: Optional[Set[str]]): @property def dbt_connection_context(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_connection_context + return ( + None if self.attributes is None else self.attributes.dbt_connection_context + ) @dbt_connection_context.setter def dbt_connection_context(self, dbt_connection_context: Optional[str]): @@ -391,7 +435,11 @@ def dbt_connection_context(self, dbt_connection_context: Optional[str]): @property def dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_semantic_layer_proxy_url + return ( + None + if self.attributes is None + else self.attributes.dbt_semantic_layer_proxy_url + ) @dbt_semantic_layer_proxy_url.setter def dbt_semantic_layer_proxy_url(self, dbt_semantic_layer_proxy_url: Optional[str]): @@ -451,7 +499,9 @@ def metric_time_grains(self, metric_time_grains: Optional[Set[str]]): @property def metric_timestamp_column(self) -> Optional[Column]: - return None if self.attributes is None else self.attributes.metric_timestamp_column + return ( + None if self.attributes is None else self.attributes.metric_timestamp_column + ) @metric_timestamp_column.setter def metric_timestamp_column(self, metric_timestamp_column: Optional[Column]): @@ -481,26 +531,40 @@ def dbt_model(self, dbt_model: Optional[DbtModel]): @property def metric_dimension_columns(self) -> Optional[List[Column]]: - return None if self.attributes is None else self.attributes.metric_dimension_columns + return ( + None + if self.attributes is None + else self.attributes.metric_dimension_columns + ) @metric_dimension_columns.setter - def metric_dimension_columns(self, metric_dimension_columns: Optional[List[Column]]): + def metric_dimension_columns( + self, metric_dimension_columns: Optional[List[Column]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.metric_dimension_columns = metric_dimension_columns @property def dbt_metric_filter_columns(self) -> Optional[List[Column]]: - return None if self.attributes is None else self.attributes.dbt_metric_filter_columns + return ( + None + if self.attributes is None + else self.attributes.dbt_metric_filter_columns + ) @dbt_metric_filter_columns.setter - def dbt_metric_filter_columns(self, dbt_metric_filter_columns: Optional[List[Column]]): + def dbt_metric_filter_columns( + self, dbt_metric_filter_columns: Optional[List[Column]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_metric_filter_columns = dbt_metric_filter_columns class Attributes(Dbt.Attributes): - dbt_metric_filters: Optional[List[DbtMetricFilter]] = Field(default=None, description="") + dbt_metric_filters: Optional[List[DbtMetricFilter]] = Field( + default=None, description="" + ) dbt_alias: Optional[str] = Field(default=None, description="") dbt_meta: Optional[str] = Field(default=None, description="") dbt_unique_id: Optional[str] = Field(default=None, description="") @@ -510,7 +574,9 @@ class Attributes(Dbt.Attributes): dbt_job_name: Optional[str] = Field(default=None, description="") dbt_job_schedule: Optional[str] = Field(default=None, description="") dbt_job_status: Optional[str] = Field(default=None, description="") - dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") + dbt_job_schedule_cron_humanized: Optional[str] = Field( + default=None, description="" + ) dbt_job_last_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") @@ -518,17 +584,29 @@ class Attributes(Dbt.Attributes): dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") dbt_tags: Optional[Set[str]] = Field(default=None, description="") dbt_connection_context: Optional[str] = Field(default=None, description="") - dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") + dbt_semantic_layer_proxy_url: Optional[str] = Field( + default=None, description="" + ) dbt_job_runs: Optional[List[DbtJobRun]] = Field(default=None, description="") metric_type: Optional[str] = Field(default=None, description="") metric_s_q_l: Optional[str] = Field(default=None, description="") metric_filters: Optional[str] = Field(default=None, description="") metric_time_grains: Optional[Set[str]] = Field(default=None, description="") - metric_timestamp_column: Optional[Column] = Field(default=None, description="") # relationship - assets: Optional[List[Asset]] = Field(default=None, description="") # relationship - dbt_model: Optional[DbtModel] = Field(default=None, description="") # relationship - metric_dimension_columns: Optional[List[Column]] = Field(default=None, description="") # relationship - dbt_metric_filter_columns: Optional[List[Column]] = Field(default=None, description="") # relationship + metric_timestamp_column: Optional[Column] = Field( + default=None, description="" + ) # relationship + assets: Optional[List[Asset]] = Field( + default=None, description="" + ) # relationship + dbt_model: Optional[DbtModel] = Field( + default=None, description="" + ) # relationship + metric_dimension_columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship + dbt_metric_filter_columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship attributes: DbtMetric.Attributes = Field( default_factory=lambda: DbtMetric.Attributes(), diff --git a/pyatlan/model/assets/core/dbt_model.py b/pyatlan/model/assets/core/dbt_model.py index 5b7d6a619..db0c50b03 100644 --- a/pyatlan/model/assets/core/dbt_model.py +++ b/pyatlan/model/assets/core/dbt_model.py @@ -47,7 +47,9 @@ def __setattr__(self, name, value): """ """ - DBT_COMPILED_SQL: ClassVar[TextField] = TextField("dbtCompiledSQL", "dbtCompiledSQL") + DBT_COMPILED_SQL: ClassVar[TextField] = TextField( + "dbtCompiledSQL", "dbtCompiledSQL" + ) """ """ @@ -55,7 +57,9 @@ def __setattr__(self, name, value): """ """ - DBT_MATERIALIZATION_TYPE: ClassVar[TextField] = TextField("dbtMaterializationType", "dbtMaterializationType") + DBT_MATERIALIZATION_TYPE: ClassVar[TextField] = TextField( + "dbtMaterializationType", "dbtMaterializationType" + ) """ """ @@ -83,7 +87,9 @@ def __setattr__(self, name, value): """ """ - DBT_MODEL_EXECUTION_TIME: ClassVar[NumericField] = NumericField("dbtModelExecutionTime", "dbtModelExecutionTime") + DBT_MODEL_EXECUTION_TIME: ClassVar[NumericField] = NumericField( + "dbtModelExecutionTime", "dbtModelExecutionTime" + ) """ """ @@ -194,7 +200,11 @@ def dbt_stats(self, dbt_stats: Optional[str]): @property def dbt_materialization_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_materialization_type + return ( + None + if self.attributes is None + else self.attributes.dbt_materialization_type + ) @dbt_materialization_type.setter def dbt_materialization_type(self, dbt_materialization_type: Optional[str]): @@ -204,47 +214,75 @@ def dbt_materialization_type(self, dbt_materialization_type: Optional[str]): @property def dbt_model_compile_started_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.dbt_model_compile_started_at + return ( + None + if self.attributes is None + else self.attributes.dbt_model_compile_started_at + ) @dbt_model_compile_started_at.setter - def dbt_model_compile_started_at(self, dbt_model_compile_started_at: Optional[datetime]): + def dbt_model_compile_started_at( + self, dbt_model_compile_started_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_compile_started_at = dbt_model_compile_started_at @property def dbt_model_compile_completed_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.dbt_model_compile_completed_at + return ( + None + if self.attributes is None + else self.attributes.dbt_model_compile_completed_at + ) @dbt_model_compile_completed_at.setter - def dbt_model_compile_completed_at(self, dbt_model_compile_completed_at: Optional[datetime]): + def dbt_model_compile_completed_at( + self, dbt_model_compile_completed_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_compile_completed_at = dbt_model_compile_completed_at @property def dbt_model_execute_started_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.dbt_model_execute_started_at + return ( + None + if self.attributes is None + else self.attributes.dbt_model_execute_started_at + ) @dbt_model_execute_started_at.setter - def dbt_model_execute_started_at(self, dbt_model_execute_started_at: Optional[datetime]): + def dbt_model_execute_started_at( + self, dbt_model_execute_started_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_execute_started_at = dbt_model_execute_started_at @property def dbt_model_execute_completed_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.dbt_model_execute_completed_at + return ( + None + if self.attributes is None + else self.attributes.dbt_model_execute_completed_at + ) @dbt_model_execute_completed_at.setter - def dbt_model_execute_completed_at(self, dbt_model_execute_completed_at: Optional[datetime]): + def dbt_model_execute_completed_at( + self, dbt_model_execute_completed_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_execute_completed_at = dbt_model_execute_completed_at @property def dbt_model_execution_time(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.dbt_model_execution_time + return ( + None + if self.attributes is None + else self.attributes.dbt_model_execution_time + ) @dbt_model_execution_time.setter def dbt_model_execution_time(self, dbt_model_execution_time: Optional[float]): @@ -254,17 +292,27 @@ def dbt_model_execution_time(self, dbt_model_execution_time: Optional[float]): @property def dbt_model_run_generated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.dbt_model_run_generated_at + return ( + None + if self.attributes is None + else self.attributes.dbt_model_run_generated_at + ) @dbt_model_run_generated_at.setter - def dbt_model_run_generated_at(self, dbt_model_run_generated_at: Optional[datetime]): + def dbt_model_run_generated_at( + self, dbt_model_run_generated_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_run_generated_at = dbt_model_run_generated_at @property def dbt_model_run_elapsed_time(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.dbt_model_run_elapsed_time + return ( + None + if self.attributes is None + else self.attributes.dbt_model_run_elapsed_time + ) @dbt_model_run_elapsed_time.setter def dbt_model_run_elapsed_time(self, dbt_model_run_elapsed_time: Optional[float]): @@ -329,18 +377,38 @@ class Attributes(Dbt.Attributes): dbt_compiled_s_q_l: Optional[str] = Field(default=None, description="") dbt_stats: Optional[str] = Field(default=None, description="") dbt_materialization_type: Optional[str] = Field(default=None, description="") - dbt_model_compile_started_at: Optional[datetime] = Field(default=None, description="") - dbt_model_compile_completed_at: Optional[datetime] = Field(default=None, description="") - dbt_model_execute_started_at: Optional[datetime] = Field(default=None, description="") - dbt_model_execute_completed_at: Optional[datetime] = Field(default=None, description="") + dbt_model_compile_started_at: Optional[datetime] = Field( + default=None, description="" + ) + dbt_model_compile_completed_at: Optional[datetime] = Field( + default=None, description="" + ) + dbt_model_execute_started_at: Optional[datetime] = Field( + default=None, description="" + ) + dbt_model_execute_completed_at: Optional[datetime] = Field( + default=None, description="" + ) dbt_model_execution_time: Optional[float] = Field(default=None, description="") - dbt_model_run_generated_at: Optional[datetime] = Field(default=None, description="") - dbt_model_run_elapsed_time: Optional[float] = Field(default=None, description="") - dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship - dbt_model_columns: Optional[List[DbtModelColumn]] = Field(default=None, description="") # relationship + dbt_model_run_generated_at: Optional[datetime] = Field( + default=None, description="" + ) + dbt_model_run_elapsed_time: Optional[float] = Field( + default=None, description="" + ) + dbt_tests: Optional[List[DbtTest]] = Field( + default=None, description="" + ) # relationship + dbt_model_columns: Optional[List[DbtModelColumn]] = Field( + default=None, description="" + ) # relationship sql_asset: Optional[SQL] = Field(default=None, description="") # relationship - dbt_metrics: Optional[List[DbtMetric]] = Field(default=None, description="") # relationship - dbt_model_sql_assets: Optional[List[SQL]] = Field(default=None, description="") # relationship + dbt_metrics: Optional[List[DbtMetric]] = Field( + default=None, description="" + ) # relationship + dbt_model_sql_assets: Optional[List[SQL]] = Field( + default=None, description="" + ) # relationship attributes: DbtModel.Attributes = Field( default_factory=lambda: DbtModel.Attributes(), diff --git a/pyatlan/model/assets/core/dbt_model_column.py b/pyatlan/model/assets/core/dbt_model_column.py index 55dbd0948..8383bc199 100644 --- a/pyatlan/model/assets/core/dbt_model_column.py +++ b/pyatlan/model/assets/core/dbt_model_column.py @@ -46,7 +46,9 @@ def __setattr__(self, name, value): """ """ - DBT_MODEL_COLUMN_ORDER: ClassVar[NumericField] = NumericField("dbtModelColumnOrder", "dbtModelColumnOrder") + DBT_MODEL_COLUMN_ORDER: ClassVar[NumericField] = NumericField( + "dbtModelColumnOrder", "dbtModelColumnOrder" + ) """ """ @@ -63,7 +65,9 @@ def __setattr__(self, name, value): """ TBC """ - DBT_MODEL_COLUMN_SQL_COLUMNS: ClassVar[RelationField] = RelationField("dbtModelColumnSqlColumns") + DBT_MODEL_COLUMN_SQL_COLUMNS: ClassVar[RelationField] = RelationField( + "dbtModelColumnSqlColumns" + ) """ TBC """ @@ -80,7 +84,11 @@ def __setattr__(self, name, value): @property def dbt_model_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_model_qualified_name + return ( + None + if self.attributes is None + else self.attributes.dbt_model_qualified_name + ) @dbt_model_qualified_name.setter def dbt_model_qualified_name(self, dbt_model_qualified_name: Optional[str]): @@ -90,7 +98,11 @@ def dbt_model_qualified_name(self, dbt_model_qualified_name: Optional[str]): @property def dbt_model_column_data_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_model_column_data_type + return ( + None + if self.attributes is None + else self.attributes.dbt_model_column_data_type + ) @dbt_model_column_data_type.setter def dbt_model_column_data_type(self, dbt_model_column_data_type: Optional[str]): @@ -100,7 +112,9 @@ def dbt_model_column_data_type(self, dbt_model_column_data_type: Optional[str]): @property def dbt_model_column_order(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.dbt_model_column_order + return ( + None if self.attributes is None else self.attributes.dbt_model_column_order + ) @dbt_model_column_order.setter def dbt_model_column_order(self, dbt_model_column_order: Optional[int]): @@ -140,10 +154,16 @@ def dbt_model(self, dbt_model: Optional[DbtModel]): @property def dbt_model_column_sql_columns(self) -> Optional[List[Column]]: - return None if self.attributes is None else self.attributes.dbt_model_column_sql_columns + return ( + None + if self.attributes is None + else self.attributes.dbt_model_column_sql_columns + ) @dbt_model_column_sql_columns.setter - def dbt_model_column_sql_columns(self, dbt_model_column_sql_columns: Optional[List[Column]]): + def dbt_model_column_sql_columns( + self, dbt_model_column_sql_columns: Optional[List[Column]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_model_column_sql_columns = dbt_model_column_sql_columns @@ -152,10 +172,18 @@ class Attributes(Dbt.Attributes): dbt_model_qualified_name: Optional[str] = Field(default=None, description="") dbt_model_column_data_type: Optional[str] = Field(default=None, description="") dbt_model_column_order: Optional[int] = Field(default=None, description="") - dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship - sql_column: Optional[Column] = Field(default=None, description="") # relationship - dbt_model: Optional[DbtModel] = Field(default=None, description="") # relationship - dbt_model_column_sql_columns: Optional[List[Column]] = Field(default=None, description="") # relationship + dbt_tests: Optional[List[DbtTest]] = Field( + default=None, description="" + ) # relationship + sql_column: Optional[Column] = Field( + default=None, description="" + ) # relationship + dbt_model: Optional[DbtModel] = Field( + default=None, description="" + ) # relationship + dbt_model_column_sql_columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship attributes: DbtModelColumn.Attributes = Field( default_factory=lambda: DbtModelColumn.Attributes(), diff --git a/pyatlan/model/assets/core/dbt_source.py b/pyatlan/model/assets/core/dbt_source.py index 024de19a6..09d01c3aa 100644 --- a/pyatlan/model/assets/core/dbt_source.py +++ b/pyatlan/model/assets/core/dbt_source.py @@ -33,7 +33,9 @@ def __setattr__(self, name, value): """ """ - DBT_FRESHNESS_CRITERIA: ClassVar[TextField] = TextField("dbtFreshnessCriteria", "dbtFreshnessCriteria") + DBT_FRESHNESS_CRITERIA: ClassVar[TextField] = TextField( + "dbtFreshnessCriteria", "dbtFreshnessCriteria" + ) """ """ @@ -71,7 +73,9 @@ def dbt_state(self, dbt_state: Optional[str]): @property def dbt_freshness_criteria(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_freshness_criteria + return ( + None if self.attributes is None else self.attributes.dbt_freshness_criteria + ) @dbt_freshness_criteria.setter def dbt_freshness_criteria(self, dbt_freshness_criteria: Optional[str]): @@ -112,8 +116,12 @@ def sql_asset(self, sql_asset: Optional[SQL]): class Attributes(Dbt.Attributes): dbt_state: Optional[str] = Field(default=None, description="") dbt_freshness_criteria: Optional[str] = Field(default=None, description="") - sql_assets: Optional[List[SQL]] = Field(default=None, description="") # relationship - dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship + sql_assets: Optional[List[SQL]] = Field( + default=None, description="" + ) # relationship + dbt_tests: Optional[List[DbtTest]] = Field( + default=None, description="" + ) # relationship sql_asset: Optional[SQL] = Field(default=None, description="") # relationship attributes: DbtSource.Attributes = Field( diff --git a/pyatlan/model/assets/core/dbt_test.py b/pyatlan/model/assets/core/dbt_test.py index db81e2d15..fe3dee9b2 100644 --- a/pyatlan/model/assets/core/dbt_test.py +++ b/pyatlan/model/assets/core/dbt_test.py @@ -29,11 +29,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DBT_TEST_STATUS: ClassVar[KeywordField] = KeywordField("dbtTestStatus", "dbtTestStatus") + DBT_TEST_STATUS: ClassVar[KeywordField] = KeywordField( + "dbtTestStatus", "dbtTestStatus" + ) """ Details of the results of the test. For errors, it reads "ERROR". """ - DBT_TEST_STATE: ClassVar[KeywordField] = KeywordField("dbtTestState", "dbtTestState") + DBT_TEST_STATE: ClassVar[KeywordField] = KeywordField( + "dbtTestState", "dbtTestState" + ) """ Test results. Can be one of, in order of severity, "error", "fail", "warn", "pass". """ @@ -41,23 +45,33 @@ def __setattr__(self, name, value): """ Error message in the case of state being "error". """ - DBT_TEST_RAW_SQL: ClassVar[TextField] = TextField("dbtTestRawSQL", "dbtTestRawSQL.text") + DBT_TEST_RAW_SQL: ClassVar[TextField] = TextField( + "dbtTestRawSQL", "dbtTestRawSQL.text" + ) """ Raw SQL of the test. """ - DBT_TEST_COMPILED_SQL: ClassVar[TextField] = TextField("dbtTestCompiledSQL", "dbtTestCompiledSQL") + DBT_TEST_COMPILED_SQL: ClassVar[TextField] = TextField( + "dbtTestCompiledSQL", "dbtTestCompiledSQL" + ) """ Compiled SQL of the test. """ - DBT_TEST_RAW_CODE: ClassVar[TextField] = TextField("dbtTestRawCode", "dbtTestRawCode.text") + DBT_TEST_RAW_CODE: ClassVar[TextField] = TextField( + "dbtTestRawCode", "dbtTestRawCode.text" + ) """ Raw code of the test (when the test is defined using Python). """ - DBT_TEST_COMPILED_CODE: ClassVar[TextField] = TextField("dbtTestCompiledCode", "dbtTestCompiledCode") + DBT_TEST_COMPILED_CODE: ClassVar[TextField] = TextField( + "dbtTestCompiledCode", "dbtTestCompiledCode" + ) """ Compiled code of the test (when the test is defined using Python). """ - DBT_TEST_LANGUAGE: ClassVar[TextField] = TextField("dbtTestLanguage", "dbtTestLanguage") + DBT_TEST_LANGUAGE: ClassVar[TextField] = TextField( + "dbtTestLanguage", "dbtTestLanguage" + ) """ Language in which the test is written, for example: SQL or Python. """ @@ -136,7 +150,9 @@ def dbt_test_raw_s_q_l(self, dbt_test_raw_s_q_l: Optional[str]): @property def dbt_test_compiled_s_q_l(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_test_compiled_s_q_l + return ( + None if self.attributes is None else self.attributes.dbt_test_compiled_s_q_l + ) @dbt_test_compiled_s_q_l.setter def dbt_test_compiled_s_q_l(self, dbt_test_compiled_s_q_l: Optional[str]): @@ -156,7 +172,9 @@ def dbt_test_raw_code(self, dbt_test_raw_code: Optional[str]): @property def dbt_test_compiled_code(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_test_compiled_code + return ( + None if self.attributes is None else self.attributes.dbt_test_compiled_code + ) @dbt_test_compiled_code.setter def dbt_test_compiled_code(self, dbt_test_compiled_code: Optional[str]): @@ -223,10 +241,18 @@ class Attributes(Dbt.Attributes): dbt_test_raw_code: Optional[str] = Field(default=None, description="") dbt_test_compiled_code: Optional[str] = Field(default=None, description="") dbt_test_language: Optional[str] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - sql_assets: Optional[List[SQL]] = Field(default=None, description="") # relationship - dbt_model_columns: Optional[List[DbtModelColumn]] = Field(default=None, description="") # relationship - dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + sql_assets: Optional[List[SQL]] = Field( + default=None, description="" + ) # relationship + dbt_model_columns: Optional[List[DbtModelColumn]] = Field( + default=None, description="" + ) # relationship + dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship attributes: DbtTest.Attributes = Field( default_factory=lambda: DbtTest.Attributes(), diff --git a/pyatlan/model/assets/core/dynamo_d_b_secondary_index.py b/pyatlan/model/assets/core/dynamo_d_b_secondary_index.py index 2f3ceaf1e..bc577b1c8 100644 --- a/pyatlan/model/assets/core/dynamo_d_b_secondary_index.py +++ b/pyatlan/model/assets/core/dynamo_d_b_secondary_index.py @@ -67,35 +67,51 @@ def __setattr__(self, name, value): """ Whether this table is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( + "isQueryPreview", "isQueryPreview" + ) """ Whether preview queries are allowed for this table (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( + "queryPreviewConfig", "queryPreviewConfig" + ) """ Configuration for preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") + EXTERNAL_LOCATION: ClassVar[TextField] = TextField( + "externalLocation", "externalLocation" + ) """ External location of this table, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( + "externalLocationRegion", "externalLocationRegion" + ) """ Region of the external location of this table, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( + "externalLocationFormat", "externalLocationFormat" + ) """ Format of the external location of this table, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( + "isPartitioned", "isPartitioned" + ) """ Whether this table is partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( + "partitionStrategy", "partitionStrategy" + ) """ Partition strategy for this table. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") + PARTITION_COUNT: ClassVar[NumericField] = NumericField( + "partitionCount", "partitionCount" + ) """ Number of partitions in this table. """ @@ -111,15 +127,21 @@ def __setattr__(self, name, value): """ Type of the table. """ - ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField("icebergCatalogName", "icebergCatalogName") + ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField( + "icebergCatalogName", "icebergCatalogName" + ) """ iceberg table catalog name (can be any user defined name) """ - ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField("icebergTableType", "icebergTableType") + ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField( + "icebergTableType", "icebergTableType" + ) """ iceberg table type (managed vs unmanaged) """ - ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField("icebergCatalogSource", "icebergCatalogSource") + ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField( + "icebergCatalogSource", "icebergCatalogSource" + ) """ iceberg table catalog type (glue, polaris, snowflake) """ @@ -147,7 +169,9 @@ def __setattr__(self, name, value): """ iceberg table base location inside the external volume. """ - TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField("tableRetentionTime", "tableRetentionTime") + TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField( + "tableRetentionTime", "tableRetentionTime" + ) """ Data retention time in days. """ @@ -155,47 +179,69 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( + "queryUserCount", "queryUserCount" + ) """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( + "queryUserMap", "queryUserMap" + ) """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( + "queryCountUpdatedAt", "queryCountUpdatedAt" + ) """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "databaseName", "databaseName.keyword", "databaseName" + ) """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "databaseQualifiedName", "databaseQualifiedName" + ) """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "schemaName", "schemaName.keyword", "schemaName" + ) """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "schemaQualifiedName", "schemaQualifiedName" + ) """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "tableName", "tableName.keyword", "tableName" + ) """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "tableQualifiedName", "tableQualifiedName" + ) """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "viewName", "viewName.keyword", "viewName" + ) """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "viewQualifiedName", "viewQualifiedName" + ) """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -215,19 +261,27 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( + "lastProfiledAt", "lastProfiledAt" + ) """ Time (epoch) at which this asset was last profiled, in milliseconds. """ - DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField("dynamoDBStatus", "dynamoDBStatus") + DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField( + "dynamoDBStatus", "dynamoDBStatus" + ) """ Status of the DynamoDB Asset """ - DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBPartitionKey", "dynamoDBPartitionKey") + DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField( + "dynamoDBPartitionKey", "dynamoDBPartitionKey" + ) """ Specifies the partition key of the DynamoDB Table/Index """ - DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBSortKey", "dynamoDBSortKey") + DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField( + "dynamoDBSortKey", "dynamoDBSortKey" + ) """ Specifies the sort key of the DynamoDB Table/Index """ @@ -243,7 +297,9 @@ def __setattr__(self, name, value): """ The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( + "noSQLSchemaDefinition", "noSQLSchemaDefinition" + ) """ Represents attributes for describing the key schema for the table and indexes. """ @@ -302,16 +358,24 @@ def __setattr__(self, name, value): def dynamo_d_b_secondary_index_projection_type( self, ) -> Optional[DynamoDBSecondaryIndexProjectionType]: - return None if self.attributes is None else self.attributes.dynamo_d_b_secondary_index_projection_type + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_secondary_index_projection_type + ) @dynamo_d_b_secondary_index_projection_type.setter def dynamo_d_b_secondary_index_projection_type( self, - dynamo_d_b_secondary_index_projection_type: Optional[DynamoDBSecondaryIndexProjectionType], + dynamo_d_b_secondary_index_projection_type: Optional[ + DynamoDBSecondaryIndexProjectionType + ], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_secondary_index_projection_type = dynamo_d_b_secondary_index_projection_type + self.attributes.dynamo_d_b_secondary_index_projection_type = ( + dynamo_d_b_secondary_index_projection_type + ) @property def column_count(self) -> Optional[int]: @@ -395,7 +459,11 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_region + return ( + None + if self.attributes is None + else self.attributes.external_location_region + ) @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -405,7 +473,11 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_format + return ( + None + if self.attributes is None + else self.attributes.external_location_format + ) @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -495,7 +567,9 @@ def iceberg_table_type(self, iceberg_table_type: Optional[str]): @property def iceberg_catalog_source(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_source + return ( + None if self.attributes is None else self.attributes.iceberg_catalog_source + ) @iceberg_catalog_source.setter def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @@ -505,7 +579,11 @@ def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @property def iceberg_catalog_table_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_table_name + return ( + None + if self.attributes is None + else self.attributes.iceberg_catalog_table_name + ) @iceberg_catalog_table_name.setter def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @@ -515,17 +593,29 @@ def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @property def iceberg_catalog_table_namespace(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_table_namespace + return ( + None + if self.attributes is None + else self.attributes.iceberg_catalog_table_namespace + ) @iceberg_catalog_table_namespace.setter - def iceberg_catalog_table_namespace(self, iceberg_catalog_table_namespace: Optional[str]): + def iceberg_catalog_table_namespace( + self, iceberg_catalog_table_namespace: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.iceberg_catalog_table_namespace = iceberg_catalog_table_namespace + self.attributes.iceberg_catalog_table_namespace = ( + iceberg_catalog_table_namespace + ) @property def table_external_volume_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.table_external_volume_name + return ( + None + if self.attributes is None + else self.attributes.table_external_volume_name + ) @table_external_volume_name.setter def table_external_volume_name(self, table_external_volume_name: Optional[str]): @@ -535,7 +625,11 @@ def table_external_volume_name(self, table_external_volume_name: Optional[str]): @property def iceberg_table_base_location(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_table_base_location + return ( + None + if self.attributes is None + else self.attributes.iceberg_table_base_location + ) @iceberg_table_base_location.setter def iceberg_table_base_location(self, iceberg_table_base_location: Optional[str]): @@ -585,7 +679,9 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.query_count_updated_at + return ( + None if self.attributes is None else self.attributes.query_count_updated_at + ) @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -605,7 +701,9 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.database_qualified_name + return ( + None if self.attributes is None else self.attributes.database_qualified_name + ) @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -625,7 +723,9 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_qualified_name + return ( + None if self.attributes is None else self.attributes.schema_qualified_name + ) @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -675,7 +775,9 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_name + return ( + None if self.attributes is None else self.attributes.calculation_view_name + ) @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -685,13 +787,21 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.calculation_view_qualified_name + ) @calculation_view_qualified_name.setter - def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): + def calculation_view_qualified_name( + self, calculation_view_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = calculation_view_qualified_name + self.attributes.calculation_view_qualified_name = ( + calculation_view_qualified_name + ) @property def is_profiled(self) -> Optional[bool]: @@ -725,7 +835,11 @@ def dynamo_d_b_status(self, dynamo_d_b_status: Optional[DynamoDBStatus]): @property def dynamo_d_b_partition_key(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dynamo_d_b_partition_key + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_partition_key + ) @dynamo_d_b_partition_key.setter def dynamo_d_b_partition_key(self, dynamo_d_b_partition_key: Optional[str]): @@ -745,27 +859,45 @@ def dynamo_d_b_sort_key(self, dynamo_d_b_sort_key: Optional[str]): @property def dynamo_d_b_read_capacity_units(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.dynamo_d_b_read_capacity_units + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_read_capacity_units + ) @dynamo_d_b_read_capacity_units.setter - def dynamo_d_b_read_capacity_units(self, dynamo_d_b_read_capacity_units: Optional[int]): + def dynamo_d_b_read_capacity_units( + self, dynamo_d_b_read_capacity_units: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dynamo_d_b_read_capacity_units = dynamo_d_b_read_capacity_units @property def dynamo_d_b_write_capacity_units(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.dynamo_d_b_write_capacity_units + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_write_capacity_units + ) @dynamo_d_b_write_capacity_units.setter - def dynamo_d_b_write_capacity_units(self, dynamo_d_b_write_capacity_units: Optional[int]): + def dynamo_d_b_write_capacity_units( + self, dynamo_d_b_write_capacity_units: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_write_capacity_units = dynamo_d_b_write_capacity_units + self.attributes.dynamo_d_b_write_capacity_units = ( + dynamo_d_b_write_capacity_units + ) @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition + return ( + None + if self.attributes is None + else self.attributes.no_s_q_l_schema_definition + ) @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -774,16 +906,18 @@ def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): self.attributes.no_s_q_l_schema_definition = no_s_q_l_schema_definition class Attributes(Table.Attributes): - dynamo_d_b_secondary_index_projection_type: Optional[DynamoDBSecondaryIndexProjectionType] = Field( - default=None, description="" - ) + dynamo_d_b_secondary_index_projection_type: Optional[ + DynamoDBSecondaryIndexProjectionType + ] = Field(default=None, description="") column_count: Optional[int] = Field(default=None, description="") row_count: Optional[int] = Field(default=None, description="") size_bytes: Optional[int] = Field(default=None, description="") alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") + query_preview_config: Optional[Dict[str, str]] = Field( + default=None, description="" + ) external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -797,7 +931,9 @@ class Attributes(Table.Attributes): iceberg_table_type: Optional[str] = Field(default=None, description="") iceberg_catalog_source: Optional[str] = Field(default=None, description="") iceberg_catalog_table_name: Optional[str] = Field(default=None, description="") - iceberg_catalog_table_namespace: Optional[str] = Field(default=None, description="") + iceberg_catalog_table_namespace: Optional[str] = Field( + default=None, description="" + ) table_external_volume_name: Optional[str] = Field(default=None, description="") iceberg_table_base_location: Optional[str] = Field(default=None, description="") table_retention_time: Optional[int] = Field(default=None, description="") @@ -814,14 +950,22 @@ class Attributes(Table.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field(default=None, description="") + calculation_view_qualified_name: Optional[str] = Field( + default=None, description="" + ) is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dynamo_d_b_status: Optional[DynamoDBStatus] = Field(default=None, description="") + dynamo_d_b_status: Optional[DynamoDBStatus] = Field( + default=None, description="" + ) dynamo_d_b_partition_key: Optional[str] = Field(default=None, description="") dynamo_d_b_sort_key: Optional[str] = Field(default=None, description="") - dynamo_d_b_read_capacity_units: Optional[int] = Field(default=None, description="") - dynamo_d_b_write_capacity_units: Optional[int] = Field(default=None, description="") + dynamo_d_b_read_capacity_units: Optional[int] = Field( + default=None, description="" + ) + dynamo_d_b_write_capacity_units: Optional[int] = Field( + default=None, description="" + ) no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") attributes: DynamoDBSecondaryIndex.Attributes = Field( diff --git a/pyatlan/model/assets/core/file.py b/pyatlan/model/assets/core/file.py index ff5e15fb5..1e3381d20 100644 --- a/pyatlan/model/assets/core/file.py +++ b/pyatlan/model/assets/core/file.py @@ -21,7 +21,9 @@ class File(Resource): @classmethod @init_guid - def creator(cls, *, name: str, connection_qualified_name: str, file_type: FileType) -> File: + def creator( + cls, *, name: str, connection_qualified_name: str, file_type: FileType + ) -> File: return File( attributes=File.Attributes.create( name=name, @@ -32,9 +34,13 @@ def creator(cls, *, name: str, connection_qualified_name: str, file_type: FileTy @classmethod @init_guid - def create(cls, *, name: str, connection_qualified_name: str, file_type: FileType) -> File: + def create( + cls, *, name: str, connection_qualified_name: str, file_type: FileType + ) -> File: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -110,11 +116,15 @@ def file_assets(self, file_assets: Optional[Asset]): class Attributes(Resource.Attributes): file_type: Optional[FileType] = Field(default=None, description="") file_path: Optional[str] = Field(default=None, description="") - file_assets: Optional[Asset] = Field(default=None, description="") # relationship + file_assets: Optional[Asset] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def create(cls, *, name: str, connection_qualified_name: str, file_type: FileType) -> File.Attributes: + def create( + cls, *, name: str, connection_qualified_name: str, file_type: FileType + ) -> File.Attributes: validate_required_fields( ["name", "connection_qualified_name", "file_type"], [name, connection_qualified_name, file_type], @@ -123,7 +133,9 @@ def create(cls, *, name: str, connection_qualified_name: str, file_type: FileTyp name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), file_type=file_type, ) diff --git a/pyatlan/model/assets/core/fivetran.py b/pyatlan/model/assets/core/fivetran.py index ea1562f3f..f724a9817 100644 --- a/pyatlan/model/assets/core/fivetran.py +++ b/pyatlan/model/assets/core/fivetran.py @@ -30,11 +30,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - FIVETRAN_WORKFLOW_NAME: ClassVar[KeywordField] = KeywordField("fivetranWorkflowName", "fivetranWorkflowName") + FIVETRAN_WORKFLOW_NAME: ClassVar[KeywordField] = KeywordField( + "fivetranWorkflowName", "fivetranWorkflowName" + ) """ Name of the atlan fivetran workflow that updated this asset """ - FIVETRAN_LAST_SYNC_STATUS: ClassVar[KeywordField] = KeywordField("fivetranLastSyncStatus", "fivetranLastSyncStatus") + FIVETRAN_LAST_SYNC_STATUS: ClassVar[KeywordField] = KeywordField( + "fivetranLastSyncStatus", "fivetranLastSyncStatus" + ) """ Status of the latest sync on Fivetran. """ @@ -53,7 +57,9 @@ def __setattr__(self, name, value): @property def fivetran_workflow_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_workflow_name + return ( + None if self.attributes is None else self.attributes.fivetran_workflow_name + ) @fivetran_workflow_name.setter def fivetran_workflow_name(self, fivetran_workflow_name: Optional[str]): @@ -63,28 +69,46 @@ def fivetran_workflow_name(self, fivetran_workflow_name: Optional[str]): @property def fivetran_last_sync_status(self) -> Optional[FivetranConnectorStatus]: - return None if self.attributes is None else self.attributes.fivetran_last_sync_status + return ( + None + if self.attributes is None + else self.attributes.fivetran_last_sync_status + ) @fivetran_last_sync_status.setter - def fivetran_last_sync_status(self, fivetran_last_sync_status: Optional[FivetranConnectorStatus]): + def fivetran_last_sync_status( + self, fivetran_last_sync_status: Optional[FivetranConnectorStatus] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.fivetran_last_sync_status = fivetran_last_sync_status @property def fivetran_last_sync_records_updated(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.fivetran_last_sync_records_updated + return ( + None + if self.attributes is None + else self.attributes.fivetran_last_sync_records_updated + ) @fivetran_last_sync_records_updated.setter - def fivetran_last_sync_records_updated(self, fivetran_last_sync_records_updated: Optional[int]): + def fivetran_last_sync_records_updated( + self, fivetran_last_sync_records_updated: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_last_sync_records_updated = fivetran_last_sync_records_updated + self.attributes.fivetran_last_sync_records_updated = ( + fivetran_last_sync_records_updated + ) class Attributes(Catalog.Attributes): fivetran_workflow_name: Optional[str] = Field(default=None, description="") - fivetran_last_sync_status: Optional[FivetranConnectorStatus] = Field(default=None, description="") - fivetran_last_sync_records_updated: Optional[int] = Field(default=None, description="") + fivetran_last_sync_status: Optional[FivetranConnectorStatus] = Field( + default=None, description="" + ) + fivetran_last_sync_records_updated: Optional[int] = Field( + default=None, description="" + ) attributes: Fivetran.Attributes = Field( default_factory=lambda: Fivetran.Attributes(), diff --git a/pyatlan/model/assets/core/fivetran_connector.py b/pyatlan/model/assets/core/fivetran_connector.py index 388c19df6..59fb14a82 100644 --- a/pyatlan/model/assets/core/fivetran_connector.py +++ b/pyatlan/model/assets/core/fivetran_connector.py @@ -82,64 +82,84 @@ def __setattr__(self, name, value): """ Number of tables synced in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_EXTRACT_TIME_SECONDS: ClassVar[NumericField] = NumericField( - "fivetranConnectorLastSyncExtractTimeSeconds", - "fivetranConnectorLastSyncExtractTimeSeconds", + FIVETRAN_CONNECTOR_LAST_SYNC_EXTRACT_TIME_SECONDS: ClassVar[NumericField] = ( + NumericField( + "fivetranConnectorLastSyncExtractTimeSeconds", + "fivetranConnectorLastSyncExtractTimeSeconds", + ) ) """ Extract time in seconds in the latest sync on fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_EXTRACT_VOLUME_MEGABYTES: ClassVar[NumericField] = NumericField( - "fivetranConnectorLastSyncExtractVolumeMegabytes", - "fivetranConnectorLastSyncExtractVolumeMegabytes", + FIVETRAN_CONNECTOR_LAST_SYNC_EXTRACT_VOLUME_MEGABYTES: ClassVar[NumericField] = ( + NumericField( + "fivetranConnectorLastSyncExtractVolumeMegabytes", + "fivetranConnectorLastSyncExtractVolumeMegabytes", + ) ) """ Extracted data volume in metabytes in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_LOAD_TIME_SECONDS: ClassVar[NumericField] = NumericField( - "fivetranConnectorLastSyncLoadTimeSeconds", - "fivetranConnectorLastSyncLoadTimeSeconds", + FIVETRAN_CONNECTOR_LAST_SYNC_LOAD_TIME_SECONDS: ClassVar[NumericField] = ( + NumericField( + "fivetranConnectorLastSyncLoadTimeSeconds", + "fivetranConnectorLastSyncLoadTimeSeconds", + ) ) """ Load time in seconds in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_LOAD_VOLUME_MEGABYTES: ClassVar[NumericField] = NumericField( - "fivetranConnectorLastSyncLoadVolumeMegabytes", - "fivetranConnectorLastSyncLoadVolumeMegabytes", + FIVETRAN_CONNECTOR_LAST_SYNC_LOAD_VOLUME_MEGABYTES: ClassVar[NumericField] = ( + NumericField( + "fivetranConnectorLastSyncLoadVolumeMegabytes", + "fivetranConnectorLastSyncLoadVolumeMegabytes", + ) ) """ Loaded data volume in metabytes in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_PROCESS_TIME_SECONDS: ClassVar[NumericField] = NumericField( - "fivetranConnectorLastSyncProcessTimeSeconds", - "fivetranConnectorLastSyncProcessTimeSeconds", + FIVETRAN_CONNECTOR_LAST_SYNC_PROCESS_TIME_SECONDS: ClassVar[NumericField] = ( + NumericField( + "fivetranConnectorLastSyncProcessTimeSeconds", + "fivetranConnectorLastSyncProcessTimeSeconds", + ) ) """ Process time in seconds in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_PROCESS_VOLUME_MEGABYTES: ClassVar[NumericField] = NumericField( - "fivetranConnectorLastSyncProcessVolumeMegabytes", - "fivetranConnectorLastSyncProcessVolumeMegabytes", + FIVETRAN_CONNECTOR_LAST_SYNC_PROCESS_VOLUME_MEGABYTES: ClassVar[NumericField] = ( + NumericField( + "fivetranConnectorLastSyncProcessVolumeMegabytes", + "fivetranConnectorLastSyncProcessVolumeMegabytes", + ) ) """ Process volume in metabytes in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_LAST_SYNC_TOTAL_TIME_SECONDS: ClassVar[NumericField] = NumericField( - "fivetranConnectorLastSyncTotalTimeSeconds", - "fivetranConnectorLastSyncTotalTimeSeconds", + FIVETRAN_CONNECTOR_LAST_SYNC_TOTAL_TIME_SECONDS: ClassVar[NumericField] = ( + NumericField( + "fivetranConnectorLastSyncTotalTimeSeconds", + "fivetranConnectorLastSyncTotalTimeSeconds", + ) ) """ Total sync time in seconds in the latest sync on Fivetran """ - FIVETRAN_CONNECTOR_NAME: ClassVar[KeywordField] = KeywordField("fivetranConnectorName", "fivetranConnectorName") + FIVETRAN_CONNECTOR_NAME: ClassVar[KeywordField] = KeywordField( + "fivetranConnectorName", "fivetranConnectorName" + ) """ Connector name added by the user on Fivetran """ - FIVETRAN_CONNECTOR_TYPE: ClassVar[KeywordField] = KeywordField("fivetranConnectorType", "fivetranConnectorType") + FIVETRAN_CONNECTOR_TYPE: ClassVar[KeywordField] = KeywordField( + "fivetranConnectorType", "fivetranConnectorType" + ) """ Type of connector on Fivetran. Eg: snowflake, google_analytics, notion etc. """ - FIVETRAN_CONNECTOR_URL: ClassVar[KeywordField] = KeywordField("fivetranConnectorURL", "fivetranConnectorURL") + FIVETRAN_CONNECTOR_URL: ClassVar[KeywordField] = KeywordField( + "fivetranConnectorURL", "fivetranConnectorURL" + ) """ URL to open the connector details on Fivetran """ @@ -213,42 +233,54 @@ def __setattr__(self, name, value): """ Total Monthly Active Rows used by the connector in the past month """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_FREE: ClassVar[NumericField] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_FREE: ClassVar[ + NumericField + ] = NumericField( "fivetranConnectorMonthlyActiveRowsChangePercentageFree", "fivetranConnectorMonthlyActiveRowsChangePercentageFree", ) """ Increase in the percentage of free MAR compared to the previous month """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_PAID: ClassVar[NumericField] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_PAID: ClassVar[ + NumericField + ] = NumericField( "fivetranConnectorMonthlyActiveRowsChangePercentagePaid", "fivetranConnectorMonthlyActiveRowsChangePercentagePaid", ) """ Increase in the percentage of paid MAR compared to the previous month """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_TOTAL: ClassVar[NumericField] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_CHANGE_PERCENTAGE_TOTAL: ClassVar[ + NumericField + ] = NumericField( "fivetranConnectorMonthlyActiveRowsChangePercentageTotal", "fivetranConnectorMonthlyActiveRowsChangePercentageTotal", ) """ Increase in the percentage of total MAR compared to the previous month """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_FREE_PERCENTAGE_OF_ACCOUNT: ClassVar[NumericField] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_FREE_PERCENTAGE_OF_ACCOUNT: ClassVar[ + NumericField + ] = NumericField( "fivetranConnectorMonthlyActiveRowsFreePercentageOfAccount", "fivetranConnectorMonthlyActiveRowsFreePercentageOfAccount", ) """ Percentage of the account's total free MAR used by this connector """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_PAID_PERCENTAGE_OF_ACCOUNT: ClassVar[NumericField] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_PAID_PERCENTAGE_OF_ACCOUNT: ClassVar[ + NumericField + ] = NumericField( "fivetranConnectorMonthlyActiveRowsPaidPercentageOfAccount", "fivetranConnectorMonthlyActiveRowsPaidPercentageOfAccount", ) """ Percentage of the account's total paid MAR used by this connector """ - FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_TOTAL_PERCENTAGE_OF_ACCOUNT: ClassVar[NumericField] = NumericField( + FIVETRAN_CONNECTOR_MONTHLY_ACTIVE_ROWS_TOTAL_PERCENTAGE_OF_ACCOUNT: ClassVar[ + NumericField + ] = NumericField( "fivetranConnectorMonthlyActiveRowsTotalPercentageOfAccount", "fivetranConnectorMonthlyActiveRowsTotalPercentageOfAccount", ) @@ -329,57 +361,101 @@ def __setattr__(self, name, value): @property def fivetran_connector_last_sync_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_id + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_id + ) @fivetran_connector_last_sync_id.setter - def fivetran_connector_last_sync_id(self, fivetran_connector_last_sync_id: Optional[str]): + def fivetran_connector_last_sync_id( + self, fivetran_connector_last_sync_id: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_id = fivetran_connector_last_sync_id + self.attributes.fivetran_connector_last_sync_id = ( + fivetran_connector_last_sync_id + ) @property def fivetran_connector_last_sync_started_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_started_at + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_started_at + ) @fivetran_connector_last_sync_started_at.setter - def fivetran_connector_last_sync_started_at(self, fivetran_connector_last_sync_started_at: Optional[datetime]): + def fivetran_connector_last_sync_started_at( + self, fivetran_connector_last_sync_started_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_started_at = fivetran_connector_last_sync_started_at + self.attributes.fivetran_connector_last_sync_started_at = ( + fivetran_connector_last_sync_started_at + ) @property def fivetran_connector_last_sync_finished_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_finished_at + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_finished_at + ) @fivetran_connector_last_sync_finished_at.setter - def fivetran_connector_last_sync_finished_at(self, fivetran_connector_last_sync_finished_at: Optional[datetime]): + def fivetran_connector_last_sync_finished_at( + self, fivetran_connector_last_sync_finished_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_finished_at = fivetran_connector_last_sync_finished_at + self.attributes.fivetran_connector_last_sync_finished_at = ( + fivetran_connector_last_sync_finished_at + ) @property def fivetran_connector_last_sync_reason(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_reason + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_reason + ) @fivetran_connector_last_sync_reason.setter - def fivetran_connector_last_sync_reason(self, fivetran_connector_last_sync_reason: Optional[str]): + def fivetran_connector_last_sync_reason( + self, fivetran_connector_last_sync_reason: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_reason = fivetran_connector_last_sync_reason + self.attributes.fivetran_connector_last_sync_reason = ( + fivetran_connector_last_sync_reason + ) @property def fivetran_connector_last_sync_task_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_task_type + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_task_type + ) @fivetran_connector_last_sync_task_type.setter - def fivetran_connector_last_sync_task_type(self, fivetran_connector_last_sync_task_type: Optional[str]): + def fivetran_connector_last_sync_task_type( + self, fivetran_connector_last_sync_task_type: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_task_type = fivetran_connector_last_sync_task_type + self.attributes.fivetran_connector_last_sync_task_type = ( + fivetran_connector_last_sync_task_type + ) @property def fivetran_connector_last_sync_rescheduled_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_rescheduled_at + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_rescheduled_at + ) @fivetran_connector_last_sync_rescheduled_at.setter def fivetran_connector_last_sync_rescheduled_at( @@ -387,21 +463,35 @@ def fivetran_connector_last_sync_rescheduled_at( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_rescheduled_at = fivetran_connector_last_sync_rescheduled_at + self.attributes.fivetran_connector_last_sync_rescheduled_at = ( + fivetran_connector_last_sync_rescheduled_at + ) @property def fivetran_connector_last_sync_tables_synced(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_tables_synced + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_tables_synced + ) @fivetran_connector_last_sync_tables_synced.setter - def fivetran_connector_last_sync_tables_synced(self, fivetran_connector_last_sync_tables_synced: Optional[int]): + def fivetran_connector_last_sync_tables_synced( + self, fivetran_connector_last_sync_tables_synced: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_tables_synced = fivetran_connector_last_sync_tables_synced + self.attributes.fivetran_connector_last_sync_tables_synced = ( + fivetran_connector_last_sync_tables_synced + ) @property def fivetran_connector_last_sync_extract_time_seconds(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_extract_time_seconds + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_extract_time_seconds + ) @fivetran_connector_last_sync_extract_time_seconds.setter def fivetran_connector_last_sync_extract_time_seconds( @@ -416,7 +506,9 @@ def fivetran_connector_last_sync_extract_time_seconds( @property def fivetran_connector_last_sync_extract_volume_megabytes(self) -> Optional[float]: return ( - None if self.attributes is None else self.attributes.fivetran_connector_last_sync_extract_volume_megabytes + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_extract_volume_megabytes ) @fivetran_connector_last_sync_extract_volume_megabytes.setter @@ -431,7 +523,11 @@ def fivetran_connector_last_sync_extract_volume_megabytes( @property def fivetran_connector_last_sync_load_time_seconds(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_load_time_seconds + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_load_time_seconds + ) @fivetran_connector_last_sync_load_time_seconds.setter def fivetran_connector_last_sync_load_time_seconds( @@ -439,11 +535,17 @@ def fivetran_connector_last_sync_load_time_seconds( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_last_sync_load_time_seconds = fivetran_connector_last_sync_load_time_seconds + self.attributes.fivetran_connector_last_sync_load_time_seconds = ( + fivetran_connector_last_sync_load_time_seconds + ) @property def fivetran_connector_last_sync_load_volume_megabytes(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_load_volume_megabytes + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_load_volume_megabytes + ) @fivetran_connector_last_sync_load_volume_megabytes.setter def fivetran_connector_last_sync_load_volume_megabytes( @@ -457,7 +559,11 @@ def fivetran_connector_last_sync_load_volume_megabytes( @property def fivetran_connector_last_sync_process_time_seconds(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_process_time_seconds + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_process_time_seconds + ) @fivetran_connector_last_sync_process_time_seconds.setter def fivetran_connector_last_sync_process_time_seconds( @@ -472,7 +578,9 @@ def fivetran_connector_last_sync_process_time_seconds( @property def fivetran_connector_last_sync_process_volume_megabytes(self) -> Optional[float]: return ( - None if self.attributes is None else self.attributes.fivetran_connector_last_sync_process_volume_megabytes + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_process_volume_megabytes ) @fivetran_connector_last_sync_process_volume_megabytes.setter @@ -487,7 +595,11 @@ def fivetran_connector_last_sync_process_volume_megabytes( @property def fivetran_connector_last_sync_total_time_seconds(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.fivetran_connector_last_sync_total_time_seconds + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_last_sync_total_time_seconds + ) @fivetran_connector_last_sync_total_time_seconds.setter def fivetran_connector_last_sync_total_time_seconds( @@ -501,7 +613,9 @@ def fivetran_connector_last_sync_total_time_seconds( @property def fivetran_connector_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_name + return ( + None if self.attributes is None else self.attributes.fivetran_connector_name + ) @fivetran_connector_name.setter def fivetran_connector_name(self, fivetran_connector_name: Optional[str]): @@ -511,7 +625,9 @@ def fivetran_connector_name(self, fivetran_connector_name: Optional[str]): @property def fivetran_connector_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_type + return ( + None if self.attributes is None else self.attributes.fivetran_connector_type + ) @fivetran_connector_type.setter def fivetran_connector_type(self, fivetran_connector_type: Optional[str]): @@ -521,7 +637,9 @@ def fivetran_connector_type(self, fivetran_connector_type: Optional[str]): @property def fivetran_connector_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_url + return ( + None if self.attributes is None else self.attributes.fivetran_connector_url + ) @fivetran_connector_url.setter def fivetran_connector_url(self, fivetran_connector_url: Optional[str]): @@ -531,113 +649,199 @@ def fivetran_connector_url(self, fivetran_connector_url: Optional[str]): @property def fivetran_connector_destination_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_destination_name + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_destination_name + ) @fivetran_connector_destination_name.setter - def fivetran_connector_destination_name(self, fivetran_connector_destination_name: Optional[str]): + def fivetran_connector_destination_name( + self, fivetran_connector_destination_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_destination_name = fivetran_connector_destination_name + self.attributes.fivetran_connector_destination_name = ( + fivetran_connector_destination_name + ) @property def fivetran_connector_destination_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_destination_type + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_destination_type + ) @fivetran_connector_destination_type.setter - def fivetran_connector_destination_type(self, fivetran_connector_destination_type: Optional[str]): + def fivetran_connector_destination_type( + self, fivetran_connector_destination_type: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_destination_type = fivetran_connector_destination_type + self.attributes.fivetran_connector_destination_type = ( + fivetran_connector_destination_type + ) @property def fivetran_connector_destination_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_destination_url + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_destination_url + ) @fivetran_connector_destination_url.setter - def fivetran_connector_destination_url(self, fivetran_connector_destination_url: Optional[str]): + def fivetran_connector_destination_url( + self, fivetran_connector_destination_url: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_destination_url = fivetran_connector_destination_url + self.attributes.fivetran_connector_destination_url = ( + fivetran_connector_destination_url + ) @property def fivetran_connector_sync_setup_on(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.fivetran_connector_sync_setup_on + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_sync_setup_on + ) @fivetran_connector_sync_setup_on.setter - def fivetran_connector_sync_setup_on(self, fivetran_connector_sync_setup_on: Optional[datetime]): + def fivetran_connector_sync_setup_on( + self, fivetran_connector_sync_setup_on: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_sync_setup_on = fivetran_connector_sync_setup_on + self.attributes.fivetran_connector_sync_setup_on = ( + fivetran_connector_sync_setup_on + ) @property def fivetran_connector_sync_frequency(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_sync_frequency + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_sync_frequency + ) @fivetran_connector_sync_frequency.setter - def fivetran_connector_sync_frequency(self, fivetran_connector_sync_frequency: Optional[str]): + def fivetran_connector_sync_frequency( + self, fivetran_connector_sync_frequency: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_sync_frequency = fivetran_connector_sync_frequency + self.attributes.fivetran_connector_sync_frequency = ( + fivetran_connector_sync_frequency + ) @property def fivetran_connector_sync_paused(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.fivetran_connector_sync_paused + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_sync_paused + ) @fivetran_connector_sync_paused.setter - def fivetran_connector_sync_paused(self, fivetran_connector_sync_paused: Optional[bool]): + def fivetran_connector_sync_paused( + self, fivetran_connector_sync_paused: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.fivetran_connector_sync_paused = fivetran_connector_sync_paused @property def fivetran_connector_sync_setup_user_full_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_sync_setup_user_full_name + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_sync_setup_user_full_name + ) @fivetran_connector_sync_setup_user_full_name.setter - def fivetran_connector_sync_setup_user_full_name(self, fivetran_connector_sync_setup_user_full_name: Optional[str]): + def fivetran_connector_sync_setup_user_full_name( + self, fivetran_connector_sync_setup_user_full_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_sync_setup_user_full_name = fivetran_connector_sync_setup_user_full_name + self.attributes.fivetran_connector_sync_setup_user_full_name = ( + fivetran_connector_sync_setup_user_full_name + ) @property def fivetran_connector_sync_setup_user_email(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_sync_setup_user_email + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_sync_setup_user_email + ) @fivetran_connector_sync_setup_user_email.setter - def fivetran_connector_sync_setup_user_email(self, fivetran_connector_sync_setup_user_email: Optional[str]): + def fivetran_connector_sync_setup_user_email( + self, fivetran_connector_sync_setup_user_email: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_sync_setup_user_email = fivetran_connector_sync_setup_user_email + self.attributes.fivetran_connector_sync_setup_user_email = ( + fivetran_connector_sync_setup_user_email + ) @property def fivetran_connector_monthly_active_rows_free(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.fivetran_connector_monthly_active_rows_free + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_monthly_active_rows_free + ) @fivetran_connector_monthly_active_rows_free.setter - def fivetran_connector_monthly_active_rows_free(self, fivetran_connector_monthly_active_rows_free: Optional[int]): + def fivetran_connector_monthly_active_rows_free( + self, fivetran_connector_monthly_active_rows_free: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_free = fivetran_connector_monthly_active_rows_free + self.attributes.fivetran_connector_monthly_active_rows_free = ( + fivetran_connector_monthly_active_rows_free + ) @property def fivetran_connector_monthly_active_rows_paid(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.fivetran_connector_monthly_active_rows_paid + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_monthly_active_rows_paid + ) @fivetran_connector_monthly_active_rows_paid.setter - def fivetran_connector_monthly_active_rows_paid(self, fivetran_connector_monthly_active_rows_paid: Optional[int]): + def fivetran_connector_monthly_active_rows_paid( + self, fivetran_connector_monthly_active_rows_paid: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_paid = fivetran_connector_monthly_active_rows_paid + self.attributes.fivetran_connector_monthly_active_rows_paid = ( + fivetran_connector_monthly_active_rows_paid + ) @property def fivetran_connector_monthly_active_rows_total(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.fivetran_connector_monthly_active_rows_total + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_monthly_active_rows_total + ) @fivetran_connector_monthly_active_rows_total.setter - def fivetran_connector_monthly_active_rows_total(self, fivetran_connector_monthly_active_rows_total: Optional[int]): + def fivetran_connector_monthly_active_rows_total( + self, fivetran_connector_monthly_active_rows_total: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_total = fivetran_connector_monthly_active_rows_total + self.attributes.fivetran_connector_monthly_active_rows_total = ( + fivetran_connector_monthly_active_rows_total + ) @property def fivetran_connector_monthly_active_rows_change_percentage_free( @@ -656,9 +860,7 @@ def fivetran_connector_monthly_active_rows_change_percentage_free( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_change_percentage_free = ( - fivetran_connector_monthly_active_rows_change_percentage_free - ) + self.attributes.fivetran_connector_monthly_active_rows_change_percentage_free = fivetran_connector_monthly_active_rows_change_percentage_free @property def fivetran_connector_monthly_active_rows_change_percentage_paid( @@ -677,9 +879,7 @@ def fivetran_connector_monthly_active_rows_change_percentage_paid( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_change_percentage_paid = ( - fivetran_connector_monthly_active_rows_change_percentage_paid - ) + self.attributes.fivetran_connector_monthly_active_rows_change_percentage_paid = fivetran_connector_monthly_active_rows_change_percentage_paid @property def fivetran_connector_monthly_active_rows_change_percentage_total( @@ -698,9 +898,7 @@ def fivetran_connector_monthly_active_rows_change_percentage_total( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_change_percentage_total = ( - fivetran_connector_monthly_active_rows_change_percentage_total - ) + self.attributes.fivetran_connector_monthly_active_rows_change_percentage_total = fivetran_connector_monthly_active_rows_change_percentage_total @property def fivetran_connector_monthly_active_rows_free_percentage_of_account( @@ -715,13 +913,13 @@ def fivetran_connector_monthly_active_rows_free_percentage_of_account( @fivetran_connector_monthly_active_rows_free_percentage_of_account.setter def fivetran_connector_monthly_active_rows_free_percentage_of_account( self, - fivetran_connector_monthly_active_rows_free_percentage_of_account: Optional[float], + fivetran_connector_monthly_active_rows_free_percentage_of_account: Optional[ + float + ], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_free_percentage_of_account = ( - fivetran_connector_monthly_active_rows_free_percentage_of_account - ) + self.attributes.fivetran_connector_monthly_active_rows_free_percentage_of_account = fivetran_connector_monthly_active_rows_free_percentage_of_account @property def fivetran_connector_monthly_active_rows_paid_percentage_of_account( @@ -736,13 +934,13 @@ def fivetran_connector_monthly_active_rows_paid_percentage_of_account( @fivetran_connector_monthly_active_rows_paid_percentage_of_account.setter def fivetran_connector_monthly_active_rows_paid_percentage_of_account( self, - fivetran_connector_monthly_active_rows_paid_percentage_of_account: Optional[float], + fivetran_connector_monthly_active_rows_paid_percentage_of_account: Optional[ + float + ], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_paid_percentage_of_account = ( - fivetran_connector_monthly_active_rows_paid_percentage_of_account - ) + self.attributes.fivetran_connector_monthly_active_rows_paid_percentage_of_account = fivetran_connector_monthly_active_rows_paid_percentage_of_account @property def fivetran_connector_monthly_active_rows_total_percentage_of_account( @@ -757,53 +955,83 @@ def fivetran_connector_monthly_active_rows_total_percentage_of_account( @fivetran_connector_monthly_active_rows_total_percentage_of_account.setter def fivetran_connector_monthly_active_rows_total_percentage_of_account( self, - fivetran_connector_monthly_active_rows_total_percentage_of_account: Optional[float], + fivetran_connector_monthly_active_rows_total_percentage_of_account: Optional[ + float + ], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_monthly_active_rows_total_percentage_of_account = ( - fivetran_connector_monthly_active_rows_total_percentage_of_account - ) + self.attributes.fivetran_connector_monthly_active_rows_total_percentage_of_account = fivetran_connector_monthly_active_rows_total_percentage_of_account @property def fivetran_connector_total_tables_synced(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.fivetran_connector_total_tables_synced + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_total_tables_synced + ) @fivetran_connector_total_tables_synced.setter - def fivetran_connector_total_tables_synced(self, fivetran_connector_total_tables_synced: Optional[int]): + def fivetran_connector_total_tables_synced( + self, fivetran_connector_total_tables_synced: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_total_tables_synced = fivetran_connector_total_tables_synced + self.attributes.fivetran_connector_total_tables_synced = ( + fivetran_connector_total_tables_synced + ) @property def fivetran_connector_top_tables_by_m_a_r(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.fivetran_connector_top_tables_by_m_a_r + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_top_tables_by_m_a_r + ) @fivetran_connector_top_tables_by_m_a_r.setter - def fivetran_connector_top_tables_by_m_a_r(self, fivetran_connector_top_tables_by_m_a_r: Optional[str]): + def fivetran_connector_top_tables_by_m_a_r( + self, fivetran_connector_top_tables_by_m_a_r: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_top_tables_by_m_a_r = fivetran_connector_top_tables_by_m_a_r + self.attributes.fivetran_connector_top_tables_by_m_a_r = ( + fivetran_connector_top_tables_by_m_a_r + ) @property def fivetran_connector_usage_cost(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.fivetran_connector_usage_cost + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_usage_cost + ) @fivetran_connector_usage_cost.setter - def fivetran_connector_usage_cost(self, fivetran_connector_usage_cost: Optional[float]): + def fivetran_connector_usage_cost( + self, fivetran_connector_usage_cost: Optional[float] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.fivetran_connector_usage_cost = fivetran_connector_usage_cost @property def fivetran_connector_credits_used(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.fivetran_connector_credits_used + return ( + None + if self.attributes is None + else self.attributes.fivetran_connector_credits_used + ) @fivetran_connector_credits_used.setter - def fivetran_connector_credits_used(self, fivetran_connector_credits_used: Optional[float]): + def fivetran_connector_credits_used( + self, fivetran_connector_credits_used: Optional[float] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.fivetran_connector_credits_used = fivetran_connector_credits_used + self.attributes.fivetran_connector_credits_used = ( + fivetran_connector_credits_used + ) @property def processes(self) -> Optional[List[Process]]: @@ -816,57 +1044,117 @@ def processes(self, processes: Optional[List[Process]]): self.attributes.processes = processes class Attributes(Fivetran.Attributes): - fivetran_connector_last_sync_id: Optional[str] = Field(default=None, description="") - fivetran_connector_last_sync_started_at: Optional[datetime] = Field(default=None, description="") - fivetran_connector_last_sync_finished_at: Optional[datetime] = Field(default=None, description="") - fivetran_connector_last_sync_reason: Optional[str] = Field(default=None, description="") - fivetran_connector_last_sync_task_type: Optional[str] = Field(default=None, description="") - fivetran_connector_last_sync_rescheduled_at: Optional[datetime] = Field(default=None, description="") - fivetran_connector_last_sync_tables_synced: Optional[int] = Field(default=None, description="") - fivetran_connector_last_sync_extract_time_seconds: Optional[float] = Field(default=None, description="") - fivetran_connector_last_sync_extract_volume_megabytes: Optional[float] = Field(default=None, description="") - fivetran_connector_last_sync_load_time_seconds: Optional[float] = Field(default=None, description="") - fivetran_connector_last_sync_load_volume_megabytes: Optional[float] = Field(default=None, description="") - fivetran_connector_last_sync_process_time_seconds: Optional[float] = Field(default=None, description="") - fivetran_connector_last_sync_process_volume_megabytes: Optional[float] = Field(default=None, description="") - fivetran_connector_last_sync_total_time_seconds: Optional[float] = Field(default=None, description="") + fivetran_connector_last_sync_id: Optional[str] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_started_at: Optional[datetime] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_finished_at: Optional[datetime] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_reason: Optional[str] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_task_type: Optional[str] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_rescheduled_at: Optional[datetime] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_tables_synced: Optional[int] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_extract_time_seconds: Optional[float] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_extract_volume_megabytes: Optional[float] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_load_time_seconds: Optional[float] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_load_volume_megabytes: Optional[float] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_process_time_seconds: Optional[float] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_process_volume_megabytes: Optional[float] = Field( + default=None, description="" + ) + fivetran_connector_last_sync_total_time_seconds: Optional[float] = Field( + default=None, description="" + ) fivetran_connector_name: Optional[str] = Field(default=None, description="") fivetran_connector_type: Optional[str] = Field(default=None, description="") fivetran_connector_url: Optional[str] = Field(default=None, description="") - fivetran_connector_destination_name: Optional[str] = Field(default=None, description="") - fivetran_connector_destination_type: Optional[str] = Field(default=None, description="") - fivetran_connector_destination_url: Optional[str] = Field(default=None, description="") - fivetran_connector_sync_setup_on: Optional[datetime] = Field(default=None, description="") - fivetran_connector_sync_frequency: Optional[str] = Field(default=None, description="") - fivetran_connector_sync_paused: Optional[bool] = Field(default=None, description="") - fivetran_connector_sync_setup_user_full_name: Optional[str] = Field(default=None, description="") - fivetran_connector_sync_setup_user_email: Optional[str] = Field(default=None, description="") - fivetran_connector_monthly_active_rows_free: Optional[int] = Field(default=None, description="") - fivetran_connector_monthly_active_rows_paid: Optional[int] = Field(default=None, description="") - fivetran_connector_monthly_active_rows_total: Optional[int] = Field(default=None, description="") - fivetran_connector_monthly_active_rows_change_percentage_free: Optional[float] = Field( + fivetran_connector_destination_name: Optional[str] = Field( + default=None, description="" + ) + fivetran_connector_destination_type: Optional[str] = Field( + default=None, description="" + ) + fivetran_connector_destination_url: Optional[str] = Field( + default=None, description="" + ) + fivetran_connector_sync_setup_on: Optional[datetime] = Field( default=None, description="" ) - fivetran_connector_monthly_active_rows_change_percentage_paid: Optional[float] = Field( + fivetran_connector_sync_frequency: Optional[str] = Field( default=None, description="" ) - fivetran_connector_monthly_active_rows_change_percentage_total: Optional[float] = Field( + fivetran_connector_sync_paused: Optional[bool] = Field( default=None, description="" ) - fivetran_connector_monthly_active_rows_free_percentage_of_account: Optional[float] = Field( + fivetran_connector_sync_setup_user_full_name: Optional[str] = Field( default=None, description="" ) - fivetran_connector_monthly_active_rows_paid_percentage_of_account: Optional[float] = Field( + fivetran_connector_sync_setup_user_email: Optional[str] = Field( default=None, description="" ) - fivetran_connector_monthly_active_rows_total_percentage_of_account: Optional[float] = Field( + fivetran_connector_monthly_active_rows_free: Optional[int] = Field( default=None, description="" ) - fivetran_connector_total_tables_synced: Optional[int] = Field(default=None, description="") - fivetran_connector_top_tables_by_m_a_r: Optional[str] = Field(default=None, description="") - fivetran_connector_usage_cost: Optional[float] = Field(default=None, description="") - fivetran_connector_credits_used: Optional[float] = Field(default=None, description="") - processes: Optional[List[Process]] = Field(default=None, description="") # relationship + fivetran_connector_monthly_active_rows_paid: Optional[int] = Field( + default=None, description="" + ) + fivetran_connector_monthly_active_rows_total: Optional[int] = Field( + default=None, description="" + ) + fivetran_connector_monthly_active_rows_change_percentage_free: Optional[ + float + ] = Field(default=None, description="") + fivetran_connector_monthly_active_rows_change_percentage_paid: Optional[ + float + ] = Field(default=None, description="") + fivetran_connector_monthly_active_rows_change_percentage_total: Optional[ + float + ] = Field(default=None, description="") + fivetran_connector_monthly_active_rows_free_percentage_of_account: Optional[ + float + ] = Field(default=None, description="") + fivetran_connector_monthly_active_rows_paid_percentage_of_account: Optional[ + float + ] = Field(default=None, description="") + fivetran_connector_monthly_active_rows_total_percentage_of_account: Optional[ + float + ] = Field(default=None, description="") + fivetran_connector_total_tables_synced: Optional[int] = Field( + default=None, description="" + ) + fivetran_connector_top_tables_by_m_a_r: Optional[str] = Field( + default=None, description="" + ) + fivetran_connector_usage_cost: Optional[float] = Field( + default=None, description="" + ) + fivetran_connector_credits_used: Optional[float] = Field( + default=None, description="" + ) + processes: Optional[List[Process]] = Field( + default=None, description="" + ) # relationship attributes: FivetranConnector.Attributes = Field( default_factory=lambda: FivetranConnector.Attributes(), diff --git a/pyatlan/model/assets/core/folder.py b/pyatlan/model/assets/core/folder.py index f3204dbf9..e06aa1471 100644 --- a/pyatlan/model/assets/core/folder.py +++ b/pyatlan/model/assets/core/folder.py @@ -94,7 +94,9 @@ def __setattr__(self, name, value): @property def parent_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.parent_qualified_name + return ( + None if self.attributes is None else self.attributes.parent_qualified_name + ) @parent_qualified_name.setter def parent_qualified_name(self, parent_qualified_name: Optional[str]): @@ -104,7 +106,11 @@ def parent_qualified_name(self, parent_qualified_name: Optional[str]): @property def collection_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.collection_qualified_name + return ( + None + if self.attributes is None + else self.attributes.collection_qualified_name + ) @collection_qualified_name.setter def collection_qualified_name(self, collection_qualified_name: Optional[str]): @@ -125,7 +131,9 @@ def parent(self, parent: Optional[Namespace]): class Attributes(Namespace.Attributes): parent_qualified_name: Optional[str] = Field(default=None, description="") collection_qualified_name: Optional[str] = Field(default=None, description="") - parent: Optional[Namespace] = Field(default=None, description="") # relationship + parent: Optional[Namespace] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -148,13 +156,17 @@ def creator( if not parent_folder_qualified_name: qualified_name = f"{collection_qualified_name}/{name}" parent_qn = collection_qualified_name - parent = Collection.ref_by_qualified_name(collection_qualified_name or "") + parent = Collection.ref_by_qualified_name( + collection_qualified_name or "" + ) else: tokens = parent_folder_qualified_name.split("/") if len(tokens) < 4: raise ValueError("Invalid collection_qualified_name") - collection_qualified_name = f"{tokens[0]}/{tokens[1]}/{tokens[2]}/{tokens[3]}" + collection_qualified_name = ( + f"{tokens[0]}/{tokens[1]}/{tokens[2]}/{tokens[3]}" + ) qualified_name = f"{parent_folder_qualified_name}/{name}" parent_qn = parent_folder_qualified_name parent = Folder.ref_by_qualified_name(parent_folder_qualified_name) # type: ignore[assignment] diff --git a/pyatlan/model/assets/core/function.py b/pyatlan/model/assets/core/function.py index 9a0e2dc48..8a3f4d8be 100644 --- a/pyatlan/model/assets/core/function.py +++ b/pyatlan/model/assets/core/function.py @@ -34,19 +34,27 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - FUNCTION_DEFINITION: ClassVar[TextField] = TextField("functionDefinition", "functionDefinition") + FUNCTION_DEFINITION: ClassVar[TextField] = TextField( + "functionDefinition", "functionDefinition" + ) """ Code or set of statements that determine the output of the function. """ - FUNCTION_RETURN_TYPE: ClassVar[KeywordField] = KeywordField("functionReturnType", "functionReturnType") + FUNCTION_RETURN_TYPE: ClassVar[KeywordField] = KeywordField( + "functionReturnType", "functionReturnType" + ) """ Data type of the value returned by the function. """ - FUNCTION_ARGUMENTS: ClassVar[KeywordField] = KeywordField("functionArguments", "functionArguments") + FUNCTION_ARGUMENTS: ClassVar[KeywordField] = KeywordField( + "functionArguments", "functionArguments" + ) """ Arguments that are passed in to the function. """ - FUNCTION_LANGUAGE: ClassVar[KeywordField] = KeywordField("functionLanguage", "functionLanguage") + FUNCTION_LANGUAGE: ClassVar[KeywordField] = KeywordField( + "functionLanguage", "functionLanguage" + ) """ Programming language in which the function is written. """ @@ -54,19 +62,27 @@ def __setattr__(self, name, value): """ Type of function. """ - FUNCTION_IS_EXTERNAL: ClassVar[BooleanField] = BooleanField("functionIsExternal", "functionIsExternal") + FUNCTION_IS_EXTERNAL: ClassVar[BooleanField] = BooleanField( + "functionIsExternal", "functionIsExternal" + ) """ Whether the function is stored or executed externally (true) or internally (false). """ - FUNCTION_IS_DMF: ClassVar[BooleanField] = BooleanField("functionIsDMF", "functionIsDMF") + FUNCTION_IS_DMF: ClassVar[BooleanField] = BooleanField( + "functionIsDMF", "functionIsDMF" + ) """ Whether the function is a data metric function. """ - FUNCTION_IS_SECURE: ClassVar[BooleanField] = BooleanField("functionIsSecure", "functionIsSecure") + FUNCTION_IS_SECURE: ClassVar[BooleanField] = BooleanField( + "functionIsSecure", "functionIsSecure" + ) """ Whether sensitive information of the function is omitted for unauthorized users (true) or not (false). """ - FUNCTION_IS_MEMOIZABLE: ClassVar[BooleanField] = BooleanField("functionIsMemoizable", "functionIsMemoizable") + FUNCTION_IS_MEMOIZABLE: ClassVar[BooleanField] = BooleanField( + "functionIsMemoizable", "functionIsMemoizable" + ) """ Whether the function must re-compute if there are no underlying changes in the values (false) or not (true). """ @@ -171,7 +187,9 @@ def function_is_secure(self, function_is_secure: Optional[bool]): @property def function_is_memoizable(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.function_is_memoizable + return ( + None if self.attributes is None else self.attributes.function_is_memoizable + ) @function_is_memoizable.setter def function_is_memoizable(self, function_is_memoizable: Optional[bool]): @@ -199,7 +217,9 @@ class Attributes(SQL.Attributes): function_is_d_m_f: Optional[bool] = Field(default=None, description="") function_is_secure: Optional[bool] = Field(default=None, description="") function_is_memoizable: Optional[bool] = Field(default=None, description="") - function_schema: Optional[Schema] = Field(default=None, description="") # relationship + function_schema: Optional[Schema] = Field( + default=None, description="" + ) # relationship attributes: Function.Attributes = Field( default_factory=lambda: Function.Attributes(), diff --git a/pyatlan/model/assets/core/link.py b/pyatlan/model/assets/core/link.py index b5bdeb691..b2ade4ffb 100644 --- a/pyatlan/model/assets/core/link.py +++ b/pyatlan/model/assets/core/link.py @@ -22,14 +22,24 @@ class Link(Resource): @classmethod @init_guid - def creator(cls, *, asset: Asset, name: str, link: str, idempotent: bool = False) -> Link: - return Link(attributes=Link.Attributes.create(asset=asset, name=name, link=link, idempotent=idempotent)) + def creator( + cls, *, asset: Asset, name: str, link: str, idempotent: bool = False + ) -> Link: + return Link( + attributes=Link.Attributes.create( + asset=asset, name=name, link=link, idempotent=idempotent + ) + ) @classmethod @init_guid - def create(cls, *, asset: Asset, name: str, link: str, idempotent: bool = False) -> Link: + def create( + cls, *, asset: Asset, name: str, link: str, idempotent: bool = False + ) -> Link: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -105,7 +115,9 @@ class Attributes(Resource.Attributes): @classmethod @init_guid - def create(cls, *, asset: Asset, name: str, link: str, idempotent: bool) -> Link.Attributes: + def create( + cls, *, asset: Asset, name: str, link: str, idempotent: bool + ) -> Link.Attributes: validate_required_fields(["asset", "name", "link"], [asset, name, link]) qn = f"{asset.qualified_name}/{name}" if idempotent else str(uuid.uuid4()) return Link.Attributes( diff --git a/pyatlan/model/assets/core/m_c_incident.py b/pyatlan/model/assets/core/m_c_incident.py index f69b44368..39d98f04b 100644 --- a/pyatlan/model/assets/core/m_c_incident.py +++ b/pyatlan/model/assets/core/m_c_incident.py @@ -29,31 +29,45 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MC_INCIDENT_ID: ClassVar[KeywordField] = KeywordField("mcIncidentId", "mcIncidentId") + MC_INCIDENT_ID: ClassVar[KeywordField] = KeywordField( + "mcIncidentId", "mcIncidentId" + ) """ Identifier of this incident, from Monte Carlo. """ - MC_INCIDENT_TYPE: ClassVar[KeywordField] = KeywordField("mcIncidentType", "mcIncidentType") + MC_INCIDENT_TYPE: ClassVar[KeywordField] = KeywordField( + "mcIncidentType", "mcIncidentType" + ) """ Type of this incident. """ - MC_INCIDENT_SUB_TYPES: ClassVar[KeywordField] = KeywordField("mcIncidentSubTypes", "mcIncidentSubTypes") + MC_INCIDENT_SUB_TYPES: ClassVar[KeywordField] = KeywordField( + "mcIncidentSubTypes", "mcIncidentSubTypes" + ) """ Subtypes of this incident. """ - MC_INCIDENT_SEVERITY: ClassVar[KeywordField] = KeywordField("mcIncidentSeverity", "mcIncidentSeverity") + MC_INCIDENT_SEVERITY: ClassVar[KeywordField] = KeywordField( + "mcIncidentSeverity", "mcIncidentSeverity" + ) """ Severity of this incident. """ - MC_INCIDENT_PRIORITY: ClassVar[KeywordField] = KeywordField("mcIncidentPriority", "mcIncidentPriority") + MC_INCIDENT_PRIORITY: ClassVar[KeywordField] = KeywordField( + "mcIncidentPriority", "mcIncidentPriority" + ) """ Priority of this incident inherited from monitor. """ - MC_INCIDENT_STATE: ClassVar[KeywordField] = KeywordField("mcIncidentState", "mcIncidentState") + MC_INCIDENT_STATE: ClassVar[KeywordField] = KeywordField( + "mcIncidentState", "mcIncidentState" + ) """ State of this incident. """ - MC_INCIDENT_WAREHOUSE: ClassVar[KeywordField] = KeywordField("mcIncidentWarehouse", "mcIncidentWarehouse") + MC_INCIDENT_WAREHOUSE: ClassVar[KeywordField] = KeywordField( + "mcIncidentWarehouse", "mcIncidentWarehouse" + ) """ Name of this incident's warehouse. """ @@ -101,7 +115,9 @@ def mc_incident_type(self, mc_incident_type: Optional[str]): @property def mc_incident_sub_types(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.mc_incident_sub_types + return ( + None if self.attributes is None else self.attributes.mc_incident_sub_types + ) @mc_incident_sub_types.setter def mc_incident_sub_types(self, mc_incident_sub_types: Optional[Set[str]]): @@ -141,7 +157,9 @@ def mc_incident_state(self, mc_incident_state: Optional[str]): @property def mc_incident_warehouse(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mc_incident_warehouse + return ( + None if self.attributes is None else self.attributes.mc_incident_warehouse + ) @mc_incident_warehouse.setter def mc_incident_warehouse(self, mc_incident_warehouse: Optional[str]): @@ -177,8 +195,12 @@ class Attributes(MonteCarlo.Attributes): mc_incident_priority: Optional[str] = Field(default=None, description="") mc_incident_state: Optional[str] = Field(default=None, description="") mc_incident_warehouse: Optional[str] = Field(default=None, description="") - mc_monitor: Optional[MCMonitor] = Field(default=None, description="") # relationship - mc_incident_assets: Optional[List[Asset]] = Field(default=None, description="") # relationship + mc_monitor: Optional[MCMonitor] = Field( + default=None, description="" + ) # relationship + mc_incident_assets: Optional[List[Asset]] = Field( + default=None, description="" + ) # relationship attributes: MCIncident.Attributes = Field( default_factory=lambda: MCIncident.Attributes(), diff --git a/pyatlan/model/assets/core/m_c_monitor.py b/pyatlan/model/assets/core/m_c_monitor.py index c3655ae47..d12bfe509 100644 --- a/pyatlan/model/assets/core/m_c_monitor.py +++ b/pyatlan/model/assets/core/m_c_monitor.py @@ -42,19 +42,27 @@ def __setattr__(self, name, value): """ Unique identifier for this monitor, from Monte Carlo. """ - MC_MONITOR_STATUS: ClassVar[KeywordField] = KeywordField("mcMonitorStatus", "mcMonitorStatus") + MC_MONITOR_STATUS: ClassVar[KeywordField] = KeywordField( + "mcMonitorStatus", "mcMonitorStatus" + ) """ Status of this monitor. """ - MC_MONITOR_TYPE: ClassVar[KeywordField] = KeywordField("mcMonitorType", "mcMonitorType") + MC_MONITOR_TYPE: ClassVar[KeywordField] = KeywordField( + "mcMonitorType", "mcMonitorType" + ) """ Type of this monitor, for example: field health (stats) or dimension tracking (categories). """ - MC_MONITOR_WAREHOUSE: ClassVar[KeywordField] = KeywordField("mcMonitorWarehouse", "mcMonitorWarehouse") + MC_MONITOR_WAREHOUSE: ClassVar[KeywordField] = KeywordField( + "mcMonitorWarehouse", "mcMonitorWarehouse" + ) """ Name of the warehouse for this monitor. """ - MC_MONITOR_SCHEDULE_TYPE: ClassVar[KeywordField] = KeywordField("mcMonitorScheduleType", "mcMonitorScheduleType") + MC_MONITOR_SCHEDULE_TYPE: ClassVar[KeywordField] = KeywordField( + "mcMonitorScheduleType", "mcMonitorScheduleType" + ) """ Type of schedule for this monitor, for example: fixed or dynamic. """ @@ -64,11 +72,15 @@ def __setattr__(self, name, value): """ Namespace of this monitor. """ - MC_MONITOR_RULE_TYPE: ClassVar[KeywordField] = KeywordField("mcMonitorRuleType", "mcMonitorRuleType") + MC_MONITOR_RULE_TYPE: ClassVar[KeywordField] = KeywordField( + "mcMonitorRuleType", "mcMonitorRuleType" + ) """ Type of rule for this monitor. """ - MC_MONITOR_RULE_CUSTOM_SQL: ClassVar[TextField] = TextField("mcMonitorRuleCustomSql", "mcMonitorRuleCustomSql") + MC_MONITOR_RULE_CUSTOM_SQL: ClassVar[TextField] = TextField( + "mcMonitorRuleCustomSql", "mcMonitorRuleCustomSql" + ) """ SQL code for custom SQL rules. """ @@ -84,7 +96,9 @@ def __setattr__(self, name, value): """ Readable description of the schedule for the rule. """ - MC_MONITOR_ALERT_CONDITION: ClassVar[TextField] = TextField("mcMonitorAlertCondition", "mcMonitorAlertCondition") + MC_MONITOR_ALERT_CONDITION: ClassVar[TextField] = TextField( + "mcMonitorAlertCondition", "mcMonitorAlertCondition" + ) """ Condition on which the monitor produces an alert. """ @@ -112,23 +126,33 @@ def __setattr__(self, name, value): """ Whether the rule is currently snoozed (true) or not (false). """ - MC_MONITOR_BREACH_RATE: ClassVar[NumericField] = NumericField("mcMonitorBreachRate", "mcMonitorBreachRate") + MC_MONITOR_BREACH_RATE: ClassVar[NumericField] = NumericField( + "mcMonitorBreachRate", "mcMonitorBreachRate" + ) """ Rate at which this monitor is breached. """ - MC_MONITOR_INCIDENT_COUNT: ClassVar[NumericField] = NumericField("mcMonitorIncidentCount", "mcMonitorIncidentCount") + MC_MONITOR_INCIDENT_COUNT: ClassVar[NumericField] = NumericField( + "mcMonitorIncidentCount", "mcMonitorIncidentCount" + ) """ Number of incidents associated with this monitor. """ - MC_MONITOR_ALERT_COUNT: ClassVar[NumericField] = NumericField("mcMonitorAlertCount", "mcMonitorAlertCount") + MC_MONITOR_ALERT_COUNT: ClassVar[NumericField] = NumericField( + "mcMonitorAlertCount", "mcMonitorAlertCount" + ) """ Number of alerts associated with this monitor. """ - MC_MONITOR_PRIORITY: ClassVar[KeywordField] = KeywordField("mcMonitorPriority", "mcMonitorPriority") + MC_MONITOR_PRIORITY: ClassVar[KeywordField] = KeywordField( + "mcMonitorPriority", "mcMonitorPriority" + ) """ Priority of this monitor. """ - MC_MONITOR_IS_OOTB: ClassVar[BooleanField] = BooleanField("mcMonitorIsOotb", "mcMonitorIsOotb") + MC_MONITOR_IS_OOTB: ClassVar[BooleanField] = BooleanField( + "mcMonitorIsOotb", "mcMonitorIsOotb" + ) """ Whether the monitor is OOTB or not """ @@ -204,7 +228,11 @@ def mc_monitor_warehouse(self, mc_monitor_warehouse: Optional[str]): @property def mc_monitor_schedule_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mc_monitor_schedule_type + return ( + None + if self.attributes is None + else self.attributes.mc_monitor_schedule_type + ) @mc_monitor_schedule_type.setter def mc_monitor_schedule_type(self, mc_monitor_schedule_type: Optional[str]): @@ -234,7 +262,11 @@ def mc_monitor_rule_type(self, mc_monitor_rule_type: Optional[str]): @property def mc_monitor_rule_custom_sql(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mc_monitor_rule_custom_sql + return ( + None + if self.attributes is None + else self.attributes.mc_monitor_rule_custom_sql + ) @mc_monitor_rule_custom_sql.setter def mc_monitor_rule_custom_sql(self, mc_monitor_rule_custom_sql: Optional[str]): @@ -244,27 +276,47 @@ def mc_monitor_rule_custom_sql(self, mc_monitor_rule_custom_sql: Optional[str]): @property def mc_monitor_rule_schedule_config(self) -> Optional[MCRuleSchedule]: - return None if self.attributes is None else self.attributes.mc_monitor_rule_schedule_config + return ( + None + if self.attributes is None + else self.attributes.mc_monitor_rule_schedule_config + ) @mc_monitor_rule_schedule_config.setter - def mc_monitor_rule_schedule_config(self, mc_monitor_rule_schedule_config: Optional[MCRuleSchedule]): + def mc_monitor_rule_schedule_config( + self, mc_monitor_rule_schedule_config: Optional[MCRuleSchedule] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mc_monitor_rule_schedule_config = mc_monitor_rule_schedule_config + self.attributes.mc_monitor_rule_schedule_config = ( + mc_monitor_rule_schedule_config + ) @property def mc_monitor_rule_schedule_config_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mc_monitor_rule_schedule_config_humanized + return ( + None + if self.attributes is None + else self.attributes.mc_monitor_rule_schedule_config_humanized + ) @mc_monitor_rule_schedule_config_humanized.setter - def mc_monitor_rule_schedule_config_humanized(self, mc_monitor_rule_schedule_config_humanized: Optional[str]): + def mc_monitor_rule_schedule_config_humanized( + self, mc_monitor_rule_schedule_config_humanized: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mc_monitor_rule_schedule_config_humanized = mc_monitor_rule_schedule_config_humanized + self.attributes.mc_monitor_rule_schedule_config_humanized = ( + mc_monitor_rule_schedule_config_humanized + ) @property def mc_monitor_alert_condition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mc_monitor_alert_condition + return ( + None + if self.attributes is None + else self.attributes.mc_monitor_alert_condition + ) @mc_monitor_alert_condition.setter def mc_monitor_alert_condition(self, mc_monitor_alert_condition: Optional[str]): @@ -274,37 +326,63 @@ def mc_monitor_alert_condition(self, mc_monitor_alert_condition: Optional[str]): @property def mc_monitor_rule_next_execution_time(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.mc_monitor_rule_next_execution_time + return ( + None + if self.attributes is None + else self.attributes.mc_monitor_rule_next_execution_time + ) @mc_monitor_rule_next_execution_time.setter - def mc_monitor_rule_next_execution_time(self, mc_monitor_rule_next_execution_time: Optional[datetime]): + def mc_monitor_rule_next_execution_time( + self, mc_monitor_rule_next_execution_time: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mc_monitor_rule_next_execution_time = mc_monitor_rule_next_execution_time + self.attributes.mc_monitor_rule_next_execution_time = ( + mc_monitor_rule_next_execution_time + ) @property def mc_monitor_rule_previous_execution_time(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.mc_monitor_rule_previous_execution_time + return ( + None + if self.attributes is None + else self.attributes.mc_monitor_rule_previous_execution_time + ) @mc_monitor_rule_previous_execution_time.setter - def mc_monitor_rule_previous_execution_time(self, mc_monitor_rule_previous_execution_time: Optional[datetime]): + def mc_monitor_rule_previous_execution_time( + self, mc_monitor_rule_previous_execution_time: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mc_monitor_rule_previous_execution_time = mc_monitor_rule_previous_execution_time + self.attributes.mc_monitor_rule_previous_execution_time = ( + mc_monitor_rule_previous_execution_time + ) @property def mc_monitor_rule_comparisons(self) -> Optional[List[MCRuleComparison]]: - return None if self.attributes is None else self.attributes.mc_monitor_rule_comparisons + return ( + None + if self.attributes is None + else self.attributes.mc_monitor_rule_comparisons + ) @mc_monitor_rule_comparisons.setter - def mc_monitor_rule_comparisons(self, mc_monitor_rule_comparisons: Optional[List[MCRuleComparison]]): + def mc_monitor_rule_comparisons( + self, mc_monitor_rule_comparisons: Optional[List[MCRuleComparison]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mc_monitor_rule_comparisons = mc_monitor_rule_comparisons @property def mc_monitor_rule_is_snoozed(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.mc_monitor_rule_is_snoozed + return ( + None + if self.attributes is None + else self.attributes.mc_monitor_rule_is_snoozed + ) @mc_monitor_rule_is_snoozed.setter def mc_monitor_rule_is_snoozed(self, mc_monitor_rule_is_snoozed: Optional[bool]): @@ -314,7 +392,9 @@ def mc_monitor_rule_is_snoozed(self, mc_monitor_rule_is_snoozed: Optional[bool]) @property def mc_monitor_breach_rate(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.mc_monitor_breach_rate + return ( + None if self.attributes is None else self.attributes.mc_monitor_breach_rate + ) @mc_monitor_breach_rate.setter def mc_monitor_breach_rate(self, mc_monitor_breach_rate: Optional[float]): @@ -324,7 +404,11 @@ def mc_monitor_breach_rate(self, mc_monitor_breach_rate: Optional[float]): @property def mc_monitor_incident_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mc_monitor_incident_count + return ( + None + if self.attributes is None + else self.attributes.mc_monitor_incident_count + ) @mc_monitor_incident_count.setter def mc_monitor_incident_count(self, mc_monitor_incident_count: Optional[int]): @@ -334,7 +418,9 @@ def mc_monitor_incident_count(self, mc_monitor_incident_count: Optional[int]): @property def mc_monitor_alert_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mc_monitor_alert_count + return ( + None if self.attributes is None else self.attributes.mc_monitor_alert_count + ) @mc_monitor_alert_count.setter def mc_monitor_alert_count(self, mc_monitor_alert_count: Optional[int]): @@ -381,19 +467,31 @@ class Attributes(MonteCarlo.Attributes): mc_monitor_namespace: Optional[str] = Field(default=None, description="") mc_monitor_rule_type: Optional[str] = Field(default=None, description="") mc_monitor_rule_custom_sql: Optional[str] = Field(default=None, description="") - mc_monitor_rule_schedule_config: Optional[MCRuleSchedule] = Field(default=None, description="") - mc_monitor_rule_schedule_config_humanized: Optional[str] = Field(default=None, description="") + mc_monitor_rule_schedule_config: Optional[MCRuleSchedule] = Field( + default=None, description="" + ) + mc_monitor_rule_schedule_config_humanized: Optional[str] = Field( + default=None, description="" + ) mc_monitor_alert_condition: Optional[str] = Field(default=None, description="") - mc_monitor_rule_next_execution_time: Optional[datetime] = Field(default=None, description="") - mc_monitor_rule_previous_execution_time: Optional[datetime] = Field(default=None, description="") - mc_monitor_rule_comparisons: Optional[List[MCRuleComparison]] = Field(default=None, description="") + mc_monitor_rule_next_execution_time: Optional[datetime] = Field( + default=None, description="" + ) + mc_monitor_rule_previous_execution_time: Optional[datetime] = Field( + default=None, description="" + ) + mc_monitor_rule_comparisons: Optional[List[MCRuleComparison]] = Field( + default=None, description="" + ) mc_monitor_rule_is_snoozed: Optional[bool] = Field(default=None, description="") mc_monitor_breach_rate: Optional[float] = Field(default=None, description="") mc_monitor_incident_count: Optional[int] = Field(default=None, description="") mc_monitor_alert_count: Optional[int] = Field(default=None, description="") mc_monitor_priority: Optional[str] = Field(default=None, description="") mc_monitor_is_ootb: Optional[bool] = Field(default=None, description="") - mc_monitor_assets: Optional[List[Asset]] = Field(default=None, description="") # relationship + mc_monitor_assets: Optional[List[Asset]] = Field( + default=None, description="" + ) # relationship attributes: MCMonitor.Attributes = Field( default_factory=lambda: MCMonitor.Attributes(), diff --git a/pyatlan/model/assets/core/materialised_view.py b/pyatlan/model/assets/core/materialised_view.py index 042ff4fc1..6b5370d3f 100644 --- a/pyatlan/model/assets/core/materialised_view.py +++ b/pyatlan/model/assets/core/materialised_view.py @@ -60,7 +60,9 @@ def creator( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> MaterialisedView: - validate_required_fields(["name", "schema_qualified_name"], [name, schema_qualified_name]) + validate_required_fields( + ["name", "schema_qualified_name"], [name, schema_qualified_name] + ) attributes = MaterialisedView.Attributes.create( name=name, schema_qualified_name=schema_qualified_name, @@ -75,7 +77,9 @@ def creator( @init_guid def create(cls, *, name: str, schema_qualified_name: str) -> MaterialisedView: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -96,7 +100,9 @@ def __setattr__(self, name, value): """ Refresh mode for this materialized view. """ - REFRESH_METHOD: ClassVar[KeywordField] = KeywordField("refreshMethod", "refreshMethod") + REFRESH_METHOD: ClassVar[KeywordField] = KeywordField( + "refreshMethod", "refreshMethod" + ) """ Refresh method for this materialized view. """ @@ -104,7 +110,9 @@ def __setattr__(self, name, value): """ Staleness of this materialized view. """ - STALE_SINCE_DATE: ClassVar[NumericField] = NumericField("staleSinceDate", "staleSinceDate") + STALE_SINCE_DATE: ClassVar[NumericField] = NumericField( + "staleSinceDate", "staleSinceDate" + ) """ Time (epoch) from which this materialized view is stale, in milliseconds. """ @@ -120,11 +128,15 @@ def __setattr__(self, name, value): """ Size of this materialized view, in bytes. """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( + "isQueryPreview", "isQueryPreview" + ) """ Whether it's possible to run a preview query on this materialized view (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( + "queryPreviewConfig", "queryPreviewConfig" + ) """ Configuration for the query preview of this materialized view. """ @@ -316,12 +328,18 @@ class Attributes(SQL.Attributes): row_count: Optional[int] = Field(default=None, description="") size_bytes: Optional[int] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") + query_preview_config: Optional[Dict[str, str]] = Field( + default=None, description="" + ) alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") definition: Optional[str] = Field(default=None, description="") - columns: Optional[List[Column]] = Field(default=None, description="") # relationship - atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship + columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship + atlan_schema: Optional[Schema] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -335,9 +353,13 @@ def create( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> MaterialisedView.Attributes: - validate_required_fields(["name, schema_qualified_name"], [name, schema_qualified_name]) + validate_required_fields( + ["name, schema_qualified_name"], [name, schema_qualified_name] + ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( schema_qualified_name, "schema_qualified_name", 5 @@ -348,7 +370,10 @@ def create( connection_qualified_name = connection_qualified_name or connection_qn database_name = database_name or fields[3] schema_name = schema_name or fields[4] - database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" + database_qualified_name = ( + database_qualified_name + or f"{connection_qualified_name}/{database_name}" + ) atlan_schema = Schema.ref_by_qualified_name(schema_qualified_name) return MaterialisedView.Attributes( diff --git a/pyatlan/model/assets/core/matillion.py b/pyatlan/model/assets/core/matillion.py index cc74ba4c0..f9056b485 100644 --- a/pyatlan/model/assets/core/matillion.py +++ b/pyatlan/model/assets/core/matillion.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MATILLION_VERSION: ClassVar[TextField] = TextField("matillionVersion", "matillionVersion") + MATILLION_VERSION: ClassVar[TextField] = TextField( + "matillionVersion", "matillionVersion" + ) """ Current point in time state of a project. """ diff --git a/pyatlan/model/assets/core/matillion_component.py b/pyatlan/model/assets/core/matillion_component.py index dfe9fcdcc..51c69fcd7 100644 --- a/pyatlan/model/assets/core/matillion_component.py +++ b/pyatlan/model/assets/core/matillion_component.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MATILLION_COMPONENT_ID: ClassVar[KeywordField] = KeywordField("matillionComponentId", "matillionComponentId") + MATILLION_COMPONENT_ID: ClassVar[KeywordField] = KeywordField( + "matillionComponentId", "matillionComponentId" + ) """ Unique identifier of the component in Matillion. """ @@ -62,7 +64,9 @@ def __setattr__(self, name, value): """ Last five run statuses of the component within a job. """ - MATILLION_COMPONENT_SQLS: ClassVar[TextField] = TextField("matillionComponentSqls", "matillionComponentSqls") + MATILLION_COMPONENT_SQLS: ClassVar[TextField] = TextField( + "matillionComponentSqls", "matillionComponentSqls" + ) """ SQL queries used by the component. """ @@ -105,7 +109,9 @@ def __setattr__(self, name, value): @property def matillion_component_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.matillion_component_id + return ( + None if self.attributes is None else self.attributes.matillion_component_id + ) @matillion_component_id.setter def matillion_component_id(self, matillion_component_id: Optional[str]): @@ -115,47 +121,81 @@ def matillion_component_id(self, matillion_component_id: Optional[str]): @property def matillion_component_implementation_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.matillion_component_implementation_id + return ( + None + if self.attributes is None + else self.attributes.matillion_component_implementation_id + ) @matillion_component_implementation_id.setter - def matillion_component_implementation_id(self, matillion_component_implementation_id: Optional[str]): + def matillion_component_implementation_id( + self, matillion_component_implementation_id: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.matillion_component_implementation_id = matillion_component_implementation_id + self.attributes.matillion_component_implementation_id = ( + matillion_component_implementation_id + ) @property def matillion_component_linked_job(self) -> Optional[Dict[str, str]]: - return None if self.attributes is None else self.attributes.matillion_component_linked_job + return ( + None + if self.attributes is None + else self.attributes.matillion_component_linked_job + ) @matillion_component_linked_job.setter - def matillion_component_linked_job(self, matillion_component_linked_job: Optional[Dict[str, str]]): + def matillion_component_linked_job( + self, matillion_component_linked_job: Optional[Dict[str, str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.matillion_component_linked_job = matillion_component_linked_job @property def matillion_component_last_run_status(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.matillion_component_last_run_status + return ( + None + if self.attributes is None + else self.attributes.matillion_component_last_run_status + ) @matillion_component_last_run_status.setter - def matillion_component_last_run_status(self, matillion_component_last_run_status: Optional[str]): + def matillion_component_last_run_status( + self, matillion_component_last_run_status: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.matillion_component_last_run_status = matillion_component_last_run_status + self.attributes.matillion_component_last_run_status = ( + matillion_component_last_run_status + ) @property def matillion_component_last_five_run_status(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.matillion_component_last_five_run_status + return ( + None + if self.attributes is None + else self.attributes.matillion_component_last_five_run_status + ) @matillion_component_last_five_run_status.setter - def matillion_component_last_five_run_status(self, matillion_component_last_five_run_status: Optional[str]): + def matillion_component_last_five_run_status( + self, matillion_component_last_five_run_status: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.matillion_component_last_five_run_status = matillion_component_last_five_run_status + self.attributes.matillion_component_last_five_run_status = ( + matillion_component_last_five_run_status + ) @property def matillion_component_sqls(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.matillion_component_sqls + return ( + None + if self.attributes is None + else self.attributes.matillion_component_sqls + ) @matillion_component_sqls.setter def matillion_component_sqls(self, matillion_component_sqls: Optional[Set[str]]): @@ -175,7 +215,11 @@ def matillion_job_name(self, matillion_job_name: Optional[str]): @property def matillion_job_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.matillion_job_qualified_name + return ( + None + if self.attributes is None + else self.attributes.matillion_job_qualified_name + ) @matillion_job_qualified_name.setter def matillion_job_qualified_name(self, matillion_job_qualified_name: Optional[str]): @@ -205,15 +249,31 @@ def matillion_process(self, matillion_process: Optional[Process]): class Attributes(Matillion.Attributes): matillion_component_id: Optional[str] = Field(default=None, description="") - matillion_component_implementation_id: Optional[str] = Field(default=None, description="") - matillion_component_linked_job: Optional[Dict[str, str]] = Field(default=None, description="") - matillion_component_last_run_status: Optional[str] = Field(default=None, description="") - matillion_component_last_five_run_status: Optional[str] = Field(default=None, description="") - matillion_component_sqls: Optional[Set[str]] = Field(default=None, description="") + matillion_component_implementation_id: Optional[str] = Field( + default=None, description="" + ) + matillion_component_linked_job: Optional[Dict[str, str]] = Field( + default=None, description="" + ) + matillion_component_last_run_status: Optional[str] = Field( + default=None, description="" + ) + matillion_component_last_five_run_status: Optional[str] = Field( + default=None, description="" + ) + matillion_component_sqls: Optional[Set[str]] = Field( + default=None, description="" + ) matillion_job_name: Optional[str] = Field(default=None, description="") - matillion_job_qualified_name: Optional[str] = Field(default=None, description="") - matillion_job: Optional[MatillionJob] = Field(default=None, description="") # relationship - matillion_process: Optional[Process] = Field(default=None, description="") # relationship + matillion_job_qualified_name: Optional[str] = Field( + default=None, description="" + ) + matillion_job: Optional[MatillionJob] = Field( + default=None, description="" + ) # relationship + matillion_process: Optional[Process] = Field( + default=None, description="" + ) # relationship attributes: MatillionComponent.Attributes = Field( default_factory=lambda: MatillionComponent.Attributes(), diff --git a/pyatlan/model/assets/core/matillion_group.py b/pyatlan/model/assets/core/matillion_group.py index 70db12d04..b778095c6 100644 --- a/pyatlan/model/assets/core/matillion_group.py +++ b/pyatlan/model/assets/core/matillion_group.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MATILLION_PROJECT_COUNT: ClassVar[NumericField] = NumericField("matillionProjectCount", "matillionProjectCount") + MATILLION_PROJECT_COUNT: ClassVar[NumericField] = NumericField( + "matillionProjectCount", "matillionProjectCount" + ) """ Number of projects within the group. """ @@ -46,7 +48,9 @@ def __setattr__(self, name, value): @property def matillion_project_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.matillion_project_count + return ( + None if self.attributes is None else self.attributes.matillion_project_count + ) @matillion_project_count.setter def matillion_project_count(self, matillion_project_count: Optional[int]): @@ -66,7 +70,9 @@ def matillion_projects(self, matillion_projects: Optional[List[MatillionProject] class Attributes(Matillion.Attributes): matillion_project_count: Optional[int] = Field(default=None, description="") - matillion_projects: Optional[List[MatillionProject]] = Field(default=None, description="") # relationship + matillion_projects: Optional[List[MatillionProject]] = Field( + default=None, description="" + ) # relationship attributes: MatillionGroup.Attributes = Field( default_factory=lambda: MatillionGroup.Attributes(), diff --git a/pyatlan/model/assets/core/matillion_job.py b/pyatlan/model/assets/core/matillion_job.py index aa4d90ba6..53aca4d1d 100644 --- a/pyatlan/model/assets/core/matillion_job.py +++ b/pyatlan/model/assets/core/matillion_job.py @@ -35,7 +35,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MATILLION_JOB_TYPE: ClassVar[KeywordField] = KeywordField("matillionJobType", "matillionJobType") + MATILLION_JOB_TYPE: ClassVar[KeywordField] = KeywordField( + "matillionJobType", "matillionJobType" + ) """ Type of the job, for example: orchestration or transformation. """ @@ -51,7 +53,9 @@ def __setattr__(self, name, value): """ Number of components within the job. """ - MATILLION_JOB_SCHEDULE: ClassVar[KeywordField] = KeywordField("matillionJobSchedule", "matillionJobSchedule") + MATILLION_JOB_SCHEDULE: ClassVar[KeywordField] = KeywordField( + "matillionJobSchedule", "matillionJobSchedule" + ) """ How the job is scheduled, for example: weekly or monthly. """ @@ -112,17 +116,25 @@ def matillion_job_path(self, matillion_job_path: Optional[str]): @property def matillion_job_component_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.matillion_job_component_count + return ( + None + if self.attributes is None + else self.attributes.matillion_job_component_count + ) @matillion_job_component_count.setter - def matillion_job_component_count(self, matillion_job_component_count: Optional[int]): + def matillion_job_component_count( + self, matillion_job_component_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.matillion_job_component_count = matillion_job_component_count @property def matillion_job_schedule(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.matillion_job_schedule + return ( + None if self.attributes is None else self.attributes.matillion_job_schedule + ) @matillion_job_schedule.setter def matillion_job_schedule(self, matillion_job_schedule: Optional[str]): @@ -132,7 +144,9 @@ def matillion_job_schedule(self, matillion_job_schedule: Optional[str]): @property def matillion_project_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.matillion_project_name + return ( + None if self.attributes is None else self.attributes.matillion_project_name + ) @matillion_project_name.setter def matillion_project_name(self, matillion_project_name: Optional[str]): @@ -142,13 +156,21 @@ def matillion_project_name(self, matillion_project_name: Optional[str]): @property def matillion_project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.matillion_project_qualified_name + return ( + None + if self.attributes is None + else self.attributes.matillion_project_qualified_name + ) @matillion_project_qualified_name.setter - def matillion_project_qualified_name(self, matillion_project_qualified_name: Optional[str]): + def matillion_project_qualified_name( + self, matillion_project_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.matillion_project_qualified_name = matillion_project_qualified_name + self.attributes.matillion_project_qualified_name = ( + matillion_project_qualified_name + ) @property def matillion_project(self) -> Optional[MatillionProject]: @@ -165,20 +187,32 @@ def matillion_components(self) -> Optional[List[MatillionComponent]]: return None if self.attributes is None else self.attributes.matillion_components @matillion_components.setter - def matillion_components(self, matillion_components: Optional[List[MatillionComponent]]): + def matillion_components( + self, matillion_components: Optional[List[MatillionComponent]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.matillion_components = matillion_components class Attributes(Matillion.Attributes): - matillion_job_type: Optional[MatillionJobType] = Field(default=None, description="") + matillion_job_type: Optional[MatillionJobType] = Field( + default=None, description="" + ) matillion_job_path: Optional[str] = Field(default=None, description="") - matillion_job_component_count: Optional[int] = Field(default=None, description="") + matillion_job_component_count: Optional[int] = Field( + default=None, description="" + ) matillion_job_schedule: Optional[str] = Field(default=None, description="") matillion_project_name: Optional[str] = Field(default=None, description="") - matillion_project_qualified_name: Optional[str] = Field(default=None, description="") - matillion_project: Optional[MatillionProject] = Field(default=None, description="") # relationship - matillion_components: Optional[List[MatillionComponent]] = Field(default=None, description="") # relationship + matillion_project_qualified_name: Optional[str] = Field( + default=None, description="" + ) + matillion_project: Optional[MatillionProject] = Field( + default=None, description="" + ) # relationship + matillion_components: Optional[List[MatillionComponent]] = Field( + default=None, description="" + ) # relationship attributes: MatillionJob.Attributes = Field( default_factory=lambda: MatillionJob.Attributes(), diff --git a/pyatlan/model/assets/core/matillion_project.py b/pyatlan/model/assets/core/matillion_project.py index 2d87f5f77..ca6d9e345 100644 --- a/pyatlan/model/assets/core/matillion_project.py +++ b/pyatlan/model/assets/core/matillion_project.py @@ -34,11 +34,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MATILLION_VERSIONS: ClassVar[TextField] = TextField("matillionVersions", "matillionVersions") + MATILLION_VERSIONS: ClassVar[TextField] = TextField( + "matillionVersions", "matillionVersions" + ) """ List of versions in the project. """ - MATILLION_ENVIRONMENTS: ClassVar[TextField] = TextField("matillionEnvironments", "matillionEnvironments") + MATILLION_ENVIRONMENTS: ClassVar[TextField] = TextField( + "matillionEnvironments", "matillionEnvironments" + ) """ List of environments in the project. """ @@ -94,7 +98,9 @@ def matillion_versions(self, matillion_versions: Optional[Set[str]]): @property def matillion_environments(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.matillion_environments + return ( + None if self.attributes is None else self.attributes.matillion_environments + ) @matillion_environments.setter def matillion_environments(self, matillion_environments: Optional[Set[str]]): @@ -104,7 +110,11 @@ def matillion_environments(self, matillion_environments: Optional[Set[str]]): @property def matillion_project_job_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.matillion_project_job_count + return ( + None + if self.attributes is None + else self.attributes.matillion_project_job_count + ) @matillion_project_job_count.setter def matillion_project_job_count(self, matillion_project_job_count: Optional[int]): @@ -124,10 +134,16 @@ def matillion_group_name(self, matillion_group_name: Optional[str]): @property def matillion_group_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.matillion_group_qualified_name + return ( + None + if self.attributes is None + else self.attributes.matillion_group_qualified_name + ) @matillion_group_qualified_name.setter - def matillion_group_qualified_name(self, matillion_group_qualified_name: Optional[str]): + def matillion_group_qualified_name( + self, matillion_group_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.matillion_group_qualified_name = matillion_group_qualified_name @@ -157,9 +173,15 @@ class Attributes(Matillion.Attributes): matillion_environments: Optional[Set[str]] = Field(default=None, description="") matillion_project_job_count: Optional[int] = Field(default=None, description="") matillion_group_name: Optional[str] = Field(default=None, description="") - matillion_group_qualified_name: Optional[str] = Field(default=None, description="") - matillion_jobs: Optional[List[MatillionJob]] = Field(default=None, description="") # relationship - matillion_group: Optional[MatillionGroup] = Field(default=None, description="") # relationship + matillion_group_qualified_name: Optional[str] = Field( + default=None, description="" + ) + matillion_jobs: Optional[List[MatillionJob]] = Field( + default=None, description="" + ) # relationship + matillion_group: Optional[MatillionGroup] = Field( + default=None, description="" + ) # relationship attributes: MatillionProject.Attributes = Field( default_factory=lambda: MatillionProject.Attributes(), diff --git a/pyatlan/model/assets/core/metric.py b/pyatlan/model/assets/core/metric.py index 8a7d964f1..337c6f134 100644 --- a/pyatlan/model/assets/core/metric.py +++ b/pyatlan/model/assets/core/metric.py @@ -41,12 +41,16 @@ def __setattr__(self, name, value): """ Filters to be applied to the metric query. """ - METRIC_TIME_GRAINS: ClassVar[TextField] = TextField("metricTimeGrains", "metricTimeGrains") + METRIC_TIME_GRAINS: ClassVar[TextField] = TextField( + "metricTimeGrains", "metricTimeGrains" + ) """ List of time grains to be applied to the metric query. """ - METRIC_TIMESTAMP_COLUMN: ClassVar[RelationField] = RelationField("metricTimestampColumn") + METRIC_TIMESTAMP_COLUMN: ClassVar[RelationField] = RelationField( + "metricTimestampColumn" + ) """ TBC """ @@ -54,7 +58,9 @@ def __setattr__(self, name, value): """ TBC """ - METRIC_DIMENSION_COLUMNS: ClassVar[RelationField] = RelationField("metricDimensionColumns") + METRIC_DIMENSION_COLUMNS: ClassVar[RelationField] = RelationField( + "metricDimensionColumns" + ) """ TBC """ @@ -111,7 +117,9 @@ def metric_time_grains(self, metric_time_grains: Optional[Set[str]]): @property def metric_timestamp_column(self) -> Optional[Column]: - return None if self.attributes is None else self.attributes.metric_timestamp_column + return ( + None if self.attributes is None else self.attributes.metric_timestamp_column + ) @metric_timestamp_column.setter def metric_timestamp_column(self, metric_timestamp_column: Optional[Column]): @@ -131,10 +139,16 @@ def assets(self, assets: Optional[List[Asset]]): @property def metric_dimension_columns(self) -> Optional[List[Column]]: - return None if self.attributes is None else self.attributes.metric_dimension_columns + return ( + None + if self.attributes is None + else self.attributes.metric_dimension_columns + ) @metric_dimension_columns.setter - def metric_dimension_columns(self, metric_dimension_columns: Optional[List[Column]]): + def metric_dimension_columns( + self, metric_dimension_columns: Optional[List[Column]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.metric_dimension_columns = metric_dimension_columns @@ -144,9 +158,15 @@ class Attributes(DataQuality.Attributes): metric_s_q_l: Optional[str] = Field(default=None, description="") metric_filters: Optional[str] = Field(default=None, description="") metric_time_grains: Optional[Set[str]] = Field(default=None, description="") - metric_timestamp_column: Optional[Column] = Field(default=None, description="") # relationship - assets: Optional[List[Asset]] = Field(default=None, description="") # relationship - metric_dimension_columns: Optional[List[Column]] = Field(default=None, description="") # relationship + metric_timestamp_column: Optional[Column] = Field( + default=None, description="" + ) # relationship + assets: Optional[List[Asset]] = Field( + default=None, description="" + ) # relationship + metric_dimension_columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship attributes: Metric.Attributes = Field( default_factory=lambda: Metric.Attributes(), diff --git a/pyatlan/model/assets/core/model.py b/pyatlan/model/assets/core/model.py index 32c3ef54d..083c395ab 100644 --- a/pyatlan/model/assets/core/model.py +++ b/pyatlan/model/assets/core/model.py @@ -34,15 +34,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODEL_NAME: ClassVar[KeywordTextField] = KeywordTextField("modelName", "modelName.keyword", "modelName") + MODEL_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "modelName", "modelName.keyword", "modelName" + ) """ Simple name of the model in which this asset exists, or empty if it is itself a data model. """ - MODEL_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("modelQualifiedName", "modelQualifiedName") + MODEL_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "modelQualifiedName", "modelQualifiedName" + ) """ Unique name of the model in which this asset exists, or empty if it is itself a data model. """ - MODEL_DOMAIN: ClassVar[KeywordTextField] = KeywordTextField("modelDomain", "modelDomain.keyword", "modelDomain") + MODEL_DOMAIN: ClassVar[KeywordTextField] = KeywordTextField( + "modelDomain", "modelDomain.keyword", "modelDomain" + ) """ Model domain in which this asset exists. """ @@ -86,11 +92,15 @@ def __setattr__(self, name, value): """ Type of the model asset (conceptual, logical, physical). """ - MODEL_SYSTEM_DATE: ClassVar[NumericField] = NumericField("modelSystemDate", "modelSystemDate") + MODEL_SYSTEM_DATE: ClassVar[NumericField] = NumericField( + "modelSystemDate", "modelSystemDate" + ) """ System date for the asset. """ - MODEL_BUSINESS_DATE: ClassVar[NumericField] = NumericField("modelBusinessDate", "modelBusinessDate") + MODEL_BUSINESS_DATE: ClassVar[NumericField] = NumericField( + "modelBusinessDate", "modelBusinessDate" + ) """ Business date for the asset. """ @@ -176,17 +186,29 @@ def model_version_name(self, model_version_name: Optional[str]): @property def model_version_agnostic_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_version_agnostic_qualified_name + return ( + None + if self.attributes is None + else self.attributes.model_version_agnostic_qualified_name + ) @model_version_agnostic_qualified_name.setter - def model_version_agnostic_qualified_name(self, model_version_agnostic_qualified_name: Optional[str]): + def model_version_agnostic_qualified_name( + self, model_version_agnostic_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_version_agnostic_qualified_name = model_version_agnostic_qualified_name + self.attributes.model_version_agnostic_qualified_name = ( + model_version_agnostic_qualified_name + ) @property def model_version_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_version_qualified_name + return ( + None + if self.attributes is None + else self.attributes.model_version_qualified_name + ) @model_version_qualified_name.setter def model_version_qualified_name(self, model_version_qualified_name: Optional[str]): @@ -206,7 +228,11 @@ def model_entity_name(self, model_entity_name: Optional[str]): @property def model_entity_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_entity_qualified_name + return ( + None + if self.attributes is None + else self.attributes.model_entity_qualified_name + ) @model_entity_qualified_name.setter def model_entity_qualified_name(self, model_entity_qualified_name: Optional[str]): @@ -246,20 +272,32 @@ def model_business_date(self, model_business_date: Optional[datetime]): @property def model_expired_at_system_date(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.model_expired_at_system_date + return ( + None + if self.attributes is None + else self.attributes.model_expired_at_system_date + ) @model_expired_at_system_date.setter - def model_expired_at_system_date(self, model_expired_at_system_date: Optional[datetime]): + def model_expired_at_system_date( + self, model_expired_at_system_date: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_expired_at_system_date = model_expired_at_system_date @property def model_expired_at_business_date(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.model_expired_at_business_date + return ( + None + if self.attributes is None + else self.attributes.model_expired_at_business_date + ) @model_expired_at_business_date.setter - def model_expired_at_business_date(self, model_expired_at_business_date: Optional[datetime]): + def model_expired_at_business_date( + self, model_expired_at_business_date: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_expired_at_business_date = model_expired_at_business_date @@ -270,15 +308,23 @@ class Attributes(Catalog.Attributes): model_domain: Optional[str] = Field(default=None, description="") model_namespace: Optional[str] = Field(default=None, description="") model_version_name: Optional[str] = Field(default=None, description="") - model_version_agnostic_qualified_name: Optional[str] = Field(default=None, description="") - model_version_qualified_name: Optional[str] = Field(default=None, description="") + model_version_agnostic_qualified_name: Optional[str] = Field( + default=None, description="" + ) + model_version_qualified_name: Optional[str] = Field( + default=None, description="" + ) model_entity_name: Optional[str] = Field(default=None, description="") model_entity_qualified_name: Optional[str] = Field(default=None, description="") model_type: Optional[str] = Field(default=None, description="") model_system_date: Optional[datetime] = Field(default=None, description="") model_business_date: Optional[datetime] = Field(default=None, description="") - model_expired_at_system_date: Optional[datetime] = Field(default=None, description="") - model_expired_at_business_date: Optional[datetime] = Field(default=None, description="") + model_expired_at_system_date: Optional[datetime] = Field( + default=None, description="" + ) + model_expired_at_business_date: Optional[datetime] = Field( + default=None, description="" + ) attributes: Model.Attributes = Field( default_factory=lambda: Model.Attributes(), diff --git a/pyatlan/model/assets/core/model_attribute.py b/pyatlan/model/assets/core/model_attribute.py index 334426c8f..b929c91ed 100644 --- a/pyatlan/model/assets/core/model_attribute.py +++ b/pyatlan/model/assets/core/model_attribute.py @@ -64,11 +64,15 @@ def __setattr__(self, name, value): """ Precision of the attribute. """ - MODEL_ATTRIBUTE_SCALE: ClassVar[NumericField] = NumericField("modelAttributeScale", "modelAttributeScale") + MODEL_ATTRIBUTE_SCALE: ClassVar[NumericField] = NumericField( + "modelAttributeScale", "modelAttributeScale" + ) """ Scale of the attribute. """ - MODEL_ATTRIBUTE_DATA_TYPE: ClassVar[KeywordField] = KeywordField("modelAttributeDataType", "modelAttributeDataType") + MODEL_ATTRIBUTE_DATA_TYPE: ClassVar[KeywordField] = KeywordField( + "modelAttributeDataType", "modelAttributeDataType" + ) """ Type of the attribute. """ @@ -79,15 +83,21 @@ def __setattr__(self, name, value): When true, this attribute has relationships with other attributes. """ - MODEL_ATTRIBUTE_IMPLEMENTED_BY_ASSETS: ClassVar[RelationField] = RelationField("modelAttributeImplementedByAssets") + MODEL_ATTRIBUTE_IMPLEMENTED_BY_ASSETS: ClassVar[RelationField] = RelationField( + "modelAttributeImplementedByAssets" + ) """ TBC """ - MODEL_ATTRIBUTE_RELATED_TO_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelAttributeRelatedToAttributes") + MODEL_ATTRIBUTE_RELATED_TO_ATTRIBUTES: ClassVar[RelationField] = RelationField( + "modelAttributeRelatedToAttributes" + ) """ TBC """ - MODEL_ATTRIBUTE_ENTITIES: ClassVar[RelationField] = RelationField("modelAttributeEntities") + MODEL_ATTRIBUTE_ENTITIES: ClassVar[RelationField] = RelationField( + "modelAttributeEntities" + ) """ TBC """ @@ -97,7 +107,9 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_ATTRIBUTE_MAPPED_TO_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelAttributeMappedToAttributes") + MODEL_ATTRIBUTE_MAPPED_TO_ATTRIBUTES: ClassVar[RelationField] = RelationField( + "modelAttributeMappedToAttributes" + ) """ TBC """ @@ -127,7 +139,11 @@ def __setattr__(self, name, value): @property def model_attribute_is_nullable(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.model_attribute_is_nullable + return ( + None + if self.attributes is None + else self.attributes.model_attribute_is_nullable + ) @model_attribute_is_nullable.setter def model_attribute_is_nullable(self, model_attribute_is_nullable: Optional[bool]): @@ -137,7 +153,11 @@ def model_attribute_is_nullable(self, model_attribute_is_nullable: Optional[bool @property def model_attribute_is_primary(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.model_attribute_is_primary + return ( + None + if self.attributes is None + else self.attributes.model_attribute_is_primary + ) @model_attribute_is_primary.setter def model_attribute_is_primary(self, model_attribute_is_primary: Optional[bool]): @@ -147,7 +167,11 @@ def model_attribute_is_primary(self, model_attribute_is_primary: Optional[bool]) @property def model_attribute_is_foreign(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.model_attribute_is_foreign + return ( + None + if self.attributes is None + else self.attributes.model_attribute_is_foreign + ) @model_attribute_is_foreign.setter def model_attribute_is_foreign(self, model_attribute_is_foreign: Optional[bool]): @@ -157,7 +181,11 @@ def model_attribute_is_foreign(self, model_attribute_is_foreign: Optional[bool]) @property def model_attribute_is_derived(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.model_attribute_is_derived + return ( + None + if self.attributes is None + else self.attributes.model_attribute_is_derived + ) @model_attribute_is_derived.setter def model_attribute_is_derived(self, model_attribute_is_derived: Optional[bool]): @@ -167,7 +195,11 @@ def model_attribute_is_derived(self, model_attribute_is_derived: Optional[bool]) @property def model_attribute_precision(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.model_attribute_precision + return ( + None + if self.attributes is None + else self.attributes.model_attribute_precision + ) @model_attribute_precision.setter def model_attribute_precision(self, model_attribute_precision: Optional[int]): @@ -177,7 +209,9 @@ def model_attribute_precision(self, model_attribute_precision: Optional[int]): @property def model_attribute_scale(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.model_attribute_scale + return ( + None if self.attributes is None else self.attributes.model_attribute_scale + ) @model_attribute_scale.setter def model_attribute_scale(self, model_attribute_scale: Optional[int]): @@ -187,7 +221,11 @@ def model_attribute_scale(self, model_attribute_scale: Optional[int]): @property def model_attribute_data_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_attribute_data_type + return ( + None + if self.attributes is None + else self.attributes.model_attribute_data_type + ) @model_attribute_data_type.setter def model_attribute_data_type(self, model_attribute_data_type: Optional[str]): @@ -197,45 +235,75 @@ def model_attribute_data_type(self, model_attribute_data_type: Optional[str]): @property def model_attribute_has_relationships(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.model_attribute_has_relationships + return ( + None + if self.attributes is None + else self.attributes.model_attribute_has_relationships + ) @model_attribute_has_relationships.setter - def model_attribute_has_relationships(self, model_attribute_has_relationships: Optional[bool]): + def model_attribute_has_relationships( + self, model_attribute_has_relationships: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_has_relationships = model_attribute_has_relationships + self.attributes.model_attribute_has_relationships = ( + model_attribute_has_relationships + ) @property def model_attribute_implemented_by_assets(self) -> Optional[List[Catalog]]: - return None if self.attributes is None else self.attributes.model_attribute_implemented_by_assets + return ( + None + if self.attributes is None + else self.attributes.model_attribute_implemented_by_assets + ) @model_attribute_implemented_by_assets.setter - def model_attribute_implemented_by_assets(self, model_attribute_implemented_by_assets: Optional[List[Catalog]]): + def model_attribute_implemented_by_assets( + self, model_attribute_implemented_by_assets: Optional[List[Catalog]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_implemented_by_assets = model_attribute_implemented_by_assets + self.attributes.model_attribute_implemented_by_assets = ( + model_attribute_implemented_by_assets + ) @property def model_attribute_related_to_attributes( self, ) -> Optional[List[ModelAttributeAssociation]]: - return None if self.attributes is None else self.attributes.model_attribute_related_to_attributes + return ( + None + if self.attributes is None + else self.attributes.model_attribute_related_to_attributes + ) @model_attribute_related_to_attributes.setter def model_attribute_related_to_attributes( self, - model_attribute_related_to_attributes: Optional[List[ModelAttributeAssociation]], + model_attribute_related_to_attributes: Optional[ + List[ModelAttributeAssociation] + ], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_related_to_attributes = model_attribute_related_to_attributes + self.attributes.model_attribute_related_to_attributes = ( + model_attribute_related_to_attributes + ) @property def model_attribute_entities(self) -> Optional[List[ModelEntity]]: - return None if self.attributes is None else self.attributes.model_attribute_entities + return ( + None + if self.attributes is None + else self.attributes.model_attribute_entities + ) @model_attribute_entities.setter - def model_attribute_entities(self, model_attribute_entities: Optional[List[ModelEntity]]): + def model_attribute_entities( + self, model_attribute_entities: Optional[List[ModelEntity]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_attribute_entities = model_attribute_entities @@ -244,20 +312,32 @@ def model_attribute_entities(self, model_attribute_entities: Optional[List[Model def model_attribute_related_from_attributes( self, ) -> Optional[List[ModelAttributeAssociation]]: - return None if self.attributes is None else self.attributes.model_attribute_related_from_attributes + return ( + None + if self.attributes is None + else self.attributes.model_attribute_related_from_attributes + ) @model_attribute_related_from_attributes.setter def model_attribute_related_from_attributes( self, - model_attribute_related_from_attributes: Optional[List[ModelAttributeAssociation]], + model_attribute_related_from_attributes: Optional[ + List[ModelAttributeAssociation] + ], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_related_from_attributes = model_attribute_related_from_attributes + self.attributes.model_attribute_related_from_attributes = ( + model_attribute_related_from_attributes + ) @property def model_attribute_mapped_to_attributes(self) -> Optional[List[ModelAttribute]]: - return None if self.attributes is None else self.attributes.model_attribute_mapped_to_attributes + return ( + None + if self.attributes is None + else self.attributes.model_attribute_mapped_to_attributes + ) @model_attribute_mapped_to_attributes.setter def model_attribute_mapped_to_attributes( @@ -265,11 +345,17 @@ def model_attribute_mapped_to_attributes( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_mapped_to_attributes = model_attribute_mapped_to_attributes + self.attributes.model_attribute_mapped_to_attributes = ( + model_attribute_mapped_to_attributes + ) @property def model_attribute_mapped_from_attributes(self) -> Optional[List[ModelAttribute]]: - return None if self.attributes is None else self.attributes.model_attribute_mapped_from_attributes + return ( + None + if self.attributes is None + else self.attributes.model_attribute_mapped_from_attributes + ) @model_attribute_mapped_from_attributes.setter def model_attribute_mapped_from_attributes( @@ -277,27 +363,35 @@ def model_attribute_mapped_from_attributes( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_mapped_from_attributes = model_attribute_mapped_from_attributes + self.attributes.model_attribute_mapped_from_attributes = ( + model_attribute_mapped_from_attributes + ) class Attributes(Model.Attributes): - model_attribute_is_nullable: Optional[bool] = Field(default=None, description="") + model_attribute_is_nullable: Optional[bool] = Field( + default=None, description="" + ) model_attribute_is_primary: Optional[bool] = Field(default=None, description="") model_attribute_is_foreign: Optional[bool] = Field(default=None, description="") model_attribute_is_derived: Optional[bool] = Field(default=None, description="") model_attribute_precision: Optional[int] = Field(default=None, description="") model_attribute_scale: Optional[int] = Field(default=None, description="") model_attribute_data_type: Optional[str] = Field(default=None, description="") - model_attribute_has_relationships: Optional[bool] = Field(default=None, description="") - model_attribute_implemented_by_assets: Optional[List[Catalog]] = Field( + model_attribute_has_relationships: Optional[bool] = Field( default=None, description="" - ) # relationship - model_attribute_related_to_attributes: Optional[List[ModelAttributeAssociation]] = Field( + ) + model_attribute_implemented_by_assets: Optional[List[Catalog]] = Field( default=None, description="" ) # relationship - model_attribute_entities: Optional[List[ModelEntity]] = Field(default=None, description="") # relationship - model_attribute_related_from_attributes: Optional[List[ModelAttributeAssociation]] = Field( + model_attribute_related_to_attributes: Optional[ + List[ModelAttributeAssociation] + ] = Field(default=None, description="") # relationship + model_attribute_entities: Optional[List[ModelEntity]] = Field( default=None, description="" ) # relationship + model_attribute_related_from_attributes: Optional[ + List[ModelAttributeAssociation] + ] = Field(default=None, description="") # relationship model_attribute_mapped_to_attributes: Optional[List[ModelAttribute]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/core/model_attribute_association.py b/pyatlan/model/assets/core/model_attribute_association.py index c616f7f4d..d2865c604 100644 --- a/pyatlan/model/assets/core/model_attribute_association.py +++ b/pyatlan/model/assets/core/model_attribute_association.py @@ -29,16 +29,20 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODEL_ATTRIBUTE_ASSOCIATION_TO_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "modelAttributeAssociationToQualifiedName", - "modelAttributeAssociationToQualifiedName", + MODEL_ATTRIBUTE_ASSOCIATION_TO_QUALIFIED_NAME: ClassVar[KeywordField] = ( + KeywordField( + "modelAttributeAssociationToQualifiedName", + "modelAttributeAssociationToQualifiedName", + ) ) """ Unique name of the association to which this attribute is related. """ - MODEL_ATTRIBUTE_ASSOCIATION_FROM_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( - "modelAttributeAssociationFromQualifiedName", - "modelAttributeAssociationFromQualifiedName", + MODEL_ATTRIBUTE_ASSOCIATION_FROM_QUALIFIED_NAME: ClassVar[KeywordField] = ( + KeywordField( + "modelAttributeAssociationFromQualifiedName", + "modelAttributeAssociationFromQualifiedName", + ) ) """ Unique name of the association from which this attribute is related. @@ -50,11 +54,15 @@ def __setattr__(self, name, value): Unique name of the entity association to which this attribute is related. """ - MODEL_ATTRIBUTE_ASSOCIATION_FROM: ClassVar[RelationField] = RelationField("modelAttributeAssociationFrom") + MODEL_ATTRIBUTE_ASSOCIATION_FROM: ClassVar[RelationField] = RelationField( + "modelAttributeAssociationFrom" + ) """ TBC """ - MODEL_ATTRIBUTE_ASSOCIATION_TO: ClassVar[RelationField] = RelationField("modelAttributeAssociationTo") + MODEL_ATTRIBUTE_ASSOCIATION_TO: ClassVar[RelationField] = RelationField( + "modelAttributeAssociationTo" + ) """ TBC """ @@ -69,7 +77,11 @@ def __setattr__(self, name, value): @property def model_attribute_association_to_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_attribute_association_to_qualified_name + return ( + None + if self.attributes is None + else self.attributes.model_attribute_association_to_qualified_name + ) @model_attribute_association_to_qualified_name.setter def model_attribute_association_to_qualified_name( @@ -77,11 +89,17 @@ def model_attribute_association_to_qualified_name( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_association_to_qualified_name = model_attribute_association_to_qualified_name + self.attributes.model_attribute_association_to_qualified_name = ( + model_attribute_association_to_qualified_name + ) @property def model_attribute_association_from_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_attribute_association_from_qualified_name + return ( + None + if self.attributes is None + else self.attributes.model_attribute_association_from_qualified_name + ) @model_attribute_association_from_qualified_name.setter def model_attribute_association_from_qualified_name( @@ -95,40 +113,72 @@ def model_attribute_association_from_qualified_name( @property def model_entity_association_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_entity_association_qualified_name + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_qualified_name + ) @model_entity_association_qualified_name.setter - def model_entity_association_qualified_name(self, model_entity_association_qualified_name: Optional[str]): + def model_entity_association_qualified_name( + self, model_entity_association_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_qualified_name = model_entity_association_qualified_name + self.attributes.model_entity_association_qualified_name = ( + model_entity_association_qualified_name + ) @property def model_attribute_association_from(self) -> Optional[ModelAttribute]: - return None if self.attributes is None else self.attributes.model_attribute_association_from + return ( + None + if self.attributes is None + else self.attributes.model_attribute_association_from + ) @model_attribute_association_from.setter - def model_attribute_association_from(self, model_attribute_association_from: Optional[ModelAttribute]): + def model_attribute_association_from( + self, model_attribute_association_from: Optional[ModelAttribute] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_attribute_association_from = model_attribute_association_from + self.attributes.model_attribute_association_from = ( + model_attribute_association_from + ) @property def model_attribute_association_to(self) -> Optional[ModelAttribute]: - return None if self.attributes is None else self.attributes.model_attribute_association_to + return ( + None + if self.attributes is None + else self.attributes.model_attribute_association_to + ) @model_attribute_association_to.setter - def model_attribute_association_to(self, model_attribute_association_to: Optional[ModelAttribute]): + def model_attribute_association_to( + self, model_attribute_association_to: Optional[ModelAttribute] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_attribute_association_to = model_attribute_association_to class Attributes(Model.Attributes): - model_attribute_association_to_qualified_name: Optional[str] = Field(default=None, description="") - model_attribute_association_from_qualified_name: Optional[str] = Field(default=None, description="") - model_entity_association_qualified_name: Optional[str] = Field(default=None, description="") - model_attribute_association_from: Optional[ModelAttribute] = Field(default=None, description="") # relationship - model_attribute_association_to: Optional[ModelAttribute] = Field(default=None, description="") # relationship + model_attribute_association_to_qualified_name: Optional[str] = Field( + default=None, description="" + ) + model_attribute_association_from_qualified_name: Optional[str] = Field( + default=None, description="" + ) + model_entity_association_qualified_name: Optional[str] = Field( + default=None, description="" + ) + model_attribute_association_from: Optional[ModelAttribute] = Field( + default=None, description="" + ) # relationship + model_attribute_association_to: Optional[ModelAttribute] = Field( + default=None, description="" + ) # relationship attributes: ModelAttributeAssociation.Attributes = Field( default_factory=lambda: ModelAttributeAssociation.Attributes(), diff --git a/pyatlan/model/assets/core/model_data_model.py b/pyatlan/model/assets/core/model_data_model.py index bcbb30fec..794a63ed2 100644 --- a/pyatlan/model/assets/core/model_data_model.py +++ b/pyatlan/model/assets/core/model_data_model.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODEL_VERSION_COUNT: ClassVar[NumericField] = NumericField("modelVersionCount", "modelVersionCount") + MODEL_VERSION_COUNT: ClassVar[NumericField] = NumericField( + "modelVersionCount", "modelVersionCount" + ) """ Number of versions of the data model. """ @@ -82,7 +84,9 @@ def model_versions(self, model_versions: Optional[List[ModelVersion]]): class Attributes(Model.Attributes): model_version_count: Optional[int] = Field(default=None, description="") model_tool: Optional[str] = Field(default=None, description="") - model_versions: Optional[List[ModelVersion]] = Field(default=None, description="") # relationship + model_versions: Optional[List[ModelVersion]] = Field( + default=None, description="" + ) # relationship attributes: ModelDataModel.Attributes = Field( default_factory=lambda: ModelDataModel.Attributes(), diff --git a/pyatlan/model/assets/core/model_entity.py b/pyatlan/model/assets/core/model_entity.py index e8fb33a1d..36bbdc7c5 100644 --- a/pyatlan/model/assets/core/model_entity.py +++ b/pyatlan/model/assets/core/model_entity.py @@ -40,7 +40,9 @@ def __setattr__(self, name, value): """ Number of attributes in the entity. """ - MODEL_ENTITY_SUBJECT_AREA: ClassVar[KeywordField] = KeywordField("modelEntitySubjectArea", "modelEntitySubjectArea") + MODEL_ENTITY_SUBJECT_AREA: ClassVar[KeywordField] = KeywordField( + "modelEntitySubjectArea", "modelEntitySubjectArea" + ) """ Subject area of the entity. """ @@ -60,27 +62,39 @@ def __setattr__(self, name, value): Unique identifier for the general entity. """ - MODEL_ENTITY_RELATED_TO_ENTITIES: ClassVar[RelationField] = RelationField("modelEntityRelatedToEntities") + MODEL_ENTITY_RELATED_TO_ENTITIES: ClassVar[RelationField] = RelationField( + "modelEntityRelatedToEntities" + ) """ TBC """ - MODEL_ENTITY_GENERALIZATION_ENTITY: ClassVar[RelationField] = RelationField("modelEntityGeneralizationEntity") + MODEL_ENTITY_GENERALIZATION_ENTITY: ClassVar[RelationField] = RelationField( + "modelEntityGeneralizationEntity" + ) """ TBC """ - MODEL_ENTITY_IMPLEMENTED_BY_ASSETS: ClassVar[RelationField] = RelationField("modelEntityImplementedByAssets") + MODEL_ENTITY_IMPLEMENTED_BY_ASSETS: ClassVar[RelationField] = RelationField( + "modelEntityImplementedByAssets" + ) """ TBC """ - MODEL_ENTITY_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelEntityAttributes") + MODEL_ENTITY_ATTRIBUTES: ClassVar[RelationField] = RelationField( + "modelEntityAttributes" + ) """ TBC """ - MODEL_ENTITY_MAPPED_TO_ENTITIES: ClassVar[RelationField] = RelationField("modelEntityMappedToEntities") + MODEL_ENTITY_MAPPED_TO_ENTITIES: ClassVar[RelationField] = RelationField( + "modelEntityMappedToEntities" + ) """ TBC """ - MODEL_ENTITY_RELATED_FROM_ENTITIES: ClassVar[RelationField] = RelationField("modelEntityRelatedFromEntities") + MODEL_ENTITY_RELATED_FROM_ENTITIES: ClassVar[RelationField] = RelationField( + "modelEntityRelatedFromEntities" + ) """ TBC """ @@ -88,11 +102,15 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_ENTITY_MAPPED_FROM_ENTITIES: ClassVar[RelationField] = RelationField("modelEntityMappedFromEntities") + MODEL_ENTITY_MAPPED_FROM_ENTITIES: ClassVar[RelationField] = RelationField( + "modelEntityMappedFromEntities" + ) """ TBC """ - MODEL_ENTITY_SPECIALIZATION_ENTITIES: ClassVar[RelationField] = RelationField("modelEntitySpecializationEntities") + MODEL_ENTITY_SPECIALIZATION_ENTITIES: ClassVar[RelationField] = RelationField( + "modelEntitySpecializationEntities" + ) """ TBC """ @@ -115,7 +133,11 @@ def __setattr__(self, name, value): @property def model_entity_attribute_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.model_entity_attribute_count + return ( + None + if self.attributes is None + else self.attributes.model_entity_attribute_count + ) @model_entity_attribute_count.setter def model_entity_attribute_count(self, model_entity_attribute_count: Optional[int]): @@ -125,7 +147,11 @@ def model_entity_attribute_count(self, model_entity_attribute_count: Optional[in @property def model_entity_subject_area(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_entity_subject_area + return ( + None + if self.attributes is None + else self.attributes.model_entity_subject_area + ) @model_entity_subject_area.setter def model_entity_subject_area(self, model_entity_subject_area: Optional[str]): @@ -135,29 +161,49 @@ def model_entity_subject_area(self, model_entity_subject_area: Optional[str]): @property def model_entity_generalization_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_entity_generalization_name + return ( + None + if self.attributes is None + else self.attributes.model_entity_generalization_name + ) @model_entity_generalization_name.setter - def model_entity_generalization_name(self, model_entity_generalization_name: Optional[str]): + def model_entity_generalization_name( + self, model_entity_generalization_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_generalization_name = model_entity_generalization_name + self.attributes.model_entity_generalization_name = ( + model_entity_generalization_name + ) @property def model_entity_generalization_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_entity_generalization_qualified_name + return ( + None + if self.attributes is None + else self.attributes.model_entity_generalization_qualified_name + ) @model_entity_generalization_qualified_name.setter - def model_entity_generalization_qualified_name(self, model_entity_generalization_qualified_name: Optional[str]): + def model_entity_generalization_qualified_name( + self, model_entity_generalization_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_generalization_qualified_name = model_entity_generalization_qualified_name + self.attributes.model_entity_generalization_qualified_name = ( + model_entity_generalization_qualified_name + ) @property def model_entity_related_to_entities( self, ) -> Optional[List[ModelEntityAssociation]]: - return None if self.attributes is None else self.attributes.model_entity_related_to_entities + return ( + None + if self.attributes is None + else self.attributes.model_entity_related_to_entities + ) @model_entity_related_to_entities.setter def model_entity_related_to_entities( @@ -165,53 +211,87 @@ def model_entity_related_to_entities( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_related_to_entities = model_entity_related_to_entities + self.attributes.model_entity_related_to_entities = ( + model_entity_related_to_entities + ) @property def model_entity_generalization_entity(self) -> Optional[ModelEntity]: - return None if self.attributes is None else self.attributes.model_entity_generalization_entity + return ( + None + if self.attributes is None + else self.attributes.model_entity_generalization_entity + ) @model_entity_generalization_entity.setter - def model_entity_generalization_entity(self, model_entity_generalization_entity: Optional[ModelEntity]): + def model_entity_generalization_entity( + self, model_entity_generalization_entity: Optional[ModelEntity] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_generalization_entity = model_entity_generalization_entity + self.attributes.model_entity_generalization_entity = ( + model_entity_generalization_entity + ) @property def model_entity_implemented_by_assets(self) -> Optional[List[Catalog]]: - return None if self.attributes is None else self.attributes.model_entity_implemented_by_assets + return ( + None + if self.attributes is None + else self.attributes.model_entity_implemented_by_assets + ) @model_entity_implemented_by_assets.setter - def model_entity_implemented_by_assets(self, model_entity_implemented_by_assets: Optional[List[Catalog]]): + def model_entity_implemented_by_assets( + self, model_entity_implemented_by_assets: Optional[List[Catalog]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_implemented_by_assets = model_entity_implemented_by_assets + self.attributes.model_entity_implemented_by_assets = ( + model_entity_implemented_by_assets + ) @property def model_entity_attributes(self) -> Optional[List[ModelAttribute]]: - return None if self.attributes is None else self.attributes.model_entity_attributes + return ( + None if self.attributes is None else self.attributes.model_entity_attributes + ) @model_entity_attributes.setter - def model_entity_attributes(self, model_entity_attributes: Optional[List[ModelAttribute]]): + def model_entity_attributes( + self, model_entity_attributes: Optional[List[ModelAttribute]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_entity_attributes = model_entity_attributes @property def model_entity_mapped_to_entities(self) -> Optional[List[ModelEntity]]: - return None if self.attributes is None else self.attributes.model_entity_mapped_to_entities + return ( + None + if self.attributes is None + else self.attributes.model_entity_mapped_to_entities + ) @model_entity_mapped_to_entities.setter - def model_entity_mapped_to_entities(self, model_entity_mapped_to_entities: Optional[List[ModelEntity]]): + def model_entity_mapped_to_entities( + self, model_entity_mapped_to_entities: Optional[List[ModelEntity]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_mapped_to_entities = model_entity_mapped_to_entities + self.attributes.model_entity_mapped_to_entities = ( + model_entity_mapped_to_entities + ) @property def model_entity_related_from_entities( self, ) -> Optional[List[ModelEntityAssociation]]: - return None if self.attributes is None else self.attributes.model_entity_related_from_entities + return ( + None + if self.attributes is None + else self.attributes.model_entity_related_from_entities + ) @model_entity_related_from_entities.setter def model_entity_related_from_entities( @@ -219,7 +299,9 @@ def model_entity_related_from_entities( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_related_from_entities = model_entity_related_from_entities + self.attributes.model_entity_related_from_entities = ( + model_entity_related_from_entities + ) @property def model_versions(self) -> Optional[List[ModelVersion]]: @@ -233,44 +315,72 @@ def model_versions(self, model_versions: Optional[List[ModelVersion]]): @property def model_entity_mapped_from_entities(self) -> Optional[List[ModelEntity]]: - return None if self.attributes is None else self.attributes.model_entity_mapped_from_entities + return ( + None + if self.attributes is None + else self.attributes.model_entity_mapped_from_entities + ) @model_entity_mapped_from_entities.setter - def model_entity_mapped_from_entities(self, model_entity_mapped_from_entities: Optional[List[ModelEntity]]): + def model_entity_mapped_from_entities( + self, model_entity_mapped_from_entities: Optional[List[ModelEntity]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_mapped_from_entities = model_entity_mapped_from_entities + self.attributes.model_entity_mapped_from_entities = ( + model_entity_mapped_from_entities + ) @property def model_entity_specialization_entities(self) -> Optional[List[ModelEntity]]: - return None if self.attributes is None else self.attributes.model_entity_specialization_entities + return ( + None + if self.attributes is None + else self.attributes.model_entity_specialization_entities + ) @model_entity_specialization_entities.setter - def model_entity_specialization_entities(self, model_entity_specialization_entities: Optional[List[ModelEntity]]): + def model_entity_specialization_entities( + self, model_entity_specialization_entities: Optional[List[ModelEntity]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_specialization_entities = model_entity_specialization_entities + self.attributes.model_entity_specialization_entities = ( + model_entity_specialization_entities + ) class Attributes(Model.Attributes): - model_entity_attribute_count: Optional[int] = Field(default=None, description="") + model_entity_attribute_count: Optional[int] = Field( + default=None, description="" + ) model_entity_subject_area: Optional[str] = Field(default=None, description="") - model_entity_generalization_name: Optional[str] = Field(default=None, description="") - model_entity_generalization_qualified_name: Optional[str] = Field(default=None, description="") - model_entity_related_to_entities: Optional[List[ModelEntityAssociation]] = Field( + model_entity_generalization_name: Optional[str] = Field( + default=None, description="" + ) + model_entity_generalization_qualified_name: Optional[str] = Field( + default=None, description="" + ) + model_entity_related_to_entities: Optional[List[ModelEntityAssociation]] = ( + Field(default=None, description="") + ) # relationship + model_entity_generalization_entity: Optional[ModelEntity] = Field( default=None, description="" ) # relationship - model_entity_generalization_entity: Optional[ModelEntity] = Field(default=None, description="") # relationship model_entity_implemented_by_assets: Optional[List[Catalog]] = Field( default=None, description="" ) # relationship - model_entity_attributes: Optional[List[ModelAttribute]] = Field(default=None, description="") # relationship + model_entity_attributes: Optional[List[ModelAttribute]] = Field( + default=None, description="" + ) # relationship model_entity_mapped_to_entities: Optional[List[ModelEntity]] = Field( default=None, description="" ) # relationship - model_entity_related_from_entities: Optional[List[ModelEntityAssociation]] = Field( + model_entity_related_from_entities: Optional[List[ModelEntityAssociation]] = ( + Field(default=None, description="") + ) # relationship + model_versions: Optional[List[ModelVersion]] = Field( default=None, description="" ) # relationship - model_versions: Optional[List[ModelVersion]] = Field(default=None, description="") # relationship model_entity_mapped_from_entities: Optional[List[ModelEntity]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/core/model_entity_association.py b/pyatlan/model/assets/core/model_entity_association.py index 27b4323e6..1789255d9 100644 --- a/pyatlan/model/assets/core/model_entity_association.py +++ b/pyatlan/model/assets/core/model_entity_association.py @@ -81,26 +81,34 @@ def __setattr__(self, name, value): """ Label when read from the association from which this entity is related. """ - MODEL_ENTITY_ASSOCIATION_FROM_MIN_CARDINALITY: ClassVar[NumericField] = NumericField( - "modelEntityAssociationFromMinCardinality", - "modelEntityAssociationFromMinCardinality", + MODEL_ENTITY_ASSOCIATION_FROM_MIN_CARDINALITY: ClassVar[NumericField] = ( + NumericField( + "modelEntityAssociationFromMinCardinality", + "modelEntityAssociationFromMinCardinality", + ) ) """ Minimum cardinality of the data entity from which the association exists. """ - MODEL_ENTITY_ASSOCIATION_FROM_MAX_CARDINALITY: ClassVar[NumericField] = NumericField( - "modelEntityAssociationFromMaxCardinality", - "modelEntityAssociationFromMaxCardinality", + MODEL_ENTITY_ASSOCIATION_FROM_MAX_CARDINALITY: ClassVar[NumericField] = ( + NumericField( + "modelEntityAssociationFromMaxCardinality", + "modelEntityAssociationFromMaxCardinality", + ) ) """ Maximum cardinality of the data entity from which the association exists. """ - MODEL_ENTITY_ASSOCIATION_TO: ClassVar[RelationField] = RelationField("modelEntityAssociationTo") + MODEL_ENTITY_ASSOCIATION_TO: ClassVar[RelationField] = RelationField( + "modelEntityAssociationTo" + ) """ TBC """ - MODEL_ENTITY_ASSOCIATION_FROM: ClassVar[RelationField] = RelationField("modelEntityAssociationFrom") + MODEL_ENTITY_ASSOCIATION_FROM: ClassVar[RelationField] = RelationField( + "modelEntityAssociationFrom" + ) """ TBC """ @@ -122,7 +130,11 @@ def __setattr__(self, name, value): @property def model_entity_association_cardinality(self) -> Optional[ModelCardinalityType]: - return None if self.attributes is None else self.attributes.model_entity_association_cardinality + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_cardinality + ) @model_entity_association_cardinality.setter def model_entity_association_cardinality( @@ -130,81 +142,141 @@ def model_entity_association_cardinality( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_cardinality = model_entity_association_cardinality + self.attributes.model_entity_association_cardinality = ( + model_entity_association_cardinality + ) @property def model_entity_association_label(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_entity_association_label + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_label + ) @model_entity_association_label.setter - def model_entity_association_label(self, model_entity_association_label: Optional[str]): + def model_entity_association_label( + self, model_entity_association_label: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_entity_association_label = model_entity_association_label @property def model_entity_association_to_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_entity_association_to_qualified_name + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_to_qualified_name + ) @model_entity_association_to_qualified_name.setter - def model_entity_association_to_qualified_name(self, model_entity_association_to_qualified_name: Optional[str]): + def model_entity_association_to_qualified_name( + self, model_entity_association_to_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_to_qualified_name = model_entity_association_to_qualified_name + self.attributes.model_entity_association_to_qualified_name = ( + model_entity_association_to_qualified_name + ) @property def model_entity_association_to_label(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_entity_association_to_label + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_to_label + ) @model_entity_association_to_label.setter - def model_entity_association_to_label(self, model_entity_association_to_label: Optional[str]): + def model_entity_association_to_label( + self, model_entity_association_to_label: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_to_label = model_entity_association_to_label + self.attributes.model_entity_association_to_label = ( + model_entity_association_to_label + ) @property def model_entity_association_to_min_cardinality(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.model_entity_association_to_min_cardinality + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_to_min_cardinality + ) @model_entity_association_to_min_cardinality.setter - def model_entity_association_to_min_cardinality(self, model_entity_association_to_min_cardinality: Optional[int]): + def model_entity_association_to_min_cardinality( + self, model_entity_association_to_min_cardinality: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_to_min_cardinality = model_entity_association_to_min_cardinality + self.attributes.model_entity_association_to_min_cardinality = ( + model_entity_association_to_min_cardinality + ) @property def model_entity_association_to_max_cardinality(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.model_entity_association_to_max_cardinality + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_to_max_cardinality + ) @model_entity_association_to_max_cardinality.setter - def model_entity_association_to_max_cardinality(self, model_entity_association_to_max_cardinality: Optional[int]): + def model_entity_association_to_max_cardinality( + self, model_entity_association_to_max_cardinality: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_to_max_cardinality = model_entity_association_to_max_cardinality + self.attributes.model_entity_association_to_max_cardinality = ( + model_entity_association_to_max_cardinality + ) @property def model_entity_association_from_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_entity_association_from_qualified_name + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_from_qualified_name + ) @model_entity_association_from_qualified_name.setter - def model_entity_association_from_qualified_name(self, model_entity_association_from_qualified_name: Optional[str]): + def model_entity_association_from_qualified_name( + self, model_entity_association_from_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_from_qualified_name = model_entity_association_from_qualified_name + self.attributes.model_entity_association_from_qualified_name = ( + model_entity_association_from_qualified_name + ) @property def model_entity_association_from_label(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.model_entity_association_from_label + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_from_label + ) @model_entity_association_from_label.setter - def model_entity_association_from_label(self, model_entity_association_from_label: Optional[str]): + def model_entity_association_from_label( + self, model_entity_association_from_label: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_from_label = model_entity_association_from_label + self.attributes.model_entity_association_from_label = ( + model_entity_association_from_label + ) @property def model_entity_association_from_min_cardinality(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.model_entity_association_from_min_cardinality + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_from_min_cardinality + ) @model_entity_association_from_min_cardinality.setter def model_entity_association_from_min_cardinality( @@ -212,11 +284,17 @@ def model_entity_association_from_min_cardinality( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_from_min_cardinality = model_entity_association_from_min_cardinality + self.attributes.model_entity_association_from_min_cardinality = ( + model_entity_association_from_min_cardinality + ) @property def model_entity_association_from_max_cardinality(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.model_entity_association_from_max_cardinality + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_from_max_cardinality + ) @model_entity_association_from_max_cardinality.setter def model_entity_association_from_max_cardinality( @@ -224,41 +302,79 @@ def model_entity_association_from_max_cardinality( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.model_entity_association_from_max_cardinality = model_entity_association_from_max_cardinality + self.attributes.model_entity_association_from_max_cardinality = ( + model_entity_association_from_max_cardinality + ) @property def model_entity_association_to(self) -> Optional[ModelEntity]: - return None if self.attributes is None else self.attributes.model_entity_association_to + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_to + ) @model_entity_association_to.setter - def model_entity_association_to(self, model_entity_association_to: Optional[ModelEntity]): + def model_entity_association_to( + self, model_entity_association_to: Optional[ModelEntity] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_entity_association_to = model_entity_association_to @property def model_entity_association_from(self) -> Optional[ModelEntity]: - return None if self.attributes is None else self.attributes.model_entity_association_from + return ( + None + if self.attributes is None + else self.attributes.model_entity_association_from + ) @model_entity_association_from.setter - def model_entity_association_from(self, model_entity_association_from: Optional[ModelEntity]): + def model_entity_association_from( + self, model_entity_association_from: Optional[ModelEntity] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_entity_association_from = model_entity_association_from class Attributes(Model.Attributes): - model_entity_association_cardinality: Optional[ModelCardinalityType] = Field(default=None, description="") - model_entity_association_label: Optional[str] = Field(default=None, description="") - model_entity_association_to_qualified_name: Optional[str] = Field(default=None, description="") - model_entity_association_to_label: Optional[str] = Field(default=None, description="") - model_entity_association_to_min_cardinality: Optional[int] = Field(default=None, description="") - model_entity_association_to_max_cardinality: Optional[int] = Field(default=None, description="") - model_entity_association_from_qualified_name: Optional[str] = Field(default=None, description="") - model_entity_association_from_label: Optional[str] = Field(default=None, description="") - model_entity_association_from_min_cardinality: Optional[int] = Field(default=None, description="") - model_entity_association_from_max_cardinality: Optional[int] = Field(default=None, description="") - model_entity_association_to: Optional[ModelEntity] = Field(default=None, description="") # relationship - model_entity_association_from: Optional[ModelEntity] = Field(default=None, description="") # relationship + model_entity_association_cardinality: Optional[ModelCardinalityType] = Field( + default=None, description="" + ) + model_entity_association_label: Optional[str] = Field( + default=None, description="" + ) + model_entity_association_to_qualified_name: Optional[str] = Field( + default=None, description="" + ) + model_entity_association_to_label: Optional[str] = Field( + default=None, description="" + ) + model_entity_association_to_min_cardinality: Optional[int] = Field( + default=None, description="" + ) + model_entity_association_to_max_cardinality: Optional[int] = Field( + default=None, description="" + ) + model_entity_association_from_qualified_name: Optional[str] = Field( + default=None, description="" + ) + model_entity_association_from_label: Optional[str] = Field( + default=None, description="" + ) + model_entity_association_from_min_cardinality: Optional[int] = Field( + default=None, description="" + ) + model_entity_association_from_max_cardinality: Optional[int] = Field( + default=None, description="" + ) + model_entity_association_to: Optional[ModelEntity] = Field( + default=None, description="" + ) # relationship + model_entity_association_from: Optional[ModelEntity] = Field( + default=None, description="" + ) # relationship attributes: ModelEntityAssociation.Attributes = Field( default_factory=lambda: ModelEntityAssociation.Attributes(), diff --git a/pyatlan/model/assets/core/model_version.py b/pyatlan/model/assets/core/model_version.py index 1016c3465..bd0b220e8 100644 --- a/pyatlan/model/assets/core/model_version.py +++ b/pyatlan/model/assets/core/model_version.py @@ -40,7 +40,9 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_VERSION_ENTITIES: ClassVar[RelationField] = RelationField("modelVersionEntities") + MODEL_VERSION_ENTITIES: ClassVar[RelationField] = RelationField( + "modelVersionEntities" + ) """ TBC """ @@ -53,7 +55,11 @@ def __setattr__(self, name, value): @property def model_version_entity_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.model_version_entity_count + return ( + None + if self.attributes is None + else self.attributes.model_version_entity_count + ) @model_version_entity_count.setter def model_version_entity_count(self, model_version_entity_count: Optional[int]): @@ -73,18 +79,26 @@ def model_data_model(self, model_data_model: Optional[ModelDataModel]): @property def model_version_entities(self) -> Optional[List[ModelEntity]]: - return None if self.attributes is None else self.attributes.model_version_entities + return ( + None if self.attributes is None else self.attributes.model_version_entities + ) @model_version_entities.setter - def model_version_entities(self, model_version_entities: Optional[List[ModelEntity]]): + def model_version_entities( + self, model_version_entities: Optional[List[ModelEntity]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_version_entities = model_version_entities class Attributes(Model.Attributes): model_version_entity_count: Optional[int] = Field(default=None, description="") - model_data_model: Optional[ModelDataModel] = Field(default=None, description="") # relationship - model_version_entities: Optional[List[ModelEntity]] = Field(default=None, description="") # relationship + model_data_model: Optional[ModelDataModel] = Field( + default=None, description="" + ) # relationship + model_version_entities: Optional[List[ModelEntity]] = Field( + default=None, description="" + ) # relationship attributes: ModelVersion.Attributes = Field( default_factory=lambda: ModelVersion.Attributes(), diff --git a/pyatlan/model/assets/core/mongo_d_b_collection.py b/pyatlan/model/assets/core/mongo_d_b_collection.py index 658d7867c..109567078 100644 --- a/pyatlan/model/assets/core/mongo_d_b_collection.py +++ b/pyatlan/model/assets/core/mongo_d_b_collection.py @@ -132,35 +132,51 @@ def __setattr__(self, name, value): """ Whether this table is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( + "isQueryPreview", "isQueryPreview" + ) """ Whether preview queries are allowed for this table (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( + "queryPreviewConfig", "queryPreviewConfig" + ) """ Configuration for preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") + EXTERNAL_LOCATION: ClassVar[TextField] = TextField( + "externalLocation", "externalLocation" + ) """ External location of this table, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( + "externalLocationRegion", "externalLocationRegion" + ) """ Region of the external location of this table, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( + "externalLocationFormat", "externalLocationFormat" + ) """ Format of the external location of this table, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( + "isPartitioned", "isPartitioned" + ) """ Whether this table is partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( + "partitionStrategy", "partitionStrategy" + ) """ Partition strategy for this table. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") + PARTITION_COUNT: ClassVar[NumericField] = NumericField( + "partitionCount", "partitionCount" + ) """ Number of partitions in this table. """ @@ -176,15 +192,21 @@ def __setattr__(self, name, value): """ Type of the table. """ - ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField("icebergCatalogName", "icebergCatalogName") + ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField( + "icebergCatalogName", "icebergCatalogName" + ) """ iceberg table catalog name (can be any user defined name) """ - ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField("icebergTableType", "icebergTableType") + ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField( + "icebergTableType", "icebergTableType" + ) """ iceberg table type (managed vs unmanaged) """ - ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField("icebergCatalogSource", "icebergCatalogSource") + ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField( + "icebergCatalogSource", "icebergCatalogSource" + ) """ iceberg table catalog type (glue, polaris, snowflake) """ @@ -212,7 +234,9 @@ def __setattr__(self, name, value): """ iceberg table base location inside the external volume. """ - TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField("tableRetentionTime", "tableRetentionTime") + TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField( + "tableRetentionTime", "tableRetentionTime" + ) """ Data retention time in days. """ @@ -220,47 +244,69 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( + "queryUserCount", "queryUserCount" + ) """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( + "queryUserMap", "queryUserMap" + ) """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( + "queryCountUpdatedAt", "queryCountUpdatedAt" + ) """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "databaseName", "databaseName.keyword", "databaseName" + ) """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "databaseQualifiedName", "databaseQualifiedName" + ) """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "schemaName", "schemaName.keyword", "schemaName" + ) """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "schemaQualifiedName", "schemaQualifiedName" + ) """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "tableName", "tableName.keyword", "tableName" + ) """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "tableQualifiedName", "tableQualifiedName" + ) """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "viewName", "viewName.keyword", "viewName" + ) """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "viewQualifiedName", "viewQualifiedName" + ) """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -280,11 +326,15 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( + "lastProfiledAt", "lastProfiledAt" + ) """ Time (epoch) at which this asset was last profiled, in milliseconds. """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( + "noSQLSchemaDefinition", "noSQLSchemaDefinition" + ) """ Represents attributes for describing the key schema for the table and indexes. """ @@ -353,7 +403,11 @@ def __setattr__(self, name, value): @property def mongo_d_b_collection_subtype(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_subtype + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_subtype + ) @mongo_d_b_collection_subtype.setter def mongo_d_b_collection_subtype(self, mongo_d_b_collection_subtype: Optional[str]): @@ -363,113 +417,197 @@ def mongo_d_b_collection_subtype(self, mongo_d_b_collection_subtype: Optional[st @property def mongo_d_b_collection_is_capped(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_is_capped + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_is_capped + ) @mongo_d_b_collection_is_capped.setter - def mongo_d_b_collection_is_capped(self, mongo_d_b_collection_is_capped: Optional[bool]): + def mongo_d_b_collection_is_capped( + self, mongo_d_b_collection_is_capped: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collection_is_capped = mongo_d_b_collection_is_capped @property def mongo_d_b_collection_time_field(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_time_field + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_time_field + ) @mongo_d_b_collection_time_field.setter - def mongo_d_b_collection_time_field(self, mongo_d_b_collection_time_field: Optional[str]): + def mongo_d_b_collection_time_field( + self, mongo_d_b_collection_time_field: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_time_field = mongo_d_b_collection_time_field + self.attributes.mongo_d_b_collection_time_field = ( + mongo_d_b_collection_time_field + ) @property def mongo_d_b_collection_time_granularity(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_time_granularity + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_time_granularity + ) @mongo_d_b_collection_time_granularity.setter - def mongo_d_b_collection_time_granularity(self, mongo_d_b_collection_time_granularity: Optional[str]): + def mongo_d_b_collection_time_granularity( + self, mongo_d_b_collection_time_granularity: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_time_granularity = mongo_d_b_collection_time_granularity + self.attributes.mongo_d_b_collection_time_granularity = ( + mongo_d_b_collection_time_granularity + ) @property def mongo_d_b_collection_expire_after_seconds(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_expire_after_seconds + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_expire_after_seconds + ) @mongo_d_b_collection_expire_after_seconds.setter - def mongo_d_b_collection_expire_after_seconds(self, mongo_d_b_collection_expire_after_seconds: Optional[int]): + def mongo_d_b_collection_expire_after_seconds( + self, mongo_d_b_collection_expire_after_seconds: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_expire_after_seconds = mongo_d_b_collection_expire_after_seconds + self.attributes.mongo_d_b_collection_expire_after_seconds = ( + mongo_d_b_collection_expire_after_seconds + ) @property def mongo_d_b_collection_maximum_document_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_maximum_document_count + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_maximum_document_count + ) @mongo_d_b_collection_maximum_document_count.setter - def mongo_d_b_collection_maximum_document_count(self, mongo_d_b_collection_maximum_document_count: Optional[int]): + def mongo_d_b_collection_maximum_document_count( + self, mongo_d_b_collection_maximum_document_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_maximum_document_count = mongo_d_b_collection_maximum_document_count + self.attributes.mongo_d_b_collection_maximum_document_count = ( + mongo_d_b_collection_maximum_document_count + ) @property def mongo_d_b_collection_max_size(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_max_size + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_max_size + ) @mongo_d_b_collection_max_size.setter - def mongo_d_b_collection_max_size(self, mongo_d_b_collection_max_size: Optional[int]): + def mongo_d_b_collection_max_size( + self, mongo_d_b_collection_max_size: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collection_max_size = mongo_d_b_collection_max_size @property def mongo_d_b_collection_num_orphan_docs(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_num_orphan_docs + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_num_orphan_docs + ) @mongo_d_b_collection_num_orphan_docs.setter - def mongo_d_b_collection_num_orphan_docs(self, mongo_d_b_collection_num_orphan_docs: Optional[int]): + def mongo_d_b_collection_num_orphan_docs( + self, mongo_d_b_collection_num_orphan_docs: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_num_orphan_docs = mongo_d_b_collection_num_orphan_docs + self.attributes.mongo_d_b_collection_num_orphan_docs = ( + mongo_d_b_collection_num_orphan_docs + ) @property def mongo_d_b_collection_num_indexes(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_num_indexes + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_num_indexes + ) @mongo_d_b_collection_num_indexes.setter - def mongo_d_b_collection_num_indexes(self, mongo_d_b_collection_num_indexes: Optional[int]): + def mongo_d_b_collection_num_indexes( + self, mongo_d_b_collection_num_indexes: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_num_indexes = mongo_d_b_collection_num_indexes + self.attributes.mongo_d_b_collection_num_indexes = ( + mongo_d_b_collection_num_indexes + ) @property def mongo_d_b_collection_total_index_size(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_total_index_size + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_total_index_size + ) @mongo_d_b_collection_total_index_size.setter - def mongo_d_b_collection_total_index_size(self, mongo_d_b_collection_total_index_size: Optional[int]): + def mongo_d_b_collection_total_index_size( + self, mongo_d_b_collection_total_index_size: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_total_index_size = mongo_d_b_collection_total_index_size + self.attributes.mongo_d_b_collection_total_index_size = ( + mongo_d_b_collection_total_index_size + ) @property def mongo_d_b_collection_average_object_size(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_average_object_size + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_average_object_size + ) @mongo_d_b_collection_average_object_size.setter - def mongo_d_b_collection_average_object_size(self, mongo_d_b_collection_average_object_size: Optional[int]): + def mongo_d_b_collection_average_object_size( + self, mongo_d_b_collection_average_object_size: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_average_object_size = mongo_d_b_collection_average_object_size + self.attributes.mongo_d_b_collection_average_object_size = ( + mongo_d_b_collection_average_object_size + ) @property def mongo_d_b_collection_schema_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mongo_d_b_collection_schema_definition + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_collection_schema_definition + ) @mongo_d_b_collection_schema_definition.setter - def mongo_d_b_collection_schema_definition(self, mongo_d_b_collection_schema_definition: Optional[str]): + def mongo_d_b_collection_schema_definition( + self, mongo_d_b_collection_schema_definition: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_collection_schema_definition = mongo_d_b_collection_schema_definition + self.attributes.mongo_d_b_collection_schema_definition = ( + mongo_d_b_collection_schema_definition + ) @property def column_count(self) -> Optional[int]: @@ -553,7 +691,11 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_region + return ( + None + if self.attributes is None + else self.attributes.external_location_region + ) @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -563,7 +705,11 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_format + return ( + None + if self.attributes is None + else self.attributes.external_location_format + ) @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -653,7 +799,9 @@ def iceberg_table_type(self, iceberg_table_type: Optional[str]): @property def iceberg_catalog_source(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_source + return ( + None if self.attributes is None else self.attributes.iceberg_catalog_source + ) @iceberg_catalog_source.setter def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @@ -663,7 +811,11 @@ def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @property def iceberg_catalog_table_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_table_name + return ( + None + if self.attributes is None + else self.attributes.iceberg_catalog_table_name + ) @iceberg_catalog_table_name.setter def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @@ -673,17 +825,29 @@ def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @property def iceberg_catalog_table_namespace(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_table_namespace + return ( + None + if self.attributes is None + else self.attributes.iceberg_catalog_table_namespace + ) @iceberg_catalog_table_namespace.setter - def iceberg_catalog_table_namespace(self, iceberg_catalog_table_namespace: Optional[str]): + def iceberg_catalog_table_namespace( + self, iceberg_catalog_table_namespace: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.iceberg_catalog_table_namespace = iceberg_catalog_table_namespace + self.attributes.iceberg_catalog_table_namespace = ( + iceberg_catalog_table_namespace + ) @property def table_external_volume_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.table_external_volume_name + return ( + None + if self.attributes is None + else self.attributes.table_external_volume_name + ) @table_external_volume_name.setter def table_external_volume_name(self, table_external_volume_name: Optional[str]): @@ -693,7 +857,11 @@ def table_external_volume_name(self, table_external_volume_name: Optional[str]): @property def iceberg_table_base_location(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_table_base_location + return ( + None + if self.attributes is None + else self.attributes.iceberg_table_base_location + ) @iceberg_table_base_location.setter def iceberg_table_base_location(self, iceberg_table_base_location: Optional[str]): @@ -743,7 +911,9 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.query_count_updated_at + return ( + None if self.attributes is None else self.attributes.query_count_updated_at + ) @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -763,7 +933,9 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.database_qualified_name + return ( + None if self.attributes is None else self.attributes.database_qualified_name + ) @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -783,7 +955,9 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_qualified_name + return ( + None if self.attributes is None else self.attributes.schema_qualified_name + ) @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -833,7 +1007,9 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_name + return ( + None if self.attributes is None else self.attributes.calculation_view_name + ) @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -843,13 +1019,21 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.calculation_view_qualified_name + ) @calculation_view_qualified_name.setter - def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): + def calculation_view_qualified_name( + self, calculation_view_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = calculation_view_qualified_name + self.attributes.calculation_view_qualified_name = ( + calculation_view_qualified_name + ) @property def is_profiled(self) -> Optional[bool]: @@ -873,7 +1057,11 @@ def last_profiled_at(self, last_profiled_at: Optional[datetime]): @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition + return ( + None + if self.attributes is None + else self.attributes.no_s_q_l_schema_definition + ) @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -892,25 +1080,51 @@ def mongo_d_b_database(self, mongo_d_b_database: Optional[MongoDBDatabase]): self.attributes.mongo_d_b_database = mongo_d_b_database class Attributes(Table.Attributes): - mongo_d_b_collection_subtype: Optional[str] = Field(default=None, description="") - mongo_d_b_collection_is_capped: Optional[bool] = Field(default=None, description="") - mongo_d_b_collection_time_field: Optional[str] = Field(default=None, description="") - mongo_d_b_collection_time_granularity: Optional[str] = Field(default=None, description="") - mongo_d_b_collection_expire_after_seconds: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_maximum_document_count: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_max_size: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_num_orphan_docs: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_num_indexes: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_total_index_size: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_average_object_size: Optional[int] = Field(default=None, description="") - mongo_d_b_collection_schema_definition: Optional[str] = Field(default=None, description="") + mongo_d_b_collection_subtype: Optional[str] = Field( + default=None, description="" + ) + mongo_d_b_collection_is_capped: Optional[bool] = Field( + default=None, description="" + ) + mongo_d_b_collection_time_field: Optional[str] = Field( + default=None, description="" + ) + mongo_d_b_collection_time_granularity: Optional[str] = Field( + default=None, description="" + ) + mongo_d_b_collection_expire_after_seconds: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_maximum_document_count: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_max_size: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_num_orphan_docs: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_num_indexes: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_total_index_size: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_average_object_size: Optional[int] = Field( + default=None, description="" + ) + mongo_d_b_collection_schema_definition: Optional[str] = Field( + default=None, description="" + ) column_count: Optional[int] = Field(default=None, description="") row_count: Optional[int] = Field(default=None, description="") size_bytes: Optional[int] = Field(default=None, description="") alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") + query_preview_config: Optional[Dict[str, str]] = Field( + default=None, description="" + ) external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -924,7 +1138,9 @@ class Attributes(Table.Attributes): iceberg_table_type: Optional[str] = Field(default=None, description="") iceberg_catalog_source: Optional[str] = Field(default=None, description="") iceberg_catalog_table_name: Optional[str] = Field(default=None, description="") - iceberg_catalog_table_namespace: Optional[str] = Field(default=None, description="") + iceberg_catalog_table_namespace: Optional[str] = Field( + default=None, description="" + ) table_external_volume_name: Optional[str] = Field(default=None, description="") iceberg_table_base_location: Optional[str] = Field(default=None, description="") table_retention_time: Optional[int] = Field(default=None, description="") @@ -941,11 +1157,15 @@ class Attributes(Table.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field(default=None, description="") + calculation_view_qualified_name: Optional[str] = Field( + default=None, description="" + ) is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") - mongo_d_b_database: Optional[MongoDBDatabase] = Field(default=None, description="") # relationship + mongo_d_b_database: Optional[MongoDBDatabase] = Field( + default=None, description="" + ) # relationship attributes: MongoDBCollection.Attributes = Field( default_factory=lambda: MongoDBCollection.Attributes(), diff --git a/pyatlan/model/assets/core/mongo_d_b_database.py b/pyatlan/model/assets/core/mongo_d_b_database.py index 317312eb3..6a9af1da1 100644 --- a/pyatlan/model/assets/core/mongo_d_b_database.py +++ b/pyatlan/model/assets/core/mongo_d_b_database.py @@ -51,47 +51,69 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( + "queryUserCount", "queryUserCount" + ) """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( + "queryUserMap", "queryUserMap" + ) """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( + "queryCountUpdatedAt", "queryCountUpdatedAt" + ) """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "databaseName", "databaseName.keyword", "databaseName" + ) """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "databaseQualifiedName", "databaseQualifiedName" + ) """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "schemaName", "schemaName.keyword", "schemaName" + ) """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "schemaQualifiedName", "schemaQualifiedName" + ) """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "tableName", "tableName.keyword", "tableName" + ) """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "tableQualifiedName", "tableQualifiedName" + ) """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "viewName", "viewName.keyword", "viewName" + ) """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "viewQualifiedName", "viewQualifiedName" + ) """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -111,11 +133,15 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( + "lastProfiledAt", "lastProfiledAt" + ) """ Time (epoch) at which this asset was last profiled, in milliseconds. """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( + "noSQLSchemaDefinition", "noSQLSchemaDefinition" + ) """ Represents attributes for describing the key schema for the table and indexes. """ @@ -150,13 +176,21 @@ def __setattr__(self, name, value): @property def mongo_d_b_database_collection_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mongo_d_b_database_collection_count + return ( + None + if self.attributes is None + else self.attributes.mongo_d_b_database_collection_count + ) @mongo_d_b_database_collection_count.setter - def mongo_d_b_database_collection_count(self, mongo_d_b_database_collection_count: Optional[int]): + def mongo_d_b_database_collection_count( + self, mongo_d_b_database_collection_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.mongo_d_b_database_collection_count = mongo_d_b_database_collection_count + self.attributes.mongo_d_b_database_collection_count = ( + mongo_d_b_database_collection_count + ) @property def schema_count(self) -> Optional[int]: @@ -200,7 +234,9 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.query_count_updated_at + return ( + None if self.attributes is None else self.attributes.query_count_updated_at + ) @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -220,7 +256,9 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.database_qualified_name + return ( + None if self.attributes is None else self.attributes.database_qualified_name + ) @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -240,7 +278,9 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_qualified_name + return ( + None if self.attributes is None else self.attributes.schema_qualified_name + ) @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -290,7 +330,9 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_name + return ( + None if self.attributes is None else self.attributes.calculation_view_name + ) @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -300,13 +342,21 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.calculation_view_qualified_name + ) @calculation_view_qualified_name.setter - def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): + def calculation_view_qualified_name( + self, calculation_view_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = calculation_view_qualified_name + self.attributes.calculation_view_qualified_name = ( + calculation_view_qualified_name + ) @property def is_profiled(self) -> Optional[bool]: @@ -330,7 +380,11 @@ def last_profiled_at(self, last_profiled_at: Optional[datetime]): @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition + return ( + None + if self.attributes is None + else self.attributes.no_s_q_l_schema_definition + ) @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -340,16 +394,22 @@ def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @property def mongo_d_b_collections(self) -> Optional[List[MongoDBCollection]]: - return None if self.attributes is None else self.attributes.mongo_d_b_collections + return ( + None if self.attributes is None else self.attributes.mongo_d_b_collections + ) @mongo_d_b_collections.setter - def mongo_d_b_collections(self, mongo_d_b_collections: Optional[List[MongoDBCollection]]): + def mongo_d_b_collections( + self, mongo_d_b_collections: Optional[List[MongoDBCollection]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mongo_d_b_collections = mongo_d_b_collections class Attributes(Database.Attributes): - mongo_d_b_database_collection_count: Optional[int] = Field(default=None, description="") + mongo_d_b_database_collection_count: Optional[int] = Field( + default=None, description="" + ) schema_count: Optional[int] = Field(default=None, description="") query_count: Optional[int] = Field(default=None, description="") query_user_count: Optional[int] = Field(default=None, description="") @@ -364,11 +424,15 @@ class Attributes(Database.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field(default=None, description="") + calculation_view_qualified_name: Optional[str] = Field( + default=None, description="" + ) is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") - mongo_d_b_collections: Optional[List[MongoDBCollection]] = Field(default=None, description="") # relationship + mongo_d_b_collections: Optional[List[MongoDBCollection]] = Field( + default=None, description="" + ) # relationship attributes: MongoDBDatabase.Attributes = Field( default_factory=lambda: MongoDBDatabase.Attributes(), diff --git a/pyatlan/model/assets/core/monte_carlo.py b/pyatlan/model/assets/core/monte_carlo.py index 56e561c1e..55438a0f6 100644 --- a/pyatlan/model/assets/core/monte_carlo.py +++ b/pyatlan/model/assets/core/monte_carlo.py @@ -33,7 +33,9 @@ def __setattr__(self, name, value): """ List of labels for this Monte Carlo asset. """ - MC_ASSET_QUALIFIED_NAMES: ClassVar[KeywordField] = KeywordField("mcAssetQualifiedNames", "mcAssetQualifiedNames") + MC_ASSET_QUALIFIED_NAMES: ClassVar[KeywordField] = KeywordField( + "mcAssetQualifiedNames", "mcAssetQualifiedNames" + ) """ List of unique names of assets that are part of this Monte Carlo asset. """ @@ -55,7 +57,11 @@ def mc_labels(self, mc_labels: Optional[Set[str]]): @property def mc_asset_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.mc_asset_qualified_names + return ( + None + if self.attributes is None + else self.attributes.mc_asset_qualified_names + ) @mc_asset_qualified_names.setter def mc_asset_qualified_names(self, mc_asset_qualified_names: Optional[Set[str]]): @@ -65,7 +71,9 @@ def mc_asset_qualified_names(self, mc_asset_qualified_names: Optional[Set[str]]) class Attributes(DataQuality.Attributes): mc_labels: Optional[Set[str]] = Field(default=None, description="") - mc_asset_qualified_names: Optional[Set[str]] = Field(default=None, description="") + mc_asset_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) attributes: MonteCarlo.Attributes = Field( default_factory=lambda: MonteCarlo.Attributes(), diff --git a/pyatlan/model/assets/core/namespace.py b/pyatlan/model/assets/core/namespace.py index 3bec05fa4..8d15f8a68 100644 --- a/pyatlan/model/assets/core/namespace.py +++ b/pyatlan/model/assets/core/namespace.py @@ -64,8 +64,12 @@ def children_queries(self, children_queries: Optional[List[Query]]): self.attributes.children_queries = children_queries class Attributes(Asset.Attributes): - children_folders: Optional[List[Folder]] = Field(default=None, description="") # relationship - children_queries: Optional[List[Query]] = Field(default=None, description="") # relationship + children_folders: Optional[List[Folder]] = Field( + default=None, description="" + ) # relationship + children_queries: Optional[List[Query]] = Field( + default=None, description="" + ) # relationship attributes: Namespace.Attributes = Field( default_factory=lambda: Namespace.Attributes(), diff --git a/pyatlan/model/assets/core/no_s_q_l.py b/pyatlan/model/assets/core/no_s_q_l.py index 4513a2498..5da903bd1 100644 --- a/pyatlan/model/assets/core/no_s_q_l.py +++ b/pyatlan/model/assets/core/no_s_q_l.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( + "noSQLSchemaDefinition", "noSQLSchemaDefinition" + ) """ Represents attributes for describing the key schema for the table and indexes. """ @@ -40,7 +42,11 @@ def __setattr__(self, name, value): @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition + return ( + None + if self.attributes is None + else self.attributes.no_s_q_l_schema_definition + ) @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): diff --git a/pyatlan/model/assets/core/persona.py b/pyatlan/model/assets/core/persona.py index f0f78105e..b2c73f47d 100644 --- a/pyatlan/model/assets/core/persona.py +++ b/pyatlan/model/assets/core/persona.py @@ -40,7 +40,9 @@ def creator(cls, *, name: str) -> Persona: @init_guid def create(cls, *, name: str) -> Persona: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -185,11 +187,15 @@ def create_for_modification( is_enabled: bool = True, ) -> Persona: warn( - ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'updater' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.updater(qualified_name=qualified_name, name=name, is_enabled=is_enabled) + return cls.updater( + qualified_name=qualified_name, name=name, is_enabled=is_enabled + ) type_name: str = Field(default="Persona", allow_mutation=False) @@ -204,7 +210,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - PERSONA_GROUPS: ClassVar[KeywordField] = KeywordField("personaGroups", "personaGroups") + PERSONA_GROUPS: ClassVar[KeywordField] = KeywordField( + "personaGroups", "personaGroups" + ) """ TBC """ diff --git a/pyatlan/model/assets/core/power_b_i.py b/pyatlan/model/assets/core/power_b_i.py index 551321cd5..4f8ddaef8 100644 --- a/pyatlan/model/assets/core/power_b_i.py +++ b/pyatlan/model/assets/core/power_b_i.py @@ -35,7 +35,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - POWER_BI_IS_HIDDEN: ClassVar[BooleanField] = BooleanField("powerBIIsHidden", "powerBIIsHidden") + POWER_BI_IS_HIDDEN: ClassVar[BooleanField] = BooleanField( + "powerBIIsHidden", "powerBIIsHidden" + ) """ Whether this asset is hidden in Power BI (true) or not (false). """ @@ -47,11 +49,15 @@ def __setattr__(self, name, value): """ Unique name of the Power BI table in which this asset exists. """ - POWER_BI_FORMAT_STRING: ClassVar[TextField] = TextField("powerBIFormatString", "powerBIFormatString") + POWER_BI_FORMAT_STRING: ClassVar[TextField] = TextField( + "powerBIFormatString", "powerBIFormatString" + ) """ Format of this asset, as specified in the FORMAT_STRING of the MDX cell property. """ - POWER_BI_ENDORSEMENT: ClassVar[KeywordField] = KeywordField("powerBIEndorsement", "powerBIEndorsement") + POWER_BI_ENDORSEMENT: ClassVar[KeywordField] = KeywordField( + "powerBIEndorsement", "powerBIEndorsement" + ) """ Endorsement status of this asset, in Power BI. """ @@ -75,17 +81,25 @@ def power_b_i_is_hidden(self, power_b_i_is_hidden: Optional[bool]): @property def power_b_i_table_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_table_qualified_name + return ( + None + if self.attributes is None + else self.attributes.power_b_i_table_qualified_name + ) @power_b_i_table_qualified_name.setter - def power_b_i_table_qualified_name(self, power_b_i_table_qualified_name: Optional[str]): + def power_b_i_table_qualified_name( + self, power_b_i_table_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_table_qualified_name = power_b_i_table_qualified_name @property def power_b_i_format_string(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_format_string + return ( + None if self.attributes is None else self.attributes.power_b_i_format_string + ) @power_b_i_format_string.setter def power_b_i_format_string(self, power_b_i_format_string: Optional[str]): @@ -95,19 +109,27 @@ def power_b_i_format_string(self, power_b_i_format_string: Optional[str]): @property def power_b_i_endorsement(self) -> Optional[PowerbiEndorsement]: - return None if self.attributes is None else self.attributes.power_b_i_endorsement + return ( + None if self.attributes is None else self.attributes.power_b_i_endorsement + ) @power_b_i_endorsement.setter - def power_b_i_endorsement(self, power_b_i_endorsement: Optional[PowerbiEndorsement]): + def power_b_i_endorsement( + self, power_b_i_endorsement: Optional[PowerbiEndorsement] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_endorsement = power_b_i_endorsement class Attributes(BI.Attributes): power_b_i_is_hidden: Optional[bool] = Field(default=None, description="") - power_b_i_table_qualified_name: Optional[str] = Field(default=None, description="") + power_b_i_table_qualified_name: Optional[str] = Field( + default=None, description="" + ) power_b_i_format_string: Optional[str] = Field(default=None, description="") - power_b_i_endorsement: Optional[PowerbiEndorsement] = Field(default=None, description="") + power_b_i_endorsement: Optional[PowerbiEndorsement] = Field( + default=None, description="" + ) attributes: PowerBI.Attributes = Field( default_factory=lambda: PowerBI.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_column.py b/pyatlan/model/assets/core/power_b_i_column.py index 137456298..5d7c4b6f6 100644 --- a/pyatlan/model/assets/core/power_b_i_column.py +++ b/pyatlan/model/assets/core/power_b_i_column.py @@ -42,7 +42,9 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this column exists. """ - DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasetQualifiedName", "datasetQualifiedName") + DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "datasetQualifiedName", "datasetQualifiedName" + ) """ Unique name of the dataset in which this column exists. """ @@ -52,11 +54,15 @@ def __setattr__(self, name, value): """ Data category that describes the data in this column. """ - POWER_BI_COLUMN_DATA_TYPE: ClassVar[KeywordField] = KeywordField("powerBIColumnDataType", "powerBIColumnDataType") + POWER_BI_COLUMN_DATA_TYPE: ClassVar[KeywordField] = KeywordField( + "powerBIColumnDataType", "powerBIColumnDataType" + ) """ Data type of this column. """ - POWER_BI_SORT_BY_COLUMN: ClassVar[KeywordField] = KeywordField("powerBISortByColumn", "powerBISortByColumn") + POWER_BI_SORT_BY_COLUMN: ClassVar[KeywordField] = KeywordField( + "powerBISortByColumn", "powerBISortByColumn" + ) """ Name of a column in the same table to use to order this column. """ @@ -84,7 +90,11 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.workspace_qualified_name + ) @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -94,7 +104,9 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def dataset_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dataset_qualified_name + return ( + None if self.attributes is None else self.attributes.dataset_qualified_name + ) @dataset_qualified_name.setter def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @@ -104,17 +116,27 @@ def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @property def power_b_i_column_data_category(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_column_data_category + return ( + None + if self.attributes is None + else self.attributes.power_b_i_column_data_category + ) @power_b_i_column_data_category.setter - def power_b_i_column_data_category(self, power_b_i_column_data_category: Optional[str]): + def power_b_i_column_data_category( + self, power_b_i_column_data_category: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_column_data_category = power_b_i_column_data_category @property def power_b_i_column_data_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_column_data_type + return ( + None + if self.attributes is None + else self.attributes.power_b_i_column_data_type + ) @power_b_i_column_data_type.setter def power_b_i_column_data_type(self, power_b_i_column_data_type: Optional[str]): @@ -124,7 +146,11 @@ def power_b_i_column_data_type(self, power_b_i_column_data_type: Optional[str]): @property def power_b_i_sort_by_column(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_sort_by_column + return ( + None + if self.attributes is None + else self.attributes.power_b_i_sort_by_column + ) @power_b_i_sort_by_column.setter def power_b_i_sort_by_column(self, power_b_i_sort_by_column: Optional[str]): @@ -134,10 +160,16 @@ def power_b_i_sort_by_column(self, power_b_i_sort_by_column: Optional[str]): @property def power_b_i_column_summarize_by(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_column_summarize_by + return ( + None + if self.attributes is None + else self.attributes.power_b_i_column_summarize_by + ) @power_b_i_column_summarize_by.setter - def power_b_i_column_summarize_by(self, power_b_i_column_summarize_by: Optional[str]): + def power_b_i_column_summarize_by( + self, power_b_i_column_summarize_by: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_column_summarize_by = power_b_i_column_summarize_by @@ -155,11 +187,17 @@ def table(self, table: Optional[PowerBITable]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") dataset_qualified_name: Optional[str] = Field(default=None, description="") - power_b_i_column_data_category: Optional[str] = Field(default=None, description="") + power_b_i_column_data_category: Optional[str] = Field( + default=None, description="" + ) power_b_i_column_data_type: Optional[str] = Field(default=None, description="") power_b_i_sort_by_column: Optional[str] = Field(default=None, description="") - power_b_i_column_summarize_by: Optional[str] = Field(default=None, description="") - table: Optional[PowerBITable] = Field(default=None, description="") # relationship + power_b_i_column_summarize_by: Optional[str] = Field( + default=None, description="" + ) + table: Optional[PowerBITable] = Field( + default=None, description="" + ) # relationship attributes: PowerBIColumn.Attributes = Field( default_factory=lambda: PowerBIColumn.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_dashboard.py b/pyatlan/model/assets/core/power_b_i_dashboard.py index 60700bf9e..fccb372ff 100644 --- a/pyatlan/model/assets/core/power_b_i_dashboard.py +++ b/pyatlan/model/assets/core/power_b_i_dashboard.py @@ -70,7 +70,11 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.workspace_qualified_name + ) @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -122,8 +126,12 @@ class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") web_url: Optional[str] = Field(default=None, description="") tile_count: Optional[int] = Field(default=None, description="") - workspace: Optional[PowerBIWorkspace] = Field(default=None, description="") # relationship - tiles: Optional[List[PowerBITile]] = Field(default=None, description="") # relationship + workspace: Optional[PowerBIWorkspace] = Field( + default=None, description="" + ) # relationship + tiles: Optional[List[PowerBITile]] = Field( + default=None, description="" + ) # relationship attributes: PowerBIDashboard.Attributes = Field( default_factory=lambda: PowerBIDashboard.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_dataflow.py b/pyatlan/model/assets/core/power_b_i_dataflow.py index 0afcb8e29..d53378615 100644 --- a/pyatlan/model/assets/core/power_b_i_dataflow.py +++ b/pyatlan/model/assets/core/power_b_i_dataflow.py @@ -79,7 +79,9 @@ def __setattr__(self, name, value): """ TBC """ - POWER_BI_DATAFLOW_ENTITY_COLUMNS: ClassVar[RelationField] = RelationField("powerBIDataflowEntityColumns") + POWER_BI_DATAFLOW_ENTITY_COLUMNS: ClassVar[RelationField] = RelationField( + "powerBIDataflowEntityColumns" + ) """ TBC """ @@ -91,11 +93,15 @@ def __setattr__(self, name, value): """ TBC """ - POWER_BI_DATAFLOW_CHILDREN: ClassVar[RelationField] = RelationField("powerBIDataflowChildren") + POWER_BI_DATAFLOW_CHILDREN: ClassVar[RelationField] = RelationField( + "powerBIDataflowChildren" + ) """ TBC """ - POWER_BI_DATAFLOW_PARENTS: ClassVar[RelationField] = RelationField("powerBIDataflowParents") + POWER_BI_DATAFLOW_PARENTS: ClassVar[RelationField] = RelationField( + "powerBIDataflowParents" + ) """ TBC """ @@ -118,7 +124,11 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.workspace_qualified_name + ) @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -138,7 +148,11 @@ def web_url(self, web_url: Optional[str]): @property def power_b_i_dataflow_refresh_schedule_frequency(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_dataflow_refresh_schedule_frequency + return ( + None + if self.attributes is None + else self.attributes.power_b_i_dataflow_refresh_schedule_frequency + ) @power_b_i_dataflow_refresh_schedule_frequency.setter def power_b_i_dataflow_refresh_schedule_frequency( @@ -146,21 +160,35 @@ def power_b_i_dataflow_refresh_schedule_frequency( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_refresh_schedule_frequency = power_b_i_dataflow_refresh_schedule_frequency + self.attributes.power_b_i_dataflow_refresh_schedule_frequency = ( + power_b_i_dataflow_refresh_schedule_frequency + ) @property def power_b_i_dataflow_refresh_schedule_times(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.power_b_i_dataflow_refresh_schedule_times + return ( + None + if self.attributes is None + else self.attributes.power_b_i_dataflow_refresh_schedule_times + ) @power_b_i_dataflow_refresh_schedule_times.setter - def power_b_i_dataflow_refresh_schedule_times(self, power_b_i_dataflow_refresh_schedule_times: Optional[Set[str]]): + def power_b_i_dataflow_refresh_schedule_times( + self, power_b_i_dataflow_refresh_schedule_times: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_refresh_schedule_times = power_b_i_dataflow_refresh_schedule_times + self.attributes.power_b_i_dataflow_refresh_schedule_times = ( + power_b_i_dataflow_refresh_schedule_times + ) @property def power_b_i_dataflow_refresh_schedule_time_zone(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_dataflow_refresh_schedule_time_zone + return ( + None + if self.attributes is None + else self.attributes.power_b_i_dataflow_refresh_schedule_time_zone + ) @power_b_i_dataflow_refresh_schedule_time_zone.setter def power_b_i_dataflow_refresh_schedule_time_zone( @@ -168,7 +196,9 @@ def power_b_i_dataflow_refresh_schedule_time_zone( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_refresh_schedule_time_zone = power_b_i_dataflow_refresh_schedule_time_zone + self.attributes.power_b_i_dataflow_refresh_schedule_time_zone = ( + power_b_i_dataflow_refresh_schedule_time_zone + ) @property def workspace(self) -> Optional[PowerBIWorkspace]: @@ -204,7 +234,11 @@ def datasets(self, datasets: Optional[List[PowerBIDataset]]): def power_b_i_dataflow_entity_columns( self, ) -> Optional[List[PowerBIDataflowEntityColumn]]: - return None if self.attributes is None else self.attributes.power_b_i_dataflow_entity_columns + return ( + None + if self.attributes is None + else self.attributes.power_b_i_dataflow_entity_columns + ) @power_b_i_dataflow_entity_columns.setter def power_b_i_dataflow_entity_columns( @@ -213,7 +247,9 @@ def power_b_i_dataflow_entity_columns( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_entity_columns = power_b_i_dataflow_entity_columns + self.attributes.power_b_i_dataflow_entity_columns = ( + power_b_i_dataflow_entity_columns + ) @property def tables(self) -> Optional[List[PowerBITable]]: @@ -227,30 +263,46 @@ def tables(self, tables: Optional[List[PowerBITable]]): @property def power_b_i_datasources(self) -> Optional[List[PowerBIDatasource]]: - return None if self.attributes is None else self.attributes.power_b_i_datasources + return ( + None if self.attributes is None else self.attributes.power_b_i_datasources + ) @power_b_i_datasources.setter - def power_b_i_datasources(self, power_b_i_datasources: Optional[List[PowerBIDatasource]]): + def power_b_i_datasources( + self, power_b_i_datasources: Optional[List[PowerBIDatasource]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_datasources = power_b_i_datasources @property def power_b_i_dataflow_children(self) -> Optional[List[PowerBIDataflow]]: - return None if self.attributes is None else self.attributes.power_b_i_dataflow_children + return ( + None + if self.attributes is None + else self.attributes.power_b_i_dataflow_children + ) @power_b_i_dataflow_children.setter - def power_b_i_dataflow_children(self, power_b_i_dataflow_children: Optional[List[PowerBIDataflow]]): + def power_b_i_dataflow_children( + self, power_b_i_dataflow_children: Optional[List[PowerBIDataflow]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_dataflow_children = power_b_i_dataflow_children @property def power_b_i_dataflow_parents(self) -> Optional[List[PowerBIDataflow]]: - return None if self.attributes is None else self.attributes.power_b_i_dataflow_parents + return ( + None + if self.attributes is None + else self.attributes.power_b_i_dataflow_parents + ) @power_b_i_dataflow_parents.setter - def power_b_i_dataflow_parents(self, power_b_i_dataflow_parents: Optional[List[PowerBIDataflow]]): + def power_b_i_dataflow_parents( + self, power_b_i_dataflow_parents: Optional[List[PowerBIDataflow]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_dataflow_parents = power_b_i_dataflow_parents @@ -258,17 +310,33 @@ def power_b_i_dataflow_parents(self, power_b_i_dataflow_parents: Optional[List[P class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") web_url: Optional[str] = Field(default=None, description="") - power_b_i_dataflow_refresh_schedule_frequency: Optional[str] = Field(default=None, description="") - power_b_i_dataflow_refresh_schedule_times: Optional[Set[str]] = Field(default=None, description="") - power_b_i_dataflow_refresh_schedule_time_zone: Optional[str] = Field(default=None, description="") - workspace: Optional[PowerBIWorkspace] = Field(default=None, description="") # relationship - power_b_i_processes: Optional[List[Process]] = Field(default=None, description="") # relationship - datasets: Optional[List[PowerBIDataset]] = Field(default=None, description="") # relationship - power_b_i_dataflow_entity_columns: Optional[List[PowerBIDataflowEntityColumn]] = Field( + power_b_i_dataflow_refresh_schedule_frequency: Optional[str] = Field( + default=None, description="" + ) + power_b_i_dataflow_refresh_schedule_times: Optional[Set[str]] = Field( + default=None, description="" + ) + power_b_i_dataflow_refresh_schedule_time_zone: Optional[str] = Field( + default=None, description="" + ) + workspace: Optional[PowerBIWorkspace] = Field( + default=None, description="" + ) # relationship + power_b_i_processes: Optional[List[Process]] = Field( + default=None, description="" + ) # relationship + datasets: Optional[List[PowerBIDataset]] = Field( + default=None, description="" + ) # relationship + power_b_i_dataflow_entity_columns: Optional[ + List[PowerBIDataflowEntityColumn] + ] = Field(default=None, description="") # relationship + tables: Optional[List[PowerBITable]] = Field( + default=None, description="" + ) # relationship + power_b_i_datasources: Optional[List[PowerBIDatasource]] = Field( default=None, description="" ) # relationship - tables: Optional[List[PowerBITable]] = Field(default=None, description="") # relationship - power_b_i_datasources: Optional[List[PowerBIDatasource]] = Field(default=None, description="") # relationship power_b_i_dataflow_children: Optional[List[PowerBIDataflow]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/core/power_b_i_dataflow_entity_column.py b/pyatlan/model/assets/core/power_b_i_dataflow_entity_column.py index b3a706726..d734366c9 100644 --- a/pyatlan/model/assets/core/power_b_i_dataflow_entity_column.py +++ b/pyatlan/model/assets/core/power_b_i_dataflow_entity_column.py @@ -69,43 +69,73 @@ def __setattr__(self, name, value): @property def power_b_i_dataflow_entity_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_dataflow_entity_name + return ( + None + if self.attributes is None + else self.attributes.power_b_i_dataflow_entity_name + ) @power_b_i_dataflow_entity_name.setter - def power_b_i_dataflow_entity_name(self, power_b_i_dataflow_entity_name: Optional[str]): + def power_b_i_dataflow_entity_name( + self, power_b_i_dataflow_entity_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_dataflow_entity_name = power_b_i_dataflow_entity_name @property def power_b_i_workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.power_b_i_workspace_qualified_name + ) @power_b_i_workspace_qualified_name.setter - def power_b_i_workspace_qualified_name(self, power_b_i_workspace_qualified_name: Optional[str]): + def power_b_i_workspace_qualified_name( + self, power_b_i_workspace_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_workspace_qualified_name = power_b_i_workspace_qualified_name + self.attributes.power_b_i_workspace_qualified_name = ( + power_b_i_workspace_qualified_name + ) @property def power_b_i_dataflow_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_dataflow_qualified_name + return ( + None + if self.attributes is None + else self.attributes.power_b_i_dataflow_qualified_name + ) @power_b_i_dataflow_qualified_name.setter - def power_b_i_dataflow_qualified_name(self, power_b_i_dataflow_qualified_name: Optional[str]): + def power_b_i_dataflow_qualified_name( + self, power_b_i_dataflow_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_qualified_name = power_b_i_dataflow_qualified_name + self.attributes.power_b_i_dataflow_qualified_name = ( + power_b_i_dataflow_qualified_name + ) @property def power_b_i_dataflow_entity_column_data_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_dataflow_entity_column_data_type + return ( + None + if self.attributes is None + else self.attributes.power_b_i_dataflow_entity_column_data_type + ) @power_b_i_dataflow_entity_column_data_type.setter - def power_b_i_dataflow_entity_column_data_type(self, power_b_i_dataflow_entity_column_data_type: Optional[str]): + def power_b_i_dataflow_entity_column_data_type( + self, power_b_i_dataflow_entity_column_data_type: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_dataflow_entity_column_data_type = power_b_i_dataflow_entity_column_data_type + self.attributes.power_b_i_dataflow_entity_column_data_type = ( + power_b_i_dataflow_entity_column_data_type + ) @property def power_b_i_dataflow(self) -> Optional[PowerBIDataflow]: @@ -118,11 +148,21 @@ def power_b_i_dataflow(self, power_b_i_dataflow: Optional[PowerBIDataflow]): self.attributes.power_b_i_dataflow = power_b_i_dataflow class Attributes(PowerBI.Attributes): - power_b_i_dataflow_entity_name: Optional[str] = Field(default=None, description="") - power_b_i_workspace_qualified_name: Optional[str] = Field(default=None, description="") - power_b_i_dataflow_qualified_name: Optional[str] = Field(default=None, description="") - power_b_i_dataflow_entity_column_data_type: Optional[str] = Field(default=None, description="") - power_b_i_dataflow: Optional[PowerBIDataflow] = Field(default=None, description="") # relationship + power_b_i_dataflow_entity_name: Optional[str] = Field( + default=None, description="" + ) + power_b_i_workspace_qualified_name: Optional[str] = Field( + default=None, description="" + ) + power_b_i_dataflow_qualified_name: Optional[str] = Field( + default=None, description="" + ) + power_b_i_dataflow_entity_column_data_type: Optional[str] = Field( + default=None, description="" + ) + power_b_i_dataflow: Optional[PowerBIDataflow] = Field( + default=None, description="" + ) # relationship attributes: PowerBIDataflowEntityColumn.Attributes = Field( default_factory=lambda: PowerBIDataflowEntityColumn.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_dataset.py b/pyatlan/model/assets/core/power_b_i_dataset.py index dbc2aad10..bcd0cf026 100644 --- a/pyatlan/model/assets/core/power_b_i_dataset.py +++ b/pyatlan/model/assets/core/power_b_i_dataset.py @@ -80,7 +80,11 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.workspace_qualified_name + ) @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -161,12 +165,24 @@ def datasources(self, datasources: Optional[List[PowerBIDatasource]]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") web_url: Optional[str] = Field(default=None, description="") - reports: Optional[List[PowerBIReport]] = Field(default=None, description="") # relationship - workspace: Optional[PowerBIWorkspace] = Field(default=None, description="") # relationship - tiles: Optional[List[PowerBITile]] = Field(default=None, description="") # relationship - tables: Optional[List[PowerBITable]] = Field(default=None, description="") # relationship - dataflows: Optional[List[PowerBIDataflow]] = Field(default=None, description="") # relationship - datasources: Optional[List[PowerBIDatasource]] = Field(default=None, description="") # relationship + reports: Optional[List[PowerBIReport]] = Field( + default=None, description="" + ) # relationship + workspace: Optional[PowerBIWorkspace] = Field( + default=None, description="" + ) # relationship + tiles: Optional[List[PowerBITile]] = Field( + default=None, description="" + ) # relationship + tables: Optional[List[PowerBITable]] = Field( + default=None, description="" + ) # relationship + dataflows: Optional[List[PowerBIDataflow]] = Field( + default=None, description="" + ) # relationship + datasources: Optional[List[PowerBIDatasource]] = Field( + default=None, description="" + ) # relationship attributes: PowerBIDataset.Attributes = Field( default_factory=lambda: PowerBIDataset.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_datasource.py b/pyatlan/model/assets/core/power_b_i_datasource.py index 474d03ca7..8accfcca2 100644 --- a/pyatlan/model/assets/core/power_b_i_datasource.py +++ b/pyatlan/model/assets/core/power_b_i_datasource.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - CONNECTION_DETAILS: ClassVar[KeywordField] = KeywordField("connectionDetails", "connectionDetails") + CONNECTION_DETAILS: ClassVar[KeywordField] = KeywordField( + "connectionDetails", "connectionDetails" + ) """ Connection details of the datasource. """ @@ -80,9 +82,15 @@ def datasets(self, datasets: Optional[List[PowerBIDataset]]): self.attributes.datasets = datasets class Attributes(PowerBI.Attributes): - connection_details: Optional[Dict[str, str]] = Field(default=None, description="") - power_b_i_dataflows: Optional[List[PowerBIDataflow]] = Field(default=None, description="") # relationship - datasets: Optional[List[PowerBIDataset]] = Field(default=None, description="") # relationship + connection_details: Optional[Dict[str, str]] = Field( + default=None, description="" + ) + power_b_i_dataflows: Optional[List[PowerBIDataflow]] = Field( + default=None, description="" + ) # relationship + datasets: Optional[List[PowerBIDataset]] = Field( + default=None, description="" + ) # relationship attributes: PowerBIDatasource.Attributes = Field( default_factory=lambda: PowerBIDatasource.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_measure.py b/pyatlan/model/assets/core/power_b_i_measure.py index b48a45b06..3b3a7f0df 100644 --- a/pyatlan/model/assets/core/power_b_i_measure.py +++ b/pyatlan/model/assets/core/power_b_i_measure.py @@ -42,11 +42,15 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this measure exists. """ - DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasetQualifiedName", "datasetQualifiedName") + DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "datasetQualifiedName", "datasetQualifiedName" + ) """ Unique name of the dataset in which this measure exists. """ - POWER_BI_MEASURE_EXPRESSION: ClassVar[TextField] = TextField("powerBIMeasureExpression", "powerBIMeasureExpression") + POWER_BI_MEASURE_EXPRESSION: ClassVar[TextField] = TextField( + "powerBIMeasureExpression", "powerBIMeasureExpression" + ) """ DAX expression for this measure. """ @@ -72,7 +76,11 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.workspace_qualified_name + ) @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -82,7 +90,9 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def dataset_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dataset_qualified_name + return ( + None if self.attributes is None else self.attributes.dataset_qualified_name + ) @dataset_qualified_name.setter def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @@ -92,7 +102,11 @@ def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @property def power_b_i_measure_expression(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.power_b_i_measure_expression + return ( + None + if self.attributes is None + else self.attributes.power_b_i_measure_expression + ) @power_b_i_measure_expression.setter def power_b_i_measure_expression(self, power_b_i_measure_expression: Optional[str]): @@ -102,10 +116,16 @@ def power_b_i_measure_expression(self, power_b_i_measure_expression: Optional[st @property def power_b_i_is_external_measure(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.power_b_i_is_external_measure + return ( + None + if self.attributes is None + else self.attributes.power_b_i_is_external_measure + ) @power_b_i_is_external_measure.setter - def power_b_i_is_external_measure(self, power_b_i_is_external_measure: Optional[bool]): + def power_b_i_is_external_measure( + self, power_b_i_is_external_measure: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_is_external_measure = power_b_i_is_external_measure @@ -123,9 +143,15 @@ def table(self, table: Optional[PowerBITable]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") dataset_qualified_name: Optional[str] = Field(default=None, description="") - power_b_i_measure_expression: Optional[str] = Field(default=None, description="") - power_b_i_is_external_measure: Optional[bool] = Field(default=None, description="") - table: Optional[PowerBITable] = Field(default=None, description="") # relationship + power_b_i_measure_expression: Optional[str] = Field( + default=None, description="" + ) + power_b_i_is_external_measure: Optional[bool] = Field( + default=None, description="" + ) + table: Optional[PowerBITable] = Field( + default=None, description="" + ) # relationship attributes: PowerBIMeasure.Attributes = Field( default_factory=lambda: PowerBIMeasure.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_page.py b/pyatlan/model/assets/core/power_b_i_page.py index 88db91f31..75cc670ae 100644 --- a/pyatlan/model/assets/core/power_b_i_page.py +++ b/pyatlan/model/assets/core/power_b_i_page.py @@ -37,7 +37,9 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this page exists. """ - REPORT_QUALIFIED_NAME: ClassVar[TextField] = TextField("reportQualifiedName", "reportQualifiedName") + REPORT_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "reportQualifiedName", "reportQualifiedName" + ) """ Unique name of the report in which this page exists. """ @@ -55,7 +57,11 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.workspace_qualified_name + ) @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -65,7 +71,9 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def report_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.report_qualified_name + return ( + None if self.attributes is None else self.attributes.report_qualified_name + ) @report_qualified_name.setter def report_qualified_name(self, report_qualified_name: Optional[str]): @@ -86,7 +94,9 @@ def report(self, report: Optional[PowerBIReport]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") report_qualified_name: Optional[str] = Field(default=None, description="") - report: Optional[PowerBIReport] = Field(default=None, description="") # relationship + report: Optional[PowerBIReport] = Field( + default=None, description="" + ) # relationship attributes: PowerBIPage.Attributes = Field( default_factory=lambda: PowerBIPage.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_report.py b/pyatlan/model/assets/core/power_b_i_report.py index 3ef606932..d8ddc70a3 100644 --- a/pyatlan/model/assets/core/power_b_i_report.py +++ b/pyatlan/model/assets/core/power_b_i_report.py @@ -42,7 +42,9 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this report exists. """ - DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasetQualifiedName", "datasetQualifiedName") + DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "datasetQualifiedName", "datasetQualifiedName" + ) """ Unique name of the dataset used to build this report. """ @@ -85,7 +87,11 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.workspace_qualified_name + ) @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -95,7 +101,9 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def dataset_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dataset_qualified_name + return ( + None if self.attributes is None else self.attributes.dataset_qualified_name + ) @dataset_qualified_name.setter def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @@ -168,10 +176,18 @@ class Attributes(PowerBI.Attributes): dataset_qualified_name: Optional[str] = Field(default=None, description="") web_url: Optional[str] = Field(default=None, description="") page_count: Optional[int] = Field(default=None, description="") - workspace: Optional[PowerBIWorkspace] = Field(default=None, description="") # relationship - tiles: Optional[List[PowerBITile]] = Field(default=None, description="") # relationship - pages: Optional[List[PowerBIPage]] = Field(default=None, description="") # relationship - dataset: Optional[PowerBIDataset] = Field(default=None, description="") # relationship + workspace: Optional[PowerBIWorkspace] = Field( + default=None, description="" + ) # relationship + tiles: Optional[List[PowerBITile]] = Field( + default=None, description="" + ) # relationship + pages: Optional[List[PowerBIPage]] = Field( + default=None, description="" + ) # relationship + dataset: Optional[PowerBIDataset] = Field( + default=None, description="" + ) # relationship attributes: PowerBIReport.Attributes = Field( default_factory=lambda: PowerBIReport.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_table.py b/pyatlan/model/assets/core/power_b_i_table.py index a6ab63477..69520437d 100644 --- a/pyatlan/model/assets/core/power_b_i_table.py +++ b/pyatlan/model/assets/core/power_b_i_table.py @@ -42,7 +42,9 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this table exists. """ - DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasetQualifiedName", "datasetQualifiedName") + DATASET_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "datasetQualifiedName", "datasetQualifiedName" + ) """ Unique name of the dataset in which this table exists. """ @@ -105,7 +107,11 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.workspace_qualified_name + ) @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -115,7 +121,9 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def dataset_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dataset_qualified_name + return ( + None if self.attributes is None else self.attributes.dataset_qualified_name + ) @dataset_qualified_name.setter def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @@ -125,7 +133,11 @@ def dataset_qualified_name(self, dataset_qualified_name: Optional[str]): @property def dataflow_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.dataflow_qualified_names + return ( + None + if self.attributes is None + else self.attributes.dataflow_qualified_names + ) @dataflow_qualified_names.setter def dataflow_qualified_names(self, dataflow_qualified_names: Optional[Set[str]]): @@ -135,17 +147,29 @@ def dataflow_qualified_names(self, dataflow_qualified_names: Optional[Set[str]]) @property def power_b_i_table_source_expressions(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.power_b_i_table_source_expressions + return ( + None + if self.attributes is None + else self.attributes.power_b_i_table_source_expressions + ) @power_b_i_table_source_expressions.setter - def power_b_i_table_source_expressions(self, power_b_i_table_source_expressions: Optional[Set[str]]): + def power_b_i_table_source_expressions( + self, power_b_i_table_source_expressions: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.power_b_i_table_source_expressions = power_b_i_table_source_expressions + self.attributes.power_b_i_table_source_expressions = ( + power_b_i_table_source_expressions + ) @property def power_b_i_table_column_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.power_b_i_table_column_count + return ( + None + if self.attributes is None + else self.attributes.power_b_i_table_column_count + ) @power_b_i_table_column_count.setter def power_b_i_table_column_count(self, power_b_i_table_column_count: Optional[int]): @@ -155,10 +179,16 @@ def power_b_i_table_column_count(self, power_b_i_table_column_count: Optional[in @property def power_b_i_table_measure_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.power_b_i_table_measure_count + return ( + None + if self.attributes is None + else self.attributes.power_b_i_table_measure_count + ) @power_b_i_table_measure_count.setter - def power_b_i_table_measure_count(self, power_b_i_table_measure_count: Optional[int]): + def power_b_i_table_measure_count( + self, power_b_i_table_measure_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.power_b_i_table_measure_count = power_b_i_table_measure_count @@ -206,14 +236,30 @@ def dataset(self, dataset: Optional[PowerBIDataset]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") dataset_qualified_name: Optional[str] = Field(default=None, description="") - dataflow_qualified_names: Optional[Set[str]] = Field(default=None, description="") - power_b_i_table_source_expressions: Optional[Set[str]] = Field(default=None, description="") - power_b_i_table_column_count: Optional[int] = Field(default=None, description="") - power_b_i_table_measure_count: Optional[int] = Field(default=None, description="") - columns: Optional[List[PowerBIColumn]] = Field(default=None, description="") # relationship - measures: Optional[List[PowerBIMeasure]] = Field(default=None, description="") # relationship - dataflows: Optional[List[PowerBIDataflow]] = Field(default=None, description="") # relationship - dataset: Optional[PowerBIDataset] = Field(default=None, description="") # relationship + dataflow_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) + power_b_i_table_source_expressions: Optional[Set[str]] = Field( + default=None, description="" + ) + power_b_i_table_column_count: Optional[int] = Field( + default=None, description="" + ) + power_b_i_table_measure_count: Optional[int] = Field( + default=None, description="" + ) + columns: Optional[List[PowerBIColumn]] = Field( + default=None, description="" + ) # relationship + measures: Optional[List[PowerBIMeasure]] = Field( + default=None, description="" + ) # relationship + dataflows: Optional[List[PowerBIDataflow]] = Field( + default=None, description="" + ) # relationship + dataset: Optional[PowerBIDataset] = Field( + default=None, description="" + ) # relationship attributes: PowerBITable.Attributes = Field( default_factory=lambda: PowerBITable.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_tile.py b/pyatlan/model/assets/core/power_b_i_tile.py index be686b541..d31fdeb00 100644 --- a/pyatlan/model/assets/core/power_b_i_tile.py +++ b/pyatlan/model/assets/core/power_b_i_tile.py @@ -37,7 +37,9 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this tile exists. """ - DASHBOARD_QUALIFIED_NAME: ClassVar[TextField] = TextField("dashboardQualifiedName", "dashboardQualifiedName") + DASHBOARD_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "dashboardQualifiedName", "dashboardQualifiedName" + ) """ Unique name of the dashboard in which this tile is pinned. """ @@ -65,7 +67,11 @@ def __setattr__(self, name, value): @property def workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.workspace_qualified_name + ) @workspace_qualified_name.setter def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @@ -75,7 +81,11 @@ def workspace_qualified_name(self, workspace_qualified_name: Optional[str]): @property def dashboard_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dashboard_qualified_name + return ( + None + if self.attributes is None + else self.attributes.dashboard_qualified_name + ) @dashboard_qualified_name.setter def dashboard_qualified_name(self, dashboard_qualified_name: Optional[str]): @@ -116,9 +126,15 @@ def dataset(self, dataset: Optional[PowerBIDataset]): class Attributes(PowerBI.Attributes): workspace_qualified_name: Optional[str] = Field(default=None, description="") dashboard_qualified_name: Optional[str] = Field(default=None, description="") - dashboard: Optional[PowerBIDashboard] = Field(default=None, description="") # relationship - report: Optional[PowerBIReport] = Field(default=None, description="") # relationship - dataset: Optional[PowerBIDataset] = Field(default=None, description="") # relationship + dashboard: Optional[PowerBIDashboard] = Field( + default=None, description="" + ) # relationship + report: Optional[PowerBIReport] = Field( + default=None, description="" + ) # relationship + dataset: Optional[PowerBIDataset] = Field( + default=None, description="" + ) # relationship attributes: PowerBITile.Attributes = Field( default_factory=lambda: PowerBITile.Attributes(), diff --git a/pyatlan/model/assets/core/power_b_i_workspace.py b/pyatlan/model/assets/core/power_b_i_workspace.py index 436986446..47966cb64 100644 --- a/pyatlan/model/assets/core/power_b_i_workspace.py +++ b/pyatlan/model/assets/core/power_b_i_workspace.py @@ -37,7 +37,9 @@ def __setattr__(self, name, value): """ Number of reports in this workspace. """ - DASHBOARD_COUNT: ClassVar[NumericField] = NumericField("dashboardCount", "dashboardCount") + DASHBOARD_COUNT: ClassVar[NumericField] = NumericField( + "dashboardCount", "dashboardCount" + ) """ Number of dashboards in this workspace. """ @@ -45,7 +47,9 @@ def __setattr__(self, name, value): """ Number of datasets in this workspace. """ - DATAFLOW_COUNT: ClassVar[NumericField] = NumericField("dataflowCount", "dataflowCount") + DATAFLOW_COUNT: ClassVar[NumericField] = NumericField( + "dataflowCount", "dataflowCount" + ) """ Number of dataflows in this workspace. """ @@ -175,10 +179,18 @@ class Attributes(PowerBI.Attributes): dashboard_count: Optional[int] = Field(default=None, description="") dataset_count: Optional[int] = Field(default=None, description="") dataflow_count: Optional[int] = Field(default=None, description="") - reports: Optional[List[PowerBIReport]] = Field(default=None, description="") # relationship - datasets: Optional[List[PowerBIDataset]] = Field(default=None, description="") # relationship - dashboards: Optional[List[PowerBIDashboard]] = Field(default=None, description="") # relationship - dataflows: Optional[List[PowerBIDataflow]] = Field(default=None, description="") # relationship + reports: Optional[List[PowerBIReport]] = Field( + default=None, description="" + ) # relationship + datasets: Optional[List[PowerBIDataset]] = Field( + default=None, description="" + ) # relationship + dashboards: Optional[List[PowerBIDashboard]] = Field( + default=None, description="" + ) # relationship + dataflows: Optional[List[PowerBIDataflow]] = Field( + default=None, description="" + ) # relationship attributes: PowerBIWorkspace.Attributes = Field( default_factory=lambda: PowerBIWorkspace.Attributes(), diff --git a/pyatlan/model/assets/core/procedure.py b/pyatlan/model/assets/core/procedure.py index 2e07718b4..52e9f238f 100644 --- a/pyatlan/model/assets/core/procedure.py +++ b/pyatlan/model/assets/core/procedure.py @@ -73,7 +73,9 @@ def updater(cls, *, name: str, qualified_name: str, definition: str) -> Procedur ["name", "qualified_name", "definition"], [name, qualified_name, definition], ) - procedure = Procedure(attributes=Procedure.Attributes(qualified_name=qualified_name, name=name)) + procedure = Procedure( + attributes=Procedure.Attributes(qualified_name=qualified_name, name=name) + ) procedure.definition = definition return procedure @@ -134,7 +136,9 @@ def atlan_schema(self, atlan_schema: Optional[Schema]): class Attributes(SQL.Attributes): definition: Optional[str] = Field(default=None, description="") - atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship + atlan_schema: Optional[Schema] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -155,7 +159,9 @@ def create( ) assert schema_qualified_name # noqa: S101 if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( schema_qualified_name, "schema_qualified_name", 5 @@ -166,7 +172,10 @@ def create( connection_qualified_name = connection_qualified_name or connection_qn database_name = database_name or fields[3] schema_name = schema_name or fields[4] - database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" + database_qualified_name = ( + database_qualified_name + or f"{connection_qualified_name}/{database_name}" + ) return Procedure.Attributes( name=name, diff --git a/pyatlan/model/assets/core/process.py b/pyatlan/model/assets/core/process.py index 4143f9146..26009bc41 100644 --- a/pyatlan/model/assets/core/process.py +++ b/pyatlan/model/assets/core/process.py @@ -54,7 +54,9 @@ def create( parent: Optional[Process] = None, ) -> Process: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -92,7 +94,9 @@ def __setattr__(self, name, value): """ Parsed AST of the code or SQL statements that describe the logic of this process. """ - ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField("additionalEtlContext", "additionalEtlContext") + ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField( + "additionalEtlContext", "additionalEtlContext" + ) """ Additional Context of the ETL pipeline/notebook which creates the process. """ @@ -194,7 +198,9 @@ def ast(self, ast: Optional[str]): @property def additional_etl_context(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.additional_etl_context + return ( + None if self.attributes is None else self.attributes.additional_etl_context + ) @additional_etl_context.setter def additional_etl_context(self, additional_etl_context: Optional[str]): @@ -279,13 +285,27 @@ class Attributes(Asset.Attributes): sql: Optional[str] = Field(default=None, description="") ast: Optional[str] = Field(default=None, description="") additional_etl_context: Optional[str] = Field(default=None, description="") - adf_activity: Optional[AdfActivity] = Field(default=None, description="") # relationship - spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship - matillion_component: Optional[MatillionComponent] = Field(default=None, description="") # relationship - airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship - fivetran_connector: Optional[FivetranConnector] = Field(default=None, description="") # relationship - power_b_i_dataflow: Optional[PowerBIDataflow] = Field(default=None, description="") # relationship - column_processes: Optional[List[ColumnProcess]] = Field(default=None, description="") # relationship + adf_activity: Optional[AdfActivity] = Field( + default=None, description="" + ) # relationship + spark_jobs: Optional[List[SparkJob]] = Field( + default=None, description="" + ) # relationship + matillion_component: Optional[MatillionComponent] = Field( + default=None, description="" + ) # relationship + airflow_tasks: Optional[List[AirflowTask]] = Field( + default=None, description="" + ) # relationship + fivetran_connector: Optional[FivetranConnector] = Field( + default=None, description="" + ) # relationship + power_b_i_dataflow: Optional[PowerBIDataflow] = Field( + default=None, description="" + ) # relationship + column_processes: Optional[List[ColumnProcess]] = Field( + default=None, description="" + ) # relationship @staticmethod def generate_qualified_name( diff --git a/pyatlan/model/assets/core/query.py b/pyatlan/model/assets/core/query.py index c54681a06..1f4bd5201 100644 --- a/pyatlan/model/assets/core/query.py +++ b/pyatlan/model/assets/core/query.py @@ -82,7 +82,9 @@ def updater( else: parent = Folder.ref_by_qualified_name(parent_qualified_name) # type: ignore[assignment] - query = Query(attributes=Query.Attributes(qualified_name=qualified_name, name=name)) + query = Query( + attributes=Query.Attributes(qualified_name=qualified_name, name=name) + ) query.parent = parent query.collection_qualified_name = collection_qualified_name query.parent_qualified_name = parent_qualified_name @@ -109,7 +111,9 @@ def with_raw_query(self, schema_qualified_name: str, query: str): self.default_schema_qualified_name = schema_qualified_name self.is_visual_query = False self.raw_query_text = query - self.variables_schema_base64 = b64encode(_DEFAULT_VARIABLE_SCHEMA.encode("utf-8")).decode("utf-8") + self.variables_schema_base64 = b64encode( + _DEFAULT_VARIABLE_SCHEMA.encode("utf-8") + ).decode("utf-8") type_name: str = Field(default="Query", allow_mutation=False) @@ -152,7 +156,9 @@ def __setattr__(self, name, value): """ Unique name of the default database to use for this query. """ - VARIABLES_SCHEMA_BASE64: ClassVar[TextField] = TextField("variablesSchemaBase64", "variablesSchemaBase64") + VARIABLES_SCHEMA_BASE64: ClassVar[TextField] = TextField( + "variablesSchemaBase64", "variablesSchemaBase64" + ) """ Base64-encoded string of the variables to use in this query. """ @@ -160,7 +166,9 @@ def __setattr__(self, name, value): """ Whether this query is private (true) or shared (false). """ - IS_SQL_SNIPPET: ClassVar[BooleanField] = BooleanField("isSqlSnippet", "isSqlSnippet") + IS_SQL_SNIPPET: ClassVar[BooleanField] = BooleanField( + "isSqlSnippet", "isSqlSnippet" + ) """ Whether this query is a SQL snippet (true) or not (false). """ @@ -178,7 +186,9 @@ def __setattr__(self, name, value): """ Unique name of the collection in which this query exists. """ - IS_VISUAL_QUERY: ClassVar[BooleanField] = BooleanField("isVisualQuery", "isVisualQuery") + IS_VISUAL_QUERY: ClassVar[BooleanField] = BooleanField( + "isVisualQuery", "isVisualQuery" + ) """ Whether this query is a visual query (true) or not (false). """ @@ -257,27 +267,43 @@ def raw_query_text(self, raw_query_text: Optional[str]): @property def default_schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.default_schema_qualified_name + return ( + None + if self.attributes is None + else self.attributes.default_schema_qualified_name + ) @default_schema_qualified_name.setter - def default_schema_qualified_name(self, default_schema_qualified_name: Optional[str]): + def default_schema_qualified_name( + self, default_schema_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.default_schema_qualified_name = default_schema_qualified_name @property def default_database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.default_database_qualified_name + return ( + None + if self.attributes is None + else self.attributes.default_database_qualified_name + ) @default_database_qualified_name.setter - def default_database_qualified_name(self, default_database_qualified_name: Optional[str]): + def default_database_qualified_name( + self, default_database_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.default_database_qualified_name = default_database_qualified_name + self.attributes.default_database_qualified_name = ( + default_database_qualified_name + ) @property def variables_schema_base64(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.variables_schema_base64 + return ( + None if self.attributes is None else self.attributes.variables_schema_base64 + ) @variables_schema_base64.setter def variables_schema_base64(self, variables_schema_base64: Optional[str]): @@ -307,7 +333,9 @@ def is_sql_snippet(self, is_sql_snippet: Optional[bool]): @property def parent_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.parent_qualified_name + return ( + None if self.attributes is None else self.attributes.parent_qualified_name + ) @parent_qualified_name.setter def parent_qualified_name(self, parent_qualified_name: Optional[str]): @@ -317,7 +345,11 @@ def parent_qualified_name(self, parent_qualified_name: Optional[str]): @property def collection_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.collection_qualified_name + return ( + None + if self.attributes is None + else self.attributes.collection_qualified_name + ) @collection_qualified_name.setter def collection_qualified_name(self, collection_qualified_name: Optional[str]): @@ -337,7 +369,11 @@ def is_visual_query(self, is_visual_query: Optional[bool]): @property def visual_builder_schema_base64(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.visual_builder_schema_base64 + return ( + None + if self.attributes is None + else self.attributes.visual_builder_schema_base64 + ) @visual_builder_schema_base64.setter def visual_builder_schema_base64(self, visual_builder_schema_base64: Optional[str]): @@ -389,19 +425,33 @@ class Attributes(SQL.Attributes): raw_query: Optional[str] = Field(default=None, description="") long_raw_query: Optional[str] = Field(default=None, description="") raw_query_text: Optional[str] = Field(default=None, description="") - default_schema_qualified_name: Optional[str] = Field(default=None, description="") - default_database_qualified_name: Optional[str] = Field(default=None, description="") + default_schema_qualified_name: Optional[str] = Field( + default=None, description="" + ) + default_database_qualified_name: Optional[str] = Field( + default=None, description="" + ) variables_schema_base64: Optional[str] = Field(default=None, description="") is_private: Optional[bool] = Field(default=None, description="") is_sql_snippet: Optional[bool] = Field(default=None, description="") parent_qualified_name: Optional[str] = Field(default=None, description="") collection_qualified_name: Optional[str] = Field(default=None, description="") is_visual_query: Optional[bool] = Field(default=None, description="") - visual_builder_schema_base64: Optional[str] = Field(default=None, description="") - parent: Optional[Namespace] = Field(default=None, description="") # relationship - columns: Optional[List[Column]] = Field(default=None, description="") # relationship - tables: Optional[List[Table]] = Field(default=None, description="") # relationship - views: Optional[List[View]] = Field(default=None, description="") # relationship + visual_builder_schema_base64: Optional[str] = Field( + default=None, description="" + ) + parent: Optional[Namespace] = Field( + default=None, description="" + ) # relationship + columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship + tables: Optional[List[Table]] = Field( + default=None, description="" + ) # relationship + views: Optional[List[View]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -424,13 +474,17 @@ def creator( if not parent_folder_qualified_name: qualified_name = f"{collection_qualified_name}/{name}" parent_qn = collection_qualified_name - parent = Collection.ref_by_qualified_name(collection_qualified_name or "") + parent = Collection.ref_by_qualified_name( + collection_qualified_name or "" + ) else: tokens = parent_folder_qualified_name.split("/") if len(tokens) < 4: raise ValueError("Invalid collection_qualified_name") - collection_qualified_name = f"{tokens[0]}/{tokens[1]}/{tokens[2]}/{tokens[3]}" + collection_qualified_name = ( + f"{tokens[0]}/{tokens[1]}/{tokens[2]}/{tokens[3]}" + ) qualified_name = f"{parent_folder_qualified_name}/{name}" parent_qn = parent_folder_qualified_name parent = Folder.ref_by_qualified_name(parent_folder_qualified_name) # type: ignore[assignment] diff --git a/pyatlan/model/assets/core/readme.py b/pyatlan/model/assets/core/readme.py index 71bd8fcaf..0f6bdb154 100644 --- a/pyatlan/model/assets/core/readme.py +++ b/pyatlan/model/assets/core/readme.py @@ -21,14 +21,24 @@ class Readme(Resource): @classmethod @init_guid - def creator(cls, *, asset: Asset, content: str, asset_name: Optional[str] = None) -> Readme: - return Readme(attributes=Readme.Attributes.create(asset=asset, content=content, asset_name=asset_name)) + def creator( + cls, *, asset: Asset, content: str, asset_name: Optional[str] = None + ) -> Readme: + return Readme( + attributes=Readme.Attributes.create( + asset=asset, content=content, asset_name=asset_name + ) + ) @classmethod @init_guid - def create(cls, *, asset: Asset, content: str, asset_name: Optional[str] = None) -> Readme: + def create( + cls, *, asset: Asset, content: str, asset_name: Optional[str] = None + ) -> Readme: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -43,7 +53,9 @@ def description(self) -> Optional[str]: def description(self, description: Optional[str]): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.description = quote(description) if description is not None else description + self.attributes.description = ( + quote(description) if description is not None else description + ) type_name: str = Field(default="Readme", allow_mutation=False) @@ -93,18 +105,26 @@ def asset(self, asset: Optional[Asset]): self.attributes.asset = asset class Attributes(Resource.Attributes): - see_also: Optional[List[Readme]] = Field(default=None, description="") # relationship + see_also: Optional[List[Readme]] = Field( + default=None, description="" + ) # relationship asset: Optional[Asset] = Field(default=None, description="") # relationship @classmethod @init_guid - def create(cls, *, asset: Asset, content: str, asset_name: Optional[str] = None) -> Readme.Attributes: + def create( + cls, *, asset: Asset, content: str, asset_name: Optional[str] = None + ) -> Readme.Attributes: validate_required_fields(["asset", "content"], [asset, content]) if not asset.name or len(asset.name) < 1: if not asset_name: - raise ValueError("asset_name is required when name is not available from asset") + raise ValueError( + "asset_name is required when name is not available from asset" + ) elif asset_name: - raise ValueError("asset_name can not be given when name is available from asset") + raise ValueError( + "asset_name can not be given when name is available from asset" + ) else: asset_name = asset.name if not asset.guid: diff --git a/pyatlan/model/assets/core/referenceable.py b/pyatlan/model/assets/core/referenceable.py index 5d20f6ca2..33fa2f03f 100644 --- a/pyatlan/model/assets/core/referenceable.py +++ b/pyatlan/model/assets/core/referenceable.py @@ -30,7 +30,9 @@ class Referenceable(AtlanObject): def __init__(__pydantic_self__, **data: Any) -> None: super().__init__(**data) __pydantic_self__.__fields_set__.update(["attributes", "type_name"]) - __pydantic_self__._metadata_proxy = CustomMetadataProxy(__pydantic_self__.business_attributes) + __pydantic_self__._metadata_proxy = CustomMetadataProxy( + __pydantic_self__.business_attributes + ) @root_validator(pre=True) def parse_custom_attributes(cls, values): @@ -88,7 +90,10 @@ def atlan_tag_names(self) -> List[str]: from pyatlan.model.constants import DELETED_ if self.classification_names: - return [AtlanTagCache.get_name_for_id(tag_id) or DELETED_ for tag_id in self.classification_names] + return [ + AtlanTagCache.get_name_for_id(tag_id) or DELETED_ + for tag_id in self.classification_names + ] return [] def __setattr__(self, name, value): @@ -115,20 +120,32 @@ def qualified_name(self, qualified_name: Optional[str]): @property def user_def_relationship_to(self) -> Optional[List[Referenceable]]: - return None if self.attributes is None else self.attributes.user_def_relationship_to + return ( + None + if self.attributes is None + else self.attributes.user_def_relationship_to + ) @user_def_relationship_to.setter - def user_def_relationship_to(self, user_def_relationship_to: Optional[List[Referenceable]]): + def user_def_relationship_to( + self, user_def_relationship_to: Optional[List[Referenceable]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.user_def_relationship_to = user_def_relationship_to @property def user_def_relationship_from(self) -> Optional[List[Referenceable]]: - return None if self.attributes is None else self.attributes.user_def_relationship_from + return ( + None + if self.attributes is None + else self.attributes.user_def_relationship_from + ) @user_def_relationship_from.setter - def user_def_relationship_from(self, user_def_relationship_from: Optional[List[Referenceable]]): + def user_def_relationship_from( + self, user_def_relationship_from: Optional[List[Referenceable]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.user_def_relationship_from = user_def_relationship_from @@ -145,9 +162,15 @@ def assigned_terms(self, assigned_terms: Optional[List[AtlasGlossaryTerm]]): class Attributes(AtlanObject): qualified_name: Optional[str] = Field(default="", description="") - user_def_relationship_to: Optional[List[Referenceable]] = Field(default=None, description="") # relationship - user_def_relationship_from: Optional[List[Referenceable]] = Field(default=None, description="") # relationship - meanings: Optional[List[AtlasGlossaryTerm]] = Field(default=None, description="") # relationship + user_def_relationship_to: Optional[List[Referenceable]] = Field( + default=None, description="" + ) # relationship + user_def_relationship_from: Optional[List[Referenceable]] = Field( + default=None, description="" + ) # relationship + meanings: Optional[List[AtlasGlossaryTerm]] = Field( + default=None, description="" + ) # relationship def validate_required(self): pass @@ -160,13 +183,19 @@ def validate_required(self): GUID: ClassVar[KeywordField] = InternalKeywordField("guid", "__guid", "__guid") """Globally unique identifier (GUID) of any object in Atlan.""" - CREATED_BY: ClassVar[KeywordField] = InternalKeywordField("createdBy", "__createdBy", "__createdBy") + CREATED_BY: ClassVar[KeywordField] = InternalKeywordField( + "createdBy", "__createdBy", "__createdBy" + ) """Atlan user who created this asset.""" - UPDATED_BY: ClassVar[KeywordField] = InternalKeywordField("updatedBy", "__modifiedBy", "__modifiedBy") + UPDATED_BY: ClassVar[KeywordField] = InternalKeywordField( + "updatedBy", "__modifiedBy", "__modifiedBy" + ) """Atlan user who last updated the asset.""" - STATUS: ClassVar[KeywordField] = InternalKeywordField("status", "__state", "__state") + STATUS: ClassVar[KeywordField] = InternalKeywordField( + "status", "__state", "__state" + ) """Asset status in Atlan (active vs deleted).""" ATLAN_TAGS: ClassVar[KeywordTextField] = InternalKeywordTextField( @@ -197,7 +226,9 @@ def validate_required(self): ) """All super types of an asset.""" - CREATE_TIME: ClassVar[NumericField] = InternalNumericField("createTime", "__timestamp", "__timestamp") + CREATE_TIME: ClassVar[NumericField] = InternalNumericField( + "createTime", "__timestamp", "__timestamp" + ) """Time (in milliseconds) when the asset was created.""" UPDATE_TIME: ClassVar[NumericField] = InternalNumericField( @@ -210,7 +241,9 @@ def validate_required(self): ) """Unique fully-qualified name of the asset in Atlan.""" - CUSTOM_ATTRIBUTES: ClassVar[TextField] = TextField("__customAttributes", "__customAttributes") + CUSTOM_ATTRIBUTES: ClassVar[TextField] = TextField( + "__customAttributes", "__customAttributes" + ) """ Any source-provided custom information. NOTE: This is NOT the same as custom metadata (user-managed), @@ -252,7 +285,9 @@ def validate_required(self): example="917ffec9-fa84-4c59-8e6c-c7b114d04be3", ) is_incomplete: Optional[bool] = Field(default=True, description="", example=True) - labels: Optional[List[str]] = Field(default=None, description="Arbitrary textual labels for the asset.") + labels: Optional[List[str]] = Field( + default=None, description="Arbitrary textual labels for the asset." + ) relationship_attributes: Optional[Dict[str, Any]] = Field( default=None, description="Map of relationships for the entity. The specific keys of this map will vary by type, " @@ -271,7 +306,9 @@ def validate_required(self): description="Time (epoch) at which this object was last assets_updated, in milliseconds.", example=1649172284333, ) - version: Optional[int] = Field(default=None, description="Version of this object.", example=2) + version: Optional[int] = Field( + default=None, description="Version of this object.", example=2 + ) atlan_tags: Optional[List[AtlanTag]] = Field( default=None, description="Atlan tags", diff --git a/pyatlan/model/assets/core/resource.py b/pyatlan/model/assets/core/resource.py index c8f77ef42..00f6be3ab 100644 --- a/pyatlan/model/assets/core/resource.py +++ b/pyatlan/model/assets/core/resource.py @@ -41,7 +41,9 @@ def __setattr__(self, name, value): """ Reference to the resource. """ - RESOURCE_METADATA: ClassVar[KeywordField] = KeywordField("resourceMetadata", "resourceMetadata") + RESOURCE_METADATA: ClassVar[KeywordField] = KeywordField( + "resourceMetadata", "resourceMetadata" + ) """ Metadata of the resource. """ @@ -97,7 +99,9 @@ class Attributes(Catalog.Attributes): link: Optional[str] = Field(default=None, description="") is_global: Optional[bool] = Field(default=None, description="") reference: Optional[str] = Field(default=None, description="") - resource_metadata: Optional[Dict[str, str]] = Field(default=None, description="") + resource_metadata: Optional[Dict[str, str]] = Field( + default=None, description="" + ) attributes: Resource.Attributes = Field( default_factory=lambda: Resource.Attributes(), diff --git a/pyatlan/model/assets/core/s_q_l.py b/pyatlan/model/assets/core/s_q_l.py index e4e1150b6..52c349640 100644 --- a/pyatlan/model/assets/core/s_q_l.py +++ b/pyatlan/model/assets/core/s_q_l.py @@ -40,47 +40,69 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( + "queryUserCount", "queryUserCount" + ) """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( + "queryUserMap", "queryUserMap" + ) """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( + "queryCountUpdatedAt", "queryCountUpdatedAt" + ) """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "databaseName", "databaseName.keyword", "databaseName" + ) """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "databaseQualifiedName", "databaseQualifiedName" + ) """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "schemaName", "schemaName.keyword", "schemaName" + ) """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "schemaQualifiedName", "schemaQualifiedName" + ) """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "tableName", "tableName.keyword", "tableName" + ) """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "tableQualifiedName", "tableQualifiedName" + ) """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "viewName", "viewName.keyword", "viewName" + ) """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "viewQualifiedName", "viewQualifiedName" + ) """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -100,7 +122,9 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( + "lastProfiledAt", "lastProfiledAt" + ) """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -182,7 +206,9 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.query_count_updated_at + return ( + None if self.attributes is None else self.attributes.query_count_updated_at + ) @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -202,7 +228,9 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.database_qualified_name + return ( + None if self.attributes is None else self.attributes.database_qualified_name + ) @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -222,7 +250,9 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_qualified_name + return ( + None if self.attributes is None else self.attributes.schema_qualified_name + ) @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -272,7 +302,9 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_name + return ( + None if self.attributes is None else self.attributes.calculation_view_name + ) @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -282,13 +314,21 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.calculation_view_qualified_name + ) @calculation_view_qualified_name.setter - def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): + def calculation_view_qualified_name( + self, calculation_view_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = calculation_view_qualified_name + self.attributes.calculation_view_qualified_name = ( + calculation_view_qualified_name + ) @property def is_profiled(self) -> Optional[bool]: @@ -374,14 +414,26 @@ class Attributes(Catalog.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field(default=None, description="") + calculation_view_qualified_name: Optional[str] = Field( + default=None, description="" + ) is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship - dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship + dbt_tests: Optional[List[DbtTest]] = Field( + default=None, description="" + ) # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship attributes: SQL.Attributes = Field( default_factory=lambda: SQL.Attributes(), diff --git a/pyatlan/model/assets/core/schema.py b/pyatlan/model/assets/core/schema.py index a3e8be496..2e8b45fc6 100644 --- a/pyatlan/model/assets/core/schema.py +++ b/pyatlan/model/assets/core/schema.py @@ -49,7 +49,9 @@ def creator( database_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> Schema: - validate_required_fields(["name", "database_qualified_name"], [name, database_qualified_name]) + validate_required_fields( + ["name", "database_qualified_name"], [name, database_qualified_name] + ) attributes = Schema.Attributes.create( name=name, database_qualified_name=database_qualified_name, @@ -62,7 +64,9 @@ def creator( @init_guid def create(cls, *, name: str, database_qualified_name: str) -> Schema: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -127,7 +131,9 @@ def __setattr__(self, name, value): """ TBC """ - SNOWFLAKE_DYNAMIC_TABLES: ClassVar[RelationField] = RelationField("snowflakeDynamicTables") + SNOWFLAKE_DYNAMIC_TABLES: ClassVar[RelationField] = RelationField( + "snowflakeDynamicTables" + ) """ TBC """ @@ -183,7 +189,11 @@ def views_count(self, views_count: Optional[int]): @property def linked_schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.linked_schema_qualified_name + return ( + None + if self.attributes is None + else self.attributes.linked_schema_qualified_name + ) @linked_schema_qualified_name.setter def linked_schema_qualified_name(self, linked_schema_qualified_name: Optional[str]): @@ -263,10 +273,16 @@ def materialised_views(self, materialised_views: Optional[List[MaterialisedView] @property def snowflake_dynamic_tables(self) -> Optional[List[SnowflakeDynamicTable]]: - return None if self.attributes is None else self.attributes.snowflake_dynamic_tables + return ( + None + if self.attributes is None + else self.attributes.snowflake_dynamic_tables + ) @snowflake_dynamic_tables.setter - def snowflake_dynamic_tables(self, snowflake_dynamic_tables: Optional[List[SnowflakeDynamicTable]]): + def snowflake_dynamic_tables( + self, snowflake_dynamic_tables: Optional[List[SnowflakeDynamicTable]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.snowflake_dynamic_tables = snowflake_dynamic_tables @@ -304,20 +320,42 @@ def calculation_views(self, calculation_views: Optional[List[CalculationView]]): class Attributes(SQL.Attributes): table_count: Optional[int] = Field(default=None, description="") views_count: Optional[int] = Field(default=None, description="") - linked_schema_qualified_name: Optional[str] = Field(default=None, description="") - snowflake_tags: Optional[List[SnowflakeTag]] = Field(default=None, description="") # relationship - functions: Optional[List[Function]] = Field(default=None, description="") # relationship - tables: Optional[List[Table]] = Field(default=None, description="") # relationship - database: Optional[Database] = Field(default=None, description="") # relationship - procedures: Optional[List[Procedure]] = Field(default=None, description="") # relationship - views: Optional[List[View]] = Field(default=None, description="") # relationship - materialised_views: Optional[List[MaterialisedView]] = Field(default=None, description="") # relationship + linked_schema_qualified_name: Optional[str] = Field( + default=None, description="" + ) + snowflake_tags: Optional[List[SnowflakeTag]] = Field( + default=None, description="" + ) # relationship + functions: Optional[List[Function]] = Field( + default=None, description="" + ) # relationship + tables: Optional[List[Table]] = Field( + default=None, description="" + ) # relationship + database: Optional[Database] = Field( + default=None, description="" + ) # relationship + procedures: Optional[List[Procedure]] = Field( + default=None, description="" + ) # relationship + views: Optional[List[View]] = Field( + default=None, description="" + ) # relationship + materialised_views: Optional[List[MaterialisedView]] = Field( + default=None, description="" + ) # relationship snowflake_dynamic_tables: Optional[List[SnowflakeDynamicTable]] = Field( default=None, description="" ) # relationship - snowflake_pipes: Optional[List[SnowflakePipe]] = Field(default=None, description="") # relationship - snowflake_streams: Optional[List[SnowflakeStream]] = Field(default=None, description="") # relationship - calculation_views: Optional[List[CalculationView]] = Field(default=None, description="") # relationship + snowflake_pipes: Optional[List[SnowflakePipe]] = Field( + default=None, description="" + ) # relationship + snowflake_streams: Optional[List[SnowflakeStream]] = Field( + default=None, description="" + ) # relationship + calculation_views: Optional[List[CalculationView]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -329,9 +367,13 @@ def create( database_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> Schema.Attributes: - validate_required_fields(["name, database_qualified_name"], [name, database_qualified_name]) + validate_required_fields( + ["name, database_qualified_name"], [name, database_qualified_name] + ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( database_qualified_name, "database_qualified_name", 4 diff --git a/pyatlan/model/assets/core/schema_registry.py b/pyatlan/model/assets/core/schema_registry.py index 0968814f3..bbb485d15 100644 --- a/pyatlan/model/assets/core/schema_registry.py +++ b/pyatlan/model/assets/core/schema_registry.py @@ -36,7 +36,9 @@ def __setattr__(self, name, value): """ Type of language or specification used to define the schema, for example: JSON, Protobuf, etc. """ - SCHEMA_REGISTRY_SCHEMA_ID: ClassVar[KeywordField] = KeywordField("schemaRegistrySchemaId", "schemaRegistrySchemaId") + SCHEMA_REGISTRY_SCHEMA_ID: ClassVar[KeywordField] = KeywordField( + "schemaRegistrySchemaId", "schemaRegistrySchemaId" + ) """ Unique identifier for schema definition set by the schema registry. """ @@ -48,17 +50,27 @@ def __setattr__(self, name, value): @property def schema_registry_schema_type(self) -> Optional[SchemaRegistrySchemaType]: - return None if self.attributes is None else self.attributes.schema_registry_schema_type + return ( + None + if self.attributes is None + else self.attributes.schema_registry_schema_type + ) @schema_registry_schema_type.setter - def schema_registry_schema_type(self, schema_registry_schema_type: Optional[SchemaRegistrySchemaType]): + def schema_registry_schema_type( + self, schema_registry_schema_type: Optional[SchemaRegistrySchemaType] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.schema_registry_schema_type = schema_registry_schema_type @property def schema_registry_schema_id(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_registry_schema_id + return ( + None + if self.attributes is None + else self.attributes.schema_registry_schema_id + ) @schema_registry_schema_id.setter def schema_registry_schema_id(self, schema_registry_schema_id: Optional[str]): @@ -67,7 +79,9 @@ def schema_registry_schema_id(self, schema_registry_schema_id: Optional[str]): self.attributes.schema_registry_schema_id = schema_registry_schema_id class Attributes(Catalog.Attributes): - schema_registry_schema_type: Optional[SchemaRegistrySchemaType] = Field(default=None, description="") + schema_registry_schema_type: Optional[SchemaRegistrySchemaType] = Field( + default=None, description="" + ) schema_registry_schema_id: Optional[str] = Field(default=None, description="") attributes: SchemaRegistry.Attributes = Field( diff --git a/pyatlan/model/assets/core/schema_registry_subject.py b/pyatlan/model/assets/core/schema_registry_subject.py index 8998f7492..71d9e563d 100644 --- a/pyatlan/model/assets/core/schema_registry_subject.py +++ b/pyatlan/model/assets/core/schema_registry_subject.py @@ -54,9 +54,11 @@ def __setattr__(self, name, value): """ Compatibility of the schema across versions. """ - SCHEMA_REGISTRY_SUBJECT_LATEST_SCHEMA_VERSION: ClassVar[KeywordField] = KeywordField( - "schemaRegistrySubjectLatestSchemaVersion", - "schemaRegistrySubjectLatestSchemaVersion", + SCHEMA_REGISTRY_SUBJECT_LATEST_SCHEMA_VERSION: ClassVar[KeywordField] = ( + KeywordField( + "schemaRegistrySubjectLatestSchemaVersion", + "schemaRegistrySubjectLatestSchemaVersion", + ) ) """ Latest schema version of the subject. @@ -68,9 +70,11 @@ def __setattr__(self, name, value): """ Definition of the latest schema in the subject. """ - SCHEMA_REGISTRY_SUBJECT_GOVERNING_ASSET_QUALIFIED_NAMES: ClassVar[KeywordField] = KeywordField( - "schemaRegistrySubjectGoverningAssetQualifiedNames", - "schemaRegistrySubjectGoverningAssetQualifiedNames", + SCHEMA_REGISTRY_SUBJECT_GOVERNING_ASSET_QUALIFIED_NAMES: ClassVar[KeywordField] = ( + KeywordField( + "schemaRegistrySubjectGoverningAssetQualifiedNames", + "schemaRegistrySubjectGoverningAssetQualifiedNames", + ) ) """ List of asset qualified names that this subject is governing/validating. @@ -93,42 +97,70 @@ def __setattr__(self, name, value): @property def schema_registry_subject_base_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_registry_subject_base_name + return ( + None + if self.attributes is None + else self.attributes.schema_registry_subject_base_name + ) @schema_registry_subject_base_name.setter - def schema_registry_subject_base_name(self, schema_registry_subject_base_name: Optional[str]): + def schema_registry_subject_base_name( + self, schema_registry_subject_base_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.schema_registry_subject_base_name = schema_registry_subject_base_name + self.attributes.schema_registry_subject_base_name = ( + schema_registry_subject_base_name + ) @property def schema_registry_subject_is_key_schema(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.schema_registry_subject_is_key_schema + return ( + None + if self.attributes is None + else self.attributes.schema_registry_subject_is_key_schema + ) @schema_registry_subject_is_key_schema.setter - def schema_registry_subject_is_key_schema(self, schema_registry_subject_is_key_schema: Optional[bool]): + def schema_registry_subject_is_key_schema( + self, schema_registry_subject_is_key_schema: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.schema_registry_subject_is_key_schema = schema_registry_subject_is_key_schema + self.attributes.schema_registry_subject_is_key_schema = ( + schema_registry_subject_is_key_schema + ) @property def schema_registry_subject_schema_compatibility( self, ) -> Optional[SchemaRegistrySchemaCompatibility]: - return None if self.attributes is None else self.attributes.schema_registry_subject_schema_compatibility + return ( + None + if self.attributes is None + else self.attributes.schema_registry_subject_schema_compatibility + ) @schema_registry_subject_schema_compatibility.setter def schema_registry_subject_schema_compatibility( self, - schema_registry_subject_schema_compatibility: Optional[SchemaRegistrySchemaCompatibility], + schema_registry_subject_schema_compatibility: Optional[ + SchemaRegistrySchemaCompatibility + ], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.schema_registry_subject_schema_compatibility = schema_registry_subject_schema_compatibility + self.attributes.schema_registry_subject_schema_compatibility = ( + schema_registry_subject_schema_compatibility + ) @property def schema_registry_subject_latest_schema_version(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_registry_subject_latest_schema_version + return ( + None + if self.attributes is None + else self.attributes.schema_registry_subject_latest_schema_version + ) @schema_registry_subject_latest_schema_version.setter def schema_registry_subject_latest_schema_version( @@ -136,11 +168,17 @@ def schema_registry_subject_latest_schema_version( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.schema_registry_subject_latest_schema_version = schema_registry_subject_latest_schema_version + self.attributes.schema_registry_subject_latest_schema_version = ( + schema_registry_subject_latest_schema_version + ) @property def schema_registry_subject_latest_schema_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_registry_subject_latest_schema_definition + return ( + None + if self.attributes is None + else self.attributes.schema_registry_subject_latest_schema_definition + ) @schema_registry_subject_latest_schema_definition.setter def schema_registry_subject_latest_schema_definition( @@ -157,7 +195,9 @@ def schema_registry_subject_governing_asset_qualified_names( self, ) -> Optional[Set[str]]: return ( - None if self.attributes is None else self.attributes.schema_registry_subject_governing_asset_qualified_names + None + if self.attributes is None + else self.attributes.schema_registry_subject_governing_asset_qualified_names ) @schema_registry_subject_governing_asset_qualified_names.setter @@ -182,17 +222,27 @@ def assets(self, assets: Optional[List[Asset]]): self.attributes.assets = assets class Attributes(SchemaRegistry.Attributes): - schema_registry_subject_base_name: Optional[str] = Field(default=None, description="") - schema_registry_subject_is_key_schema: Optional[bool] = Field(default=None, description="") - schema_registry_subject_schema_compatibility: Optional[SchemaRegistrySchemaCompatibility] = Field( + schema_registry_subject_base_name: Optional[str] = Field( default=None, description="" ) - schema_registry_subject_latest_schema_version: Optional[str] = Field(default=None, description="") - schema_registry_subject_latest_schema_definition: Optional[str] = Field(default=None, description="") - schema_registry_subject_governing_asset_qualified_names: Optional[Set[str]] = Field( + schema_registry_subject_is_key_schema: Optional[bool] = Field( default=None, description="" ) - assets: Optional[List[Asset]] = Field(default=None, description="") # relationship + schema_registry_subject_schema_compatibility: Optional[ + SchemaRegistrySchemaCompatibility + ] = Field(default=None, description="") + schema_registry_subject_latest_schema_version: Optional[str] = Field( + default=None, description="" + ) + schema_registry_subject_latest_schema_definition: Optional[str] = Field( + default=None, description="" + ) + schema_registry_subject_governing_asset_qualified_names: Optional[Set[str]] = ( + Field(default=None, description="") + ) + assets: Optional[List[Asset]] = Field( + default=None, description="" + ) # relationship attributes: SchemaRegistrySubject.Attributes = Field( default_factory=lambda: SchemaRegistrySubject.Attributes(), diff --git a/pyatlan/model/assets/core/snowflake_pipe.py b/pyatlan/model/assets/core/snowflake_pipe.py index 1e764fb1c..3fffa9a45 100644 --- a/pyatlan/model/assets/core/snowflake_pipe.py +++ b/pyatlan/model/assets/core/snowflake_pipe.py @@ -44,10 +44,12 @@ def __setattr__(self, name, value): """ Whether auto-ingest is enabled for this pipe (true) or not (false). """ - SNOWFLAKE_PIPE_NOTIFICATION_CHANNEL_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "snowflakePipeNotificationChannelName", - "snowflakePipeNotificationChannelName", - "snowflakePipeNotificationChannelName.text", + SNOWFLAKE_PIPE_NOTIFICATION_CHANNEL_NAME: ClassVar[KeywordTextField] = ( + KeywordTextField( + "snowflakePipeNotificationChannelName", + "snowflakePipeNotificationChannelName", + "snowflakePipeNotificationChannelName.text", + ) ) """ Name of the notification channel for this pipe. @@ -77,23 +79,39 @@ def definition(self, definition: Optional[str]): @property def snowflake_pipe_is_auto_ingest_enabled(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.snowflake_pipe_is_auto_ingest_enabled + return ( + None + if self.attributes is None + else self.attributes.snowflake_pipe_is_auto_ingest_enabled + ) @snowflake_pipe_is_auto_ingest_enabled.setter - def snowflake_pipe_is_auto_ingest_enabled(self, snowflake_pipe_is_auto_ingest_enabled: Optional[bool]): + def snowflake_pipe_is_auto_ingest_enabled( + self, snowflake_pipe_is_auto_ingest_enabled: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.snowflake_pipe_is_auto_ingest_enabled = snowflake_pipe_is_auto_ingest_enabled + self.attributes.snowflake_pipe_is_auto_ingest_enabled = ( + snowflake_pipe_is_auto_ingest_enabled + ) @property def snowflake_pipe_notification_channel_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.snowflake_pipe_notification_channel_name + return ( + None + if self.attributes is None + else self.attributes.snowflake_pipe_notification_channel_name + ) @snowflake_pipe_notification_channel_name.setter - def snowflake_pipe_notification_channel_name(self, snowflake_pipe_notification_channel_name: Optional[str]): + def snowflake_pipe_notification_channel_name( + self, snowflake_pipe_notification_channel_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.snowflake_pipe_notification_channel_name = snowflake_pipe_notification_channel_name + self.attributes.snowflake_pipe_notification_channel_name = ( + snowflake_pipe_notification_channel_name + ) @property def atlan_schema(self) -> Optional[Schema]: @@ -107,9 +125,15 @@ def atlan_schema(self, atlan_schema: Optional[Schema]): class Attributes(SQL.Attributes): definition: Optional[str] = Field(default=None, description="") - snowflake_pipe_is_auto_ingest_enabled: Optional[bool] = Field(default=None, description="") - snowflake_pipe_notification_channel_name: Optional[str] = Field(default=None, description="") - atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship + snowflake_pipe_is_auto_ingest_enabled: Optional[bool] = Field( + default=None, description="" + ) + snowflake_pipe_notification_channel_name: Optional[str] = Field( + default=None, description="" + ) + atlan_schema: Optional[Schema] = Field( + default=None, description="" + ) # relationship attributes: SnowflakePipe.Attributes = Field( default_factory=lambda: SnowflakePipe.Attributes(), diff --git a/pyatlan/model/assets/core/snowflake_stream.py b/pyatlan/model/assets/core/snowflake_stream.py index 05d0560e3..081dc4241 100644 --- a/pyatlan/model/assets/core/snowflake_stream.py +++ b/pyatlan/model/assets/core/snowflake_stream.py @@ -35,7 +35,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SNOWFLAKE_STREAM_TYPE: ClassVar[KeywordField] = KeywordField("snowflakeStreamType", "snowflakeStreamType") + SNOWFLAKE_STREAM_TYPE: ClassVar[KeywordField] = KeywordField( + "snowflakeStreamType", "snowflakeStreamType" + ) """ Type of this stream, for example: standard, append-only, insert-only, etc. """ @@ -45,11 +47,15 @@ def __setattr__(self, name, value): """ Type of the source of this stream. """ - SNOWFLAKE_STREAM_MODE: ClassVar[KeywordField] = KeywordField("snowflakeStreamMode", "snowflakeStreamMode") + SNOWFLAKE_STREAM_MODE: ClassVar[KeywordField] = KeywordField( + "snowflakeStreamMode", "snowflakeStreamMode" + ) """ Mode of this stream. """ - SNOWFLAKE_STREAM_IS_STALE: ClassVar[BooleanField] = BooleanField("snowflakeStreamIsStale", "snowflakeStreamIsStale") + SNOWFLAKE_STREAM_IS_STALE: ClassVar[BooleanField] = BooleanField( + "snowflakeStreamIsStale", "snowflakeStreamIsStale" + ) """ Whether this stream is stale (true) or not (false). """ @@ -76,7 +82,9 @@ def __setattr__(self, name, value): @property def snowflake_stream_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.snowflake_stream_type + return ( + None if self.attributes is None else self.attributes.snowflake_stream_type + ) @snowflake_stream_type.setter def snowflake_stream_type(self, snowflake_stream_type: Optional[str]): @@ -86,7 +94,11 @@ def snowflake_stream_type(self, snowflake_stream_type: Optional[str]): @property def snowflake_stream_source_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.snowflake_stream_source_type + return ( + None + if self.attributes is None + else self.attributes.snowflake_stream_source_type + ) @snowflake_stream_source_type.setter def snowflake_stream_source_type(self, snowflake_stream_source_type: Optional[str]): @@ -96,7 +108,9 @@ def snowflake_stream_source_type(self, snowflake_stream_source_type: Optional[st @property def snowflake_stream_mode(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.snowflake_stream_mode + return ( + None if self.attributes is None else self.attributes.snowflake_stream_mode + ) @snowflake_stream_mode.setter def snowflake_stream_mode(self, snowflake_stream_mode: Optional[str]): @@ -106,7 +120,11 @@ def snowflake_stream_mode(self, snowflake_stream_mode: Optional[str]): @property def snowflake_stream_is_stale(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.snowflake_stream_is_stale + return ( + None + if self.attributes is None + else self.attributes.snowflake_stream_is_stale + ) @snowflake_stream_is_stale.setter def snowflake_stream_is_stale(self, snowflake_stream_is_stale: Optional[bool]): @@ -116,10 +134,16 @@ def snowflake_stream_is_stale(self, snowflake_stream_is_stale: Optional[bool]): @property def snowflake_stream_stale_after(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.snowflake_stream_stale_after + return ( + None + if self.attributes is None + else self.attributes.snowflake_stream_stale_after + ) @snowflake_stream_stale_after.setter - def snowflake_stream_stale_after(self, snowflake_stream_stale_after: Optional[datetime]): + def snowflake_stream_stale_after( + self, snowflake_stream_stale_after: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.snowflake_stream_stale_after = snowflake_stream_stale_after @@ -136,11 +160,17 @@ def atlan_schema(self, atlan_schema: Optional[Schema]): class Attributes(SQL.Attributes): snowflake_stream_type: Optional[str] = Field(default=None, description="") - snowflake_stream_source_type: Optional[str] = Field(default=None, description="") + snowflake_stream_source_type: Optional[str] = Field( + default=None, description="" + ) snowflake_stream_mode: Optional[str] = Field(default=None, description="") snowflake_stream_is_stale: Optional[bool] = Field(default=None, description="") - snowflake_stream_stale_after: Optional[datetime] = Field(default=None, description="") - atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship + snowflake_stream_stale_after: Optional[datetime] = Field( + default=None, description="" + ) + atlan_schema: Optional[Schema] = Field( + default=None, description="" + ) # relationship attributes: SnowflakeStream.Attributes = Field( default_factory=lambda: SnowflakeStream.Attributes(), diff --git a/pyatlan/model/assets/core/snowflake_tag.py b/pyatlan/model/assets/core/snowflake_tag.py index c200e2fbc..e04428a26 100644 --- a/pyatlan/model/assets/core/snowflake_tag.py +++ b/pyatlan/model/assets/core/snowflake_tag.py @@ -41,7 +41,9 @@ def __setattr__(self, name, value): """ Unique identifier of the tag in the source system. """ - TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("tagAttributes", "tagAttributes") + TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( + "tagAttributes", "tagAttributes" + ) """ Attributes associated with the tag in the source system. """ @@ -61,47 +63,69 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( + "queryUserCount", "queryUserCount" + ) """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( + "queryUserMap", "queryUserMap" + ) """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( + "queryCountUpdatedAt", "queryCountUpdatedAt" + ) """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "databaseName", "databaseName.keyword", "databaseName" + ) """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "databaseQualifiedName", "databaseQualifiedName" + ) """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "schemaName", "schemaName.keyword", "schemaName" + ) """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "schemaQualifiedName", "schemaQualifiedName" + ) """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "tableName", "tableName.keyword", "tableName" + ) """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "tableQualifiedName", "tableQualifiedName" + ) """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "viewName", "viewName.keyword", "viewName" + ) """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "viewQualifiedName", "viewQualifiedName" + ) """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -121,7 +145,9 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( + "lastProfiledAt", "lastProfiledAt" + ) """ Time (epoch) at which this asset was last profiled, in milliseconds. """ @@ -212,7 +238,9 @@ def tag_allowed_values(self, tag_allowed_values: Optional[Set[str]]): @property def mapped_atlan_tag_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mapped_atlan_tag_name + return ( + None if self.attributes is None else self.attributes.mapped_atlan_tag_name + ) @mapped_atlan_tag_name.setter def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): @@ -252,7 +280,9 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.query_count_updated_at + return ( + None if self.attributes is None else self.attributes.query_count_updated_at + ) @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -272,7 +302,9 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.database_qualified_name + return ( + None if self.attributes is None else self.attributes.database_qualified_name + ) @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -292,7 +324,9 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_qualified_name + return ( + None if self.attributes is None else self.attributes.schema_qualified_name + ) @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -342,7 +376,9 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_name + return ( + None if self.attributes is None else self.attributes.calculation_view_name + ) @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -352,13 +388,21 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.calculation_view_qualified_name + ) @calculation_view_qualified_name.setter - def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): + def calculation_view_qualified_name( + self, calculation_view_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = calculation_view_qualified_name + self.attributes.calculation_view_qualified_name = ( + calculation_view_qualified_name + ) @property def is_profiled(self) -> Optional[bool]: @@ -442,7 +486,9 @@ def dbt_models(self, dbt_models: Optional[List[DbtModel]]): class Attributes(Tag.Attributes): tag_id: Optional[str] = Field(default=None, description="") - tag_attributes: Optional[List[SourceTagAttribute]] = Field(default=None, description="") + tag_attributes: Optional[List[SourceTagAttribute]] = Field( + default=None, description="" + ) tag_allowed_values: Optional[Set[str]] = Field(default=None, description="") mapped_atlan_tag_name: Optional[str] = Field(default=None, description="") query_count: Optional[int] = Field(default=None, description="") @@ -458,15 +504,29 @@ class Attributes(Tag.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field(default=None, description="") + calculation_view_qualified_name: Optional[str] = Field( + default=None, description="" + ) is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - sql_dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship - dbt_tests: Optional[List[DbtTest]] = Field(default=None, description="") # relationship - atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship - sql_dbt_sources: Optional[List[DbtSource]] = Field(default=None, description="") # relationship - dbt_models: Optional[List[DbtModel]] = Field(default=None, description="") # relationship + dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + sql_dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship + dbt_tests: Optional[List[DbtTest]] = Field( + default=None, description="" + ) # relationship + atlan_schema: Optional[Schema] = Field( + default=None, description="" + ) # relationship + sql_dbt_sources: Optional[List[DbtSource]] = Field( + default=None, description="" + ) # relationship + dbt_models: Optional[List[DbtModel]] = Field( + default=None, description="" + ) # relationship attributes: SnowflakeTag.Attributes = Field( default_factory=lambda: SnowflakeTag.Attributes(), diff --git a/pyatlan/model/assets/core/soda_check.py b/pyatlan/model/assets/core/soda_check.py index 7beea1f95..d71097ef4 100644 --- a/pyatlan/model/assets/core/soda_check.py +++ b/pyatlan/model/assets/core/soda_check.py @@ -45,15 +45,21 @@ def __setattr__(self, name, value): """ Status of the check in Soda. """ - SODA_CHECK_DEFINITION: ClassVar[TextField] = TextField("sodaCheckDefinition", "sodaCheckDefinition") + SODA_CHECK_DEFINITION: ClassVar[TextField] = TextField( + "sodaCheckDefinition", "sodaCheckDefinition" + ) """ Definition of the check in Soda. """ - SODA_CHECK_LAST_SCAN_AT: ClassVar[NumericField] = NumericField("sodaCheckLastScanAt", "sodaCheckLastScanAt") + SODA_CHECK_LAST_SCAN_AT: ClassVar[NumericField] = NumericField( + "sodaCheckLastScanAt", "sodaCheckLastScanAt" + ) """ """ - SODA_CHECK_INCIDENT_COUNT: ClassVar[NumericField] = NumericField("sodaCheckIncidentCount", "sodaCheckIncidentCount") + SODA_CHECK_INCIDENT_COUNT: ClassVar[NumericField] = NumericField( + "sodaCheckIncidentCount", "sodaCheckIncidentCount" + ) """ """ @@ -89,7 +95,11 @@ def soda_check_id(self, soda_check_id: Optional[str]): @property def soda_check_evaluation_status(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.soda_check_evaluation_status + return ( + None + if self.attributes is None + else self.attributes.soda_check_evaluation_status + ) @soda_check_evaluation_status.setter def soda_check_evaluation_status(self, soda_check_evaluation_status: Optional[str]): @@ -99,7 +109,9 @@ def soda_check_evaluation_status(self, soda_check_evaluation_status: Optional[st @property def soda_check_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.soda_check_definition + return ( + None if self.attributes is None else self.attributes.soda_check_definition + ) @soda_check_definition.setter def soda_check_definition(self, soda_check_definition: Optional[str]): @@ -109,7 +121,9 @@ def soda_check_definition(self, soda_check_definition: Optional[str]): @property def soda_check_last_scan_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.soda_check_last_scan_at + return ( + None if self.attributes is None else self.attributes.soda_check_last_scan_at + ) @soda_check_last_scan_at.setter def soda_check_last_scan_at(self, soda_check_last_scan_at: Optional[datetime]): @@ -119,7 +133,11 @@ def soda_check_last_scan_at(self, soda_check_last_scan_at: Optional[datetime]): @property def soda_check_incident_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.soda_check_incident_count + return ( + None + if self.attributes is None + else self.attributes.soda_check_incident_count + ) @soda_check_incident_count.setter def soda_check_incident_count(self, soda_check_incident_count: Optional[int]): @@ -149,12 +167,20 @@ def soda_check_assets(self, soda_check_assets: Optional[List[Asset]]): class Attributes(Soda.Attributes): soda_check_id: Optional[str] = Field(default=None, description="") - soda_check_evaluation_status: Optional[str] = Field(default=None, description="") + soda_check_evaluation_status: Optional[str] = Field( + default=None, description="" + ) soda_check_definition: Optional[str] = Field(default=None, description="") - soda_check_last_scan_at: Optional[datetime] = Field(default=None, description="") + soda_check_last_scan_at: Optional[datetime] = Field( + default=None, description="" + ) soda_check_incident_count: Optional[int] = Field(default=None, description="") - soda_check_columns: Optional[List[Column]] = Field(default=None, description="") # relationship - soda_check_assets: Optional[List[Asset]] = Field(default=None, description="") # relationship + soda_check_columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship + soda_check_assets: Optional[List[Asset]] = Field( + default=None, description="" + ) # relationship attributes: SodaCheck.Attributes = Field( default_factory=lambda: SodaCheck.Attributes(), diff --git a/pyatlan/model/assets/core/spark.py b/pyatlan/model/assets/core/spark.py index 145e70fc5..86841c96b 100644 --- a/pyatlan/model/assets/core/spark.py +++ b/pyatlan/model/assets/core/spark.py @@ -31,7 +31,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SPARK_RUN_VERSION: ClassVar[KeywordField] = KeywordField("sparkRunVersion", "sparkRunVersion") + SPARK_RUN_VERSION: ClassVar[KeywordField] = KeywordField( + "sparkRunVersion", "sparkRunVersion" + ) """ Spark Version for the Spark Job run eg. 3.4.1 """ @@ -41,11 +43,15 @@ def __setattr__(self, name, value): """ OpenLineage Version of the Spark Job run eg. 1.1.0 """ - SPARK_RUN_START_TIME: ClassVar[NumericField] = NumericField("sparkRunStartTime", "sparkRunStartTime") + SPARK_RUN_START_TIME: ClassVar[NumericField] = NumericField( + "sparkRunStartTime", "sparkRunStartTime" + ) """ Start time of the Spark Job eg. 1695673598218 """ - SPARK_RUN_END_TIME: ClassVar[NumericField] = NumericField("sparkRunEndTime", "sparkRunEndTime") + SPARK_RUN_END_TIME: ClassVar[NumericField] = NumericField( + "sparkRunEndTime", "sparkRunEndTime" + ) """ End time of the Spark Job eg. 1695673598218 """ @@ -76,10 +82,16 @@ def spark_run_version(self, spark_run_version: Optional[str]): @property def spark_run_open_lineage_version(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.spark_run_open_lineage_version + return ( + None + if self.attributes is None + else self.attributes.spark_run_open_lineage_version + ) @spark_run_open_lineage_version.setter - def spark_run_open_lineage_version(self, spark_run_open_lineage_version: Optional[str]): + def spark_run_open_lineage_version( + self, spark_run_open_lineage_version: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.spark_run_open_lineage_version = spark_run_open_lineage_version @@ -106,20 +118,30 @@ def spark_run_end_time(self, spark_run_end_time: Optional[datetime]): @property def spark_run_open_lineage_state(self) -> Optional[OpenLineageRunState]: - return None if self.attributes is None else self.attributes.spark_run_open_lineage_state + return ( + None + if self.attributes is None + else self.attributes.spark_run_open_lineage_state + ) @spark_run_open_lineage_state.setter - def spark_run_open_lineage_state(self, spark_run_open_lineage_state: Optional[OpenLineageRunState]): + def spark_run_open_lineage_state( + self, spark_run_open_lineage_state: Optional[OpenLineageRunState] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.spark_run_open_lineage_state = spark_run_open_lineage_state class Attributes(Catalog.Attributes): spark_run_version: Optional[str] = Field(default=None, description="") - spark_run_open_lineage_version: Optional[str] = Field(default=None, description="") + spark_run_open_lineage_version: Optional[str] = Field( + default=None, description="" + ) spark_run_start_time: Optional[datetime] = Field(default=None, description="") spark_run_end_time: Optional[datetime] = Field(default=None, description="") - spark_run_open_lineage_state: Optional[OpenLineageRunState] = Field(default=None, description="") + spark_run_open_lineage_state: Optional[OpenLineageRunState] = Field( + default=None, description="" + ) attributes: Spark.Attributes = Field( default_factory=lambda: Spark.Attributes(), diff --git a/pyatlan/model/assets/core/spark_job.py b/pyatlan/model/assets/core/spark_job.py index 4ec7c5527..27a92593b 100644 --- a/pyatlan/model/assets/core/spark_job.py +++ b/pyatlan/model/assets/core/spark_job.py @@ -118,8 +118,12 @@ def process(self, process: Optional[Process]): class Attributes(Spark.Attributes): spark_app_name: Optional[str] = Field(default=None, description="") spark_master: Optional[str] = Field(default=None, description="") - outputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship - inputs: Optional[List[Catalog]] = Field(default=None, description="") # relationship + outputs: Optional[List[Catalog]] = Field( + default=None, description="" + ) # relationship + inputs: Optional[List[Catalog]] = Field( + default=None, description="" + ) # relationship process: Optional[Process] = Field(default=None, description="") # relationship attributes: SparkJob.Attributes = Field( diff --git a/pyatlan/model/assets/core/stakeholder.py b/pyatlan/model/assets/core/stakeholder.py index 3d23f9ab2..768b8342b 100644 --- a/pyatlan/model/assets/core/stakeholder.py +++ b/pyatlan/model/assets/core/stakeholder.py @@ -35,7 +35,9 @@ def __setattr__(self, name, value): """ TBC """ - STAKEHOLDER_TITLE_GUID: ClassVar[KeywordField] = KeywordField("stakeholderTitleGuid", "stakeholderTitleGuid") + STAKEHOLDER_TITLE_GUID: ClassVar[KeywordField] = KeywordField( + "stakeholderTitleGuid", "stakeholderTitleGuid" + ) """ TBC """ @@ -44,7 +46,9 @@ def __setattr__(self, name, value): """ TBC """ - STAKEHOLDER_DATA_DOMAIN: ClassVar[RelationField] = RelationField("stakeholderDataDomain") + STAKEHOLDER_DATA_DOMAIN: ClassVar[RelationField] = RelationField( + "stakeholderDataDomain" + ) """ TBC """ @@ -58,17 +62,27 @@ def __setattr__(self, name, value): @property def stakeholder_domain_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.stakeholder_domain_qualified_name + return ( + None + if self.attributes is None + else self.attributes.stakeholder_domain_qualified_name + ) @stakeholder_domain_qualified_name.setter - def stakeholder_domain_qualified_name(self, stakeholder_domain_qualified_name: Optional[str]): + def stakeholder_domain_qualified_name( + self, stakeholder_domain_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.stakeholder_domain_qualified_name = stakeholder_domain_qualified_name + self.attributes.stakeholder_domain_qualified_name = ( + stakeholder_domain_qualified_name + ) @property def stakeholder_title_guid(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.stakeholder_title_guid + return ( + None if self.attributes is None else self.attributes.stakeholder_title_guid + ) @stakeholder_title_guid.setter def stakeholder_title_guid(self, stakeholder_title_guid: Optional[str]): @@ -88,7 +102,9 @@ def stakeholder_title(self, stakeholder_title: Optional[StakeholderTitle]): @property def stakeholder_data_domain(self) -> Optional[DataDomain]: - return None if self.attributes is None else self.attributes.stakeholder_data_domain + return ( + None if self.attributes is None else self.attributes.stakeholder_data_domain + ) @stakeholder_data_domain.setter def stakeholder_data_domain(self, stakeholder_data_domain: Optional[DataDomain]): @@ -97,10 +113,16 @@ def stakeholder_data_domain(self, stakeholder_data_domain: Optional[DataDomain]) self.attributes.stakeholder_data_domain = stakeholder_data_domain class Attributes(Persona.Attributes): - stakeholder_domain_qualified_name: Optional[str] = Field(default=None, description="") + stakeholder_domain_qualified_name: Optional[str] = Field( + default=None, description="" + ) stakeholder_title_guid: Optional[str] = Field(default=None, description="") - stakeholder_title: Optional[StakeholderTitle] = Field(default=None, description="") # relationship - stakeholder_data_domain: Optional[DataDomain] = Field(default=None, description="") # relationship + stakeholder_title: Optional[StakeholderTitle] = Field( + default=None, description="" + ) # relationship + stakeholder_data_domain: Optional[DataDomain] = Field( + default=None, description="" + ) # relationship attributes: Stakeholder.Attributes = Field( default_factory=lambda: Stakeholder.Attributes(), diff --git a/pyatlan/model/assets/core/stakeholder_title.py b/pyatlan/model/assets/core/stakeholder_title.py index b2511bea5..d22bf45c9 100644 --- a/pyatlan/model/assets/core/stakeholder_title.py +++ b/pyatlan/model/assets/core/stakeholder_title.py @@ -48,13 +48,21 @@ def __setattr__(self, name, value): @property def stakeholder_title_domain_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.stakeholder_title_domain_qualified_names + return ( + None + if self.attributes is None + else self.attributes.stakeholder_title_domain_qualified_names + ) @stakeholder_title_domain_qualified_names.setter - def stakeholder_title_domain_qualified_names(self, stakeholder_title_domain_qualified_names: Optional[Set[str]]): + def stakeholder_title_domain_qualified_names( + self, stakeholder_title_domain_qualified_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.stakeholder_title_domain_qualified_names = stakeholder_title_domain_qualified_names + self.attributes.stakeholder_title_domain_qualified_names = ( + stakeholder_title_domain_qualified_names + ) @property def stakeholders(self) -> Optional[List[Stakeholder]]: @@ -67,8 +75,12 @@ def stakeholders(self, stakeholders: Optional[List[Stakeholder]]): self.attributes.stakeholders = stakeholders class Attributes(Asset.Attributes): - stakeholder_title_domain_qualified_names: Optional[Set[str]] = Field(default=None, description="") - stakeholders: Optional[List[Stakeholder]] = Field(default=None, description="") # relationship + stakeholder_title_domain_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) + stakeholders: Optional[List[Stakeholder]] = Field( + default=None, description="" + ) # relationship attributes: StakeholderTitle.Attributes = Field( default_factory=lambda: StakeholderTitle.Attributes(), diff --git a/pyatlan/model/assets/core/table.py b/pyatlan/model/assets/core/table.py index 3367b031d..7ed2dc6dd 100644 --- a/pyatlan/model/assets/core/table.py +++ b/pyatlan/model/assets/core/table.py @@ -59,7 +59,9 @@ def creator( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> Table: - validate_required_fields(["name", "schema_qualified_name"], [name, schema_qualified_name]) + validate_required_fields( + ["name", "schema_qualified_name"], [name, schema_qualified_name] + ) attributes = Table.Attributes.create( name=name, schema_qualified_name=schema_qualified_name, @@ -74,7 +76,9 @@ def creator( @init_guid def create(cls, *, name: str, schema_qualified_name: str) -> Table: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -114,35 +118,51 @@ def __setattr__(self, name, value): """ Whether this table is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( + "isQueryPreview", "isQueryPreview" + ) """ Whether preview queries are allowed for this table (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( + "queryPreviewConfig", "queryPreviewConfig" + ) """ Configuration for preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") + EXTERNAL_LOCATION: ClassVar[TextField] = TextField( + "externalLocation", "externalLocation" + ) """ External location of this table, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( + "externalLocationRegion", "externalLocationRegion" + ) """ Region of the external location of this table, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( + "externalLocationFormat", "externalLocationFormat" + ) """ Format of the external location of this table, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( + "isPartitioned", "isPartitioned" + ) """ Whether this table is partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( + "partitionStrategy", "partitionStrategy" + ) """ Partition strategy for this table. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") + PARTITION_COUNT: ClassVar[NumericField] = NumericField( + "partitionCount", "partitionCount" + ) """ Number of partitions in this table. """ @@ -158,15 +178,21 @@ def __setattr__(self, name, value): """ Type of the table. """ - ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField("icebergCatalogName", "icebergCatalogName") + ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField( + "icebergCatalogName", "icebergCatalogName" + ) """ iceberg table catalog name (can be any user defined name) """ - ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField("icebergTableType", "icebergTableType") + ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField( + "icebergTableType", "icebergTableType" + ) """ iceberg table type (managed vs unmanaged) """ - ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField("icebergCatalogSource", "icebergCatalogSource") + ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField( + "icebergCatalogSource", "icebergCatalogSource" + ) """ iceberg table catalog type (glue, polaris, snowflake) """ @@ -194,7 +220,9 @@ def __setattr__(self, name, value): """ iceberg table base location inside the external volume. """ - TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField("tableRetentionTime", "tableRetentionTime") + TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField( + "tableRetentionTime", "tableRetentionTime" + ) """ Data retention time in days. """ @@ -339,7 +367,11 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_region + return ( + None + if self.attributes is None + else self.attributes.external_location_region + ) @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -349,7 +381,11 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_format + return ( + None + if self.attributes is None + else self.attributes.external_location_format + ) @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -439,7 +475,9 @@ def iceberg_table_type(self, iceberg_table_type: Optional[str]): @property def iceberg_catalog_source(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_source + return ( + None if self.attributes is None else self.attributes.iceberg_catalog_source + ) @iceberg_catalog_source.setter def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @@ -449,7 +487,11 @@ def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @property def iceberg_catalog_table_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_table_name + return ( + None + if self.attributes is None + else self.attributes.iceberg_catalog_table_name + ) @iceberg_catalog_table_name.setter def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @@ -459,17 +501,29 @@ def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @property def iceberg_catalog_table_namespace(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_table_namespace + return ( + None + if self.attributes is None + else self.attributes.iceberg_catalog_table_namespace + ) @iceberg_catalog_table_namespace.setter - def iceberg_catalog_table_namespace(self, iceberg_catalog_table_namespace: Optional[str]): + def iceberg_catalog_table_namespace( + self, iceberg_catalog_table_namespace: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.iceberg_catalog_table_namespace = iceberg_catalog_table_namespace + self.attributes.iceberg_catalog_table_namespace = ( + iceberg_catalog_table_namespace + ) @property def table_external_volume_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.table_external_volume_name + return ( + None + if self.attributes is None + else self.attributes.table_external_volume_name + ) @table_external_volume_name.setter def table_external_volume_name(self, table_external_volume_name: Optional[str]): @@ -479,7 +533,11 @@ def table_external_volume_name(self, table_external_volume_name: Optional[str]): @property def iceberg_table_base_location(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_table_base_location + return ( + None + if self.attributes is None + else self.attributes.iceberg_table_base_location + ) @iceberg_table_base_location.setter def iceberg_table_base_location(self, iceberg_table_base_location: Optional[str]): @@ -564,7 +622,9 @@ class Attributes(SQL.Attributes): alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") + query_preview_config: Optional[Dict[str, str]] = Field( + default=None, description="" + ) external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -578,16 +638,30 @@ class Attributes(SQL.Attributes): iceberg_table_type: Optional[str] = Field(default=None, description="") iceberg_catalog_source: Optional[str] = Field(default=None, description="") iceberg_catalog_table_name: Optional[str] = Field(default=None, description="") - iceberg_catalog_table_namespace: Optional[str] = Field(default=None, description="") + iceberg_catalog_table_namespace: Optional[str] = Field( + default=None, description="" + ) table_external_volume_name: Optional[str] = Field(default=None, description="") iceberg_table_base_location: Optional[str] = Field(default=None, description="") table_retention_time: Optional[int] = Field(default=None, description="") - columns: Optional[List[Column]] = Field(default=None, description="") # relationship - facts: Optional[List[Table]] = Field(default=None, description="") # relationship - atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship - partitions: Optional[List[TablePartition]] = Field(default=None, description="") # relationship - queries: Optional[List[Query]] = Field(default=None, description="") # relationship - dimensions: Optional[List[Table]] = Field(default=None, description="") # relationship + columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship + facts: Optional[List[Table]] = Field( + default=None, description="" + ) # relationship + atlan_schema: Optional[Schema] = Field( + default=None, description="" + ) # relationship + partitions: Optional[List[TablePartition]] = Field( + default=None, description="" + ) # relationship + queries: Optional[List[Query]] = Field( + default=None, description="" + ) # relationship + dimensions: Optional[List[Table]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -601,9 +675,13 @@ def create( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> Table.Attributes: - validate_required_fields(["name, schema_qualified_name"], [name, schema_qualified_name]) + validate_required_fields( + ["name, schema_qualified_name"], [name, schema_qualified_name] + ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( schema_qualified_name, "schema_qualified_name", 5 @@ -614,7 +692,10 @@ def create( connection_qualified_name = connection_qualified_name or connection_qn database_name = database_name or fields[3] schema_name = schema_name or fields[4] - database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" + database_qualified_name = ( + database_qualified_name + or f"{connection_qualified_name}/{database_name}" + ) return Table.Attributes( name=name, diff --git a/pyatlan/model/assets/core/table_partition.py b/pyatlan/model/assets/core/table_partition.py index 374a51fa6..f975f97b5 100644 --- a/pyatlan/model/assets/core/table_partition.py +++ b/pyatlan/model/assets/core/table_partition.py @@ -144,35 +144,51 @@ def __setattr__(self, name, value): """ Whether this partition is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( + "isQueryPreview", "isQueryPreview" + ) """ Whether preview queries for this partition are allowed (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( + "queryPreviewConfig", "queryPreviewConfig" + ) """ Configuration for the preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") + EXTERNAL_LOCATION: ClassVar[TextField] = TextField( + "externalLocation", "externalLocation" + ) """ External location of this partition, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( + "externalLocationRegion", "externalLocationRegion" + ) """ Region of the external location of this partition, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( + "externalLocationFormat", "externalLocationFormat" + ) """ Format of the external location of this partition, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( + "isPartitioned", "isPartitioned" + ) """ Whether this partition is further partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( + "partitionStrategy", "partitionStrategy" + ) """ Partition strategy of this partition. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") + PARTITION_COUNT: ClassVar[NumericField] = NumericField( + "partitionCount", "partitionCount" + ) """ Number of sub-partitions of this partition. """ @@ -189,11 +205,15 @@ def __setattr__(self, name, value): """ TBC """ - CHILD_TABLE_PARTITIONS: ClassVar[RelationField] = RelationField("childTablePartitions") + CHILD_TABLE_PARTITIONS: ClassVar[RelationField] = RelationField( + "childTablePartitions" + ) """ TBC """ - PARENT_TABLE_PARTITION: ClassVar[RelationField] = RelationField("parentTablePartition") + PARENT_TABLE_PARTITION: ClassVar[RelationField] = RelationField( + "parentTablePartition" + ) """ TBC """ @@ -312,7 +332,11 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_region + return ( + None + if self.attributes is None + else self.attributes.external_location_region + ) @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -322,7 +346,11 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_format + return ( + None + if self.attributes is None + else self.attributes.external_location_format + ) @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -392,17 +420,23 @@ def parent_table(self, parent_table: Optional[Table]): @property def child_table_partitions(self) -> Optional[List[TablePartition]]: - return None if self.attributes is None else self.attributes.child_table_partitions + return ( + None if self.attributes is None else self.attributes.child_table_partitions + ) @child_table_partitions.setter - def child_table_partitions(self, child_table_partitions: Optional[List[TablePartition]]): + def child_table_partitions( + self, child_table_partitions: Optional[List[TablePartition]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.child_table_partitions = child_table_partitions @property def parent_table_partition(self) -> Optional[TablePartition]: - return None if self.attributes is None else self.attributes.parent_table_partition + return ( + None if self.attributes is None else self.attributes.parent_table_partition + ) @parent_table_partition.setter def parent_table_partition(self, parent_table_partition: Optional[TablePartition]): @@ -418,7 +452,9 @@ class Attributes(SQL.Attributes): alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") + query_preview_config: Optional[Dict[str, str]] = Field( + default=None, description="" + ) external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -426,10 +462,18 @@ class Attributes(SQL.Attributes): partition_strategy: Optional[str] = Field(default=None, description="") partition_count: Optional[int] = Field(default=None, description="") partition_list: Optional[str] = Field(default=None, description="") - columns: Optional[List[Column]] = Field(default=None, description="") # relationship - parent_table: Optional[Table] = Field(default=None, description="") # relationship - child_table_partitions: Optional[List[TablePartition]] = Field(default=None, description="") # relationship - parent_table_partition: Optional[TablePartition] = Field(default=None, description="") # relationship + columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship + parent_table: Optional[Table] = Field( + default=None, description="" + ) # relationship + child_table_partitions: Optional[List[TablePartition]] = Field( + default=None, description="" + ) # relationship + parent_table_partition: Optional[TablePartition] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -464,7 +508,9 @@ def creator( ) assert table_qualified_name # noqa: S101 if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( table_qualified_name, "table_qualified_name", 6 @@ -476,8 +522,13 @@ def creator( database_name = database_name or fields[3] schema_name = schema_name or fields[4] table_name = table_name or fields[5] - database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" - schema_qualified_name = schema_qualified_name or f"{database_qualified_name}/{schema_name}" + database_qualified_name = ( + database_qualified_name + or f"{connection_qualified_name}/{database_name}" + ) + schema_qualified_name = ( + schema_qualified_name or f"{database_qualified_name}/{schema_name}" + ) qualified_name = f"{schema_qualified_name}/{name}" diff --git a/pyatlan/model/assets/core/tag.py b/pyatlan/model/assets/core/tag.py index 9ce2545ab..9b7919062 100644 --- a/pyatlan/model/assets/core/tag.py +++ b/pyatlan/model/assets/core/tag.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): """ Unique identifier of the tag in the source system. """ - TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("tagAttributes", "tagAttributes") + TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( + "tagAttributes", "tagAttributes" + ) """ Attributes associated with the tag in the source system. """ @@ -90,7 +92,9 @@ def tag_allowed_values(self, tag_allowed_values: Optional[Set[str]]): @property def mapped_atlan_tag_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mapped_atlan_tag_name + return ( + None if self.attributes is None else self.attributes.mapped_atlan_tag_name + ) @mapped_atlan_tag_name.setter def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): @@ -100,7 +104,9 @@ def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): class Attributes(Catalog.Attributes): tag_id: Optional[str] = Field(default=None, description="") - tag_attributes: Optional[List[SourceTagAttribute]] = Field(default=None, description="") + tag_attributes: Optional[List[SourceTagAttribute]] = Field( + default=None, description="" + ) tag_allowed_values: Optional[Set[str]] = Field(default=None, description="") mapped_atlan_tag_name: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/core/view.py b/pyatlan/model/assets/core/view.py index 8b841a5d9..7358f37c1 100644 --- a/pyatlan/model/assets/core/view.py +++ b/pyatlan/model/assets/core/view.py @@ -59,7 +59,9 @@ def creator( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> View: - validate_required_fields(["name", "schema_qualified_name"], [name, schema_qualified_name]) + validate_required_fields( + ["name", "schema_qualified_name"], [name, schema_qualified_name] + ) attributes = View.Attributes.create( name=name, schema_qualified_name=schema_qualified_name, @@ -74,7 +76,9 @@ def creator( @init_guid def create(cls, *, name: str, schema_qualified_name: str) -> View: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -106,11 +110,15 @@ def __setattr__(self, name, value): """ Size of this view, in bytes. """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( + "isQueryPreview", "isQueryPreview" + ) """ Whether preview queries are allowed on this view (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( + "queryPreviewConfig", "queryPreviewConfig" + ) """ Configuration for preview queries on this view. """ @@ -269,13 +277,21 @@ class Attributes(SQL.Attributes): row_count: Optional[int] = Field(default=None, description="") size_bytes: Optional[int] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") + query_preview_config: Optional[Dict[str, str]] = Field( + default=None, description="" + ) alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") definition: Optional[str] = Field(default=None, description="") - columns: Optional[List[Column]] = Field(default=None, description="") # relationship - atlan_schema: Optional[Schema] = Field(default=None, description="") # relationship - queries: Optional[List[Query]] = Field(default=None, description="") # relationship + columns: Optional[List[Column]] = Field( + default=None, description="" + ) # relationship + atlan_schema: Optional[Schema] = Field( + default=None, description="" + ) # relationship + queries: Optional[List[Query]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -289,9 +305,13 @@ def create( database_qualified_name: Optional[str] = None, connection_qualified_name: Optional[str] = None, ) -> View.Attributes: - validate_required_fields(["name, schema_qualified_name"], [name, schema_qualified_name]) + validate_required_fields( + ["name, schema_qualified_name"], [name, schema_qualified_name] + ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( schema_qualified_name, "schema_qualified_name", 5 @@ -302,7 +322,10 @@ def create( connection_qualified_name = connection_qualified_name or connection_qn database_name = database_name or fields[3] schema_name = schema_name or fields[4] - database_qualified_name = database_qualified_name or f"{connection_qualified_name}/{database_name}" + database_qualified_name = ( + database_qualified_name + or f"{connection_qualified_name}/{database_name}" + ) atlan_schema = Schema.ref_by_qualified_name(schema_qualified_name) return View.Attributes( diff --git a/pyatlan/model/assets/cube.py b/pyatlan/model/assets/cube.py index e39994712..b7de24623 100644 --- a/pyatlan/model/assets/cube.py +++ b/pyatlan/model/assets/cube.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - CUBE_DIMENSION_COUNT: ClassVar[NumericField] = NumericField("cubeDimensionCount", "cubeDimensionCount") + CUBE_DIMENSION_COUNT: ClassVar[NumericField] = NumericField( + "cubeDimensionCount", "cubeDimensionCount" + ) """ Number of dimensions in the cube. """ @@ -66,7 +68,9 @@ def cube_dimensions(self, cube_dimensions: Optional[List[CubeDimension]]): class Attributes(MultiDimensionalDataset.Attributes): cube_dimension_count: Optional[int] = Field(default=None, description="") - cube_dimensions: Optional[List[CubeDimension]] = Field(default=None, description="") # relationship + cube_dimensions: Optional[List[CubeDimension]] = Field( + default=None, description="" + ) # relationship attributes: Cube.Attributes = Field( default_factory=lambda: Cube.Attributes(), diff --git a/pyatlan/model/assets/cube_dimension.py b/pyatlan/model/assets/cube_dimension.py index 65786a9e7..9375b1d03 100644 --- a/pyatlan/model/assets/cube_dimension.py +++ b/pyatlan/model/assets/cube_dimension.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - CUBE_HIERARCHY_COUNT: ClassVar[NumericField] = NumericField("cubeHierarchyCount", "cubeHierarchyCount") + CUBE_HIERARCHY_COUNT: ClassVar[NumericField] = NumericField( + "cubeHierarchyCount", "cubeHierarchyCount" + ) """ Number of hierarchies in the cube dimension. """ @@ -81,7 +83,9 @@ def cube(self, cube: Optional[Cube]): class Attributes(MultiDimensionalDataset.Attributes): cube_hierarchy_count: Optional[int] = Field(default=None, description="") - cube_hierarchies: Optional[List[CubeHierarchy]] = Field(default=None, description="") # relationship + cube_hierarchies: Optional[List[CubeHierarchy]] = Field( + default=None, description="" + ) # relationship cube: Optional[Cube] = Field(default=None, description="") # relationship attributes: CubeDimension.Attributes = Field( diff --git a/pyatlan/model/assets/cube_field.py b/pyatlan/model/assets/cube_field.py index 6e0cf0d1d..f8667d215 100644 --- a/pyatlan/model/assets/cube_field.py +++ b/pyatlan/model/assets/cube_field.py @@ -46,11 +46,15 @@ def __setattr__(self, name, value): """ Unique name of the parent field in which this field is nested. """ - CUBE_FIELD_LEVEL: ClassVar[NumericField] = NumericField("cubeFieldLevel", "cubeFieldLevel") + CUBE_FIELD_LEVEL: ClassVar[NumericField] = NumericField( + "cubeFieldLevel", "cubeFieldLevel" + ) """ Level of the field in the cube hierarchy. """ - CUBE_FIELD_GENERATION: ClassVar[NumericField] = NumericField("cubeFieldGeneration", "cubeFieldGeneration") + CUBE_FIELD_GENERATION: ClassVar[NumericField] = NumericField( + "cubeFieldGeneration", "cubeFieldGeneration" + ) """ Generation of the field in the cube hierarchy. """ @@ -62,7 +66,9 @@ def __setattr__(self, name, value): """ Expression used to calculate this measure. """ - CUBE_SUB_FIELD_COUNT: ClassVar[NumericField] = NumericField("cubeSubFieldCount", "cubeSubFieldCount") + CUBE_SUB_FIELD_COUNT: ClassVar[NumericField] = NumericField( + "cubeSubFieldCount", "cubeSubFieldCount" + ) """ Number of sub-fields that are direct children of this field. """ @@ -94,7 +100,9 @@ def __setattr__(self, name, value): @property def cube_parent_field_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cube_parent_field_name + return ( + None if self.attributes is None else self.attributes.cube_parent_field_name + ) @cube_parent_field_name.setter def cube_parent_field_name(self, cube_parent_field_name: Optional[str]): @@ -104,13 +112,21 @@ def cube_parent_field_name(self, cube_parent_field_name: Optional[str]): @property def cube_parent_field_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cube_parent_field_qualified_name + return ( + None + if self.attributes is None + else self.attributes.cube_parent_field_qualified_name + ) @cube_parent_field_qualified_name.setter - def cube_parent_field_qualified_name(self, cube_parent_field_qualified_name: Optional[str]): + def cube_parent_field_qualified_name( + self, cube_parent_field_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.cube_parent_field_qualified_name = cube_parent_field_qualified_name + self.attributes.cube_parent_field_qualified_name = ( + cube_parent_field_qualified_name + ) @property def cube_field_level(self) -> Optional[int]: @@ -124,7 +140,9 @@ def cube_field_level(self, cube_field_level: Optional[int]): @property def cube_field_generation(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.cube_field_generation + return ( + None if self.attributes is None else self.attributes.cube_field_generation + ) @cube_field_generation.setter def cube_field_generation(self, cube_field_generation: Optional[int]): @@ -134,10 +152,16 @@ def cube_field_generation(self, cube_field_generation: Optional[int]): @property def cube_field_measure_expression(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cube_field_measure_expression + return ( + None + if self.attributes is None + else self.attributes.cube_field_measure_expression + ) @cube_field_measure_expression.setter - def cube_field_measure_expression(self, cube_field_measure_expression: Optional[str]): + def cube_field_measure_expression( + self, cube_field_measure_expression: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cube_field_measure_expression = cube_field_measure_expression @@ -184,14 +208,24 @@ def cube_nested_fields(self, cube_nested_fields: Optional[List[CubeField]]): class Attributes(MultiDimensionalDataset.Attributes): cube_parent_field_name: Optional[str] = Field(default=None, description="") - cube_parent_field_qualified_name: Optional[str] = Field(default=None, description="") + cube_parent_field_qualified_name: Optional[str] = Field( + default=None, description="" + ) cube_field_level: Optional[int] = Field(default=None, description="") cube_field_generation: Optional[int] = Field(default=None, description="") - cube_field_measure_expression: Optional[str] = Field(default=None, description="") + cube_field_measure_expression: Optional[str] = Field( + default=None, description="" + ) cube_sub_field_count: Optional[int] = Field(default=None, description="") - cube_parent_field: Optional[CubeField] = Field(default=None, description="") # relationship - cube_hierarchy: Optional[CubeHierarchy] = Field(default=None, description="") # relationship - cube_nested_fields: Optional[List[CubeField]] = Field(default=None, description="") # relationship + cube_parent_field: Optional[CubeField] = Field( + default=None, description="" + ) # relationship + cube_hierarchy: Optional[CubeHierarchy] = Field( + default=None, description="" + ) # relationship + cube_nested_fields: Optional[List[CubeField]] = Field( + default=None, description="" + ) # relationship attributes: CubeField.Attributes = Field( default_factory=lambda: CubeField.Attributes(), diff --git a/pyatlan/model/assets/cube_hierarchy.py b/pyatlan/model/assets/cube_hierarchy.py index cd36cb4a2..eac7ce209 100644 --- a/pyatlan/model/assets/cube_hierarchy.py +++ b/pyatlan/model/assets/cube_hierarchy.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - CUBE_FIELD_COUNT: ClassVar[NumericField] = NumericField("cubeFieldCount", "cubeFieldCount") + CUBE_FIELD_COUNT: ClassVar[NumericField] = NumericField( + "cubeFieldCount", "cubeFieldCount" + ) """ Number of total fields in the cube hierarchy. """ @@ -81,8 +83,12 @@ def cube_dimension(self, cube_dimension: Optional[CubeDimension]): class Attributes(MultiDimensionalDataset.Attributes): cube_field_count: Optional[int] = Field(default=None, description="") - cube_fields: Optional[List[CubeField]] = Field(default=None, description="") # relationship - cube_dimension: Optional[CubeDimension] = Field(default=None, description="") # relationship + cube_fields: Optional[List[CubeField]] = Field( + default=None, description="" + ) # relationship + cube_dimension: Optional[CubeDimension] = Field( + default=None, description="" + ) # relationship attributes: CubeHierarchy.Attributes = Field( default_factory=lambda: CubeHierarchy.Attributes(), diff --git a/pyatlan/model/assets/custom_entity.py b/pyatlan/model/assets/custom_entity.py index d469564fb..98ed2e7fd 100644 --- a/pyatlan/model/assets/custom_entity.py +++ b/pyatlan/model/assets/custom_entity.py @@ -21,8 +21,12 @@ class CustomEntity(Custom): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> CustomEntity: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) - attributes = CustomEntity.Attributes.creator(name=name, connection_qualified_name=connection_qualified_name) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) + attributes = CustomEntity.Attributes.creator( + name=name, connection_qualified_name=connection_qualified_name + ) return cls(attributes=attributes) type_name: str = Field(default="CustomEntity", allow_mutation=False) @@ -42,15 +46,21 @@ def __setattr__(self, name, value): """ TBC """ - CUSTOM_CHILD_ENTITIES: ClassVar[RelationField] = RelationField("customChildEntities") + CUSTOM_CHILD_ENTITIES: ClassVar[RelationField] = RelationField( + "customChildEntities" + ) """ TBC """ - CUSTOM_RELATED_TO_ENTITIES: ClassVar[RelationField] = RelationField("customRelatedToEntities") + CUSTOM_RELATED_TO_ENTITIES: ClassVar[RelationField] = RelationField( + "customRelatedToEntities" + ) """ TBC """ - CUSTOM_RELATED_FROM_ENTITIES: ClassVar[RelationField] = RelationField("customRelatedFromEntities") + CUSTOM_RELATED_FROM_ENTITIES: ClassVar[RelationField] = RelationField( + "customRelatedFromEntities" + ) """ TBC """ @@ -74,49 +84,79 @@ def custom_parent_entity(self, custom_parent_entity: Optional[CustomEntity]): @property def custom_child_entities(self) -> Optional[List[CustomEntity]]: - return None if self.attributes is None else self.attributes.custom_child_entities + return ( + None if self.attributes is None else self.attributes.custom_child_entities + ) @custom_child_entities.setter - def custom_child_entities(self, custom_child_entities: Optional[List[CustomEntity]]): + def custom_child_entities( + self, custom_child_entities: Optional[List[CustomEntity]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.custom_child_entities = custom_child_entities @property def custom_related_to_entities(self) -> Optional[List[CustomEntity]]: - return None if self.attributes is None else self.attributes.custom_related_to_entities + return ( + None + if self.attributes is None + else self.attributes.custom_related_to_entities + ) @custom_related_to_entities.setter - def custom_related_to_entities(self, custom_related_to_entities: Optional[List[CustomEntity]]): + def custom_related_to_entities( + self, custom_related_to_entities: Optional[List[CustomEntity]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.custom_related_to_entities = custom_related_to_entities @property def custom_related_from_entities(self) -> Optional[List[CustomEntity]]: - return None if self.attributes is None else self.attributes.custom_related_from_entities + return ( + None + if self.attributes is None + else self.attributes.custom_related_from_entities + ) @custom_related_from_entities.setter - def custom_related_from_entities(self, custom_related_from_entities: Optional[List[CustomEntity]]): + def custom_related_from_entities( + self, custom_related_from_entities: Optional[List[CustomEntity]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.custom_related_from_entities = custom_related_from_entities class Attributes(Custom.Attributes): - custom_parent_entity: Optional[CustomEntity] = Field(default=None, description="") # relationship - custom_child_entities: Optional[List[CustomEntity]] = Field(default=None, description="") # relationship - custom_related_to_entities: Optional[List[CustomEntity]] = Field(default=None, description="") # relationship - custom_related_from_entities: Optional[List[CustomEntity]] = Field(default=None, description="") # relationship + custom_parent_entity: Optional[CustomEntity] = Field( + default=None, description="" + ) # relationship + custom_child_entities: Optional[List[CustomEntity]] = Field( + default=None, description="" + ) # relationship + custom_related_to_entities: Optional[List[CustomEntity]] = Field( + default=None, description="" + ) # relationship + custom_related_from_entities: Optional[List[CustomEntity]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def creator(cls, *, name: str, connection_qualified_name: str) -> CustomEntity.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + def creator( + cls, *, name: str, connection_qualified_name: str + ) -> CustomEntity.Attributes: + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return CustomEntity.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: CustomEntity.Attributes = Field( diff --git a/pyatlan/model/assets/data_studio.py b/pyatlan/model/assets/data_studio.py index 9eba56474..225217b17 100644 --- a/pyatlan/model/assets/data_studio.py +++ b/pyatlan/model/assets/data_studio.py @@ -35,7 +35,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField("googleService", "googleService") + GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField( + "googleService", "googleService" + ) """ Service in Google in which the asset exists. """ @@ -51,15 +53,21 @@ def __setattr__(self, name, value): """ ID of the project in which the asset exists. """ - GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField("googleProjectNumber", "googleProjectNumber") + GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField( + "googleProjectNumber", "googleProjectNumber" + ) """ Number of the project in which the asset exists. """ - GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField("googleLocation", "googleLocation") + GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField( + "googleLocation", "googleLocation" + ) """ Location of this asset in Google. """ - GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField("googleLocationType", "googleLocationType") + GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField( + "googleLocationType", "googleLocationType" + ) """ Type of location of this asset in Google. """ @@ -76,7 +84,9 @@ def __setattr__(self, name, value): """ TBC """ - INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("inputToAirflowTasks") + INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( + "inputToAirflowTasks" + ) """ TBC """ @@ -84,23 +94,33 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelImplementedAttributes") + MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField( + "modelImplementedAttributes" + ) """ TBC """ - OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("outputFromAirflowTasks") + OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( + "outputFromAirflowTasks" + ) """ TBC """ - OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField("outputFromSparkJobs") + OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField( + "outputFromSparkJobs" + ) """ TBC """ - MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField("modelImplementedEntities") + MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField( + "modelImplementedEntities" + ) """ TBC """ - OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField("outputFromProcesses") + OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField( + "outputFromProcesses" + ) """ TBC """ @@ -156,7 +176,9 @@ def google_project_id(self, google_project_id: Optional[str]): @property def google_project_number(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.google_project_number + return ( + None if self.attributes is None else self.attributes.google_project_number + ) @google_project_number.setter def google_project_number(self, google_project_number: Optional[int]): @@ -216,10 +238,14 @@ def input_to_spark_jobs(self, input_to_spark_jobs: Optional[List[SparkJob]]): @property def input_to_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return None if self.attributes is None else self.attributes.input_to_airflow_tasks + return ( + None if self.attributes is None else self.attributes.input_to_airflow_tasks + ) @input_to_airflow_tasks.setter - def input_to_airflow_tasks(self, input_to_airflow_tasks: Optional[List[AirflowTask]]): + def input_to_airflow_tasks( + self, input_to_airflow_tasks: Optional[List[AirflowTask]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.input_to_airflow_tasks = input_to_airflow_tasks @@ -236,27 +262,41 @@ def input_to_processes(self, input_to_processes: Optional[List[Process]]): @property def model_implemented_attributes(self) -> Optional[List[ModelAttribute]]: - return None if self.attributes is None else self.attributes.model_implemented_attributes + return ( + None + if self.attributes is None + else self.attributes.model_implemented_attributes + ) @model_implemented_attributes.setter - def model_implemented_attributes(self, model_implemented_attributes: Optional[List[ModelAttribute]]): + def model_implemented_attributes( + self, model_implemented_attributes: Optional[List[ModelAttribute]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_attributes = model_implemented_attributes @property def output_from_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return None if self.attributes is None else self.attributes.output_from_airflow_tasks + return ( + None + if self.attributes is None + else self.attributes.output_from_airflow_tasks + ) @output_from_airflow_tasks.setter - def output_from_airflow_tasks(self, output_from_airflow_tasks: Optional[List[AirflowTask]]): + def output_from_airflow_tasks( + self, output_from_airflow_tasks: Optional[List[AirflowTask]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.output_from_airflow_tasks = output_from_airflow_tasks @property def output_from_spark_jobs(self) -> Optional[List[SparkJob]]: - return None if self.attributes is None else self.attributes.output_from_spark_jobs + return ( + None if self.attributes is None else self.attributes.output_from_spark_jobs + ) @output_from_spark_jobs.setter def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob]]): @@ -266,17 +306,25 @@ def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob] @property def model_implemented_entities(self) -> Optional[List[ModelEntity]]: - return None if self.attributes is None else self.attributes.model_implemented_entities + return ( + None + if self.attributes is None + else self.attributes.model_implemented_entities + ) @model_implemented_entities.setter - def model_implemented_entities(self, model_implemented_entities: Optional[List[ModelEntity]]): + def model_implemented_entities( + self, model_implemented_entities: Optional[List[ModelEntity]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_entities = model_implemented_entities @property def output_from_processes(self) -> Optional[List[Process]]: - return None if self.attributes is None else self.attributes.output_from_processes + return ( + None if self.attributes is None else self.attributes.output_from_processes + ) @output_from_processes.setter def output_from_processes(self, output_from_processes: Optional[List[Process]]): @@ -293,16 +341,30 @@ class Attributes(Google.Attributes): google_location_type: Optional[str] = Field(default=None, description="") google_labels: Optional[List[GoogleLabel]] = Field(default=None, description="") google_tags: Optional[List[GoogleTag]] = Field(default=None, description="") - input_to_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship - input_to_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship - input_to_processes: Optional[List[Process]] = Field(default=None, description="") # relationship + input_to_spark_jobs: Optional[List[SparkJob]] = Field( + default=None, description="" + ) # relationship + input_to_airflow_tasks: Optional[List[AirflowTask]] = Field( + default=None, description="" + ) # relationship + input_to_processes: Optional[List[Process]] = Field( + default=None, description="" + ) # relationship model_implemented_attributes: Optional[List[ModelAttribute]] = Field( default=None, description="" ) # relationship - output_from_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship - output_from_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship - model_implemented_entities: Optional[List[ModelEntity]] = Field(default=None, description="") # relationship - output_from_processes: Optional[List[Process]] = Field(default=None, description="") # relationship + output_from_airflow_tasks: Optional[List[AirflowTask]] = Field( + default=None, description="" + ) # relationship + output_from_spark_jobs: Optional[List[SparkJob]] = Field( + default=None, description="" + ) # relationship + model_implemented_entities: Optional[List[ModelEntity]] = Field( + default=None, description="" + ) # relationship + output_from_processes: Optional[List[Process]] = Field( + default=None, description="" + ) # relationship attributes: DataStudio.Attributes = Field( default_factory=lambda: DataStudio.Attributes(), diff --git a/pyatlan/model/assets/data_studio_asset.py b/pyatlan/model/assets/data_studio_asset.py index dbf6602ec..e556a5caf 100644 --- a/pyatlan/model/assets/data_studio_asset.py +++ b/pyatlan/model/assets/data_studio_asset.py @@ -62,7 +62,9 @@ def create( gdsid: Optional[str] = None, ) -> DataStudioAsset: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -86,20 +88,26 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATA_STUDIO_ASSET_TYPE: ClassVar[KeywordField] = KeywordField("dataStudioAssetType", "dataStudioAssetType") + DATA_STUDIO_ASSET_TYPE: ClassVar[KeywordField] = KeywordField( + "dataStudioAssetType", "dataStudioAssetType" + ) """ Type of the Google Data Studio asset, for example: REPORT or DATA_SOURCE. """ - DATA_STUDIO_ASSET_TITLE: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( - "dataStudioAssetTitle", - "dataStudioAssetTitle.keyword", - "dataStudioAssetTitle", - "dataStudioAssetTitle.stemmed", + DATA_STUDIO_ASSET_TITLE: ClassVar[KeywordTextStemmedField] = ( + KeywordTextStemmedField( + "dataStudioAssetTitle", + "dataStudioAssetTitle.keyword", + "dataStudioAssetTitle", + "dataStudioAssetTitle.stemmed", + ) ) """ Title of the Google Data Studio asset. """ - DATA_STUDIO_ASSET_OWNER: ClassVar[KeywordField] = KeywordField("dataStudioAssetOwner", "dataStudioAssetOwner") + DATA_STUDIO_ASSET_OWNER: ClassVar[KeywordField] = KeywordField( + "dataStudioAssetOwner", "dataStudioAssetOwner" + ) """ Owner of the asset, from Google Data Studio. """ @@ -109,7 +117,9 @@ def __setattr__(self, name, value): """ Whether the Google Data Studio asset has been trashed (true) or not (false). """ - GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField("googleService", "googleService") + GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField( + "googleService", "googleService" + ) """ Service in Google in which the asset exists. """ @@ -125,15 +135,21 @@ def __setattr__(self, name, value): """ ID of the project in which the asset exists. """ - GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField("googleProjectNumber", "googleProjectNumber") + GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField( + "googleProjectNumber", "googleProjectNumber" + ) """ Number of the project in which the asset exists. """ - GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField("googleLocation", "googleLocation") + GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField( + "googleLocation", "googleLocation" + ) """ Location of this asset in Google. """ - GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField("googleLocationType", "googleLocationType") + GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField( + "googleLocationType", "googleLocationType" + ) """ Type of location of this asset in Google. """ @@ -163,17 +179,23 @@ def __setattr__(self, name, value): @property def data_studio_asset_type(self) -> Optional[GoogleDatastudioAssetType]: - return None if self.attributes is None else self.attributes.data_studio_asset_type + return ( + None if self.attributes is None else self.attributes.data_studio_asset_type + ) @data_studio_asset_type.setter - def data_studio_asset_type(self, data_studio_asset_type: Optional[GoogleDatastudioAssetType]): + def data_studio_asset_type( + self, data_studio_asset_type: Optional[GoogleDatastudioAssetType] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.data_studio_asset_type = data_studio_asset_type @property def data_studio_asset_title(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.data_studio_asset_title + return ( + None if self.attributes is None else self.attributes.data_studio_asset_title + ) @data_studio_asset_title.setter def data_studio_asset_title(self, data_studio_asset_title: Optional[str]): @@ -183,7 +205,9 @@ def data_studio_asset_title(self, data_studio_asset_title: Optional[str]): @property def data_studio_asset_owner(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.data_studio_asset_owner + return ( + None if self.attributes is None else self.attributes.data_studio_asset_owner + ) @data_studio_asset_owner.setter def data_studio_asset_owner(self, data_studio_asset_owner: Optional[str]): @@ -193,10 +217,16 @@ def data_studio_asset_owner(self, data_studio_asset_owner: Optional[str]): @property def is_trashed_data_studio_asset(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.is_trashed_data_studio_asset + return ( + None + if self.attributes is None + else self.attributes.is_trashed_data_studio_asset + ) @is_trashed_data_studio_asset.setter - def is_trashed_data_studio_asset(self, is_trashed_data_studio_asset: Optional[bool]): + def is_trashed_data_studio_asset( + self, is_trashed_data_studio_asset: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.is_trashed_data_studio_asset = is_trashed_data_studio_asset @@ -233,7 +263,9 @@ def google_project_id(self, google_project_id: Optional[str]): @property def google_project_number(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.google_project_number + return ( + None if self.attributes is None else self.attributes.google_project_number + ) @google_project_number.setter def google_project_number(self, google_project_number: Optional[int]): @@ -282,10 +314,14 @@ def google_tags(self, google_tags: Optional[List[GoogleTag]]): self.attributes.google_tags = google_tags class Attributes(DataStudio.Attributes): - data_studio_asset_type: Optional[GoogleDatastudioAssetType] = Field(default=None, description="") + data_studio_asset_type: Optional[GoogleDatastudioAssetType] = Field( + default=None, description="" + ) data_studio_asset_title: Optional[str] = Field(default=None, description="") data_studio_asset_owner: Optional[str] = Field(default=None, description="") - is_trashed_data_studio_asset: Optional[bool] = Field(default=None, description="") + is_trashed_data_studio_asset: Optional[bool] = Field( + default=None, description="" + ) google_service: Optional[str] = Field(default=None, description="") google_project_name: Optional[str] = Field(default=None, description="") google_project_id: Optional[str] = Field(default=None, description="") @@ -313,7 +349,9 @@ def create( name=name, qualified_name=f"{connection_qualified_name}/{gdsid}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), data_studio_asset_type=data_studio_asset_type, ) diff --git a/pyatlan/model/assets/dataverse.py b/pyatlan/model/assets/dataverse.py index 0bf569a71..165651951 100644 --- a/pyatlan/model/assets/dataverse.py +++ b/pyatlan/model/assets/dataverse.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATAVERSE_IS_CUSTOM: ClassVar[BooleanField] = BooleanField("dataverseIsCustom", "dataverseIsCustom") + DATAVERSE_IS_CUSTOM: ClassVar[BooleanField] = BooleanField( + "dataverseIsCustom", "dataverseIsCustom" + ) """ Indicator if DataverseEntity is custom built. """ @@ -64,7 +66,11 @@ def dataverse_is_custom(self, dataverse_is_custom: Optional[bool]): @property def dataverse_is_customizable(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.dataverse_is_customizable + return ( + None + if self.attributes is None + else self.attributes.dataverse_is_customizable + ) @dataverse_is_customizable.setter def dataverse_is_customizable(self, dataverse_is_customizable: Optional[bool]): @@ -74,7 +80,11 @@ def dataverse_is_customizable(self, dataverse_is_customizable: Optional[bool]): @property def dataverse_is_audit_enabled(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.dataverse_is_audit_enabled + return ( + None + if self.attributes is None + else self.attributes.dataverse_is_audit_enabled + ) @dataverse_is_audit_enabled.setter def dataverse_is_audit_enabled(self, dataverse_is_audit_enabled: Optional[bool]): diff --git a/pyatlan/model/assets/dataverse_attribute.py b/pyatlan/model/assets/dataverse_attribute.py index 7e8526aff..6b7332dcc 100644 --- a/pyatlan/model/assets/dataverse_attribute.py +++ b/pyatlan/model/assets/dataverse_attribute.py @@ -82,7 +82,9 @@ def __setattr__(self, name, value): """ Schema Name of the DataverseAttribute. """ - DATAVERSE_ATTRIBUTE_TYPE: ClassVar[KeywordField] = KeywordField("dataverseAttributeType", "dataverseAttributeType") + DATAVERSE_ATTRIBUTE_TYPE: ClassVar[KeywordField] = KeywordField( + "dataverseAttributeType", "dataverseAttributeType" + ) """ Type of the DataverseAttribute. """ @@ -115,27 +117,47 @@ def __setattr__(self, name, value): @property def dataverse_entity_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dataverse_entity_qualified_name + return ( + None + if self.attributes is None + else self.attributes.dataverse_entity_qualified_name + ) @dataverse_entity_qualified_name.setter - def dataverse_entity_qualified_name(self, dataverse_entity_qualified_name: Optional[str]): + def dataverse_entity_qualified_name( + self, dataverse_entity_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dataverse_entity_qualified_name = dataverse_entity_qualified_name + self.attributes.dataverse_entity_qualified_name = ( + dataverse_entity_qualified_name + ) @property def dataverse_attribute_schema_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dataverse_attribute_schema_name + return ( + None + if self.attributes is None + else self.attributes.dataverse_attribute_schema_name + ) @dataverse_attribute_schema_name.setter - def dataverse_attribute_schema_name(self, dataverse_attribute_schema_name: Optional[str]): + def dataverse_attribute_schema_name( + self, dataverse_attribute_schema_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dataverse_attribute_schema_name = dataverse_attribute_schema_name + self.attributes.dataverse_attribute_schema_name = ( + dataverse_attribute_schema_name + ) @property def dataverse_attribute_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dataverse_attribute_type + return ( + None + if self.attributes is None + else self.attributes.dataverse_attribute_type + ) @dataverse_attribute_type.setter def dataverse_attribute_type(self, dataverse_attribute_type: Optional[str]): @@ -145,23 +167,39 @@ def dataverse_attribute_type(self, dataverse_attribute_type: Optional[str]): @property def dataverse_attribute_is_primary_id(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.dataverse_attribute_is_primary_id + return ( + None + if self.attributes is None + else self.attributes.dataverse_attribute_is_primary_id + ) @dataverse_attribute_is_primary_id.setter - def dataverse_attribute_is_primary_id(self, dataverse_attribute_is_primary_id: Optional[bool]): + def dataverse_attribute_is_primary_id( + self, dataverse_attribute_is_primary_id: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dataverse_attribute_is_primary_id = dataverse_attribute_is_primary_id + self.attributes.dataverse_attribute_is_primary_id = ( + dataverse_attribute_is_primary_id + ) @property def dataverse_attribute_is_searchable(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.dataverse_attribute_is_searchable + return ( + None + if self.attributes is None + else self.attributes.dataverse_attribute_is_searchable + ) @dataverse_attribute_is_searchable.setter - def dataverse_attribute_is_searchable(self, dataverse_attribute_is_searchable: Optional[bool]): + def dataverse_attribute_is_searchable( + self, dataverse_attribute_is_searchable: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dataverse_attribute_is_searchable = dataverse_attribute_is_searchable + self.attributes.dataverse_attribute_is_searchable = ( + dataverse_attribute_is_searchable + ) @property def dataverse_entity(self) -> Optional[DataverseEntity]: @@ -174,12 +212,22 @@ def dataverse_entity(self, dataverse_entity: Optional[DataverseEntity]): self.attributes.dataverse_entity = dataverse_entity class Attributes(Dataverse.Attributes): - dataverse_entity_qualified_name: Optional[str] = Field(default=None, description="") - dataverse_attribute_schema_name: Optional[str] = Field(default=None, description="") + dataverse_entity_qualified_name: Optional[str] = Field( + default=None, description="" + ) + dataverse_attribute_schema_name: Optional[str] = Field( + default=None, description="" + ) dataverse_attribute_type: Optional[str] = Field(default=None, description="") - dataverse_attribute_is_primary_id: Optional[bool] = Field(default=None, description="") - dataverse_attribute_is_searchable: Optional[bool] = Field(default=None, description="") - dataverse_entity: Optional[DataverseEntity] = Field(default=None, description="") # relationship + dataverse_attribute_is_primary_id: Optional[bool] = Field( + default=None, description="" + ) + dataverse_attribute_is_searchable: Optional[bool] = Field( + default=None, description="" + ) + dataverse_entity: Optional[DataverseEntity] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -195,7 +243,9 @@ def creator( [name, dataverse_entity_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( dataverse_entity_qualified_name, @@ -209,7 +259,9 @@ def creator( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{dataverse_entity_qualified_name}/{name}", connector_name=connector_name, - dataverse_entity=DataverseEntity.ref_by_qualified_name(dataverse_entity_qualified_name), + dataverse_entity=DataverseEntity.ref_by_qualified_name( + dataverse_entity_qualified_name + ), ) attributes: DataverseAttribute.Attributes = Field( diff --git a/pyatlan/model/assets/dataverse_entity.py b/pyatlan/model/assets/dataverse_entity.py index 68efd7af4..3bde074ab 100644 --- a/pyatlan/model/assets/dataverse_entity.py +++ b/pyatlan/model/assets/dataverse_entity.py @@ -70,7 +70,11 @@ def __setattr__(self, name, value): @property def dataverse_entity_schema_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dataverse_entity_schema_name + return ( + None + if self.attributes is None + else self.attributes.dataverse_entity_schema_name + ) @dataverse_entity_schema_name.setter def dataverse_entity_schema_name(self, dataverse_entity_schema_name: Optional[str]): @@ -80,7 +84,11 @@ def dataverse_entity_schema_name(self, dataverse_entity_schema_name: Optional[st @property def dataverse_entity_table_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dataverse_entity_table_type + return ( + None + if self.attributes is None + else self.attributes.dataverse_entity_table_type + ) @dataverse_entity_table_type.setter def dataverse_entity_table_type(self, dataverse_entity_table_type: Optional[str]): @@ -93,19 +101,27 @@ def dataverse_attributes(self) -> Optional[List[DataverseAttribute]]: return None if self.attributes is None else self.attributes.dataverse_attributes @dataverse_attributes.setter - def dataverse_attributes(self, dataverse_attributes: Optional[List[DataverseAttribute]]): + def dataverse_attributes( + self, dataverse_attributes: Optional[List[DataverseAttribute]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dataverse_attributes = dataverse_attributes class Attributes(Dataverse.Attributes): - dataverse_entity_schema_name: Optional[str] = Field(default=None, description="") + dataverse_entity_schema_name: Optional[str] = Field( + default=None, description="" + ) dataverse_entity_table_type: Optional[str] = Field(default=None, description="") - dataverse_attributes: Optional[List[DataverseAttribute]] = Field(default=None, description="") # relationship + dataverse_attributes: Optional[List[DataverseAttribute]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def creator(cls, *, name: str, connection_qualified_name: str) -> DataverseEntity.Attributes: + def creator( + cls, *, name: str, connection_qualified_name: str + ) -> DataverseEntity.Attributes: validate_required_fields( ["name", "connection_qualified_name"], [name, connection_qualified_name], @@ -114,7 +130,9 @@ def creator(cls, *, name: str, connection_qualified_name: str) -> DataverseEntit name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: DataverseEntity.Attributes = Field( diff --git a/pyatlan/model/assets/dbt_column_process.py b/pyatlan/model/assets/dbt_column_process.py index c644e8621..3686fb408 100644 --- a/pyatlan/model/assets/dbt_column_process.py +++ b/pyatlan/model/assets/dbt_column_process.py @@ -43,7 +43,9 @@ def __setattr__(self, name, value): """ """ - DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField("dbtAlias", "dbtAlias.keyword", "dbtAlias") + DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField( + "dbtAlias", "dbtAlias.keyword", "dbtAlias" + ) """ """ @@ -51,7 +53,9 @@ def __setattr__(self, name, value): """ """ - DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField("dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId") + DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField( + "dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId" + ) """ """ @@ -73,15 +77,21 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField("dbtJobName", "dbtJobName.keyword", "dbtJobName") + DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "dbtJobName", "dbtJobName.keyword", "dbtJobName" + ) """ """ - DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField("dbtJobSchedule", "dbtJobSchedule") + DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField( + "dbtJobSchedule", "dbtJobSchedule" + ) """ """ - DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtJobStatus", "dbtJobStatus") + DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( + "dbtJobStatus", "dbtJobStatus" + ) """ """ @@ -93,11 +103,15 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("dbtJobLastRun", "dbtJobLastRun") + DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( + "dbtJobLastRun", "dbtJobLastRun" + ) """ """ - DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("dbtJobNextRun", "dbtJobNextRun") + DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( + "dbtJobNextRun", "dbtJobNextRun" + ) """ """ @@ -127,7 +141,9 @@ def __setattr__(self, name, value): """ """ - DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField("dbtConnectionContext", "dbtConnectionContext") + DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField( + "dbtConnectionContext", "dbtConnectionContext" + ) """ """ @@ -153,7 +169,9 @@ def __setattr__(self, name, value): """ Parsed AST of the code or SQL statements that describe the logic of this process. """ - ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField("additionalEtlContext", "additionalEtlContext") + ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField( + "additionalEtlContext", "additionalEtlContext" + ) """ Additional Context of the ETL pipeline/notebook which creates the process. """ @@ -230,10 +248,16 @@ def __setattr__(self, name, value): @property def dbt_column_process_job_status(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_column_process_job_status + return ( + None + if self.attributes is None + else self.attributes.dbt_column_process_job_status + ) @dbt_column_process_job_status.setter - def dbt_column_process_job_status(self, dbt_column_process_job_status: Optional[str]): + def dbt_column_process_job_status( + self, dbt_column_process_job_status: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dbt_column_process_job_status = dbt_column_process_job_status @@ -330,13 +354,21 @@ def dbt_job_status(self, dbt_job_status: Optional[str]): @property def dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_job_schedule_cron_humanized + return ( + None + if self.attributes is None + else self.attributes.dbt_job_schedule_cron_humanized + ) @dbt_job_schedule_cron_humanized.setter - def dbt_job_schedule_cron_humanized(self, dbt_job_schedule_cron_humanized: Optional[str]): + def dbt_job_schedule_cron_humanized( + self, dbt_job_schedule_cron_humanized: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dbt_job_schedule_cron_humanized = dbt_job_schedule_cron_humanized + self.attributes.dbt_job_schedule_cron_humanized = ( + dbt_job_schedule_cron_humanized + ) @property def dbt_job_last_run(self) -> Optional[datetime]: @@ -360,7 +392,11 @@ def dbt_job_next_run(self, dbt_job_next_run: Optional[datetime]): @property def dbt_job_next_run_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_job_next_run_humanized + return ( + None + if self.attributes is None + else self.attributes.dbt_job_next_run_humanized + ) @dbt_job_next_run_humanized.setter def dbt_job_next_run_humanized(self, dbt_job_next_run_humanized: Optional[str]): @@ -380,7 +416,11 @@ def dbt_environment_name(self, dbt_environment_name: Optional[str]): @property def dbt_environment_dbt_version(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_environment_dbt_version + return ( + None + if self.attributes is None + else self.attributes.dbt_environment_dbt_version + ) @dbt_environment_dbt_version.setter def dbt_environment_dbt_version(self, dbt_environment_dbt_version: Optional[str]): @@ -400,7 +440,9 @@ def dbt_tags(self, dbt_tags: Optional[Set[str]]): @property def dbt_connection_context(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_connection_context + return ( + None if self.attributes is None else self.attributes.dbt_connection_context + ) @dbt_connection_context.setter def dbt_connection_context(self, dbt_connection_context: Optional[str]): @@ -410,7 +452,11 @@ def dbt_connection_context(self, dbt_connection_context: Optional[str]): @property def dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_semantic_layer_proxy_url + return ( + None + if self.attributes is None + else self.attributes.dbt_semantic_layer_proxy_url + ) @dbt_semantic_layer_proxy_url.setter def dbt_semantic_layer_proxy_url(self, dbt_semantic_layer_proxy_url: Optional[str]): @@ -480,7 +526,9 @@ def ast(self, ast: Optional[str]): @property def additional_etl_context(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.additional_etl_context + return ( + None if self.attributes is None else self.attributes.additional_etl_context + ) @additional_etl_context.setter def additional_etl_context(self, additional_etl_context: Optional[str]): @@ -569,7 +617,9 @@ def column_processes(self, column_processes: Optional[List[ColumnProcess]]): self.attributes.column_processes = column_processes class Attributes(Dbt.Attributes): - dbt_column_process_job_status: Optional[str] = Field(default=None, description="") + dbt_column_process_job_status: Optional[str] = Field( + default=None, description="" + ) dbt_alias: Optional[str] = Field(default=None, description="") dbt_meta: Optional[str] = Field(default=None, description="") dbt_unique_id: Optional[str] = Field(default=None, description="") @@ -579,7 +629,9 @@ class Attributes(Dbt.Attributes): dbt_job_name: Optional[str] = Field(default=None, description="") dbt_job_schedule: Optional[str] = Field(default=None, description="") dbt_job_status: Optional[str] = Field(default=None, description="") - dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") + dbt_job_schedule_cron_humanized: Optional[str] = Field( + default=None, description="" + ) dbt_job_last_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") @@ -587,7 +639,9 @@ class Attributes(Dbt.Attributes): dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") dbt_tags: Optional[Set[str]] = Field(default=None, description="") dbt_connection_context: Optional[str] = Field(default=None, description="") - dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") + dbt_semantic_layer_proxy_url: Optional[str] = Field( + default=None, description="" + ) dbt_job_runs: Optional[List[DbtJobRun]] = Field(default=None, description="") inputs: Optional[List[Catalog]] = Field(default=None, description="") outputs: Optional[List[Catalog]] = Field(default=None, description="") @@ -595,14 +649,28 @@ class Attributes(Dbt.Attributes): sql: Optional[str] = Field(default=None, description="") ast: Optional[str] = Field(default=None, description="") additional_etl_context: Optional[str] = Field(default=None, description="") - adf_activity: Optional[AdfActivity] = Field(default=None, description="") # relationship - spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship - matillion_component: Optional[MatillionComponent] = Field(default=None, description="") # relationship + adf_activity: Optional[AdfActivity] = Field( + default=None, description="" + ) # relationship + spark_jobs: Optional[List[SparkJob]] = Field( + default=None, description="" + ) # relationship + matillion_component: Optional[MatillionComponent] = Field( + default=None, description="" + ) # relationship process: Optional[Process] = Field(default=None, description="") # relationship - airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship - fivetran_connector: Optional[FivetranConnector] = Field(default=None, description="") # relationship - power_b_i_dataflow: Optional[PowerBIDataflow] = Field(default=None, description="") # relationship - column_processes: Optional[List[ColumnProcess]] = Field(default=None, description="") # relationship + airflow_tasks: Optional[List[AirflowTask]] = Field( + default=None, description="" + ) # relationship + fivetran_connector: Optional[FivetranConnector] = Field( + default=None, description="" + ) # relationship + power_b_i_dataflow: Optional[PowerBIDataflow] = Field( + default=None, description="" + ) # relationship + column_processes: Optional[List[ColumnProcess]] = Field( + default=None, description="" + ) # relationship attributes: DbtColumnProcess.Attributes = Field( default_factory=lambda: DbtColumnProcess.Attributes(), diff --git a/pyatlan/model/assets/dbt_process.py b/pyatlan/model/assets/dbt_process.py index 4f3ad6973..d8f293acc 100644 --- a/pyatlan/model/assets/dbt_process.py +++ b/pyatlan/model/assets/dbt_process.py @@ -37,11 +37,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DBT_PROCESS_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtProcessJobStatus", "dbtProcessJobStatus") + DBT_PROCESS_JOB_STATUS: ClassVar[KeywordField] = KeywordField( + "dbtProcessJobStatus", "dbtProcessJobStatus" + ) """ """ - DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField("dbtAlias", "dbtAlias.keyword", "dbtAlias") + DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField( + "dbtAlias", "dbtAlias.keyword", "dbtAlias" + ) """ """ @@ -49,7 +53,9 @@ def __setattr__(self, name, value): """ """ - DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField("dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId") + DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField( + "dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId" + ) """ """ @@ -71,15 +77,21 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField("dbtJobName", "dbtJobName.keyword", "dbtJobName") + DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "dbtJobName", "dbtJobName.keyword", "dbtJobName" + ) """ """ - DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField("dbtJobSchedule", "dbtJobSchedule") + DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField( + "dbtJobSchedule", "dbtJobSchedule" + ) """ """ - DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtJobStatus", "dbtJobStatus") + DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( + "dbtJobStatus", "dbtJobStatus" + ) """ """ @@ -91,11 +103,15 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("dbtJobLastRun", "dbtJobLastRun") + DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( + "dbtJobLastRun", "dbtJobLastRun" + ) """ """ - DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("dbtJobNextRun", "dbtJobNextRun") + DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( + "dbtJobNextRun", "dbtJobNextRun" + ) """ """ @@ -125,7 +141,9 @@ def __setattr__(self, name, value): """ """ - DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField("dbtConnectionContext", "dbtConnectionContext") + DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField( + "dbtConnectionContext", "dbtConnectionContext" + ) """ """ @@ -151,7 +169,9 @@ def __setattr__(self, name, value): """ Parsed AST of the code or SQL statements that describe the logic of this process. """ - ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField("additionalEtlContext", "additionalEtlContext") + ADDITIONAL_ETL_CONTEXT: ClassVar[TextField] = TextField( + "additionalEtlContext", "additionalEtlContext" + ) """ Additional Context of the ETL pipeline/notebook which creates the process. """ @@ -223,7 +243,9 @@ def __setattr__(self, name, value): @property def dbt_process_job_status(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_process_job_status + return ( + None if self.attributes is None else self.attributes.dbt_process_job_status + ) @dbt_process_job_status.setter def dbt_process_job_status(self, dbt_process_job_status: Optional[str]): @@ -323,13 +345,21 @@ def dbt_job_status(self, dbt_job_status: Optional[str]): @property def dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_job_schedule_cron_humanized + return ( + None + if self.attributes is None + else self.attributes.dbt_job_schedule_cron_humanized + ) @dbt_job_schedule_cron_humanized.setter - def dbt_job_schedule_cron_humanized(self, dbt_job_schedule_cron_humanized: Optional[str]): + def dbt_job_schedule_cron_humanized( + self, dbt_job_schedule_cron_humanized: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dbt_job_schedule_cron_humanized = dbt_job_schedule_cron_humanized + self.attributes.dbt_job_schedule_cron_humanized = ( + dbt_job_schedule_cron_humanized + ) @property def dbt_job_last_run(self) -> Optional[datetime]: @@ -353,7 +383,11 @@ def dbt_job_next_run(self, dbt_job_next_run: Optional[datetime]): @property def dbt_job_next_run_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_job_next_run_humanized + return ( + None + if self.attributes is None + else self.attributes.dbt_job_next_run_humanized + ) @dbt_job_next_run_humanized.setter def dbt_job_next_run_humanized(self, dbt_job_next_run_humanized: Optional[str]): @@ -373,7 +407,11 @@ def dbt_environment_name(self, dbt_environment_name: Optional[str]): @property def dbt_environment_dbt_version(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_environment_dbt_version + return ( + None + if self.attributes is None + else self.attributes.dbt_environment_dbt_version + ) @dbt_environment_dbt_version.setter def dbt_environment_dbt_version(self, dbt_environment_dbt_version: Optional[str]): @@ -393,7 +431,9 @@ def dbt_tags(self, dbt_tags: Optional[Set[str]]): @property def dbt_connection_context(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_connection_context + return ( + None if self.attributes is None else self.attributes.dbt_connection_context + ) @dbt_connection_context.setter def dbt_connection_context(self, dbt_connection_context: Optional[str]): @@ -403,7 +443,11 @@ def dbt_connection_context(self, dbt_connection_context: Optional[str]): @property def dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_semantic_layer_proxy_url + return ( + None + if self.attributes is None + else self.attributes.dbt_semantic_layer_proxy_url + ) @dbt_semantic_layer_proxy_url.setter def dbt_semantic_layer_proxy_url(self, dbt_semantic_layer_proxy_url: Optional[str]): @@ -473,7 +517,9 @@ def ast(self, ast: Optional[str]): @property def additional_etl_context(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.additional_etl_context + return ( + None if self.attributes is None else self.attributes.additional_etl_context + ) @additional_etl_context.setter def additional_etl_context(self, additional_etl_context: Optional[str]): @@ -562,7 +608,9 @@ class Attributes(Dbt.Attributes): dbt_job_name: Optional[str] = Field(default=None, description="") dbt_job_schedule: Optional[str] = Field(default=None, description="") dbt_job_status: Optional[str] = Field(default=None, description="") - dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") + dbt_job_schedule_cron_humanized: Optional[str] = Field( + default=None, description="" + ) dbt_job_last_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") @@ -570,7 +618,9 @@ class Attributes(Dbt.Attributes): dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") dbt_tags: Optional[Set[str]] = Field(default=None, description="") dbt_connection_context: Optional[str] = Field(default=None, description="") - dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") + dbt_semantic_layer_proxy_url: Optional[str] = Field( + default=None, description="" + ) dbt_job_runs: Optional[List[DbtJobRun]] = Field(default=None, description="") inputs: Optional[List[Catalog]] = Field(default=None, description="") outputs: Optional[List[Catalog]] = Field(default=None, description="") @@ -578,13 +628,27 @@ class Attributes(Dbt.Attributes): sql: Optional[str] = Field(default=None, description="") ast: Optional[str] = Field(default=None, description="") additional_etl_context: Optional[str] = Field(default=None, description="") - adf_activity: Optional[AdfActivity] = Field(default=None, description="") # relationship - spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship - matillion_component: Optional[MatillionComponent] = Field(default=None, description="") # relationship - airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship - fivetran_connector: Optional[FivetranConnector] = Field(default=None, description="") # relationship - power_b_i_dataflow: Optional[PowerBIDataflow] = Field(default=None, description="") # relationship - column_processes: Optional[List[ColumnProcess]] = Field(default=None, description="") # relationship + adf_activity: Optional[AdfActivity] = Field( + default=None, description="" + ) # relationship + spark_jobs: Optional[List[SparkJob]] = Field( + default=None, description="" + ) # relationship + matillion_component: Optional[MatillionComponent] = Field( + default=None, description="" + ) # relationship + airflow_tasks: Optional[List[AirflowTask]] = Field( + default=None, description="" + ) # relationship + fivetran_connector: Optional[FivetranConnector] = Field( + default=None, description="" + ) # relationship + power_b_i_dataflow: Optional[PowerBIDataflow] = Field( + default=None, description="" + ) # relationship + column_processes: Optional[List[ColumnProcess]] = Field( + default=None, description="" + ) # relationship attributes: DbtProcess.Attributes = Field( default_factory=lambda: DbtProcess.Attributes(), diff --git a/pyatlan/model/assets/dbt_tag.py b/pyatlan/model/assets/dbt_tag.py index bbe0a77ea..22b02d83d 100644 --- a/pyatlan/model/assets/dbt_tag.py +++ b/pyatlan/model/assets/dbt_tag.py @@ -36,7 +36,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField("dbtAlias", "dbtAlias.keyword", "dbtAlias") + DBT_ALIAS: ClassVar[KeywordTextField] = KeywordTextField( + "dbtAlias", "dbtAlias.keyword", "dbtAlias" + ) """ """ @@ -44,7 +46,9 @@ def __setattr__(self, name, value): """ """ - DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField("dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId") + DBT_UNIQUE_ID: ClassVar[KeywordTextField] = KeywordTextField( + "dbtUniqueId", "dbtUniqueId.keyword", "dbtUniqueId" + ) """ """ @@ -66,15 +70,21 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField("dbtJobName", "dbtJobName.keyword", "dbtJobName") + DBT_JOB_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "dbtJobName", "dbtJobName.keyword", "dbtJobName" + ) """ """ - DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField("dbtJobSchedule", "dbtJobSchedule") + DBT_JOB_SCHEDULE: ClassVar[TextField] = TextField( + "dbtJobSchedule", "dbtJobSchedule" + ) """ """ - DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField("dbtJobStatus", "dbtJobStatus") + DBT_JOB_STATUS: ClassVar[KeywordField] = KeywordField( + "dbtJobStatus", "dbtJobStatus" + ) """ """ @@ -86,11 +96,15 @@ def __setattr__(self, name, value): """ """ - DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField("dbtJobLastRun", "dbtJobLastRun") + DBT_JOB_LAST_RUN: ClassVar[NumericField] = NumericField( + "dbtJobLastRun", "dbtJobLastRun" + ) """ """ - DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField("dbtJobNextRun", "dbtJobNextRun") + DBT_JOB_NEXT_RUN: ClassVar[NumericField] = NumericField( + "dbtJobNextRun", "dbtJobNextRun" + ) """ """ @@ -120,7 +134,9 @@ def __setattr__(self, name, value): """ """ - DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField("dbtConnectionContext", "dbtConnectionContext") + DBT_CONNECTION_CONTEXT: ClassVar[TextField] = TextField( + "dbtConnectionContext", "dbtConnectionContext" + ) """ """ @@ -138,7 +154,9 @@ def __setattr__(self, name, value): """ Unique identifier of the tag in the source system. """ - TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField("tagAttributes", "tagAttributes") + TAG_ATTRIBUTES: ClassVar[KeywordField] = KeywordField( + "tagAttributes", "tagAttributes" + ) """ Attributes associated with the tag in the source system. """ @@ -273,13 +291,21 @@ def dbt_job_status(self, dbt_job_status: Optional[str]): @property def dbt_job_schedule_cron_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_job_schedule_cron_humanized + return ( + None + if self.attributes is None + else self.attributes.dbt_job_schedule_cron_humanized + ) @dbt_job_schedule_cron_humanized.setter - def dbt_job_schedule_cron_humanized(self, dbt_job_schedule_cron_humanized: Optional[str]): + def dbt_job_schedule_cron_humanized( + self, dbt_job_schedule_cron_humanized: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dbt_job_schedule_cron_humanized = dbt_job_schedule_cron_humanized + self.attributes.dbt_job_schedule_cron_humanized = ( + dbt_job_schedule_cron_humanized + ) @property def dbt_job_last_run(self) -> Optional[datetime]: @@ -303,7 +329,11 @@ def dbt_job_next_run(self, dbt_job_next_run: Optional[datetime]): @property def dbt_job_next_run_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_job_next_run_humanized + return ( + None + if self.attributes is None + else self.attributes.dbt_job_next_run_humanized + ) @dbt_job_next_run_humanized.setter def dbt_job_next_run_humanized(self, dbt_job_next_run_humanized: Optional[str]): @@ -323,7 +353,11 @@ def dbt_environment_name(self, dbt_environment_name: Optional[str]): @property def dbt_environment_dbt_version(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_environment_dbt_version + return ( + None + if self.attributes is None + else self.attributes.dbt_environment_dbt_version + ) @dbt_environment_dbt_version.setter def dbt_environment_dbt_version(self, dbt_environment_dbt_version: Optional[str]): @@ -343,7 +377,9 @@ def dbt_tags(self, dbt_tags: Optional[Set[str]]): @property def dbt_connection_context(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_connection_context + return ( + None if self.attributes is None else self.attributes.dbt_connection_context + ) @dbt_connection_context.setter def dbt_connection_context(self, dbt_connection_context: Optional[str]): @@ -353,7 +389,11 @@ def dbt_connection_context(self, dbt_connection_context: Optional[str]): @property def dbt_semantic_layer_proxy_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dbt_semantic_layer_proxy_url + return ( + None + if self.attributes is None + else self.attributes.dbt_semantic_layer_proxy_url + ) @dbt_semantic_layer_proxy_url.setter def dbt_semantic_layer_proxy_url(self, dbt_semantic_layer_proxy_url: Optional[str]): @@ -403,7 +443,9 @@ def tag_allowed_values(self, tag_allowed_values: Optional[Set[str]]): @property def mapped_atlan_tag_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mapped_atlan_tag_name + return ( + None if self.attributes is None else self.attributes.mapped_atlan_tag_name + ) @mapped_atlan_tag_name.setter def mapped_atlan_tag_name(self, mapped_atlan_tag_name: Optional[str]): @@ -421,7 +463,9 @@ class Attributes(Dbt.Attributes): dbt_job_name: Optional[str] = Field(default=None, description="") dbt_job_schedule: Optional[str] = Field(default=None, description="") dbt_job_status: Optional[str] = Field(default=None, description="") - dbt_job_schedule_cron_humanized: Optional[str] = Field(default=None, description="") + dbt_job_schedule_cron_humanized: Optional[str] = Field( + default=None, description="" + ) dbt_job_last_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run: Optional[datetime] = Field(default=None, description="") dbt_job_next_run_humanized: Optional[str] = Field(default=None, description="") @@ -429,10 +473,14 @@ class Attributes(Dbt.Attributes): dbt_environment_dbt_version: Optional[str] = Field(default=None, description="") dbt_tags: Optional[Set[str]] = Field(default=None, description="") dbt_connection_context: Optional[str] = Field(default=None, description="") - dbt_semantic_layer_proxy_url: Optional[str] = Field(default=None, description="") + dbt_semantic_layer_proxy_url: Optional[str] = Field( + default=None, description="" + ) dbt_job_runs: Optional[List[DbtJobRun]] = Field(default=None, description="") tag_id: Optional[str] = Field(default=None, description="") - tag_attributes: Optional[List[SourceTagAttribute]] = Field(default=None, description="") + tag_attributes: Optional[List[SourceTagAttribute]] = Field( + default=None, description="" + ) tag_allowed_values: Optional[Set[str]] = Field(default=None, description="") mapped_atlan_tag_name: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/domo_card.py b/pyatlan/model/assets/domo_card.py index 56a988e7d..9d0d64d7a 100644 --- a/pyatlan/model/assets/domo_card.py +++ b/pyatlan/model/assets/domo_card.py @@ -30,15 +30,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DOMO_CARD_TYPE: ClassVar[KeywordField] = KeywordField("domoCardType", "domoCardType") + DOMO_CARD_TYPE: ClassVar[KeywordField] = KeywordField( + "domoCardType", "domoCardType" + ) """ Type of the Domo Card. """ - DOMO_CARD_TYPE_VALUE: ClassVar[KeywordField] = KeywordField("domoCardTypeValue", "domoCardTypeValue") + DOMO_CARD_TYPE_VALUE: ClassVar[KeywordField] = KeywordField( + "domoCardTypeValue", "domoCardTypeValue" + ) """ Type of the Domo Card. """ - DOMO_CARD_DASHBOARD_COUNT: ClassVar[NumericField] = NumericField("domoCardDashboardCount", "domoCardDashboardCount") + DOMO_CARD_DASHBOARD_COUNT: ClassVar[NumericField] = NumericField( + "domoCardDashboardCount", "domoCardDashboardCount" + ) """ Number of dashboards linked to this card. """ @@ -82,7 +88,11 @@ def domo_card_type_value(self, domo_card_type_value: Optional[str]): @property def domo_card_dashboard_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.domo_card_dashboard_count + return ( + None + if self.attributes is None + else self.attributes.domo_card_dashboard_count + ) @domo_card_dashboard_count.setter def domo_card_dashboard_count(self, domo_card_dashboard_count: Optional[int]): @@ -114,8 +124,12 @@ class Attributes(Domo.Attributes): domo_card_type: Optional[DomoCardType] = Field(default=None, description="") domo_card_type_value: Optional[str] = Field(default=None, description="") domo_card_dashboard_count: Optional[int] = Field(default=None, description="") - domo_dashboards: Optional[List[DomoDashboard]] = Field(default=None, description="") # relationship - domo_dataset: Optional[DomoDataset] = Field(default=None, description="") # relationship + domo_dashboards: Optional[List[DomoDashboard]] = Field( + default=None, description="" + ) # relationship + domo_dataset: Optional[DomoDataset] = Field( + default=None, description="" + ) # relationship attributes: DomoCard.Attributes = Field( default_factory=lambda: DomoCard.Attributes(), diff --git a/pyatlan/model/assets/domo_dashboard.py b/pyatlan/model/assets/domo_dashboard.py index 6d2c1464e..a6c49cad6 100644 --- a/pyatlan/model/assets/domo_dashboard.py +++ b/pyatlan/model/assets/domo_dashboard.py @@ -29,12 +29,16 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DOMO_DASHBOARD_CARD_COUNT: ClassVar[NumericField] = NumericField("domoDashboardCardCount", "domoDashboardCardCount") + DOMO_DASHBOARD_CARD_COUNT: ClassVar[NumericField] = NumericField( + "domoDashboardCardCount", "domoDashboardCardCount" + ) """ Number of cards linked to this dashboard. """ - DOMO_DASHBOARD_CHILDREN: ClassVar[RelationField] = RelationField("domoDashboardChildren") + DOMO_DASHBOARD_CHILDREN: ClassVar[RelationField] = RelationField( + "domoDashboardChildren" + ) """ TBC """ @@ -42,7 +46,9 @@ def __setattr__(self, name, value): """ TBC """ - DOMO_DASHBOARD_PARENT: ClassVar[RelationField] = RelationField("domoDashboardParent") + DOMO_DASHBOARD_PARENT: ClassVar[RelationField] = RelationField( + "domoDashboardParent" + ) """ TBC """ @@ -56,7 +62,11 @@ def __setattr__(self, name, value): @property def domo_dashboard_card_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.domo_dashboard_card_count + return ( + None + if self.attributes is None + else self.attributes.domo_dashboard_card_count + ) @domo_dashboard_card_count.setter def domo_dashboard_card_count(self, domo_dashboard_card_count: Optional[int]): @@ -66,10 +76,14 @@ def domo_dashboard_card_count(self, domo_dashboard_card_count: Optional[int]): @property def domo_dashboard_children(self) -> Optional[List[DomoDashboard]]: - return None if self.attributes is None else self.attributes.domo_dashboard_children + return ( + None if self.attributes is None else self.attributes.domo_dashboard_children + ) @domo_dashboard_children.setter - def domo_dashboard_children(self, domo_dashboard_children: Optional[List[DomoDashboard]]): + def domo_dashboard_children( + self, domo_dashboard_children: Optional[List[DomoDashboard]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.domo_dashboard_children = domo_dashboard_children @@ -86,7 +100,9 @@ def domo_cards(self, domo_cards: Optional[List[DomoCard]]): @property def domo_dashboard_parent(self) -> Optional[DomoDashboard]: - return None if self.attributes is None else self.attributes.domo_dashboard_parent + return ( + None if self.attributes is None else self.attributes.domo_dashboard_parent + ) @domo_dashboard_parent.setter def domo_dashboard_parent(self, domo_dashboard_parent: Optional[DomoDashboard]): @@ -96,9 +112,15 @@ def domo_dashboard_parent(self, domo_dashboard_parent: Optional[DomoDashboard]): class Attributes(Domo.Attributes): domo_dashboard_card_count: Optional[int] = Field(default=None, description="") - domo_dashboard_children: Optional[List[DomoDashboard]] = Field(default=None, description="") # relationship - domo_cards: Optional[List[DomoCard]] = Field(default=None, description="") # relationship - domo_dashboard_parent: Optional[DomoDashboard] = Field(default=None, description="") # relationship + domo_dashboard_children: Optional[List[DomoDashboard]] = Field( + default=None, description="" + ) # relationship + domo_cards: Optional[List[DomoCard]] = Field( + default=None, description="" + ) # relationship + domo_dashboard_parent: Optional[DomoDashboard] = Field( + default=None, description="" + ) # relationship attributes: DomoDashboard.Attributes = Field( default_factory=lambda: DomoDashboard.Attributes(), diff --git a/pyatlan/model/assets/domo_dataset.py b/pyatlan/model/assets/domo_dataset.py index b9f02a292..36baa082f 100644 --- a/pyatlan/model/assets/domo_dataset.py +++ b/pyatlan/model/assets/domo_dataset.py @@ -29,19 +29,27 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DOMO_DATASET_ROW_COUNT: ClassVar[NumericField] = NumericField("domoDatasetRowCount", "domoDatasetRowCount") + DOMO_DATASET_ROW_COUNT: ClassVar[NumericField] = NumericField( + "domoDatasetRowCount", "domoDatasetRowCount" + ) """ Number of rows in the Domo dataset. """ - DOMO_DATASET_COLUMN_COUNT: ClassVar[NumericField] = NumericField("domoDatasetColumnCount", "domoDatasetColumnCount") + DOMO_DATASET_COLUMN_COUNT: ClassVar[NumericField] = NumericField( + "domoDatasetColumnCount", "domoDatasetColumnCount" + ) """ Number of columns in the Domo dataset. """ - DOMO_DATASET_CARD_COUNT: ClassVar[NumericField] = NumericField("domoDatasetCardCount", "domoDatasetCardCount") + DOMO_DATASET_CARD_COUNT: ClassVar[NumericField] = NumericField( + "domoDatasetCardCount", "domoDatasetCardCount" + ) """ Number of cards linked to the Domo dataset. """ - DOMO_DATASET_LAST_RUN: ClassVar[TextField] = TextField("domoDatasetLastRun", "domoDatasetLastRun") + DOMO_DATASET_LAST_RUN: ClassVar[TextField] = TextField( + "domoDatasetLastRun", "domoDatasetLastRun" + ) """ An ISO-8601 representation of the time the DataSet was last run. """ @@ -66,7 +74,9 @@ def __setattr__(self, name, value): @property def domo_dataset_row_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.domo_dataset_row_count + return ( + None if self.attributes is None else self.attributes.domo_dataset_row_count + ) @domo_dataset_row_count.setter def domo_dataset_row_count(self, domo_dataset_row_count: Optional[int]): @@ -76,7 +86,11 @@ def domo_dataset_row_count(self, domo_dataset_row_count: Optional[int]): @property def domo_dataset_column_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.domo_dataset_column_count + return ( + None + if self.attributes is None + else self.attributes.domo_dataset_column_count + ) @domo_dataset_column_count.setter def domo_dataset_column_count(self, domo_dataset_column_count: Optional[int]): @@ -86,7 +100,9 @@ def domo_dataset_column_count(self, domo_dataset_column_count: Optional[int]): @property def domo_dataset_card_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.domo_dataset_card_count + return ( + None if self.attributes is None else self.attributes.domo_dataset_card_count + ) @domo_dataset_card_count.setter def domo_dataset_card_count(self, domo_dataset_card_count: Optional[int]): @@ -96,7 +112,9 @@ def domo_dataset_card_count(self, domo_dataset_card_count: Optional[int]): @property def domo_dataset_last_run(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.domo_dataset_last_run + return ( + None if self.attributes is None else self.attributes.domo_dataset_last_run + ) @domo_dataset_last_run.setter def domo_dataset_last_run(self, domo_dataset_last_run: Optional[str]): @@ -119,7 +137,9 @@ def domo_dataset_columns(self) -> Optional[List[DomoDatasetColumn]]: return None if self.attributes is None else self.attributes.domo_dataset_columns @domo_dataset_columns.setter - def domo_dataset_columns(self, domo_dataset_columns: Optional[List[DomoDatasetColumn]]): + def domo_dataset_columns( + self, domo_dataset_columns: Optional[List[DomoDatasetColumn]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.domo_dataset_columns = domo_dataset_columns @@ -129,8 +149,12 @@ class Attributes(Domo.Attributes): domo_dataset_column_count: Optional[int] = Field(default=None, description="") domo_dataset_card_count: Optional[int] = Field(default=None, description="") domo_dataset_last_run: Optional[str] = Field(default=None, description="") - domo_cards: Optional[List[DomoCard]] = Field(default=None, description="") # relationship - domo_dataset_columns: Optional[List[DomoDatasetColumn]] = Field(default=None, description="") # relationship + domo_cards: Optional[List[DomoCard]] = Field( + default=None, description="" + ) # relationship + domo_dataset_columns: Optional[List[DomoDatasetColumn]] = Field( + default=None, description="" + ) # relationship attributes: DomoDataset.Attributes = Field( default_factory=lambda: DomoDataset.Attributes(), diff --git a/pyatlan/model/assets/domo_dataset_column.py b/pyatlan/model/assets/domo_dataset_column.py index 1ec78c52a..840152720 100644 --- a/pyatlan/model/assets/domo_dataset_column.py +++ b/pyatlan/model/assets/domo_dataset_column.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DOMO_DATASET_COLUMN_TYPE: ClassVar[KeywordField] = KeywordField("domoDatasetColumnType", "domoDatasetColumnType") + DOMO_DATASET_COLUMN_TYPE: ClassVar[KeywordField] = KeywordField( + "domoDatasetColumnType", "domoDatasetColumnType" + ) """ Type of Domo Dataset Column. """ @@ -53,7 +55,11 @@ def __setattr__(self, name, value): @property def domo_dataset_column_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.domo_dataset_column_type + return ( + None + if self.attributes is None + else self.attributes.domo_dataset_column_type + ) @domo_dataset_column_type.setter def domo_dataset_column_type(self, domo_dataset_column_type: Optional[str]): @@ -63,7 +69,11 @@ def domo_dataset_column_type(self, domo_dataset_column_type: Optional[str]): @property def domo_dataset_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.domo_dataset_qualified_name + return ( + None + if self.attributes is None + else self.attributes.domo_dataset_qualified_name + ) @domo_dataset_qualified_name.setter def domo_dataset_qualified_name(self, domo_dataset_qualified_name: Optional[str]): @@ -84,7 +94,9 @@ def domo_dataset(self, domo_dataset: Optional[DomoDataset]): class Attributes(Domo.Attributes): domo_dataset_column_type: Optional[str] = Field(default=None, description="") domo_dataset_qualified_name: Optional[str] = Field(default=None, description="") - domo_dataset: Optional[DomoDataset] = Field(default=None, description="") # relationship + domo_dataset: Optional[DomoDataset] = Field( + default=None, description="" + ) # relationship attributes: DomoDatasetColumn.Attributes = Field( default_factory=lambda: DomoDatasetColumn.Attributes(), diff --git a/pyatlan/model/assets/dynamo_d_b.py b/pyatlan/model/assets/dynamo_d_b.py index 26f57b350..7cbd2c832 100644 --- a/pyatlan/model/assets/dynamo_d_b.py +++ b/pyatlan/model/assets/dynamo_d_b.py @@ -30,15 +30,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField("dynamoDBStatus", "dynamoDBStatus") + DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField( + "dynamoDBStatus", "dynamoDBStatus" + ) """ Status of the DynamoDB Asset """ - DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBPartitionKey", "dynamoDBPartitionKey") + DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField( + "dynamoDBPartitionKey", "dynamoDBPartitionKey" + ) """ Specifies the partition key of the DynamoDB Table/Index """ - DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBSortKey", "dynamoDBSortKey") + DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField( + "dynamoDBSortKey", "dynamoDBSortKey" + ) """ Specifies the sort key of the DynamoDB Table/Index """ @@ -75,7 +81,11 @@ def dynamo_d_b_status(self, dynamo_d_b_status: Optional[DynamoDBStatus]): @property def dynamo_d_b_partition_key(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dynamo_d_b_partition_key + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_partition_key + ) @dynamo_d_b_partition_key.setter def dynamo_d_b_partition_key(self, dynamo_d_b_partition_key: Optional[str]): @@ -95,30 +105,50 @@ def dynamo_d_b_sort_key(self, dynamo_d_b_sort_key: Optional[str]): @property def dynamo_d_b_read_capacity_units(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.dynamo_d_b_read_capacity_units + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_read_capacity_units + ) @dynamo_d_b_read_capacity_units.setter - def dynamo_d_b_read_capacity_units(self, dynamo_d_b_read_capacity_units: Optional[int]): + def dynamo_d_b_read_capacity_units( + self, dynamo_d_b_read_capacity_units: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dynamo_d_b_read_capacity_units = dynamo_d_b_read_capacity_units @property def dynamo_d_b_write_capacity_units(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.dynamo_d_b_write_capacity_units + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_write_capacity_units + ) @dynamo_d_b_write_capacity_units.setter - def dynamo_d_b_write_capacity_units(self, dynamo_d_b_write_capacity_units: Optional[int]): + def dynamo_d_b_write_capacity_units( + self, dynamo_d_b_write_capacity_units: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_write_capacity_units = dynamo_d_b_write_capacity_units + self.attributes.dynamo_d_b_write_capacity_units = ( + dynamo_d_b_write_capacity_units + ) class Attributes(NoSQL.Attributes): - dynamo_d_b_status: Optional[DynamoDBStatus] = Field(default=None, description="") + dynamo_d_b_status: Optional[DynamoDBStatus] = Field( + default=None, description="" + ) dynamo_d_b_partition_key: Optional[str] = Field(default=None, description="") dynamo_d_b_sort_key: Optional[str] = Field(default=None, description="") - dynamo_d_b_read_capacity_units: Optional[int] = Field(default=None, description="") - dynamo_d_b_write_capacity_units: Optional[int] = Field(default=None, description="") + dynamo_d_b_read_capacity_units: Optional[int] = Field( + default=None, description="" + ) + dynamo_d_b_write_capacity_units: Optional[int] = Field( + default=None, description="" + ) attributes: DynamoDB.Attributes = Field( default_factory=lambda: DynamoDB.Attributes(), diff --git a/pyatlan/model/assets/dynamo_d_b_global_secondary_index.py b/pyatlan/model/assets/dynamo_d_b_global_secondary_index.py index bb2fd3879..81ccd0c93 100644 --- a/pyatlan/model/assets/dynamo_d_b_global_secondary_index.py +++ b/pyatlan/model/assets/dynamo_d_b_global_secondary_index.py @@ -49,7 +49,9 @@ def dynamo_dbtable(self, dynamo_dbtable: Optional[DynamoDBTable]): self.attributes.dynamo_dbtable = dynamo_dbtable class Attributes(DynamoDBSecondaryIndex.Attributes): - dynamo_dbtable: Optional[DynamoDBTable] = Field(default=None, description="") # relationship + dynamo_dbtable: Optional[DynamoDBTable] = Field( + default=None, description="" + ) # relationship attributes: DynamoDBGlobalSecondaryIndex.Attributes = Field( default_factory=lambda: DynamoDBGlobalSecondaryIndex.Attributes(), diff --git a/pyatlan/model/assets/dynamo_d_b_local_secondary_index.py b/pyatlan/model/assets/dynamo_d_b_local_secondary_index.py index e4595082c..32e7c821e 100644 --- a/pyatlan/model/assets/dynamo_d_b_local_secondary_index.py +++ b/pyatlan/model/assets/dynamo_d_b_local_secondary_index.py @@ -49,7 +49,9 @@ def dynamo_dbtable(self, dynamo_dbtable: Optional[DynamoDBTable]): self.attributes.dynamo_dbtable = dynamo_dbtable class Attributes(DynamoDBSecondaryIndex.Attributes): - dynamo_dbtable: Optional[DynamoDBTable] = Field(default=None, description="") # relationship + dynamo_dbtable: Optional[DynamoDBTable] = Field( + default=None, description="" + ) # relationship attributes: DynamoDBLocalSecondaryIndex.Attributes = Field( default_factory=lambda: DynamoDBLocalSecondaryIndex.Attributes(), diff --git a/pyatlan/model/assets/dynamo_dbtable.py b/pyatlan/model/assets/dynamo_dbtable.py index 11b570bf5..d24722fe2 100644 --- a/pyatlan/model/assets/dynamo_dbtable.py +++ b/pyatlan/model/assets/dynamo_dbtable.py @@ -38,11 +38,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DYNAMO_DB_TABLE_GSI_COUNT: ClassVar[NumericField] = NumericField("dynamoDBTableGSICount", "dynamoDBTableGSICount") + DYNAMO_DB_TABLE_GSI_COUNT: ClassVar[NumericField] = NumericField( + "dynamoDBTableGSICount", "dynamoDBTableGSICount" + ) """ Represents the number of global secondary indexes on the table. """ - DYNAMO_DB_TABLE_LSI_COUNT: ClassVar[NumericField] = NumericField("dynamoDBTableLSICount", "dynamoDBTableLSICount") + DYNAMO_DB_TABLE_LSI_COUNT: ClassVar[NumericField] = NumericField( + "dynamoDBTableLSICount", "dynamoDBTableLSICount" + ) """ Represents the number of local secondary indexes on the table. """ @@ -66,35 +70,51 @@ def __setattr__(self, name, value): """ Whether this table is temporary (true) or not (false). """ - IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField("isQueryPreview", "isQueryPreview") + IS_QUERY_PREVIEW: ClassVar[BooleanField] = BooleanField( + "isQueryPreview", "isQueryPreview" + ) """ Whether preview queries are allowed for this table (true) or not (false). """ - QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField("queryPreviewConfig", "queryPreviewConfig") + QUERY_PREVIEW_CONFIG: ClassVar[KeywordField] = KeywordField( + "queryPreviewConfig", "queryPreviewConfig" + ) """ Configuration for preview queries. """ - EXTERNAL_LOCATION: ClassVar[TextField] = TextField("externalLocation", "externalLocation") + EXTERNAL_LOCATION: ClassVar[TextField] = TextField( + "externalLocation", "externalLocation" + ) """ External location of this table, for example: an S3 object location. """ - EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField("externalLocationRegion", "externalLocationRegion") + EXTERNAL_LOCATION_REGION: ClassVar[TextField] = TextField( + "externalLocationRegion", "externalLocationRegion" + ) """ Region of the external location of this table, for example: S3 region. """ - EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField("externalLocationFormat", "externalLocationFormat") + EXTERNAL_LOCATION_FORMAT: ClassVar[KeywordField] = KeywordField( + "externalLocationFormat", "externalLocationFormat" + ) """ Format of the external location of this table, for example: JSON, CSV, PARQUET, etc. """ - IS_PARTITIONED: ClassVar[BooleanField] = BooleanField("isPartitioned", "isPartitioned") + IS_PARTITIONED: ClassVar[BooleanField] = BooleanField( + "isPartitioned", "isPartitioned" + ) """ Whether this table is partitioned (true) or not (false). """ - PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField("partitionStrategy", "partitionStrategy") + PARTITION_STRATEGY: ClassVar[KeywordField] = KeywordField( + "partitionStrategy", "partitionStrategy" + ) """ Partition strategy for this table. """ - PARTITION_COUNT: ClassVar[NumericField] = NumericField("partitionCount", "partitionCount") + PARTITION_COUNT: ClassVar[NumericField] = NumericField( + "partitionCount", "partitionCount" + ) """ Number of partitions in this table. """ @@ -110,15 +130,21 @@ def __setattr__(self, name, value): """ Type of the table. """ - ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField("icebergCatalogName", "icebergCatalogName") + ICEBERG_CATALOG_NAME: ClassVar[KeywordField] = KeywordField( + "icebergCatalogName", "icebergCatalogName" + ) """ iceberg table catalog name (can be any user defined name) """ - ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField("icebergTableType", "icebergTableType") + ICEBERG_TABLE_TYPE: ClassVar[KeywordField] = KeywordField( + "icebergTableType", "icebergTableType" + ) """ iceberg table type (managed vs unmanaged) """ - ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField("icebergCatalogSource", "icebergCatalogSource") + ICEBERG_CATALOG_SOURCE: ClassVar[KeywordField] = KeywordField( + "icebergCatalogSource", "icebergCatalogSource" + ) """ iceberg table catalog type (glue, polaris, snowflake) """ @@ -146,7 +172,9 @@ def __setattr__(self, name, value): """ iceberg table base location inside the external volume. """ - TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField("tableRetentionTime", "tableRetentionTime") + TABLE_RETENTION_TIME: ClassVar[NumericField] = NumericField( + "tableRetentionTime", "tableRetentionTime" + ) """ Data retention time in days. """ @@ -154,47 +182,69 @@ def __setattr__(self, name, value): """ Number of times this asset has been queried. """ - QUERY_USER_COUNT: ClassVar[NumericField] = NumericField("queryUserCount", "queryUserCount") + QUERY_USER_COUNT: ClassVar[NumericField] = NumericField( + "queryUserCount", "queryUserCount" + ) """ Number of unique users who have queried this asset. """ - QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField("queryUserMap", "queryUserMap") + QUERY_USER_MAP: ClassVar[KeywordField] = KeywordField( + "queryUserMap", "queryUserMap" + ) """ Map of unique users who have queried this asset to the number of times they have queried it. """ - QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField("queryCountUpdatedAt", "queryCountUpdatedAt") + QUERY_COUNT_UPDATED_AT: ClassVar[NumericField] = NumericField( + "queryCountUpdatedAt", "queryCountUpdatedAt" + ) """ Time (epoch) at which the query count was last updated, in milliseconds. """ - DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField("databaseName", "databaseName.keyword", "databaseName") + DATABASE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "databaseName", "databaseName.keyword", "databaseName" + ) """ Simple name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("databaseQualifiedName", "databaseQualifiedName") + DATABASE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "databaseQualifiedName", "databaseQualifiedName" + ) """ Unique name of the database in which this SQL asset exists, or empty if it does not exist within a database. """ - SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField("schemaName", "schemaName.keyword", "schemaName") + SCHEMA_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "schemaName", "schemaName.keyword", "schemaName" + ) """ Simple name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("schemaQualifiedName", "schemaQualifiedName") + SCHEMA_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "schemaQualifiedName", "schemaQualifiedName" + ) """ Unique name of the schema in which this SQL asset exists, or empty if it does not exist within a schema. """ - TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField("tableName", "tableName.keyword", "tableName") + TABLE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "tableName", "tableName.keyword", "tableName" + ) """ Simple name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("tableQualifiedName", "tableQualifiedName") + TABLE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "tableQualifiedName", "tableQualifiedName" + ) """ Unique name of the table in which this SQL asset exists, or empty if it does not exist within a table. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "viewName", "viewName.keyword", "viewName" + ) """ Simple name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ - VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("viewQualifiedName", "viewQualifiedName") + VIEW_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "viewQualifiedName", "viewQualifiedName" + ) """ Unique name of the view in which this SQL asset exists, or empty if it does not exist within a view. """ @@ -214,19 +264,27 @@ def __setattr__(self, name, value): """ Whether this asset has been profiled (true) or not (false). """ - LAST_PROFILED_AT: ClassVar[NumericField] = NumericField("lastProfiledAt", "lastProfiledAt") + LAST_PROFILED_AT: ClassVar[NumericField] = NumericField( + "lastProfiledAt", "lastProfiledAt" + ) """ Time (epoch) at which this asset was last profiled, in milliseconds. """ - DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField("dynamoDBStatus", "dynamoDBStatus") + DYNAMO_DB_STATUS: ClassVar[KeywordField] = KeywordField( + "dynamoDBStatus", "dynamoDBStatus" + ) """ Status of the DynamoDB Asset """ - DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBPartitionKey", "dynamoDBPartitionKey") + DYNAMO_DB_PARTITION_KEY: ClassVar[KeywordField] = KeywordField( + "dynamoDBPartitionKey", "dynamoDBPartitionKey" + ) """ Specifies the partition key of the DynamoDB Table/Index """ - DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField("dynamoDBSortKey", "dynamoDBSortKey") + DYNAMO_DB_SORT_KEY: ClassVar[KeywordField] = KeywordField( + "dynamoDBSortKey", "dynamoDBSortKey" + ) """ Specifies the sort key of the DynamoDB Table/Index """ @@ -242,16 +300,22 @@ def __setattr__(self, name, value): """ The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException """ - NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField("noSQLSchemaDefinition", "noSQLSchemaDefinition") + NO_SQL_SCHEMA_DEFINITION: ClassVar[TextField] = TextField( + "noSQLSchemaDefinition", "noSQLSchemaDefinition" + ) """ Represents attributes for describing the key schema for the table and indexes. """ - DYNAMO_DB_LOCAL_SECONDARY_INDEXES: ClassVar[RelationField] = RelationField("dynamoDBLocalSecondaryIndexes") + DYNAMO_DB_LOCAL_SECONDARY_INDEXES: ClassVar[RelationField] = RelationField( + "dynamoDBLocalSecondaryIndexes" + ) """ TBC """ - DYNAMO_DB_GLOBAL_SECONDARY_INDEXES: ClassVar[RelationField] = RelationField("dynamoDBGlobalSecondaryIndexes") + DYNAMO_DB_GLOBAL_SECONDARY_INDEXES: ClassVar[RelationField] = RelationField( + "dynamoDBGlobalSecondaryIndexes" + ) """ TBC """ @@ -311,7 +375,11 @@ def __setattr__(self, name, value): @property def dynamo_dbtable_g_s_i_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.dynamo_dbtable_g_s_i_count + return ( + None + if self.attributes is None + else self.attributes.dynamo_dbtable_g_s_i_count + ) @dynamo_dbtable_g_s_i_count.setter def dynamo_dbtable_g_s_i_count(self, dynamo_dbtable_g_s_i_count: Optional[int]): @@ -321,7 +389,11 @@ def dynamo_dbtable_g_s_i_count(self, dynamo_dbtable_g_s_i_count: Optional[int]): @property def dynamo_dbtable_l_s_i_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.dynamo_dbtable_l_s_i_count + return ( + None + if self.attributes is None + else self.attributes.dynamo_dbtable_l_s_i_count + ) @dynamo_dbtable_l_s_i_count.setter def dynamo_dbtable_l_s_i_count(self, dynamo_dbtable_l_s_i_count: Optional[int]): @@ -411,7 +483,11 @@ def external_location(self, external_location: Optional[str]): @property def external_location_region(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_region + return ( + None + if self.attributes is None + else self.attributes.external_location_region + ) @external_location_region.setter def external_location_region(self, external_location_region: Optional[str]): @@ -421,7 +497,11 @@ def external_location_region(self, external_location_region: Optional[str]): @property def external_location_format(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.external_location_format + return ( + None + if self.attributes is None + else self.attributes.external_location_format + ) @external_location_format.setter def external_location_format(self, external_location_format: Optional[str]): @@ -511,7 +591,9 @@ def iceberg_table_type(self, iceberg_table_type: Optional[str]): @property def iceberg_catalog_source(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_source + return ( + None if self.attributes is None else self.attributes.iceberg_catalog_source + ) @iceberg_catalog_source.setter def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @@ -521,7 +603,11 @@ def iceberg_catalog_source(self, iceberg_catalog_source: Optional[str]): @property def iceberg_catalog_table_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_table_name + return ( + None + if self.attributes is None + else self.attributes.iceberg_catalog_table_name + ) @iceberg_catalog_table_name.setter def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @@ -531,17 +617,29 @@ def iceberg_catalog_table_name(self, iceberg_catalog_table_name: Optional[str]): @property def iceberg_catalog_table_namespace(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_catalog_table_namespace + return ( + None + if self.attributes is None + else self.attributes.iceberg_catalog_table_namespace + ) @iceberg_catalog_table_namespace.setter - def iceberg_catalog_table_namespace(self, iceberg_catalog_table_namespace: Optional[str]): + def iceberg_catalog_table_namespace( + self, iceberg_catalog_table_namespace: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.iceberg_catalog_table_namespace = iceberg_catalog_table_namespace + self.attributes.iceberg_catalog_table_namespace = ( + iceberg_catalog_table_namespace + ) @property def table_external_volume_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.table_external_volume_name + return ( + None + if self.attributes is None + else self.attributes.table_external_volume_name + ) @table_external_volume_name.setter def table_external_volume_name(self, table_external_volume_name: Optional[str]): @@ -551,7 +649,11 @@ def table_external_volume_name(self, table_external_volume_name: Optional[str]): @property def iceberg_table_base_location(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.iceberg_table_base_location + return ( + None + if self.attributes is None + else self.attributes.iceberg_table_base_location + ) @iceberg_table_base_location.setter def iceberg_table_base_location(self, iceberg_table_base_location: Optional[str]): @@ -601,7 +703,9 @@ def query_user_map(self, query_user_map: Optional[Dict[str, int]]): @property def query_count_updated_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.query_count_updated_at + return ( + None if self.attributes is None else self.attributes.query_count_updated_at + ) @query_count_updated_at.setter def query_count_updated_at(self, query_count_updated_at: Optional[datetime]): @@ -621,7 +725,9 @@ def database_name(self, database_name: Optional[str]): @property def database_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.database_qualified_name + return ( + None if self.attributes is None else self.attributes.database_qualified_name + ) @database_qualified_name.setter def database_qualified_name(self, database_qualified_name: Optional[str]): @@ -641,7 +747,9 @@ def schema_name(self, schema_name: Optional[str]): @property def schema_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.schema_qualified_name + return ( + None if self.attributes is None else self.attributes.schema_qualified_name + ) @schema_qualified_name.setter def schema_qualified_name(self, schema_qualified_name: Optional[str]): @@ -691,7 +799,9 @@ def view_qualified_name(self, view_qualified_name: Optional[str]): @property def calculation_view_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_name + return ( + None if self.attributes is None else self.attributes.calculation_view_name + ) @calculation_view_name.setter def calculation_view_name(self, calculation_view_name: Optional[str]): @@ -701,13 +811,21 @@ def calculation_view_name(self, calculation_view_name: Optional[str]): @property def calculation_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.calculation_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.calculation_view_qualified_name + ) @calculation_view_qualified_name.setter - def calculation_view_qualified_name(self, calculation_view_qualified_name: Optional[str]): + def calculation_view_qualified_name( + self, calculation_view_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.calculation_view_qualified_name = calculation_view_qualified_name + self.attributes.calculation_view_qualified_name = ( + calculation_view_qualified_name + ) @property def is_profiled(self) -> Optional[bool]: @@ -741,7 +859,11 @@ def dynamo_d_b_status(self, dynamo_d_b_status: Optional[DynamoDBStatus]): @property def dynamo_d_b_partition_key(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.dynamo_d_b_partition_key + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_partition_key + ) @dynamo_d_b_partition_key.setter def dynamo_d_b_partition_key(self, dynamo_d_b_partition_key: Optional[str]): @@ -761,27 +883,45 @@ def dynamo_d_b_sort_key(self, dynamo_d_b_sort_key: Optional[str]): @property def dynamo_d_b_read_capacity_units(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.dynamo_d_b_read_capacity_units + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_read_capacity_units + ) @dynamo_d_b_read_capacity_units.setter - def dynamo_d_b_read_capacity_units(self, dynamo_d_b_read_capacity_units: Optional[int]): + def dynamo_d_b_read_capacity_units( + self, dynamo_d_b_read_capacity_units: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.dynamo_d_b_read_capacity_units = dynamo_d_b_read_capacity_units @property def dynamo_d_b_write_capacity_units(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.dynamo_d_b_write_capacity_units + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_write_capacity_units + ) @dynamo_d_b_write_capacity_units.setter - def dynamo_d_b_write_capacity_units(self, dynamo_d_b_write_capacity_units: Optional[int]): + def dynamo_d_b_write_capacity_units( + self, dynamo_d_b_write_capacity_units: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_write_capacity_units = dynamo_d_b_write_capacity_units + self.attributes.dynamo_d_b_write_capacity_units = ( + dynamo_d_b_write_capacity_units + ) @property def no_s_q_l_schema_definition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.no_s_q_l_schema_definition + return ( + None + if self.attributes is None + else self.attributes.no_s_q_l_schema_definition + ) @no_s_q_l_schema_definition.setter def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): @@ -793,7 +933,11 @@ def no_s_q_l_schema_definition(self, no_s_q_l_schema_definition: Optional[str]): def dynamo_d_b_local_secondary_indexes( self, ) -> Optional[List[DynamoDBLocalSecondaryIndex]]: - return None if self.attributes is None else self.attributes.dynamo_d_b_local_secondary_indexes + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_local_secondary_indexes + ) @dynamo_d_b_local_secondary_indexes.setter def dynamo_d_b_local_secondary_indexes( @@ -802,22 +946,32 @@ def dynamo_d_b_local_secondary_indexes( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_local_secondary_indexes = dynamo_d_b_local_secondary_indexes + self.attributes.dynamo_d_b_local_secondary_indexes = ( + dynamo_d_b_local_secondary_indexes + ) @property def dynamo_d_b_global_secondary_indexes( self, ) -> Optional[List[DynamoDBGlobalSecondaryIndex]]: - return None if self.attributes is None else self.attributes.dynamo_d_b_global_secondary_indexes + return ( + None + if self.attributes is None + else self.attributes.dynamo_d_b_global_secondary_indexes + ) @dynamo_d_b_global_secondary_indexes.setter def dynamo_d_b_global_secondary_indexes( self, - dynamo_d_b_global_secondary_indexes: Optional[List[DynamoDBGlobalSecondaryIndex]], + dynamo_d_b_global_secondary_indexes: Optional[ + List[DynamoDBGlobalSecondaryIndex] + ], ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.dynamo_d_b_global_secondary_indexes = dynamo_d_b_global_secondary_indexes + self.attributes.dynamo_d_b_global_secondary_indexes = ( + dynamo_d_b_global_secondary_indexes + ) class Attributes(Table.Attributes): dynamo_dbtable_g_s_i_count: Optional[int] = Field(default=None, description="") @@ -828,7 +982,9 @@ class Attributes(Table.Attributes): alias: Optional[str] = Field(default=None, description="") is_temporary: Optional[bool] = Field(default=None, description="") is_query_preview: Optional[bool] = Field(default=None, description="") - query_preview_config: Optional[Dict[str, str]] = Field(default=None, description="") + query_preview_config: Optional[Dict[str, str]] = Field( + default=None, description="" + ) external_location: Optional[str] = Field(default=None, description="") external_location_region: Optional[str] = Field(default=None, description="") external_location_format: Optional[str] = Field(default=None, description="") @@ -842,7 +998,9 @@ class Attributes(Table.Attributes): iceberg_table_type: Optional[str] = Field(default=None, description="") iceberg_catalog_source: Optional[str] = Field(default=None, description="") iceberg_catalog_table_name: Optional[str] = Field(default=None, description="") - iceberg_catalog_table_namespace: Optional[str] = Field(default=None, description="") + iceberg_catalog_table_namespace: Optional[str] = Field( + default=None, description="" + ) table_external_volume_name: Optional[str] = Field(default=None, description="") iceberg_table_base_location: Optional[str] = Field(default=None, description="") table_retention_time: Optional[int] = Field(default=None, description="") @@ -859,21 +1017,29 @@ class Attributes(Table.Attributes): view_name: Optional[str] = Field(default=None, description="") view_qualified_name: Optional[str] = Field(default=None, description="") calculation_view_name: Optional[str] = Field(default=None, description="") - calculation_view_qualified_name: Optional[str] = Field(default=None, description="") + calculation_view_qualified_name: Optional[str] = Field( + default=None, description="" + ) is_profiled: Optional[bool] = Field(default=None, description="") last_profiled_at: Optional[datetime] = Field(default=None, description="") - dynamo_d_b_status: Optional[DynamoDBStatus] = Field(default=None, description="") + dynamo_d_b_status: Optional[DynamoDBStatus] = Field( + default=None, description="" + ) dynamo_d_b_partition_key: Optional[str] = Field(default=None, description="") dynamo_d_b_sort_key: Optional[str] = Field(default=None, description="") - dynamo_d_b_read_capacity_units: Optional[int] = Field(default=None, description="") - dynamo_d_b_write_capacity_units: Optional[int] = Field(default=None, description="") - no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") - dynamo_d_b_local_secondary_indexes: Optional[List[DynamoDBLocalSecondaryIndex]] = Field( + dynamo_d_b_read_capacity_units: Optional[int] = Field( default=None, description="" - ) # relationship - dynamo_d_b_global_secondary_indexes: Optional[List[DynamoDBGlobalSecondaryIndex]] = Field( + ) + dynamo_d_b_write_capacity_units: Optional[int] = Field( default=None, description="" - ) # relationship + ) + no_s_q_l_schema_definition: Optional[str] = Field(default=None, description="") + dynamo_d_b_local_secondary_indexes: Optional[ + List[DynamoDBLocalSecondaryIndex] + ] = Field(default=None, description="") # relationship + dynamo_d_b_global_secondary_indexes: Optional[ + List[DynamoDBGlobalSecondaryIndex] + ] = Field(default=None, description="") # relationship attributes: DynamoDBTable.Attributes = Field( default_factory=lambda: DynamoDBTable.Attributes(), diff --git a/pyatlan/model/assets/g_c_s.py b/pyatlan/model/assets/g_c_s.py index 34d432869..f5c4775a6 100644 --- a/pyatlan/model/assets/g_c_s.py +++ b/pyatlan/model/assets/g_c_s.py @@ -36,11 +36,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - GCS_STORAGE_CLASS: ClassVar[KeywordField] = KeywordField("gcsStorageClass", "gcsStorageClass") + GCS_STORAGE_CLASS: ClassVar[KeywordField] = KeywordField( + "gcsStorageClass", "gcsStorageClass" + ) """ Storage class of this asset. """ - GCS_ENCRYPTION_TYPE: ClassVar[KeywordField] = KeywordField("gcsEncryptionType", "gcsEncryptionType") + GCS_ENCRYPTION_TYPE: ClassVar[KeywordField] = KeywordField( + "gcsEncryptionType", "gcsEncryptionType" + ) """ Encryption algorithm used to encrypt this asset. """ @@ -48,19 +52,27 @@ def __setattr__(self, name, value): """ Entity tag for the asset. An entity tag is a hash of the object and represents changes to the contents of an object only, not its metadata. """ # noqa: E501 - GCS_REQUESTER_PAYS: ClassVar[BooleanField] = BooleanField("gcsRequesterPays", "gcsRequesterPays") + GCS_REQUESTER_PAYS: ClassVar[BooleanField] = BooleanField( + "gcsRequesterPays", "gcsRequesterPays" + ) """ Whether the requester pays header was sent when this asset was created (true) or not (false). """ - GCS_ACCESS_CONTROL: ClassVar[KeywordField] = KeywordField("gcsAccessControl", "gcsAccessControl") + GCS_ACCESS_CONTROL: ClassVar[KeywordField] = KeywordField( + "gcsAccessControl", "gcsAccessControl" + ) """ Access control list for this asset. """ - GCS_META_GENERATION_ID: ClassVar[NumericField] = NumericField("gcsMetaGenerationId", "gcsMetaGenerationId") + GCS_META_GENERATION_ID: ClassVar[NumericField] = NumericField( + "gcsMetaGenerationId", "gcsMetaGenerationId" + ) """ Version of metadata for this asset at this generation. Used for preconditions and detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular asset. """ # noqa: E501 - GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField("googleService", "googleService") + GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField( + "googleService", "googleService" + ) """ Service in Google in which the asset exists. """ @@ -76,15 +88,21 @@ def __setattr__(self, name, value): """ ID of the project in which the asset exists. """ - GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField("googleProjectNumber", "googleProjectNumber") + GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField( + "googleProjectNumber", "googleProjectNumber" + ) """ Number of the project in which the asset exists. """ - GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField("googleLocation", "googleLocation") + GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField( + "googleLocation", "googleLocation" + ) """ Location of this asset in Google. """ - GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField("googleLocationType", "googleLocationType") + GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField( + "googleLocationType", "googleLocationType" + ) """ Type of location of this asset in Google. """ @@ -101,7 +119,9 @@ def __setattr__(self, name, value): """ TBC """ - INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("inputToAirflowTasks") + INPUT_TO_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( + "inputToAirflowTasks" + ) """ TBC """ @@ -109,23 +129,33 @@ def __setattr__(self, name, value): """ TBC """ - MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField("modelImplementedAttributes") + MODEL_IMPLEMENTED_ATTRIBUTES: ClassVar[RelationField] = RelationField( + "modelImplementedAttributes" + ) """ TBC """ - OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField("outputFromAirflowTasks") + OUTPUT_FROM_AIRFLOW_TASKS: ClassVar[RelationField] = RelationField( + "outputFromAirflowTasks" + ) """ TBC """ - OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField("outputFromSparkJobs") + OUTPUT_FROM_SPARK_JOBS: ClassVar[RelationField] = RelationField( + "outputFromSparkJobs" + ) """ TBC """ - MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField("modelImplementedEntities") + MODEL_IMPLEMENTED_ENTITIES: ClassVar[RelationField] = RelationField( + "modelImplementedEntities" + ) """ TBC """ - OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField("outputFromProcesses") + OUTPUT_FROM_PROCESSES: ClassVar[RelationField] = RelationField( + "outputFromProcesses" + ) """ TBC """ @@ -207,7 +237,9 @@ def gcs_access_control(self, gcs_access_control: Optional[str]): @property def gcs_meta_generation_id(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.gcs_meta_generation_id + return ( + None if self.attributes is None else self.attributes.gcs_meta_generation_id + ) @gcs_meta_generation_id.setter def gcs_meta_generation_id(self, gcs_meta_generation_id: Optional[int]): @@ -247,7 +279,9 @@ def google_project_id(self, google_project_id: Optional[str]): @property def google_project_number(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.google_project_number + return ( + None if self.attributes is None else self.attributes.google_project_number + ) @google_project_number.setter def google_project_number(self, google_project_number: Optional[int]): @@ -307,10 +341,14 @@ def input_to_spark_jobs(self, input_to_spark_jobs: Optional[List[SparkJob]]): @property def input_to_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return None if self.attributes is None else self.attributes.input_to_airflow_tasks + return ( + None if self.attributes is None else self.attributes.input_to_airflow_tasks + ) @input_to_airflow_tasks.setter - def input_to_airflow_tasks(self, input_to_airflow_tasks: Optional[List[AirflowTask]]): + def input_to_airflow_tasks( + self, input_to_airflow_tasks: Optional[List[AirflowTask]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.input_to_airflow_tasks = input_to_airflow_tasks @@ -327,27 +365,41 @@ def input_to_processes(self, input_to_processes: Optional[List[Process]]): @property def model_implemented_attributes(self) -> Optional[List[ModelAttribute]]: - return None if self.attributes is None else self.attributes.model_implemented_attributes + return ( + None + if self.attributes is None + else self.attributes.model_implemented_attributes + ) @model_implemented_attributes.setter - def model_implemented_attributes(self, model_implemented_attributes: Optional[List[ModelAttribute]]): + def model_implemented_attributes( + self, model_implemented_attributes: Optional[List[ModelAttribute]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_attributes = model_implemented_attributes @property def output_from_airflow_tasks(self) -> Optional[List[AirflowTask]]: - return None if self.attributes is None else self.attributes.output_from_airflow_tasks + return ( + None + if self.attributes is None + else self.attributes.output_from_airflow_tasks + ) @output_from_airflow_tasks.setter - def output_from_airflow_tasks(self, output_from_airflow_tasks: Optional[List[AirflowTask]]): + def output_from_airflow_tasks( + self, output_from_airflow_tasks: Optional[List[AirflowTask]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.output_from_airflow_tasks = output_from_airflow_tasks @property def output_from_spark_jobs(self) -> Optional[List[SparkJob]]: - return None if self.attributes is None else self.attributes.output_from_spark_jobs + return ( + None if self.attributes is None else self.attributes.output_from_spark_jobs + ) @output_from_spark_jobs.setter def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob]]): @@ -357,17 +409,25 @@ def output_from_spark_jobs(self, output_from_spark_jobs: Optional[List[SparkJob] @property def model_implemented_entities(self) -> Optional[List[ModelEntity]]: - return None if self.attributes is None else self.attributes.model_implemented_entities + return ( + None + if self.attributes is None + else self.attributes.model_implemented_entities + ) @model_implemented_entities.setter - def model_implemented_entities(self, model_implemented_entities: Optional[List[ModelEntity]]): + def model_implemented_entities( + self, model_implemented_entities: Optional[List[ModelEntity]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.model_implemented_entities = model_implemented_entities @property def output_from_processes(self) -> Optional[List[Process]]: - return None if self.attributes is None else self.attributes.output_from_processes + return ( + None if self.attributes is None else self.attributes.output_from_processes + ) @output_from_processes.setter def output_from_processes(self, output_from_processes: Optional[List[Process]]): @@ -390,16 +450,30 @@ class Attributes(Google.Attributes): google_location_type: Optional[str] = Field(default=None, description="") google_labels: Optional[List[GoogleLabel]] = Field(default=None, description="") google_tags: Optional[List[GoogleTag]] = Field(default=None, description="") - input_to_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship - input_to_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship - input_to_processes: Optional[List[Process]] = Field(default=None, description="") # relationship + input_to_spark_jobs: Optional[List[SparkJob]] = Field( + default=None, description="" + ) # relationship + input_to_airflow_tasks: Optional[List[AirflowTask]] = Field( + default=None, description="" + ) # relationship + input_to_processes: Optional[List[Process]] = Field( + default=None, description="" + ) # relationship model_implemented_attributes: Optional[List[ModelAttribute]] = Field( default=None, description="" ) # relationship - output_from_airflow_tasks: Optional[List[AirflowTask]] = Field(default=None, description="") # relationship - output_from_spark_jobs: Optional[List[SparkJob]] = Field(default=None, description="") # relationship - model_implemented_entities: Optional[List[ModelEntity]] = Field(default=None, description="") # relationship - output_from_processes: Optional[List[Process]] = Field(default=None, description="") # relationship + output_from_airflow_tasks: Optional[List[AirflowTask]] = Field( + default=None, description="" + ) # relationship + output_from_spark_jobs: Optional[List[SparkJob]] = Field( + default=None, description="" + ) # relationship + model_implemented_entities: Optional[List[ModelEntity]] = Field( + default=None, description="" + ) # relationship + output_from_processes: Optional[List[Process]] = Field( + default=None, description="" + ) # relationship attributes: GCS.Attributes = Field( default_factory=lambda: GCS.Attributes(), diff --git a/pyatlan/model/assets/g_c_s_bucket.py b/pyatlan/model/assets/g_c_s_bucket.py index ce14b0306..3fbae2870 100644 --- a/pyatlan/model/assets/g_c_s_bucket.py +++ b/pyatlan/model/assets/g_c_s_bucket.py @@ -28,19 +28,27 @@ class GCSBucket(GCS): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> GCSBucket: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) - attributes = GCSBucket.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) + attributes = GCSBucket.Attributes.create( + name=name, connection_qualified_name=connection_qualified_name + ) return cls(attributes=attributes) @classmethod @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> GCSBucket: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, connection_qualified_name=connection_qualified_name) + return cls.creator( + name=name, connection_qualified_name=connection_qualified_name + ) type_name: str = Field(default="GCSBucket", allow_mutation=False) @@ -55,7 +63,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - GCS_OBJECT_COUNT: ClassVar[NumericField] = NumericField("gcsObjectCount", "gcsObjectCount") + GCS_OBJECT_COUNT: ClassVar[NumericField] = NumericField( + "gcsObjectCount", "gcsObjectCount" + ) """ Number of objects within the bucket. """ @@ -83,11 +93,15 @@ def __setattr__(self, name, value): """ Effective time for retention of objects in this bucket. """ - GCS_BUCKET_LIFECYCLE_RULES: ClassVar[TextField] = TextField("gcsBucketLifecycleRules", "gcsBucketLifecycleRules") + GCS_BUCKET_LIFECYCLE_RULES: ClassVar[TextField] = TextField( + "gcsBucketLifecycleRules", "gcsBucketLifecycleRules" + ) """ Lifecycle rules for this bucket. """ - GCS_BUCKET_RETENTION_POLICY: ClassVar[TextField] = TextField("gcsBucketRetentionPolicy", "gcsBucketRetentionPolicy") + GCS_BUCKET_RETENTION_POLICY: ClassVar[TextField] = TextField( + "gcsBucketRetentionPolicy", "gcsBucketRetentionPolicy" + ) """ Retention policy for this bucket. """ @@ -120,17 +134,27 @@ def gcs_object_count(self, gcs_object_count: Optional[int]): @property def gcs_bucket_versioning_enabled(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.gcs_bucket_versioning_enabled + return ( + None + if self.attributes is None + else self.attributes.gcs_bucket_versioning_enabled + ) @gcs_bucket_versioning_enabled.setter - def gcs_bucket_versioning_enabled(self, gcs_bucket_versioning_enabled: Optional[bool]): + def gcs_bucket_versioning_enabled( + self, gcs_bucket_versioning_enabled: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.gcs_bucket_versioning_enabled = gcs_bucket_versioning_enabled @property def gcs_bucket_retention_locked(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.gcs_bucket_retention_locked + return ( + None + if self.attributes is None + else self.attributes.gcs_bucket_retention_locked + ) @gcs_bucket_retention_locked.setter def gcs_bucket_retention_locked(self, gcs_bucket_retention_locked: Optional[bool]): @@ -140,7 +164,11 @@ def gcs_bucket_retention_locked(self, gcs_bucket_retention_locked: Optional[bool @property def gcs_bucket_retention_period(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.gcs_bucket_retention_period + return ( + None + if self.attributes is None + else self.attributes.gcs_bucket_retention_period + ) @gcs_bucket_retention_period.setter def gcs_bucket_retention_period(self, gcs_bucket_retention_period: Optional[int]): @@ -150,17 +178,29 @@ def gcs_bucket_retention_period(self, gcs_bucket_retention_period: Optional[int] @property def gcs_bucket_retention_effective_time(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.gcs_bucket_retention_effective_time + return ( + None + if self.attributes is None + else self.attributes.gcs_bucket_retention_effective_time + ) @gcs_bucket_retention_effective_time.setter - def gcs_bucket_retention_effective_time(self, gcs_bucket_retention_effective_time: Optional[datetime]): + def gcs_bucket_retention_effective_time( + self, gcs_bucket_retention_effective_time: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.gcs_bucket_retention_effective_time = gcs_bucket_retention_effective_time + self.attributes.gcs_bucket_retention_effective_time = ( + gcs_bucket_retention_effective_time + ) @property def gcs_bucket_lifecycle_rules(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.gcs_bucket_lifecycle_rules + return ( + None + if self.attributes is None + else self.attributes.gcs_bucket_lifecycle_rules + ) @gcs_bucket_lifecycle_rules.setter def gcs_bucket_lifecycle_rules(self, gcs_bucket_lifecycle_rules: Optional[str]): @@ -170,7 +210,11 @@ def gcs_bucket_lifecycle_rules(self, gcs_bucket_lifecycle_rules: Optional[str]): @property def gcs_bucket_retention_policy(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.gcs_bucket_retention_policy + return ( + None + if self.attributes is None + else self.attributes.gcs_bucket_retention_policy + ) @gcs_bucket_retention_policy.setter def gcs_bucket_retention_policy(self, gcs_bucket_retention_policy: Optional[str]): @@ -190,23 +234,37 @@ def gcs_objects(self, gcs_objects: Optional[List[GCSObject]]): class Attributes(GCS.Attributes): gcs_object_count: Optional[int] = Field(default=None, description="") - gcs_bucket_versioning_enabled: Optional[bool] = Field(default=None, description="") - gcs_bucket_retention_locked: Optional[bool] = Field(default=None, description="") + gcs_bucket_versioning_enabled: Optional[bool] = Field( + default=None, description="" + ) + gcs_bucket_retention_locked: Optional[bool] = Field( + default=None, description="" + ) gcs_bucket_retention_period: Optional[int] = Field(default=None, description="") - gcs_bucket_retention_effective_time: Optional[datetime] = Field(default=None, description="") + gcs_bucket_retention_effective_time: Optional[datetime] = Field( + default=None, description="" + ) gcs_bucket_lifecycle_rules: Optional[str] = Field(default=None, description="") gcs_bucket_retention_policy: Optional[str] = Field(default=None, description="") - gcs_objects: Optional[List[GCSObject]] = Field(default=None, description="") # relationship + gcs_objects: Optional[List[GCSObject]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def create(cls, *, name: str, connection_qualified_name: str) -> GCSBucket.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + def create( + cls, *, name: str, connection_qualified_name: str + ) -> GCSBucket.Attributes: + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return GCSBucket.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: GCSBucket.Attributes = Field( diff --git a/pyatlan/model/assets/g_c_s_object.py b/pyatlan/model/assets/g_c_s_object.py index 1e96d5ebd..93c5fde87 100644 --- a/pyatlan/model/assets/g_c_s_object.py +++ b/pyatlan/model/assets/g_c_s_object.py @@ -53,7 +53,9 @@ def creator( gcs_bucket_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> GCSObject: - validate_required_fields(["name", "gcs_bucket_qualified_name"], [name, gcs_bucket_qualified_name]) + validate_required_fields( + ["name", "gcs_bucket_qualified_name"], [name, gcs_bucket_qualified_name] + ) attributes = GCSObject.Attributes.create( name=name, gcs_bucket_qualified_name=gcs_bucket_qualified_name, @@ -65,11 +67,15 @@ def creator( @init_guid def create(cls, *, name: str, gcs_bucket_qualified_name: str) -> GCSObject: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, gcs_bucket_qualified_name=gcs_bucket_qualified_name) + return cls.creator( + name=name, gcs_bucket_qualified_name=gcs_bucket_qualified_name + ) type_name: str = Field(default="GCSObject", allow_mutation=False) @@ -98,11 +104,15 @@ def __setattr__(self, name, value): """ Unique name of the bucket in which this object exists. """ - GCS_OBJECT_SIZE: ClassVar[NumericField] = NumericField("gcsObjectSize", "gcsObjectSize") + GCS_OBJECT_SIZE: ClassVar[NumericField] = NumericField( + "gcsObjectSize", "gcsObjectSize" + ) """ Object size in bytes. """ - GCS_OBJECT_KEY: ClassVar[KeywordTextField] = KeywordTextField("gcsObjectKey", "gcsObjectKey", "gcsObjectKey.text") + GCS_OBJECT_KEY: ClassVar[KeywordTextField] = KeywordTextField( + "gcsObjectKey", "gcsObjectKey", "gcsObjectKey.text" + ) """ Key of this object, in GCS. """ @@ -112,19 +122,27 @@ def __setattr__(self, name, value): """ Media link to this object. """ - GCS_OBJECT_HOLD_TYPE: ClassVar[KeywordField] = KeywordField("gcsObjectHoldType", "gcsObjectHoldType") + GCS_OBJECT_HOLD_TYPE: ClassVar[KeywordField] = KeywordField( + "gcsObjectHoldType", "gcsObjectHoldType" + ) """ Type of hold on this object. """ - GCS_OBJECT_GENERATION_ID: ClassVar[NumericField] = NumericField("gcsObjectGenerationId", "gcsObjectGenerationId") + GCS_OBJECT_GENERATION_ID: ClassVar[NumericField] = NumericField( + "gcsObjectGenerationId", "gcsObjectGenerationId" + ) """ Generation ID of this object. """ - GCS_OBJECT_CRC32C_HASH: ClassVar[KeywordField] = KeywordField("gcsObjectCRC32CHash", "gcsObjectCRC32CHash") + GCS_OBJECT_CRC32C_HASH: ClassVar[KeywordField] = KeywordField( + "gcsObjectCRC32CHash", "gcsObjectCRC32CHash" + ) """ CRC32C hash of this object. """ - GCS_OBJECT_MD5HASH: ClassVar[KeywordField] = KeywordField("gcsObjectMD5Hash", "gcsObjectMD5Hash") + GCS_OBJECT_MD5HASH: ClassVar[KeywordField] = KeywordField( + "gcsObjectMD5Hash", "gcsObjectMD5Hash" + ) """ MD5 hash of this object. """ @@ -134,7 +152,9 @@ def __setattr__(self, name, value): """ Time (epoch) at which this object's data was last modified, in milliseconds. """ - GCS_OBJECT_CONTENT_TYPE: ClassVar[KeywordField] = KeywordField("gcsObjectContentType", "gcsObjectContentType") + GCS_OBJECT_CONTENT_TYPE: ClassVar[KeywordField] = KeywordField( + "gcsObjectContentType", "gcsObjectContentType" + ) """ Type of content in this object. """ @@ -199,7 +219,11 @@ def gcs_bucket_name(self, gcs_bucket_name: Optional[str]): @property def gcs_bucket_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.gcs_bucket_qualified_name + return ( + None + if self.attributes is None + else self.attributes.gcs_bucket_qualified_name + ) @gcs_bucket_qualified_name.setter def gcs_bucket_qualified_name(self, gcs_bucket_qualified_name: Optional[str]): @@ -229,7 +253,9 @@ def gcs_object_key(self, gcs_object_key: Optional[str]): @property def gcs_object_media_link(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.gcs_object_media_link + return ( + None if self.attributes is None else self.attributes.gcs_object_media_link + ) @gcs_object_media_link.setter def gcs_object_media_link(self, gcs_object_media_link: Optional[str]): @@ -249,7 +275,11 @@ def gcs_object_hold_type(self, gcs_object_hold_type: Optional[str]): @property def gcs_object_generation_id(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.gcs_object_generation_id + return ( + None + if self.attributes is None + else self.attributes.gcs_object_generation_id + ) @gcs_object_generation_id.setter def gcs_object_generation_id(self, gcs_object_generation_id: Optional[int]): @@ -259,7 +289,11 @@ def gcs_object_generation_id(self, gcs_object_generation_id: Optional[int]): @property def gcs_object_c_r_c32_c_hash(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.gcs_object_c_r_c32_c_hash + return ( + None + if self.attributes is None + else self.attributes.gcs_object_c_r_c32_c_hash + ) @gcs_object_c_r_c32_c_hash.setter def gcs_object_c_r_c32_c_hash(self, gcs_object_c_r_c32_c_hash: Optional[str]): @@ -279,17 +313,27 @@ def gcs_object_m_d5_hash(self, gcs_object_m_d5_hash: Optional[str]): @property def gcs_object_data_last_modified_time(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.gcs_object_data_last_modified_time + return ( + None + if self.attributes is None + else self.attributes.gcs_object_data_last_modified_time + ) @gcs_object_data_last_modified_time.setter - def gcs_object_data_last_modified_time(self, gcs_object_data_last_modified_time: Optional[datetime]): + def gcs_object_data_last_modified_time( + self, gcs_object_data_last_modified_time: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.gcs_object_data_last_modified_time = gcs_object_data_last_modified_time + self.attributes.gcs_object_data_last_modified_time = ( + gcs_object_data_last_modified_time + ) @property def gcs_object_content_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.gcs_object_content_type + return ( + None if self.attributes is None else self.attributes.gcs_object_content_type + ) @gcs_object_content_type.setter def gcs_object_content_type(self, gcs_object_content_type: Optional[str]): @@ -299,7 +343,11 @@ def gcs_object_content_type(self, gcs_object_content_type: Optional[str]): @property def gcs_object_content_encoding(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.gcs_object_content_encoding + return ( + None + if self.attributes is None + else self.attributes.gcs_object_content_encoding + ) @gcs_object_content_encoding.setter def gcs_object_content_encoding(self, gcs_object_content_encoding: Optional[str]): @@ -309,17 +357,27 @@ def gcs_object_content_encoding(self, gcs_object_content_encoding: Optional[str] @property def gcs_object_content_disposition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.gcs_object_content_disposition + return ( + None + if self.attributes is None + else self.attributes.gcs_object_content_disposition + ) @gcs_object_content_disposition.setter - def gcs_object_content_disposition(self, gcs_object_content_disposition: Optional[str]): + def gcs_object_content_disposition( + self, gcs_object_content_disposition: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.gcs_object_content_disposition = gcs_object_content_disposition @property def gcs_object_content_language(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.gcs_object_content_language + return ( + None + if self.attributes is None + else self.attributes.gcs_object_content_language + ) @gcs_object_content_language.setter def gcs_object_content_language(self, gcs_object_content_language: Optional[str]): @@ -329,13 +387,21 @@ def gcs_object_content_language(self, gcs_object_content_language: Optional[str] @property def gcs_object_retention_expiration_date(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.gcs_object_retention_expiration_date + return ( + None + if self.attributes is None + else self.attributes.gcs_object_retention_expiration_date + ) @gcs_object_retention_expiration_date.setter - def gcs_object_retention_expiration_date(self, gcs_object_retention_expiration_date: Optional[datetime]): + def gcs_object_retention_expiration_date( + self, gcs_object_retention_expiration_date: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.gcs_object_retention_expiration_date = gcs_object_retention_expiration_date + self.attributes.gcs_object_retention_expiration_date = ( + gcs_object_retention_expiration_date + ) @property def gcs_bucket(self) -> Optional[GCSBucket]: @@ -357,13 +423,21 @@ class Attributes(GCS.Attributes): gcs_object_generation_id: Optional[int] = Field(default=None, description="") gcs_object_c_r_c32_c_hash: Optional[str] = Field(default=None, description="") gcs_object_m_d5_hash: Optional[str] = Field(default=None, description="") - gcs_object_data_last_modified_time: Optional[datetime] = Field(default=None, description="") + gcs_object_data_last_modified_time: Optional[datetime] = Field( + default=None, description="" + ) gcs_object_content_type: Optional[str] = Field(default=None, description="") gcs_object_content_encoding: Optional[str] = Field(default=None, description="") - gcs_object_content_disposition: Optional[str] = Field(default=None, description="") + gcs_object_content_disposition: Optional[str] = Field( + default=None, description="" + ) gcs_object_content_language: Optional[str] = Field(default=None, description="") - gcs_object_retention_expiration_date: Optional[datetime] = Field(default=None, description="") - gcs_bucket: Optional[GCSBucket] = Field(default=None, description="") # relationship + gcs_object_retention_expiration_date: Optional[datetime] = Field( + default=None, description="" + ) + gcs_bucket: Optional[GCSBucket] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -374,9 +448,13 @@ def create( gcs_bucket_qualified_name: str, connection_qualified_name: Optional[str] = None, ) -> GCSObject.Attributes: - validate_required_fields(["name", "gcs_bucket_qualified_name"], [name, gcs_bucket_qualified_name]) + validate_required_fields( + ["name", "gcs_bucket_qualified_name"], [name, gcs_bucket_qualified_name] + ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( gcs_bucket_qualified_name, "gcs_bucket_qualified_name", 4 diff --git a/pyatlan/model/assets/google.py b/pyatlan/model/assets/google.py index 06b95af72..8cda3bdea 100644 --- a/pyatlan/model/assets/google.py +++ b/pyatlan/model/assets/google.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField("googleService", "googleService") + GOOGLE_SERVICE: ClassVar[KeywordField] = KeywordField( + "googleService", "googleService" + ) """ Service in Google in which the asset exists. """ @@ -50,15 +52,21 @@ def __setattr__(self, name, value): """ ID of the project in which the asset exists. """ - GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField("googleProjectNumber", "googleProjectNumber") + GOOGLE_PROJECT_NUMBER: ClassVar[NumericField] = NumericField( + "googleProjectNumber", "googleProjectNumber" + ) """ Number of the project in which the asset exists. """ - GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField("googleLocation", "googleLocation") + GOOGLE_LOCATION: ClassVar[KeywordField] = KeywordField( + "googleLocation", "googleLocation" + ) """ Location of this asset in Google. """ - GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField("googleLocationType", "googleLocationType") + GOOGLE_LOCATION_TYPE: ClassVar[KeywordField] = KeywordField( + "googleLocationType", "googleLocationType" + ) """ Type of location of this asset in Google. """ @@ -114,7 +122,9 @@ def google_project_id(self, google_project_id: Optional[str]): @property def google_project_number(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.google_project_number + return ( + None if self.attributes is None else self.attributes.google_project_number + ) @google_project_number.setter def google_project_number(self, google_project_number: Optional[int]): diff --git a/pyatlan/model/assets/incident.py b/pyatlan/model/assets/incident.py index 9b599787e..d63906521 100644 --- a/pyatlan/model/assets/incident.py +++ b/pyatlan/model/assets/incident.py @@ -30,7 +30,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - INCIDENT_SEVERITY: ClassVar[KeywordField] = KeywordField("incidentSeverity", "incidentSeverity") + INCIDENT_SEVERITY: ClassVar[KeywordField] = KeywordField( + "incidentSeverity", "incidentSeverity" + ) """ Status of this asset's severity. """ @@ -50,7 +52,9 @@ def incident_severity(self, incident_severity: Optional[IncidentSeverity]): self.attributes.incident_severity = incident_severity class Attributes(Asset.Attributes): - incident_severity: Optional[IncidentSeverity] = Field(default=None, description="") + incident_severity: Optional[IncidentSeverity] = Field( + default=None, description="" + ) attributes: Incident.Attributes = Field( default_factory=lambda: Incident.Attributes(), diff --git a/pyatlan/model/assets/kafka_consumer_group.py b/pyatlan/model/assets/kafka_consumer_group.py index c9196fff5..22c3f3c9b 100644 --- a/pyatlan/model/assets/kafka_consumer_group.py +++ b/pyatlan/model/assets/kafka_consumer_group.py @@ -50,9 +50,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - KAFKA_CONSUMER_GROUP_TOPIC_CONSUMPTION_PROPERTIES: ClassVar[KeywordField] = KeywordField( - "kafkaConsumerGroupTopicConsumptionProperties", - "kafkaConsumerGroupTopicConsumptionProperties", + KAFKA_CONSUMER_GROUP_TOPIC_CONSUMPTION_PROPERTIES: ClassVar[KeywordField] = ( + KeywordField( + "kafkaConsumerGroupTopicConsumptionProperties", + "kafkaConsumerGroupTopicConsumptionProperties", + ) ) """ List of consumption properties for Kafka topics, for this consumer group. @@ -63,7 +65,9 @@ def __setattr__(self, name, value): """ Number of members in this consumer group. """ - KAFKA_TOPIC_NAMES: ClassVar[KeywordField] = KeywordField("kafkaTopicNames", "kafkaTopicNames") + KAFKA_TOPIC_NAMES: ClassVar[KeywordField] = KeywordField( + "kafkaTopicNames", "kafkaTopicNames" + ) """ Simple names of the topics consumed by this consumer group. """ @@ -91,12 +95,18 @@ def __setattr__(self, name, value): def kafka_consumer_group_topic_consumption_properties( self, ) -> Optional[List[KafkaTopicConsumption]]: - return None if self.attributes is None else self.attributes.kafka_consumer_group_topic_consumption_properties + return ( + None + if self.attributes is None + else self.attributes.kafka_consumer_group_topic_consumption_properties + ) @kafka_consumer_group_topic_consumption_properties.setter def kafka_consumer_group_topic_consumption_properties( self, - kafka_consumer_group_topic_consumption_properties: Optional[List[KafkaTopicConsumption]], + kafka_consumer_group_topic_consumption_properties: Optional[ + List[KafkaTopicConsumption] + ], ): if self.attributes is None: self.attributes = self.Attributes() @@ -106,13 +116,21 @@ def kafka_consumer_group_topic_consumption_properties( @property def kafka_consumer_group_member_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.kafka_consumer_group_member_count + return ( + None + if self.attributes is None + else self.attributes.kafka_consumer_group_member_count + ) @kafka_consumer_group_member_count.setter - def kafka_consumer_group_member_count(self, kafka_consumer_group_member_count: Optional[int]): + def kafka_consumer_group_member_count( + self, kafka_consumer_group_member_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.kafka_consumer_group_member_count = kafka_consumer_group_member_count + self.attributes.kafka_consumer_group_member_count = ( + kafka_consumer_group_member_count + ) @property def kafka_topic_names(self) -> Optional[Set[str]]: @@ -126,10 +144,16 @@ def kafka_topic_names(self, kafka_topic_names: Optional[Set[str]]): @property def kafka_topic_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.kafka_topic_qualified_names + return ( + None + if self.attributes is None + else self.attributes.kafka_topic_qualified_names + ) @kafka_topic_qualified_names.setter - def kafka_topic_qualified_names(self, kafka_topic_qualified_names: Optional[Set[str]]): + def kafka_topic_qualified_names( + self, kafka_topic_qualified_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_topic_qualified_names = kafka_topic_qualified_names @@ -145,13 +169,19 @@ def kafka_topics(self, kafka_topics: Optional[List[KafkaTopic]]): self.attributes.kafka_topics = kafka_topics class Attributes(Kafka.Attributes): - kafka_consumer_group_topic_consumption_properties: Optional[List[KafkaTopicConsumption]] = Field( + kafka_consumer_group_topic_consumption_properties: Optional[ + List[KafkaTopicConsumption] + ] = Field(default=None, description="") + kafka_consumer_group_member_count: Optional[int] = Field( default=None, description="" ) - kafka_consumer_group_member_count: Optional[int] = Field(default=None, description="") kafka_topic_names: Optional[Set[str]] = Field(default=None, description="") - kafka_topic_qualified_names: Optional[Set[str]] = Field(default=None, description="") - kafka_topics: Optional[List[KafkaTopic]] = Field(default=None, description="") # relationship + kafka_topic_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) + kafka_topics: Optional[List[KafkaTopic]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid diff --git a/pyatlan/model/assets/kafka_topic.py b/pyatlan/model/assets/kafka_topic.py index a34fdd893..4722cc50f 100644 --- a/pyatlan/model/assets/kafka_topic.py +++ b/pyatlan/model/assets/kafka_topic.py @@ -30,8 +30,12 @@ class KafkaTopic(Kafka): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> KafkaTopic: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) - attributes = KafkaTopic.Attributes.creator(name=name, connection_qualified_name=connection_qualified_name) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) + attributes = KafkaTopic.Attributes.creator( + name=name, connection_qualified_name=connection_qualified_name + ) return cls(attributes=attributes) type_name: str = Field(default="KafkaTopic", allow_mutation=False) @@ -47,7 +51,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - KAFKA_TOPIC_IS_INTERNAL: ClassVar[BooleanField] = BooleanField("kafkaTopicIsInternal", "kafkaTopicIsInternal") + KAFKA_TOPIC_IS_INTERNAL: ClassVar[BooleanField] = BooleanField( + "kafkaTopicIsInternal", "kafkaTopicIsInternal" + ) """ Whether this topic is an internal topic (true) or not (false). """ @@ -63,7 +69,9 @@ def __setattr__(self, name, value): """ Replication factor for this topic. """ - KAFKA_TOPIC_SEGMENT_BYTES: ClassVar[NumericField] = NumericField("kafkaTopicSegmentBytes", "kafkaTopicSegmentBytes") + KAFKA_TOPIC_SEGMENT_BYTES: ClassVar[NumericField] = NumericField( + "kafkaTopicSegmentBytes", "kafkaTopicSegmentBytes" + ) """ Segment size for this topic. """ @@ -79,11 +87,15 @@ def __setattr__(self, name, value): """ Number of partitions for this topic. """ - KAFKA_TOPIC_SIZE_IN_BYTES: ClassVar[NumericField] = NumericField("kafkaTopicSizeInBytes", "kafkaTopicSizeInBytes") + KAFKA_TOPIC_SIZE_IN_BYTES: ClassVar[NumericField] = NumericField( + "kafkaTopicSizeInBytes", "kafkaTopicSizeInBytes" + ) """ Size of this topic, in bytes. """ - KAFKA_TOPIC_RECORD_COUNT: ClassVar[NumericField] = NumericField("kafkaTopicRecordCount", "kafkaTopicRecordCount") + KAFKA_TOPIC_RECORD_COUNT: ClassVar[NumericField] = NumericField( + "kafkaTopicRecordCount", "kafkaTopicRecordCount" + ) """ Number of (unexpired) messages in this topic. """ @@ -100,7 +112,9 @@ def __setattr__(self, name, value): Comma seperated Cleanup policy for this topic. """ - KAFKA_CONSUMER_GROUPS: ClassVar[RelationField] = RelationField("kafkaConsumerGroups") + KAFKA_CONSUMER_GROUPS: ClassVar[RelationField] = RelationField( + "kafkaConsumerGroups" + ) """ TBC """ @@ -121,7 +135,9 @@ def __setattr__(self, name, value): @property def kafka_topic_is_internal(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.kafka_topic_is_internal + return ( + None if self.attributes is None else self.attributes.kafka_topic_is_internal + ) @kafka_topic_is_internal.setter def kafka_topic_is_internal(self, kafka_topic_is_internal: Optional[bool]): @@ -131,27 +147,43 @@ def kafka_topic_is_internal(self, kafka_topic_is_internal: Optional[bool]): @property def kafka_topic_compression_type(self) -> Optional[KafkaTopicCompressionType]: - return None if self.attributes is None else self.attributes.kafka_topic_compression_type + return ( + None + if self.attributes is None + else self.attributes.kafka_topic_compression_type + ) @kafka_topic_compression_type.setter - def kafka_topic_compression_type(self, kafka_topic_compression_type: Optional[KafkaTopicCompressionType]): + def kafka_topic_compression_type( + self, kafka_topic_compression_type: Optional[KafkaTopicCompressionType] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_topic_compression_type = kafka_topic_compression_type @property def kafka_topic_replication_factor(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.kafka_topic_replication_factor + return ( + None + if self.attributes is None + else self.attributes.kafka_topic_replication_factor + ) @kafka_topic_replication_factor.setter - def kafka_topic_replication_factor(self, kafka_topic_replication_factor: Optional[int]): + def kafka_topic_replication_factor( + self, kafka_topic_replication_factor: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_topic_replication_factor = kafka_topic_replication_factor @property def kafka_topic_segment_bytes(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.kafka_topic_segment_bytes + return ( + None + if self.attributes is None + else self.attributes.kafka_topic_segment_bytes + ) @kafka_topic_segment_bytes.setter def kafka_topic_segment_bytes(self, kafka_topic_segment_bytes: Optional[int]): @@ -161,17 +193,29 @@ def kafka_topic_segment_bytes(self, kafka_topic_segment_bytes: Optional[int]): @property def kafka_topic_retention_time_in_ms(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.kafka_topic_retention_time_in_ms + return ( + None + if self.attributes is None + else self.attributes.kafka_topic_retention_time_in_ms + ) @kafka_topic_retention_time_in_ms.setter - def kafka_topic_retention_time_in_ms(self, kafka_topic_retention_time_in_ms: Optional[int]): + def kafka_topic_retention_time_in_ms( + self, kafka_topic_retention_time_in_ms: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.kafka_topic_retention_time_in_ms = kafka_topic_retention_time_in_ms + self.attributes.kafka_topic_retention_time_in_ms = ( + kafka_topic_retention_time_in_ms + ) @property def kafka_topic_partitions_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.kafka_topic_partitions_count + return ( + None + if self.attributes is None + else self.attributes.kafka_topic_partitions_count + ) @kafka_topic_partitions_count.setter def kafka_topic_partitions_count(self, kafka_topic_partitions_count: Optional[int]): @@ -181,7 +225,11 @@ def kafka_topic_partitions_count(self, kafka_topic_partitions_count: Optional[in @property def kafka_topic_size_in_bytes(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.kafka_topic_size_in_bytes + return ( + None + if self.attributes is None + else self.attributes.kafka_topic_size_in_bytes + ) @kafka_topic_size_in_bytes.setter def kafka_topic_size_in_bytes(self, kafka_topic_size_in_bytes: Optional[int]): @@ -191,7 +239,11 @@ def kafka_topic_size_in_bytes(self, kafka_topic_size_in_bytes: Optional[int]): @property def kafka_topic_record_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.kafka_topic_record_count + return ( + None + if self.attributes is None + else self.attributes.kafka_topic_record_count + ) @kafka_topic_record_count.setter def kafka_topic_record_count(self, kafka_topic_record_count: Optional[int]): @@ -201,56 +253,92 @@ def kafka_topic_record_count(self, kafka_topic_record_count: Optional[int]): @property def kafka_topic_cleanup_policy(self) -> Optional[KafkaTopicCleanupPolicy]: - return None if self.attributes is None else self.attributes.kafka_topic_cleanup_policy + return ( + None + if self.attributes is None + else self.attributes.kafka_topic_cleanup_policy + ) @kafka_topic_cleanup_policy.setter - def kafka_topic_cleanup_policy(self, kafka_topic_cleanup_policy: Optional[KafkaTopicCleanupPolicy]): + def kafka_topic_cleanup_policy( + self, kafka_topic_cleanup_policy: Optional[KafkaTopicCleanupPolicy] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_topic_cleanup_policy = kafka_topic_cleanup_policy @property def kafka_topic_log_cleanup_policy(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.kafka_topic_log_cleanup_policy + return ( + None + if self.attributes is None + else self.attributes.kafka_topic_log_cleanup_policy + ) @kafka_topic_log_cleanup_policy.setter - def kafka_topic_log_cleanup_policy(self, kafka_topic_log_cleanup_policy: Optional[str]): + def kafka_topic_log_cleanup_policy( + self, kafka_topic_log_cleanup_policy: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_topic_log_cleanup_policy = kafka_topic_log_cleanup_policy @property def kafka_consumer_groups(self) -> Optional[List[KafkaConsumerGroup]]: - return None if self.attributes is None else self.attributes.kafka_consumer_groups + return ( + None if self.attributes is None else self.attributes.kafka_consumer_groups + ) @kafka_consumer_groups.setter - def kafka_consumer_groups(self, kafka_consumer_groups: Optional[List[KafkaConsumerGroup]]): + def kafka_consumer_groups( + self, kafka_consumer_groups: Optional[List[KafkaConsumerGroup]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.kafka_consumer_groups = kafka_consumer_groups class Attributes(Kafka.Attributes): kafka_topic_is_internal: Optional[bool] = Field(default=None, description="") - kafka_topic_compression_type: Optional[KafkaTopicCompressionType] = Field(default=None, description="") - kafka_topic_replication_factor: Optional[int] = Field(default=None, description="") + kafka_topic_compression_type: Optional[KafkaTopicCompressionType] = Field( + default=None, description="" + ) + kafka_topic_replication_factor: Optional[int] = Field( + default=None, description="" + ) kafka_topic_segment_bytes: Optional[int] = Field(default=None, description="") - kafka_topic_retention_time_in_ms: Optional[int] = Field(default=None, description="") - kafka_topic_partitions_count: Optional[int] = Field(default=None, description="") + kafka_topic_retention_time_in_ms: Optional[int] = Field( + default=None, description="" + ) + kafka_topic_partitions_count: Optional[int] = Field( + default=None, description="" + ) kafka_topic_size_in_bytes: Optional[int] = Field(default=None, description="") kafka_topic_record_count: Optional[int] = Field(default=None, description="") - kafka_topic_cleanup_policy: Optional[KafkaTopicCleanupPolicy] = Field(default=None, description="") - kafka_topic_log_cleanup_policy: Optional[str] = Field(default=None, description="") - kafka_consumer_groups: Optional[List[KafkaConsumerGroup]] = Field(default=None, description="") # relationship + kafka_topic_cleanup_policy: Optional[KafkaTopicCleanupPolicy] = Field( + default=None, description="" + ) + kafka_topic_log_cleanup_policy: Optional[str] = Field( + default=None, description="" + ) + kafka_consumer_groups: Optional[List[KafkaConsumerGroup]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def creator(cls, *, name: str, connection_qualified_name: str) -> KafkaTopic.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + def creator( + cls, *, name: str, connection_qualified_name: str + ) -> KafkaTopic.Attributes: + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return KafkaTopic.Attributes( name=name, qualified_name=f"{connection_qualified_name}/topic/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: KafkaTopic.Attributes = Field( diff --git a/pyatlan/model/assets/looker_dashboard.py b/pyatlan/model/assets/looker_dashboard.py index 651f2c8f7..16b94b157 100644 --- a/pyatlan/model/assets/looker_dashboard.py +++ b/pyatlan/model/assets/looker_dashboard.py @@ -34,27 +34,39 @@ def __setattr__(self, name, value): """ Name of the parent folder in Looker that contains this dashboard. """ - SOURCE_USER_ID: ClassVar[NumericField] = NumericField("sourceUserId", "sourceUserId") + SOURCE_USER_ID: ClassVar[NumericField] = NumericField( + "sourceUserId", "sourceUserId" + ) """ Identifier of the user who created this dashboard, from Looker. """ - SOURCE_VIEW_COUNT: ClassVar[NumericField] = NumericField("sourceViewCount", "sourceViewCount") + SOURCE_VIEW_COUNT: ClassVar[NumericField] = NumericField( + "sourceViewCount", "sourceViewCount" + ) """ Number of times the dashboard has been viewed through the Looker web UI. """ - SOURCE_METADATA_ID: ClassVar[NumericField] = NumericField("sourceMetadataId", "sourceMetadataId") + SOURCE_METADATA_ID: ClassVar[NumericField] = NumericField( + "sourceMetadataId", "sourceMetadataId" + ) """ Identifier of the dashboard's content metadata, from Looker. """ - SOURCELAST_UPDATER_ID: ClassVar[NumericField] = NumericField("sourcelastUpdaterId", "sourcelastUpdaterId") + SOURCELAST_UPDATER_ID: ClassVar[NumericField] = NumericField( + "sourcelastUpdaterId", "sourcelastUpdaterId" + ) """ Identifier of the user who last updated the dashboard, from Looker. """ - SOURCE_LAST_ACCESSED_AT: ClassVar[NumericField] = NumericField("sourceLastAccessedAt", "sourceLastAccessedAt") + SOURCE_LAST_ACCESSED_AT: ClassVar[NumericField] = NumericField( + "sourceLastAccessedAt", "sourceLastAccessedAt" + ) """ Timestamp (epoch) when the dashboard was last accessed by a user, in milliseconds. """ - SOURCE_LAST_VIEWED_AT: ClassVar[NumericField] = NumericField("sourceLastViewedAt", "sourceLastViewedAt") + SOURCE_LAST_VIEWED_AT: ClassVar[NumericField] = NumericField( + "sourceLastViewedAt", "sourceLastViewedAt" + ) """ Timestamp (epoch) when the dashboard was last viewed by a user. """ @@ -132,7 +144,9 @@ def source_metadata_id(self, source_metadata_id: Optional[int]): @property def sourcelast_updater_id(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.sourcelast_updater_id + return ( + None if self.attributes is None else self.attributes.sourcelast_updater_id + ) @sourcelast_updater_id.setter def sourcelast_updater_id(self, sourcelast_updater_id: Optional[int]): @@ -142,7 +156,9 @@ def sourcelast_updater_id(self, sourcelast_updater_id: Optional[int]): @property def source_last_accessed_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.source_last_accessed_at + return ( + None if self.attributes is None else self.attributes.source_last_accessed_at + ) @source_last_accessed_at.setter def source_last_accessed_at(self, source_last_accessed_at: Optional[datetime]): @@ -152,7 +168,9 @@ def source_last_accessed_at(self, source_last_accessed_at: Optional[datetime]): @property def source_last_viewed_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.source_last_viewed_at + return ( + None if self.attributes is None else self.attributes.source_last_viewed_at + ) @source_last_viewed_at.setter def source_last_viewed_at(self, source_last_viewed_at: Optional[datetime]): @@ -206,12 +224,22 @@ class Attributes(Looker.Attributes): source_view_count: Optional[int] = Field(default=None, description="") source_metadata_id: Optional[int] = Field(default=None, description="") sourcelast_updater_id: Optional[int] = Field(default=None, description="") - source_last_accessed_at: Optional[datetime] = Field(default=None, description="") + source_last_accessed_at: Optional[datetime] = Field( + default=None, description="" + ) source_last_viewed_at: Optional[datetime] = Field(default=None, description="") - tiles: Optional[List[LookerTile]] = Field(default=None, description="") # relationship - looks: Optional[List[LookerLook]] = Field(default=None, description="") # relationship - folder: Optional[LookerFolder] = Field(default=None, description="") # relationship - fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship + tiles: Optional[List[LookerTile]] = Field( + default=None, description="" + ) # relationship + looks: Optional[List[LookerLook]] = Field( + default=None, description="" + ) # relationship + folder: Optional[LookerFolder] = Field( + default=None, description="" + ) # relationship + fields: Optional[List[LookerField]] = Field( + default=None, description="" + ) # relationship attributes: LookerDashboard.Attributes = Field( default_factory=lambda: LookerDashboard.Attributes(), diff --git a/pyatlan/model/assets/looker_explore.py b/pyatlan/model/assets/looker_explore.py index 63ff4d219..9f7ef5344 100644 --- a/pyatlan/model/assets/looker_explore.py +++ b/pyatlan/model/assets/looker_explore.py @@ -37,11 +37,15 @@ def __setattr__(self, name, value): """ Name of the parent model of this Explore. """ - SOURCE_CONNECTION_NAME: ClassVar[TextField] = TextField("sourceConnectionName", "sourceConnectionName") + SOURCE_CONNECTION_NAME: ClassVar[TextField] = TextField( + "sourceConnectionName", "sourceConnectionName" + ) """ Connection name for the Explore, from Looker. """ - VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField("viewName", "viewName.keyword", "viewName") + VIEW_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "viewName", "viewName.keyword", "viewName" + ) """ Name of the view for the Explore. """ @@ -96,7 +100,9 @@ def model_name(self, model_name: Optional[str]): @property def source_connection_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.source_connection_name + return ( + None if self.attributes is None else self.attributes.source_connection_name + ) @source_connection_name.setter def source_connection_name(self, source_connection_name: Optional[str]): @@ -160,9 +166,15 @@ class Attributes(Looker.Attributes): source_connection_name: Optional[str] = Field(default=None, description="") view_name: Optional[str] = Field(default=None, description="") sql_table_name: Optional[str] = Field(default=None, description="") - project: Optional[LookerProject] = Field(default=None, description="") # relationship - model: Optional[LookerModel] = Field(default=None, description="") # relationship - fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship + project: Optional[LookerProject] = Field( + default=None, description="" + ) # relationship + model: Optional[LookerModel] = Field( + default=None, description="" + ) # relationship + fields: Optional[List[LookerField]] = Field( + default=None, description="" + ) # relationship attributes: LookerExplore.Attributes = Field( default_factory=lambda: LookerExplore.Attributes(), diff --git a/pyatlan/model/assets/looker_field.py b/pyatlan/model/assets/looker_field.py index ca6c7ed70..f1a8c447a 100644 --- a/pyatlan/model/assets/looker_field.py +++ b/pyatlan/model/assets/looker_field.py @@ -84,19 +84,27 @@ def __setattr__(self, name, value): """ Name of the model in which this field exists. """ - SOURCE_DEFINITION: ClassVar[TextField] = TextField("sourceDefinition", "sourceDefinition") + SOURCE_DEFINITION: ClassVar[TextField] = TextField( + "sourceDefinition", "sourceDefinition" + ) """ Deprecated. """ - LOOKER_FIELD_DATA_TYPE: ClassVar[KeywordField] = KeywordField("lookerFieldDataType", "lookerFieldDataType") + LOOKER_FIELD_DATA_TYPE: ClassVar[KeywordField] = KeywordField( + "lookerFieldDataType", "lookerFieldDataType" + ) """ Deprecated. """ - LOOKER_TIMES_USED: ClassVar[NumericField] = NumericField("lookerTimesUsed", "lookerTimesUsed") + LOOKER_TIMES_USED: ClassVar[NumericField] = NumericField( + "lookerTimesUsed", "lookerTimesUsed" + ) """ Deprecated. """ - LOOKER_FIELD_IS_REFINED: ClassVar[BooleanField] = BooleanField("lookerFieldIsRefined", "lookerFieldIsRefined") + LOOKER_FIELD_IS_REFINED: ClassVar[BooleanField] = BooleanField( + "lookerFieldIsRefined", "lookerFieldIsRefined" + ) """ Whether the looker field asset is coming from a refinement """ @@ -177,17 +185,27 @@ def project_name(self, project_name: Optional[str]): @property def looker_explore_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.looker_explore_qualified_name + return ( + None + if self.attributes is None + else self.attributes.looker_explore_qualified_name + ) @looker_explore_qualified_name.setter - def looker_explore_qualified_name(self, looker_explore_qualified_name: Optional[str]): + def looker_explore_qualified_name( + self, looker_explore_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.looker_explore_qualified_name = looker_explore_qualified_name @property def looker_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.looker_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.looker_view_qualified_name + ) @looker_view_qualified_name.setter def looker_view_qualified_name(self, looker_view_qualified_name: Optional[str]): @@ -197,7 +215,11 @@ def looker_view_qualified_name(self, looker_view_qualified_name: Optional[str]): @property def looker_tile_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.looker_tile_qualified_name + return ( + None + if self.attributes is None + else self.attributes.looker_tile_qualified_name + ) @looker_tile_qualified_name.setter def looker_tile_qualified_name(self, looker_tile_qualified_name: Optional[str]): @@ -207,7 +229,11 @@ def looker_tile_qualified_name(self, looker_tile_qualified_name: Optional[str]): @property def looker_look_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.looker_look_qualified_name + return ( + None + if self.attributes is None + else self.attributes.looker_look_qualified_name + ) @looker_look_qualified_name.setter def looker_look_qualified_name(self, looker_look_qualified_name: Optional[str]): @@ -217,13 +243,21 @@ def looker_look_qualified_name(self, looker_look_qualified_name: Optional[str]): @property def looker_dashboard_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.looker_dashboard_qualified_name + return ( + None + if self.attributes is None + else self.attributes.looker_dashboard_qualified_name + ) @looker_dashboard_qualified_name.setter - def looker_dashboard_qualified_name(self, looker_dashboard_qualified_name: Optional[str]): + def looker_dashboard_qualified_name( + self, looker_dashboard_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.looker_dashboard_qualified_name = looker_dashboard_qualified_name + self.attributes.looker_dashboard_qualified_name = ( + looker_dashboard_qualified_name + ) @property def model_name(self) -> Optional[str]: @@ -247,7 +281,9 @@ def source_definition(self, source_definition: Optional[str]): @property def looker_field_data_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.looker_field_data_type + return ( + None if self.attributes is None else self.attributes.looker_field_data_type + ) @looker_field_data_type.setter def looker_field_data_type(self, looker_field_data_type: Optional[str]): @@ -267,7 +303,9 @@ def looker_times_used(self, looker_times_used: Optional[int]): @property def looker_field_is_refined(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.looker_field_is_refined + return ( + None if self.attributes is None else self.attributes.looker_field_is_refined + ) @looker_field_is_refined.setter def looker_field_is_refined(self, looker_field_is_refined: Optional[bool]): @@ -277,23 +315,39 @@ def looker_field_is_refined(self, looker_field_is_refined: Optional[bool]): @property def looker_field_refinement_file_path(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.looker_field_refinement_file_path + return ( + None + if self.attributes is None + else self.attributes.looker_field_refinement_file_path + ) @looker_field_refinement_file_path.setter - def looker_field_refinement_file_path(self, looker_field_refinement_file_path: Optional[str]): + def looker_field_refinement_file_path( + self, looker_field_refinement_file_path: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.looker_field_refinement_file_path = looker_field_refinement_file_path + self.attributes.looker_field_refinement_file_path = ( + looker_field_refinement_file_path + ) @property def looker_field_refinement_line_number(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.looker_field_refinement_line_number + return ( + None + if self.attributes is None + else self.attributes.looker_field_refinement_line_number + ) @looker_field_refinement_line_number.setter - def looker_field_refinement_line_number(self, looker_field_refinement_line_number: Optional[str]): + def looker_field_refinement_line_number( + self, looker_field_refinement_line_number: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.looker_field_refinement_line_number = looker_field_refinement_line_number + self.attributes.looker_field_refinement_line_number = ( + looker_field_refinement_line_number + ) @property def project(self) -> Optional[LookerProject]: @@ -367,24 +421,40 @@ def look(self, look: Optional[LookerLook]): class Attributes(Looker.Attributes): project_name: Optional[str] = Field(default=None, description="") - looker_explore_qualified_name: Optional[str] = Field(default=None, description="") + looker_explore_qualified_name: Optional[str] = Field( + default=None, description="" + ) looker_view_qualified_name: Optional[str] = Field(default=None, description="") looker_tile_qualified_name: Optional[str] = Field(default=None, description="") looker_look_qualified_name: Optional[str] = Field(default=None, description="") - looker_dashboard_qualified_name: Optional[str] = Field(default=None, description="") + looker_dashboard_qualified_name: Optional[str] = Field( + default=None, description="" + ) model_name: Optional[str] = Field(default=None, description="") source_definition: Optional[str] = Field(default=None, description="") looker_field_data_type: Optional[str] = Field(default=None, description="") looker_times_used: Optional[int] = Field(default=None, description="") looker_field_is_refined: Optional[bool] = Field(default=None, description="") - looker_field_refinement_file_path: Optional[str] = Field(default=None, description="") - looker_field_refinement_line_number: Optional[str] = Field(default=None, description="") - project: Optional[LookerProject] = Field(default=None, description="") # relationship + looker_field_refinement_file_path: Optional[str] = Field( + default=None, description="" + ) + looker_field_refinement_line_number: Optional[str] = Field( + default=None, description="" + ) + project: Optional[LookerProject] = Field( + default=None, description="" + ) # relationship view: Optional[LookerView] = Field(default=None, description="") # relationship tile: Optional[LookerTile] = Field(default=None, description="") # relationship - model: Optional[LookerModel] = Field(default=None, description="") # relationship - dashboard: Optional[LookerDashboard] = Field(default=None, description="") # relationship - explore: Optional[LookerExplore] = Field(default=None, description="") # relationship + model: Optional[LookerModel] = Field( + default=None, description="" + ) # relationship + dashboard: Optional[LookerDashboard] = Field( + default=None, description="" + ) # relationship + explore: Optional[LookerExplore] = Field( + default=None, description="" + ) # relationship look: Optional[LookerLook] = Field(default=None, description="") # relationship attributes: LookerField.Attributes = Field( diff --git a/pyatlan/model/assets/looker_folder.py b/pyatlan/model/assets/looker_folder.py index f18d38cf8..e3eb20153 100644 --- a/pyatlan/model/assets/looker_folder.py +++ b/pyatlan/model/assets/looker_folder.py @@ -35,15 +35,21 @@ def __setattr__(self, name, value): """ Identifier for the folder's content metadata in Looker. """ - SOURCE_CREATOR_ID: ClassVar[NumericField] = NumericField("sourceCreatorId", "sourceCreatorId") + SOURCE_CREATOR_ID: ClassVar[NumericField] = NumericField( + "sourceCreatorId", "sourceCreatorId" + ) """ Identifier of the user who created the folder, from Looker. """ - SOURCE_CHILD_COUNT: ClassVar[NumericField] = NumericField("sourceChildCount", "sourceChildCount") + SOURCE_CHILD_COUNT: ClassVar[NumericField] = NumericField( + "sourceChildCount", "sourceChildCount" + ) """ Number of subfolders in this folder. """ - SOURCE_PARENT_ID: ClassVar[NumericField] = NumericField("sourceParentID", "sourceParentID") + SOURCE_PARENT_ID: ClassVar[NumericField] = NumericField( + "sourceParentID", "sourceParentID" + ) """ Identifier of the parent folder of this folder, from Looker. """ @@ -78,7 +84,11 @@ def __setattr__(self, name, value): @property def source_content_metadata_id(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.source_content_metadata_id + return ( + None + if self.attributes is None + else self.attributes.source_content_metadata_id + ) @source_content_metadata_id.setter def source_content_metadata_id(self, source_content_metadata_id: Optional[int]): @@ -161,10 +171,18 @@ class Attributes(Looker.Attributes): source_creator_id: Optional[int] = Field(default=None, description="") source_child_count: Optional[int] = Field(default=None, description="") source_parent_i_d: Optional[int] = Field(default=None, description="") - looker_sub_folders: Optional[List[LookerFolder]] = Field(default=None, description="") # relationship - dashboards: Optional[List[LookerDashboard]] = Field(default=None, description="") # relationship - looks: Optional[List[LookerLook]] = Field(default=None, description="") # relationship - looker_parent_folder: Optional[LookerFolder] = Field(default=None, description="") # relationship + looker_sub_folders: Optional[List[LookerFolder]] = Field( + default=None, description="" + ) # relationship + dashboards: Optional[List[LookerDashboard]] = Field( + default=None, description="" + ) # relationship + looks: Optional[List[LookerLook]] = Field( + default=None, description="" + ) # relationship + looker_parent_folder: Optional[LookerFolder] = Field( + default=None, description="" + ) # relationship attributes: LookerFolder.Attributes = Field( default_factory=lambda: LookerFolder.Attributes(), diff --git a/pyatlan/model/assets/looker_look.py b/pyatlan/model/assets/looker_look.py index 634ea9993..65052e789 100644 --- a/pyatlan/model/assets/looker_look.py +++ b/pyatlan/model/assets/looker_look.py @@ -34,23 +34,33 @@ def __setattr__(self, name, value): """ Name of the folder in which the Look is organized. """ - SOURCE_USER_ID: ClassVar[NumericField] = NumericField("sourceUserId", "sourceUserId") + SOURCE_USER_ID: ClassVar[NumericField] = NumericField( + "sourceUserId", "sourceUserId" + ) """ Identifier of the user who created the Look, from Looker. """ - SOURCE_VIEW_COUNT: ClassVar[NumericField] = NumericField("sourceViewCount", "sourceViewCount") + SOURCE_VIEW_COUNT: ClassVar[NumericField] = NumericField( + "sourceViewCount", "sourceViewCount" + ) """ Number of times the look has been viewed in the Looker web UI. """ - SOURCELAST_UPDATER_ID: ClassVar[NumericField] = NumericField("sourcelastUpdaterId", "sourcelastUpdaterId") + SOURCELAST_UPDATER_ID: ClassVar[NumericField] = NumericField( + "sourcelastUpdaterId", "sourcelastUpdaterId" + ) """ Identifier of the user that last updated the Look, from Looker. """ - SOURCE_LAST_ACCESSED_AT: ClassVar[NumericField] = NumericField("sourceLastAccessedAt", "sourceLastAccessedAt") + SOURCE_LAST_ACCESSED_AT: ClassVar[NumericField] = NumericField( + "sourceLastAccessedAt", "sourceLastAccessedAt" + ) """ Time (epoch) when the Look was last accessed by a user, in milliseconds. """ - SOURCE_LAST_VIEWED_AT: ClassVar[NumericField] = NumericField("sourceLastViewedAt", "sourceLastViewedAt") + SOURCE_LAST_VIEWED_AT: ClassVar[NumericField] = NumericField( + "sourceLastViewedAt", "sourceLastViewedAt" + ) """ Time (epoch) when the Look was last viewed by a user, in milliseconds. """ @@ -60,7 +70,9 @@ def __setattr__(self, name, value): """ Identifier of the Look's content metadata, from Looker. """ - SOURCE_QUERY_ID: ClassVar[NumericField] = NumericField("sourceQueryId", "sourceQueryId") + SOURCE_QUERY_ID: ClassVar[NumericField] = NumericField( + "sourceQueryId", "sourceQueryId" + ) """ Identifier of the query for the Look, from Looker. """ @@ -144,7 +156,9 @@ def source_view_count(self, source_view_count: Optional[int]): @property def sourcelast_updater_id(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.sourcelast_updater_id + return ( + None if self.attributes is None else self.attributes.sourcelast_updater_id + ) @sourcelast_updater_id.setter def sourcelast_updater_id(self, sourcelast_updater_id: Optional[int]): @@ -154,7 +168,9 @@ def sourcelast_updater_id(self, sourcelast_updater_id: Optional[int]): @property def source_last_accessed_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.source_last_accessed_at + return ( + None if self.attributes is None else self.attributes.source_last_accessed_at + ) @source_last_accessed_at.setter def source_last_accessed_at(self, source_last_accessed_at: Optional[datetime]): @@ -164,7 +180,9 @@ def source_last_accessed_at(self, source_last_accessed_at: Optional[datetime]): @property def source_last_viewed_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.source_last_viewed_at + return ( + None if self.attributes is None else self.attributes.source_last_viewed_at + ) @source_last_viewed_at.setter def source_last_viewed_at(self, source_last_viewed_at: Optional[datetime]): @@ -174,7 +192,11 @@ def source_last_viewed_at(self, source_last_viewed_at: Optional[datetime]): @property def source_content_metadata_id(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.source_content_metadata_id + return ( + None + if self.attributes is None + else self.attributes.source_content_metadata_id + ) @source_content_metadata_id.setter def source_content_metadata_id(self, source_content_metadata_id: Optional[int]): @@ -267,17 +289,29 @@ class Attributes(Looker.Attributes): source_user_id: Optional[int] = Field(default=None, description="") source_view_count: Optional[int] = Field(default=None, description="") sourcelast_updater_id: Optional[int] = Field(default=None, description="") - source_last_accessed_at: Optional[datetime] = Field(default=None, description="") + source_last_accessed_at: Optional[datetime] = Field( + default=None, description="" + ) source_last_viewed_at: Optional[datetime] = Field(default=None, description="") source_content_metadata_id: Optional[int] = Field(default=None, description="") source_query_id: Optional[int] = Field(default=None, description="") model_name: Optional[str] = Field(default=None, description="") tile: Optional[LookerTile] = Field(default=None, description="") # relationship - model: Optional[LookerModel] = Field(default=None, description="") # relationship - dashboard: Optional[LookerDashboard] = Field(default=None, description="") # relationship - query: Optional[LookerQuery] = Field(default=None, description="") # relationship - folder: Optional[LookerFolder] = Field(default=None, description="") # relationship - fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship + model: Optional[LookerModel] = Field( + default=None, description="" + ) # relationship + dashboard: Optional[LookerDashboard] = Field( + default=None, description="" + ) # relationship + query: Optional[LookerQuery] = Field( + default=None, description="" + ) # relationship + folder: Optional[LookerFolder] = Field( + default=None, description="" + ) # relationship + fields: Optional[List[LookerField]] = Field( + default=None, description="" + ) # relationship attributes: LookerLook.Attributes = Field( default_factory=lambda: LookerLook.Attributes(), diff --git a/pyatlan/model/assets/looker_model.py b/pyatlan/model/assets/looker_model.py index 62d196dcc..0b3b7b4c1 100644 --- a/pyatlan/model/assets/looker_model.py +++ b/pyatlan/model/assets/looker_model.py @@ -126,11 +126,19 @@ def fields(self, fields: Optional[List[LookerField]]): class Attributes(Looker.Attributes): project_name: Optional[str] = Field(default=None, description="") - explores: Optional[List[LookerExplore]] = Field(default=None, description="") # relationship - project: Optional[LookerProject] = Field(default=None, description="") # relationship + explores: Optional[List[LookerExplore]] = Field( + default=None, description="" + ) # relationship + project: Optional[LookerProject] = Field( + default=None, description="" + ) # relationship look: Optional[LookerLook] = Field(default=None, description="") # relationship - queries: Optional[List[LookerQuery]] = Field(default=None, description="") # relationship - fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship + queries: Optional[List[LookerQuery]] = Field( + default=None, description="" + ) # relationship + fields: Optional[List[LookerField]] = Field( + default=None, description="" + ) # relationship attributes: LookerModel.Attributes = Field( default_factory=lambda: LookerModel.Attributes(), diff --git a/pyatlan/model/assets/looker_project.py b/pyatlan/model/assets/looker_project.py index 26af1886f..6c3bc635b 100644 --- a/pyatlan/model/assets/looker_project.py +++ b/pyatlan/model/assets/looker_project.py @@ -41,11 +41,15 @@ def __setattr__(self, name, value): """ TBC """ - LOOKER_PARENT_PROJECTS: ClassVar[RelationField] = RelationField("lookerParentProjects") + LOOKER_PARENT_PROJECTS: ClassVar[RelationField] = RelationField( + "lookerParentProjects" + ) """ TBC """ - LOOKER_CHILD_PROJECTS: ClassVar[RelationField] = RelationField("lookerChildProjects") + LOOKER_CHILD_PROJECTS: ClassVar[RelationField] = RelationField( + "lookerChildProjects" + ) """ TBC """ @@ -95,20 +99,28 @@ def models(self, models: Optional[List[LookerModel]]): @property def looker_parent_projects(self) -> Optional[List[LookerProject]]: - return None if self.attributes is None else self.attributes.looker_parent_projects + return ( + None if self.attributes is None else self.attributes.looker_parent_projects + ) @looker_parent_projects.setter - def looker_parent_projects(self, looker_parent_projects: Optional[List[LookerProject]]): + def looker_parent_projects( + self, looker_parent_projects: Optional[List[LookerProject]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.looker_parent_projects = looker_parent_projects @property def looker_child_projects(self) -> Optional[List[LookerProject]]: - return None if self.attributes is None else self.attributes.looker_child_projects + return ( + None if self.attributes is None else self.attributes.looker_child_projects + ) @looker_child_projects.setter - def looker_child_projects(self, looker_child_projects: Optional[List[LookerProject]]): + def looker_child_projects( + self, looker_child_projects: Optional[List[LookerProject]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.looker_child_projects = looker_child_projects @@ -124,12 +136,24 @@ def fields(self, fields: Optional[List[LookerField]]): self.attributes.fields = fields class Attributes(Looker.Attributes): - explores: Optional[List[LookerExplore]] = Field(default=None, description="") # relationship - views: Optional[List[LookerView]] = Field(default=None, description="") # relationship - models: Optional[List[LookerModel]] = Field(default=None, description="") # relationship - looker_parent_projects: Optional[List[LookerProject]] = Field(default=None, description="") # relationship - looker_child_projects: Optional[List[LookerProject]] = Field(default=None, description="") # relationship - fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship + explores: Optional[List[LookerExplore]] = Field( + default=None, description="" + ) # relationship + views: Optional[List[LookerView]] = Field( + default=None, description="" + ) # relationship + models: Optional[List[LookerModel]] = Field( + default=None, description="" + ) # relationship + looker_parent_projects: Optional[List[LookerProject]] = Field( + default=None, description="" + ) # relationship + looker_child_projects: Optional[List[LookerProject]] = Field( + default=None, description="" + ) # relationship + fields: Optional[List[LookerField]] = Field( + default=None, description="" + ) # relationship attributes: LookerProject.Attributes = Field( default_factory=lambda: LookerProject.Attributes(), diff --git a/pyatlan/model/assets/looker_query.py b/pyatlan/model/assets/looker_query.py index 5f4d61b57..3fda73d76 100644 --- a/pyatlan/model/assets/looker_query.py +++ b/pyatlan/model/assets/looker_query.py @@ -29,15 +29,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SOURCE_DEFINITION: ClassVar[TextField] = TextField("sourceDefinition", "sourceDefinition") + SOURCE_DEFINITION: ClassVar[TextField] = TextField( + "sourceDefinition", "sourceDefinition" + ) """ Deprecated. """ - SOURCE_DEFINITION_DATABASE: ClassVar[TextField] = TextField("sourceDefinitionDatabase", "sourceDefinitionDatabase") + SOURCE_DEFINITION_DATABASE: ClassVar[TextField] = TextField( + "sourceDefinitionDatabase", "sourceDefinitionDatabase" + ) """ Deprecated. """ - SOURCE_DEFINITION_SCHEMA: ClassVar[TextField] = TextField("sourceDefinitionSchema", "sourceDefinitionSchema") + SOURCE_DEFINITION_SCHEMA: ClassVar[TextField] = TextField( + "sourceDefinitionSchema", "sourceDefinitionSchema" + ) """ Deprecated. """ @@ -81,7 +87,11 @@ def source_definition(self, source_definition: Optional[str]): @property def source_definition_database(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.source_definition_database + return ( + None + if self.attributes is None + else self.attributes.source_definition_database + ) @source_definition_database.setter def source_definition_database(self, source_definition_database: Optional[str]): @@ -91,7 +101,11 @@ def source_definition_database(self, source_definition_database: Optional[str]): @property def source_definition_schema(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.source_definition_schema + return ( + None + if self.attributes is None + else self.attributes.source_definition_schema + ) @source_definition_schema.setter def source_definition_schema(self, source_definition_schema: Optional[str]): @@ -144,9 +158,15 @@ class Attributes(Looker.Attributes): source_definition_database: Optional[str] = Field(default=None, description="") source_definition_schema: Optional[str] = Field(default=None, description="") fields: Optional[Set[str]] = Field(default=None, description="") - tiles: Optional[List[LookerTile]] = Field(default=None, description="") # relationship - looks: Optional[List[LookerLook]] = Field(default=None, description="") # relationship - model: Optional[LookerModel] = Field(default=None, description="") # relationship + tiles: Optional[List[LookerTile]] = Field( + default=None, description="" + ) # relationship + looks: Optional[List[LookerLook]] = Field( + default=None, description="" + ) # relationship + model: Optional[LookerModel] = Field( + default=None, description="" + ) # relationship attributes: LookerQuery.Attributes = Field( default_factory=lambda: LookerQuery.Attributes(), diff --git a/pyatlan/model/assets/looker_tile.py b/pyatlan/model/assets/looker_tile.py index 1a3aca168..2283a3f28 100644 --- a/pyatlan/model/assets/looker_tile.py +++ b/pyatlan/model/assets/looker_tile.py @@ -45,7 +45,9 @@ def __setattr__(self, name, value): """ Identifier for the query used to build this tile, from Looker. """ - RESULT_MAKER_ID: ClassVar[NumericField] = NumericField("resultMakerID", "resultMakerID") + RESULT_MAKER_ID: ClassVar[NumericField] = NumericField( + "resultMakerID", "resultMakerID" + ) """ Identifier of the ResultMarkerLookup entry, from Looker. """ @@ -207,10 +209,16 @@ class Attributes(Looker.Attributes): result_maker_i_d: Optional[int] = Field(default=None, description="") subtitle_text: Optional[str] = Field(default=None, description="") look_id: Optional[int] = Field(default=None, description="") - dashboard: Optional[LookerDashboard] = Field(default=None, description="") # relationship - query: Optional[LookerQuery] = Field(default=None, description="") # relationship + dashboard: Optional[LookerDashboard] = Field( + default=None, description="" + ) # relationship + query: Optional[LookerQuery] = Field( + default=None, description="" + ) # relationship look: Optional[LookerLook] = Field(default=None, description="") # relationship - fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship + fields: Optional[List[LookerField]] = Field( + default=None, description="" + ) # relationship attributes: LookerTile.Attributes = Field( default_factory=lambda: LookerTile.Attributes(), diff --git a/pyatlan/model/assets/looker_view.py b/pyatlan/model/assets/looker_view.py index 755783b4b..cb048ae99 100644 --- a/pyatlan/model/assets/looker_view.py +++ b/pyatlan/model/assets/looker_view.py @@ -33,11 +33,15 @@ def __setattr__(self, name, value): """ Name of the project in which this view exists. """ - LOOKER_VIEW_FILE_PATH: ClassVar[TextField] = TextField("lookerViewFilePath", "lookerViewFilePath") + LOOKER_VIEW_FILE_PATH: ClassVar[TextField] = TextField( + "lookerViewFilePath", "lookerViewFilePath" + ) """ File path of this view within the project. """ - LOOKER_VIEW_FILE_NAME: ClassVar[KeywordField] = KeywordField("lookerViewFileName", "lookerViewFileName") + LOOKER_VIEW_FILE_NAME: ClassVar[KeywordField] = KeywordField( + "lookerViewFileName", "lookerViewFileName" + ) """ File name of this view. """ @@ -71,7 +75,9 @@ def project_name(self, project_name: Optional[str]): @property def looker_view_file_path(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.looker_view_file_path + return ( + None if self.attributes is None else self.attributes.looker_view_file_path + ) @looker_view_file_path.setter def looker_view_file_path(self, looker_view_file_path: Optional[str]): @@ -81,7 +87,9 @@ def looker_view_file_path(self, looker_view_file_path: Optional[str]): @property def looker_view_file_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.looker_view_file_name + return ( + None if self.attributes is None else self.attributes.looker_view_file_name + ) @looker_view_file_name.setter def looker_view_file_name(self, looker_view_file_name: Optional[str]): @@ -113,8 +121,12 @@ class Attributes(Looker.Attributes): project_name: Optional[str] = Field(default=None, description="") looker_view_file_path: Optional[str] = Field(default=None, description="") looker_view_file_name: Optional[str] = Field(default=None, description="") - project: Optional[LookerProject] = Field(default=None, description="") # relationship - fields: Optional[List[LookerField]] = Field(default=None, description="") # relationship + project: Optional[LookerProject] = Field( + default=None, description="" + ) # relationship + fields: Optional[List[LookerField]] = Field( + default=None, description="" + ) # relationship attributes: LookerView.Attributes = Field( default_factory=lambda: LookerView.Attributes(), diff --git a/pyatlan/model/assets/metabase.py b/pyatlan/model/assets/metabase.py index 2d3408741..0c203c79f 100644 --- a/pyatlan/model/assets/metabase.py +++ b/pyatlan/model/assets/metabase.py @@ -53,7 +53,11 @@ def __setattr__(self, name, value): @property def metabase_collection_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.metabase_collection_name + return ( + None + if self.attributes is None + else self.attributes.metabase_collection_name + ) @metabase_collection_name.setter def metabase_collection_name(self, metabase_collection_name: Optional[str]): @@ -63,17 +67,27 @@ def metabase_collection_name(self, metabase_collection_name: Optional[str]): @property def metabase_collection_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.metabase_collection_qualified_name + return ( + None + if self.attributes is None + else self.attributes.metabase_collection_qualified_name + ) @metabase_collection_qualified_name.setter - def metabase_collection_qualified_name(self, metabase_collection_qualified_name: Optional[str]): + def metabase_collection_qualified_name( + self, metabase_collection_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.metabase_collection_qualified_name = metabase_collection_qualified_name + self.attributes.metabase_collection_qualified_name = ( + metabase_collection_qualified_name + ) class Attributes(BI.Attributes): metabase_collection_name: Optional[str] = Field(default=None, description="") - metabase_collection_qualified_name: Optional[str] = Field(default=None, description="") + metabase_collection_qualified_name: Optional[str] = Field( + default=None, description="" + ) attributes: Metabase.Attributes = Field( default_factory=lambda: Metabase.Attributes(), diff --git a/pyatlan/model/assets/metabase_collection.py b/pyatlan/model/assets/metabase_collection.py index f0104c532..c8aa12d0f 100644 --- a/pyatlan/model/assets/metabase_collection.py +++ b/pyatlan/model/assets/metabase_collection.py @@ -34,11 +34,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - METABASE_SLUG: ClassVar[KeywordTextField] = KeywordTextField("metabaseSlug", "metabaseSlug", "metabaseSlug.text") + METABASE_SLUG: ClassVar[KeywordTextField] = KeywordTextField( + "metabaseSlug", "metabaseSlug", "metabaseSlug.text" + ) """ """ - METABASE_COLOR: ClassVar[KeywordField] = KeywordField("metabaseColor", "metabaseColor") + METABASE_COLOR: ClassVar[KeywordField] = KeywordField( + "metabaseColor", "metabaseColor" + ) """ """ @@ -105,20 +109,30 @@ def metabase_namespace(self, metabase_namespace: Optional[str]): @property def metabase_is_personal_collection(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.metabase_is_personal_collection + return ( + None + if self.attributes is None + else self.attributes.metabase_is_personal_collection + ) @metabase_is_personal_collection.setter - def metabase_is_personal_collection(self, metabase_is_personal_collection: Optional[bool]): + def metabase_is_personal_collection( + self, metabase_is_personal_collection: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.metabase_is_personal_collection = metabase_is_personal_collection + self.attributes.metabase_is_personal_collection = ( + metabase_is_personal_collection + ) @property def metabase_dashboards(self) -> Optional[List[MetabaseDashboard]]: return None if self.attributes is None else self.attributes.metabase_dashboards @metabase_dashboards.setter - def metabase_dashboards(self, metabase_dashboards: Optional[List[MetabaseDashboard]]): + def metabase_dashboards( + self, metabase_dashboards: Optional[List[MetabaseDashboard]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.metabase_dashboards = metabase_dashboards @@ -137,9 +151,15 @@ class Attributes(Metabase.Attributes): metabase_slug: Optional[str] = Field(default=None, description="") metabase_color: Optional[str] = Field(default=None, description="") metabase_namespace: Optional[str] = Field(default=None, description="") - metabase_is_personal_collection: Optional[bool] = Field(default=None, description="") - metabase_dashboards: Optional[List[MetabaseDashboard]] = Field(default=None, description="") # relationship - metabase_questions: Optional[List[MetabaseQuestion]] = Field(default=None, description="") # relationship + metabase_is_personal_collection: Optional[bool] = Field( + default=None, description="" + ) + metabase_dashboards: Optional[List[MetabaseDashboard]] = Field( + default=None, description="" + ) # relationship + metabase_questions: Optional[List[MetabaseQuestion]] = Field( + default=None, description="" + ) # relationship attributes: MetabaseCollection.Attributes = Field( default_factory=lambda: MetabaseCollection.Attributes(), diff --git a/pyatlan/model/assets/metabase_dashboard.py b/pyatlan/model/assets/metabase_dashboard.py index ac25372ab..d1080bab0 100644 --- a/pyatlan/model/assets/metabase_dashboard.py +++ b/pyatlan/model/assets/metabase_dashboard.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - METABASE_QUESTION_COUNT: ClassVar[NumericField] = NumericField("metabaseQuestionCount", "metabaseQuestionCount") + METABASE_QUESTION_COUNT: ClassVar[NumericField] = NumericField( + "metabaseQuestionCount", "metabaseQuestionCount" + ) """ """ @@ -51,7 +53,9 @@ def __setattr__(self, name, value): @property def metabase_question_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.metabase_question_count + return ( + None if self.attributes is None else self.attributes.metabase_question_count + ) @metabase_question_count.setter def metabase_question_count(self, metabase_question_count: Optional[int]): @@ -81,8 +85,12 @@ def metabase_collection(self, metabase_collection: Optional[MetabaseCollection]) class Attributes(Metabase.Attributes): metabase_question_count: Optional[int] = Field(default=None, description="") - metabase_questions: Optional[List[MetabaseQuestion]] = Field(default=None, description="") # relationship - metabase_collection: Optional[MetabaseCollection] = Field(default=None, description="") # relationship + metabase_questions: Optional[List[MetabaseQuestion]] = Field( + default=None, description="" + ) # relationship + metabase_collection: Optional[MetabaseCollection] = Field( + default=None, description="" + ) # relationship attributes: MetabaseDashboard.Attributes = Field( default_factory=lambda: MetabaseDashboard.Attributes(), diff --git a/pyatlan/model/assets/metabase_question.py b/pyatlan/model/assets/metabase_question.py index 0b1ae6be6..61ed21f03 100644 --- a/pyatlan/model/assets/metabase_question.py +++ b/pyatlan/model/assets/metabase_question.py @@ -33,7 +33,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - METABASE_DASHBOARD_COUNT: ClassVar[NumericField] = NumericField("metabaseDashboardCount", "metabaseDashboardCount") + METABASE_DASHBOARD_COUNT: ClassVar[NumericField] = NumericField( + "metabaseDashboardCount", "metabaseDashboardCount" + ) """ """ @@ -69,7 +71,11 @@ def __setattr__(self, name, value): @property def metabase_dashboard_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.metabase_dashboard_count + return ( + None + if self.attributes is None + else self.attributes.metabase_dashboard_count + ) @metabase_dashboard_count.setter def metabase_dashboard_count(self, metabase_dashboard_count: Optional[int]): @@ -102,7 +108,9 @@ def metabase_dashboards(self) -> Optional[List[MetabaseDashboard]]: return None if self.attributes is None else self.attributes.metabase_dashboards @metabase_dashboards.setter - def metabase_dashboards(self, metabase_dashboards: Optional[List[MetabaseDashboard]]): + def metabase_dashboards( + self, metabase_dashboards: Optional[List[MetabaseDashboard]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.metabase_dashboards = metabase_dashboards @@ -121,8 +129,12 @@ class Attributes(Metabase.Attributes): metabase_dashboard_count: Optional[int] = Field(default=None, description="") metabase_query_type: Optional[str] = Field(default=None, description="") metabase_query: Optional[str] = Field(default=None, description="") - metabase_dashboards: Optional[List[MetabaseDashboard]] = Field(default=None, description="") # relationship - metabase_collection: Optional[MetabaseCollection] = Field(default=None, description="") # relationship + metabase_dashboards: Optional[List[MetabaseDashboard]] = Field( + default=None, description="" + ) # relationship + metabase_collection: Optional[MetabaseCollection] = Field( + default=None, description="" + ) # relationship attributes: MetabaseQuestion.Attributes = Field( default_factory=lambda: MetabaseQuestion.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy.py b/pyatlan/model/assets/micro_strategy.py index 4b61c22a7..77e6a86ab 100644 --- a/pyatlan/model/assets/micro_strategy.py +++ b/pyatlan/model/assets/micro_strategy.py @@ -35,10 +35,12 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MICRO_STRATEGY_PROJECT_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "microStrategyProjectQualifiedName", - "microStrategyProjectQualifiedName", - "microStrategyProjectQualifiedName.text", + MICRO_STRATEGY_PROJECT_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( + KeywordTextField( + "microStrategyProjectQualifiedName", + "microStrategyProjectQualifiedName", + "microStrategyProjectQualifiedName.text", + ) ) """ Unique name of the project in which this asset exists. @@ -67,10 +69,12 @@ def __setattr__(self, name, value): """ Simple names of the cubes related to this asset. """ - MICRO_STRATEGY_REPORT_QUALIFIED_NAMES: ClassVar[KeywordTextField] = KeywordTextField( - "microStrategyReportQualifiedNames", - "microStrategyReportQualifiedNames", - "microStrategyReportQualifiedNames.text", + MICRO_STRATEGY_REPORT_QUALIFIED_NAMES: ClassVar[KeywordTextField] = ( + KeywordTextField( + "microStrategyReportQualifiedNames", + "microStrategyReportQualifiedNames", + "microStrategyReportQualifiedNames.text", + ) ) """ Unique names of the reports related to this asset. @@ -101,7 +105,9 @@ def __setattr__(self, name, value): """ Time (epoch) this asset was certified in MicroStrategy, in milliseconds. """ - MICRO_STRATEGY_LOCATION: ClassVar[KeywordField] = KeywordField("microStrategyLocation", "microStrategyLocation") + MICRO_STRATEGY_LOCATION: ClassVar[KeywordField] = KeywordField( + "microStrategyLocation", "microStrategyLocation" + ) """ Location of this asset in MicroStrategy. """ @@ -121,17 +127,29 @@ def __setattr__(self, name, value): @property def micro_strategy_project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.micro_strategy_project_qualified_name + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_project_qualified_name + ) @micro_strategy_project_qualified_name.setter - def micro_strategy_project_qualified_name(self, micro_strategy_project_qualified_name: Optional[str]): + def micro_strategy_project_qualified_name( + self, micro_strategy_project_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_project_qualified_name = micro_strategy_project_qualified_name + self.attributes.micro_strategy_project_qualified_name = ( + micro_strategy_project_qualified_name + ) @property def micro_strategy_project_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.micro_strategy_project_name + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_project_name + ) @micro_strategy_project_name.setter def micro_strategy_project_name(self, micro_strategy_project_name: Optional[str]): @@ -141,17 +159,29 @@ def micro_strategy_project_name(self, micro_strategy_project_name: Optional[str] @property def micro_strategy_cube_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_cube_qualified_names + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_cube_qualified_names + ) @micro_strategy_cube_qualified_names.setter - def micro_strategy_cube_qualified_names(self, micro_strategy_cube_qualified_names: Optional[Set[str]]): + def micro_strategy_cube_qualified_names( + self, micro_strategy_cube_qualified_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_cube_qualified_names = micro_strategy_cube_qualified_names + self.attributes.micro_strategy_cube_qualified_names = ( + micro_strategy_cube_qualified_names + ) @property def micro_strategy_cube_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_cube_names + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_cube_names + ) @micro_strategy_cube_names.setter def micro_strategy_cube_names(self, micro_strategy_cube_names: Optional[Set[str]]): @@ -161,27 +191,45 @@ def micro_strategy_cube_names(self, micro_strategy_cube_names: Optional[Set[str] @property def micro_strategy_report_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_report_qualified_names + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_report_qualified_names + ) @micro_strategy_report_qualified_names.setter - def micro_strategy_report_qualified_names(self, micro_strategy_report_qualified_names: Optional[Set[str]]): + def micro_strategy_report_qualified_names( + self, micro_strategy_report_qualified_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_report_qualified_names = micro_strategy_report_qualified_names + self.attributes.micro_strategy_report_qualified_names = ( + micro_strategy_report_qualified_names + ) @property def micro_strategy_report_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_report_names + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_report_names + ) @micro_strategy_report_names.setter - def micro_strategy_report_names(self, micro_strategy_report_names: Optional[Set[str]]): + def micro_strategy_report_names( + self, micro_strategy_report_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_report_names = micro_strategy_report_names @property def micro_strategy_is_certified(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.micro_strategy_is_certified + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_is_certified + ) @micro_strategy_is_certified.setter def micro_strategy_is_certified(self, micro_strategy_is_certified: Optional[bool]): @@ -191,7 +239,11 @@ def micro_strategy_is_certified(self, micro_strategy_is_certified: Optional[bool @property def micro_strategy_certified_by(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.micro_strategy_certified_by + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_certified_by + ) @micro_strategy_certified_by.setter def micro_strategy_certified_by(self, micro_strategy_certified_by: Optional[str]): @@ -201,35 +253,61 @@ def micro_strategy_certified_by(self, micro_strategy_certified_by: Optional[str] @property def micro_strategy_certified_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.micro_strategy_certified_at + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_certified_at + ) @micro_strategy_certified_at.setter - def micro_strategy_certified_at(self, micro_strategy_certified_at: Optional[datetime]): + def micro_strategy_certified_at( + self, micro_strategy_certified_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_certified_at = micro_strategy_certified_at @property def micro_strategy_location(self) -> Optional[List[Dict[str, str]]]: - return None if self.attributes is None else self.attributes.micro_strategy_location + return ( + None if self.attributes is None else self.attributes.micro_strategy_location + ) @micro_strategy_location.setter - def micro_strategy_location(self, micro_strategy_location: Optional[List[Dict[str, str]]]): + def micro_strategy_location( + self, micro_strategy_location: Optional[List[Dict[str, str]]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_location = micro_strategy_location class Attributes(BI.Attributes): - micro_strategy_project_qualified_name: Optional[str] = Field(default=None, description="") + micro_strategy_project_qualified_name: Optional[str] = Field( + default=None, description="" + ) micro_strategy_project_name: Optional[str] = Field(default=None, description="") - micro_strategy_cube_qualified_names: Optional[Set[str]] = Field(default=None, description="") - micro_strategy_cube_names: Optional[Set[str]] = Field(default=None, description="") - micro_strategy_report_qualified_names: Optional[Set[str]] = Field(default=None, description="") - micro_strategy_report_names: Optional[Set[str]] = Field(default=None, description="") - micro_strategy_is_certified: Optional[bool] = Field(default=None, description="") + micro_strategy_cube_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) + micro_strategy_cube_names: Optional[Set[str]] = Field( + default=None, description="" + ) + micro_strategy_report_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) + micro_strategy_report_names: Optional[Set[str]] = Field( + default=None, description="" + ) + micro_strategy_is_certified: Optional[bool] = Field( + default=None, description="" + ) micro_strategy_certified_by: Optional[str] = Field(default=None, description="") - micro_strategy_certified_at: Optional[datetime] = Field(default=None, description="") - micro_strategy_location: Optional[List[Dict[str, str]]] = Field(default=None, description="") + micro_strategy_certified_at: Optional[datetime] = Field( + default=None, description="" + ) + micro_strategy_location: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) attributes: MicroStrategy.Attributes = Field( default_factory=lambda: MicroStrategy.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy_attribute.py b/pyatlan/model/assets/micro_strategy_attribute.py index 500bb72ad..90e5a3f39 100644 --- a/pyatlan/model/assets/micro_strategy_attribute.py +++ b/pyatlan/model/assets/micro_strategy_attribute.py @@ -36,11 +36,15 @@ def __setattr__(self, name, value): JSON string specifying the attribute's name, description, displayFormat, etc. """ - MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField("microStrategyReports") + MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField( + "microStrategyReports" + ) """ TBC """ - MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField("microStrategyMetrics") + MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField( + "microStrategyMetrics" + ) """ TBC """ @@ -48,7 +52,9 @@ def __setattr__(self, name, value): """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( + "microStrategyProject" + ) """ TBC """ @@ -63,30 +69,44 @@ def __setattr__(self, name, value): @property def micro_strategy_attribute_forms(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.micro_strategy_attribute_forms + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_attribute_forms + ) @micro_strategy_attribute_forms.setter - def micro_strategy_attribute_forms(self, micro_strategy_attribute_forms: Optional[str]): + def micro_strategy_attribute_forms( + self, micro_strategy_attribute_forms: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attribute_forms = micro_strategy_attribute_forms @property def micro_strategy_reports(self) -> Optional[List[MicroStrategyReport]]: - return None if self.attributes is None else self.attributes.micro_strategy_reports + return ( + None if self.attributes is None else self.attributes.micro_strategy_reports + ) @micro_strategy_reports.setter - def micro_strategy_reports(self, micro_strategy_reports: Optional[List[MicroStrategyReport]]): + def micro_strategy_reports( + self, micro_strategy_reports: Optional[List[MicroStrategyReport]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_reports = micro_strategy_reports @property def micro_strategy_metrics(self) -> Optional[List[MicroStrategyMetric]]: - return None if self.attributes is None else self.attributes.micro_strategy_metrics + return ( + None if self.attributes is None else self.attributes.micro_strategy_metrics + ) @micro_strategy_metrics.setter - def micro_strategy_metrics(self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]]): + def micro_strategy_metrics( + self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metrics = micro_strategy_metrics @@ -96,31 +116,43 @@ def micro_strategy_cubes(self) -> Optional[List[MicroStrategyCube]]: return None if self.attributes is None else self.attributes.micro_strategy_cubes @micro_strategy_cubes.setter - def micro_strategy_cubes(self, micro_strategy_cubes: Optional[List[MicroStrategyCube]]): + def micro_strategy_cubes( + self, micro_strategy_cubes: Optional[List[MicroStrategyCube]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_cubes = micro_strategy_cubes @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return None if self.attributes is None else self.attributes.micro_strategy_project + return ( + None if self.attributes is None else self.attributes.micro_strategy_project + ) @micro_strategy_project.setter - def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): + def micro_strategy_project( + self, micro_strategy_project: Optional[MicroStrategyProject] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project class Attributes(MicroStrategy.Attributes): - micro_strategy_attribute_forms: Optional[str] = Field(default=None, description="") + micro_strategy_attribute_forms: Optional[str] = Field( + default=None, description="" + ) micro_strategy_reports: Optional[List[MicroStrategyReport]] = Field( default=None, description="" ) # relationship micro_strategy_metrics: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field(default=None, description="") # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship + micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field( + default=None, description="" + ) # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field( + default=None, description="" + ) # relationship attributes: MicroStrategyAttribute.Attributes = Field( default_factory=lambda: MicroStrategyAttribute.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy_cube.py b/pyatlan/model/assets/micro_strategy_cube.py index f6230fed3..9e41827f6 100644 --- a/pyatlan/model/assets/micro_strategy_cube.py +++ b/pyatlan/model/assets/micro_strategy_cube.py @@ -29,24 +29,34 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MICRO_STRATEGY_CUBE_TYPE: ClassVar[KeywordField] = KeywordField("microStrategyCubeType", "microStrategyCubeType") + MICRO_STRATEGY_CUBE_TYPE: ClassVar[KeywordField] = KeywordField( + "microStrategyCubeType", "microStrategyCubeType" + ) """ Type of cube, for example: OLAP or MTDI. """ - MICRO_STRATEGY_CUBE_QUERY: ClassVar[TextField] = TextField("microStrategyCubeQuery", "microStrategyCubeQuery") + MICRO_STRATEGY_CUBE_QUERY: ClassVar[TextField] = TextField( + "microStrategyCubeQuery", "microStrategyCubeQuery" + ) """ Query used to create the cube. """ - MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField("microStrategyMetrics") + MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField( + "microStrategyMetrics" + ) """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( + "microStrategyProject" + ) """ TBC """ - MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField("microStrategyAttributes") + MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField( + "microStrategyAttributes" + ) """ TBC """ @@ -61,7 +71,11 @@ def __setattr__(self, name, value): @property def micro_strategy_cube_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.micro_strategy_cube_type + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_cube_type + ) @micro_strategy_cube_type.setter def micro_strategy_cube_type(self, micro_strategy_cube_type: Optional[str]): @@ -71,7 +85,11 @@ def micro_strategy_cube_type(self, micro_strategy_cube_type: Optional[str]): @property def micro_strategy_cube_query(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.micro_strategy_cube_query + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_cube_query + ) @micro_strategy_cube_query.setter def micro_strategy_cube_query(self, micro_strategy_cube_query: Optional[str]): @@ -81,30 +99,44 @@ def micro_strategy_cube_query(self, micro_strategy_cube_query: Optional[str]): @property def micro_strategy_metrics(self) -> Optional[List[MicroStrategyMetric]]: - return None if self.attributes is None else self.attributes.micro_strategy_metrics + return ( + None if self.attributes is None else self.attributes.micro_strategy_metrics + ) @micro_strategy_metrics.setter - def micro_strategy_metrics(self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]]): + def micro_strategy_metrics( + self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metrics = micro_strategy_metrics @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return None if self.attributes is None else self.attributes.micro_strategy_project + return ( + None if self.attributes is None else self.attributes.micro_strategy_project + ) @micro_strategy_project.setter - def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): + def micro_strategy_project( + self, micro_strategy_project: Optional[MicroStrategyProject] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project @property def micro_strategy_attributes(self) -> Optional[List[MicroStrategyAttribute]]: - return None if self.attributes is None else self.attributes.micro_strategy_attributes + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_attributes + ) @micro_strategy_attributes.setter - def micro_strategy_attributes(self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]]): + def micro_strategy_attributes( + self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attributes = micro_strategy_attributes @@ -115,7 +147,9 @@ class Attributes(MicroStrategy.Attributes): micro_strategy_metrics: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field( + default=None, description="" + ) # relationship micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/micro_strategy_document.py b/pyatlan/model/assets/micro_strategy_document.py index df02dfa1a..060f6ea59 100644 --- a/pyatlan/model/assets/micro_strategy_document.py +++ b/pyatlan/model/assets/micro_strategy_document.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( + "microStrategyProject" + ) """ TBC """ @@ -40,16 +42,22 @@ def __setattr__(self, name, value): @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return None if self.attributes is None else self.attributes.micro_strategy_project + return ( + None if self.attributes is None else self.attributes.micro_strategy_project + ) @micro_strategy_project.setter - def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): + def micro_strategy_project( + self, micro_strategy_project: Optional[MicroStrategyProject] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project class Attributes(MicroStrategy.Attributes): - micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field( + default=None, description="" + ) # relationship attributes: MicroStrategyDocument.Attributes = Field( default_factory=lambda: MicroStrategyDocument.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy_dossier.py b/pyatlan/model/assets/micro_strategy_dossier.py index b088c16ea..85dcd8a5e 100644 --- a/pyatlan/model/assets/micro_strategy_dossier.py +++ b/pyatlan/model/assets/micro_strategy_dossier.py @@ -36,11 +36,15 @@ def __setattr__(self, name, value): List of chapter names in this dossier. """ - MICRO_STRATEGY_VISUALIZATIONS: ClassVar[RelationField] = RelationField("microStrategyVisualizations") + MICRO_STRATEGY_VISUALIZATIONS: ClassVar[RelationField] = RelationField( + "microStrategyVisualizations" + ) """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( + "microStrategyProject" + ) """ TBC """ @@ -53,42 +57,64 @@ def __setattr__(self, name, value): @property def micro_strategy_dossier_chapter_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_dossier_chapter_names + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_dossier_chapter_names + ) @micro_strategy_dossier_chapter_names.setter - def micro_strategy_dossier_chapter_names(self, micro_strategy_dossier_chapter_names: Optional[Set[str]]): + def micro_strategy_dossier_chapter_names( + self, micro_strategy_dossier_chapter_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_dossier_chapter_names = micro_strategy_dossier_chapter_names + self.attributes.micro_strategy_dossier_chapter_names = ( + micro_strategy_dossier_chapter_names + ) @property def micro_strategy_visualizations( self, ) -> Optional[List[MicroStrategyVisualization]]: - return None if self.attributes is None else self.attributes.micro_strategy_visualizations + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_visualizations + ) @micro_strategy_visualizations.setter - def micro_strategy_visualizations(self, micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]]): + def micro_strategy_visualizations( + self, micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_visualizations = micro_strategy_visualizations @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return None if self.attributes is None else self.attributes.micro_strategy_project + return ( + None if self.attributes is None else self.attributes.micro_strategy_project + ) @micro_strategy_project.setter - def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): + def micro_strategy_project( + self, micro_strategy_project: Optional[MicroStrategyProject] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project class Attributes(MicroStrategy.Attributes): - micro_strategy_dossier_chapter_names: Optional[Set[str]] = Field(default=None, description="") - micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] = Field( + micro_strategy_dossier_chapter_names: Optional[Set[str]] = Field( + default=None, description="" + ) + micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] = ( + Field(default=None, description="") + ) # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field( default=None, description="" ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship attributes: MicroStrategyDossier.Attributes = Field( default_factory=lambda: MicroStrategyDossier.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy_fact.py b/pyatlan/model/assets/micro_strategy_fact.py index fa2d27ce5..edb65a598 100644 --- a/pyatlan/model/assets/micro_strategy_fact.py +++ b/pyatlan/model/assets/micro_strategy_fact.py @@ -36,11 +36,15 @@ def __setattr__(self, name, value): List of expressions for this fact. """ - MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField("microStrategyMetrics") + MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField( + "microStrategyMetrics" + ) """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( + "microStrategyProject" + ) """ TBC """ @@ -53,40 +57,60 @@ def __setattr__(self, name, value): @property def micro_strategy_fact_expressions(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_fact_expressions + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_fact_expressions + ) @micro_strategy_fact_expressions.setter - def micro_strategy_fact_expressions(self, micro_strategy_fact_expressions: Optional[Set[str]]): + def micro_strategy_fact_expressions( + self, micro_strategy_fact_expressions: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_fact_expressions = micro_strategy_fact_expressions + self.attributes.micro_strategy_fact_expressions = ( + micro_strategy_fact_expressions + ) @property def micro_strategy_metrics(self) -> Optional[List[MicroStrategyMetric]]: - return None if self.attributes is None else self.attributes.micro_strategy_metrics + return ( + None if self.attributes is None else self.attributes.micro_strategy_metrics + ) @micro_strategy_metrics.setter - def micro_strategy_metrics(self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]]): + def micro_strategy_metrics( + self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metrics = micro_strategy_metrics @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return None if self.attributes is None else self.attributes.micro_strategy_project + return ( + None if self.attributes is None else self.attributes.micro_strategy_project + ) @micro_strategy_project.setter - def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): + def micro_strategy_project( + self, micro_strategy_project: Optional[MicroStrategyProject] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project class Attributes(MicroStrategy.Attributes): - micro_strategy_fact_expressions: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_fact_expressions: Optional[Set[str]] = Field( + default=None, description="" + ) micro_strategy_metrics: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field( + default=None, description="" + ) # relationship attributes: MicroStrategyFact.Attributes = Field( default_factory=lambda: MicroStrategyFact.Attributes(), diff --git a/pyatlan/model/assets/micro_strategy_metric.py b/pyatlan/model/assets/micro_strategy_metric.py index 5c62e6c2b..d6d2ab6d9 100644 --- a/pyatlan/model/assets/micro_strategy_metric.py +++ b/pyatlan/model/assets/micro_strategy_metric.py @@ -35,10 +35,12 @@ def __setattr__(self, name, value): """ Text specifiying this metric's expression. """ - MICRO_STRATEGY_ATTRIBUTE_QUALIFIED_NAMES: ClassVar[KeywordTextField] = KeywordTextField( - "microStrategyAttributeQualifiedNames", - "microStrategyAttributeQualifiedNames", - "microStrategyAttributeQualifiedNames.text", + MICRO_STRATEGY_ATTRIBUTE_QUALIFIED_NAMES: ClassVar[KeywordTextField] = ( + KeywordTextField( + "microStrategyAttributeQualifiedNames", + "microStrategyAttributeQualifiedNames", + "microStrategyAttributeQualifiedNames.text", + ) ) """ List of unique names of attributes related to this metric. @@ -67,10 +69,12 @@ def __setattr__(self, name, value): """ List of simple names of facts related to this metric. """ - MICRO_STRATEGY_METRIC_PARENT_QUALIFIED_NAMES: ClassVar[KeywordTextField] = KeywordTextField( - "microStrategyMetricParentQualifiedNames", - "microStrategyMetricParentQualifiedNames", - "microStrategyMetricParentQualifiedNames.text", + MICRO_STRATEGY_METRIC_PARENT_QUALIFIED_NAMES: ClassVar[KeywordTextField] = ( + KeywordTextField( + "microStrategyMetricParentQualifiedNames", + "microStrategyMetricParentQualifiedNames", + "microStrategyMetricParentQualifiedNames.text", + ) ) """ List of unique names of parent metrics of this metric. @@ -84,7 +88,9 @@ def __setattr__(self, name, value): List of simple names of parent metrics of this metric. """ - MICRO_STRATEGY_METRIC_PARENTS: ClassVar[RelationField] = RelationField("microStrategyMetricParents") + MICRO_STRATEGY_METRIC_PARENTS: ClassVar[RelationField] = RelationField( + "microStrategyMetricParents" + ) """ TBC """ @@ -92,7 +98,9 @@ def __setattr__(self, name, value): """ TBC """ - MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField("microStrategyReports") + MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField( + "microStrategyReports" + ) """ TBC """ @@ -100,15 +108,21 @@ def __setattr__(self, name, value): """ TBC """ - MICRO_STRATEGY_METRIC_CHILDREN: ClassVar[RelationField] = RelationField("microStrategyMetricChildren") + MICRO_STRATEGY_METRIC_CHILDREN: ClassVar[RelationField] = RelationField( + "microStrategyMetricChildren" + ) """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( + "microStrategyProject" + ) """ TBC """ - MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField("microStrategyAttributes") + MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField( + "microStrategyAttributes" + ) """ TBC """ @@ -132,47 +146,81 @@ def __setattr__(self, name, value): @property def micro_strategy_metric_expression(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.micro_strategy_metric_expression + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_metric_expression + ) @micro_strategy_metric_expression.setter - def micro_strategy_metric_expression(self, micro_strategy_metric_expression: Optional[str]): + def micro_strategy_metric_expression( + self, micro_strategy_metric_expression: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_metric_expression = micro_strategy_metric_expression + self.attributes.micro_strategy_metric_expression = ( + micro_strategy_metric_expression + ) @property def micro_strategy_attribute_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_attribute_qualified_names + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_attribute_qualified_names + ) @micro_strategy_attribute_qualified_names.setter - def micro_strategy_attribute_qualified_names(self, micro_strategy_attribute_qualified_names: Optional[Set[str]]): + def micro_strategy_attribute_qualified_names( + self, micro_strategy_attribute_qualified_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_attribute_qualified_names = micro_strategy_attribute_qualified_names + self.attributes.micro_strategy_attribute_qualified_names = ( + micro_strategy_attribute_qualified_names + ) @property def micro_strategy_attribute_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_attribute_names + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_attribute_names + ) @micro_strategy_attribute_names.setter - def micro_strategy_attribute_names(self, micro_strategy_attribute_names: Optional[Set[str]]): + def micro_strategy_attribute_names( + self, micro_strategy_attribute_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attribute_names = micro_strategy_attribute_names @property def micro_strategy_fact_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_fact_qualified_names + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_fact_qualified_names + ) @micro_strategy_fact_qualified_names.setter - def micro_strategy_fact_qualified_names(self, micro_strategy_fact_qualified_names: Optional[Set[str]]): + def micro_strategy_fact_qualified_names( + self, micro_strategy_fact_qualified_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_fact_qualified_names = micro_strategy_fact_qualified_names + self.attributes.micro_strategy_fact_qualified_names = ( + micro_strategy_fact_qualified_names + ) @property def micro_strategy_fact_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_fact_names + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_fact_names + ) @micro_strategy_fact_names.setter def micro_strategy_fact_names(self, micro_strategy_fact_names: Optional[Set[str]]): @@ -182,7 +230,11 @@ def micro_strategy_fact_names(self, micro_strategy_fact_names: Optional[Set[str] @property def micro_strategy_metric_parent_qualified_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_metric_parent_qualified_names + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_metric_parent_qualified_names + ) @micro_strategy_metric_parent_qualified_names.setter def micro_strategy_metric_parent_qualified_names( @@ -190,24 +242,40 @@ def micro_strategy_metric_parent_qualified_names( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_metric_parent_qualified_names = micro_strategy_metric_parent_qualified_names + self.attributes.micro_strategy_metric_parent_qualified_names = ( + micro_strategy_metric_parent_qualified_names + ) @property def micro_strategy_metric_parent_names(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.micro_strategy_metric_parent_names + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_metric_parent_names + ) @micro_strategy_metric_parent_names.setter - def micro_strategy_metric_parent_names(self, micro_strategy_metric_parent_names: Optional[Set[str]]): + def micro_strategy_metric_parent_names( + self, micro_strategy_metric_parent_names: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_metric_parent_names = micro_strategy_metric_parent_names + self.attributes.micro_strategy_metric_parent_names = ( + micro_strategy_metric_parent_names + ) @property def micro_strategy_metric_parents(self) -> Optional[List[MicroStrategyMetric]]: - return None if self.attributes is None else self.attributes.micro_strategy_metric_parents + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_metric_parents + ) @micro_strategy_metric_parents.setter - def micro_strategy_metric_parents(self, micro_strategy_metric_parents: Optional[List[MicroStrategyMetric]]): + def micro_strategy_metric_parents( + self, micro_strategy_metric_parents: Optional[List[MicroStrategyMetric]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metric_parents = micro_strategy_metric_parents @@ -217,17 +285,23 @@ def micro_strategy_facts(self) -> Optional[List[MicroStrategyFact]]: return None if self.attributes is None else self.attributes.micro_strategy_facts @micro_strategy_facts.setter - def micro_strategy_facts(self, micro_strategy_facts: Optional[List[MicroStrategyFact]]): + def micro_strategy_facts( + self, micro_strategy_facts: Optional[List[MicroStrategyFact]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_facts = micro_strategy_facts @property def micro_strategy_reports(self) -> Optional[List[MicroStrategyReport]]: - return None if self.attributes is None else self.attributes.micro_strategy_reports + return ( + None if self.attributes is None else self.attributes.micro_strategy_reports + ) @micro_strategy_reports.setter - def micro_strategy_reports(self, micro_strategy_reports: Optional[List[MicroStrategyReport]]): + def micro_strategy_reports( + self, micro_strategy_reports: Optional[List[MicroStrategyReport]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_reports = micro_strategy_reports @@ -237,61 +311,99 @@ def micro_strategy_cubes(self) -> Optional[List[MicroStrategyCube]]: return None if self.attributes is None else self.attributes.micro_strategy_cubes @micro_strategy_cubes.setter - def micro_strategy_cubes(self, micro_strategy_cubes: Optional[List[MicroStrategyCube]]): + def micro_strategy_cubes( + self, micro_strategy_cubes: Optional[List[MicroStrategyCube]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_cubes = micro_strategy_cubes @property def micro_strategy_metric_children(self) -> Optional[List[MicroStrategyMetric]]: - return None if self.attributes is None else self.attributes.micro_strategy_metric_children + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_metric_children + ) @micro_strategy_metric_children.setter - def micro_strategy_metric_children(self, micro_strategy_metric_children: Optional[List[MicroStrategyMetric]]): + def micro_strategy_metric_children( + self, micro_strategy_metric_children: Optional[List[MicroStrategyMetric]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metric_children = micro_strategy_metric_children @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return None if self.attributes is None else self.attributes.micro_strategy_project + return ( + None if self.attributes is None else self.attributes.micro_strategy_project + ) @micro_strategy_project.setter - def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): + def micro_strategy_project( + self, micro_strategy_project: Optional[MicroStrategyProject] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project @property def micro_strategy_attributes(self) -> Optional[List[MicroStrategyAttribute]]: - return None if self.attributes is None else self.attributes.micro_strategy_attributes + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_attributes + ) @micro_strategy_attributes.setter - def micro_strategy_attributes(self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]]): + def micro_strategy_attributes( + self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attributes = micro_strategy_attributes class Attributes(MicroStrategy.Attributes): - micro_strategy_metric_expression: Optional[str] = Field(default=None, description="") - micro_strategy_attribute_qualified_names: Optional[Set[str]] = Field(default=None, description="") - micro_strategy_attribute_names: Optional[Set[str]] = Field(default=None, description="") - micro_strategy_fact_qualified_names: Optional[Set[str]] = Field(default=None, description="") - micro_strategy_fact_names: Optional[Set[str]] = Field(default=None, description="") - micro_strategy_metric_parent_qualified_names: Optional[Set[str]] = Field(default=None, description="") - micro_strategy_metric_parent_names: Optional[Set[str]] = Field(default=None, description="") + micro_strategy_metric_expression: Optional[str] = Field( + default=None, description="" + ) + micro_strategy_attribute_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) + micro_strategy_attribute_names: Optional[Set[str]] = Field( + default=None, description="" + ) + micro_strategy_fact_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) + micro_strategy_fact_names: Optional[Set[str]] = Field( + default=None, description="" + ) + micro_strategy_metric_parent_qualified_names: Optional[Set[str]] = Field( + default=None, description="" + ) + micro_strategy_metric_parent_names: Optional[Set[str]] = Field( + default=None, description="" + ) micro_strategy_metric_parents: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_facts: Optional[List[MicroStrategyFact]] = Field(default=None, description="") # relationship + micro_strategy_facts: Optional[List[MicroStrategyFact]] = Field( + default=None, description="" + ) # relationship micro_strategy_reports: Optional[List[MicroStrategyReport]] = Field( default=None, description="" ) # relationship - micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field(default=None, description="") # relationship + micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field( + default=None, description="" + ) # relationship micro_strategy_metric_children: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field( + default=None, description="" + ) # relationship micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/micro_strategy_project.py b/pyatlan/model/assets/micro_strategy_project.py index 27a5f04c0..c08043fde 100644 --- a/pyatlan/model/assets/micro_strategy_project.py +++ b/pyatlan/model/assets/micro_strategy_project.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField("microStrategyReports") + MICRO_STRATEGY_REPORTS: ClassVar[RelationField] = RelationField( + "microStrategyReports" + ) """ TBC """ @@ -37,15 +39,21 @@ def __setattr__(self, name, value): """ TBC """ - MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField("microStrategyMetrics") + MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField( + "microStrategyMetrics" + ) """ TBC """ - MICRO_STRATEGY_VISUALIZATIONS: ClassVar[RelationField] = RelationField("microStrategyVisualizations") + MICRO_STRATEGY_VISUALIZATIONS: ClassVar[RelationField] = RelationField( + "microStrategyVisualizations" + ) """ TBC """ - MICRO_STRATEGY_DOCUMENTS: ClassVar[RelationField] = RelationField("microStrategyDocuments") + MICRO_STRATEGY_DOCUMENTS: ClassVar[RelationField] = RelationField( + "microStrategyDocuments" + ) """ TBC """ @@ -53,11 +61,15 @@ def __setattr__(self, name, value): """ TBC """ - MICRO_STRATEGY_DOSSIERS: ClassVar[RelationField] = RelationField("microStrategyDossiers") + MICRO_STRATEGY_DOSSIERS: ClassVar[RelationField] = RelationField( + "microStrategyDossiers" + ) """ TBC """ - MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField("microStrategyAttributes") + MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField( + "microStrategyAttributes" + ) """ TBC """ @@ -75,10 +87,14 @@ def __setattr__(self, name, value): @property def micro_strategy_reports(self) -> Optional[List[MicroStrategyReport]]: - return None if self.attributes is None else self.attributes.micro_strategy_reports + return ( + None if self.attributes is None else self.attributes.micro_strategy_reports + ) @micro_strategy_reports.setter - def micro_strategy_reports(self, micro_strategy_reports: Optional[List[MicroStrategyReport]]): + def micro_strategy_reports( + self, micro_strategy_reports: Optional[List[MicroStrategyReport]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_reports = micro_strategy_reports @@ -88,17 +104,23 @@ def micro_strategy_facts(self) -> Optional[List[MicroStrategyFact]]: return None if self.attributes is None else self.attributes.micro_strategy_facts @micro_strategy_facts.setter - def micro_strategy_facts(self, micro_strategy_facts: Optional[List[MicroStrategyFact]]): + def micro_strategy_facts( + self, micro_strategy_facts: Optional[List[MicroStrategyFact]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_facts = micro_strategy_facts @property def micro_strategy_metrics(self) -> Optional[List[MicroStrategyMetric]]: - return None if self.attributes is None else self.attributes.micro_strategy_metrics + return ( + None if self.attributes is None else self.attributes.micro_strategy_metrics + ) @micro_strategy_metrics.setter - def micro_strategy_metrics(self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]]): + def micro_strategy_metrics( + self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metrics = micro_strategy_metrics @@ -107,20 +129,32 @@ def micro_strategy_metrics(self, micro_strategy_metrics: Optional[List[MicroStra def micro_strategy_visualizations( self, ) -> Optional[List[MicroStrategyVisualization]]: - return None if self.attributes is None else self.attributes.micro_strategy_visualizations + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_visualizations + ) @micro_strategy_visualizations.setter - def micro_strategy_visualizations(self, micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]]): + def micro_strategy_visualizations( + self, micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_visualizations = micro_strategy_visualizations @property def micro_strategy_documents(self) -> Optional[List[MicroStrategyDocument]]: - return None if self.attributes is None else self.attributes.micro_strategy_documents + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_documents + ) @micro_strategy_documents.setter - def micro_strategy_documents(self, micro_strategy_documents: Optional[List[MicroStrategyDocument]]): + def micro_strategy_documents( + self, micro_strategy_documents: Optional[List[MicroStrategyDocument]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_documents = micro_strategy_documents @@ -130,27 +164,39 @@ def micro_strategy_cubes(self) -> Optional[List[MicroStrategyCube]]: return None if self.attributes is None else self.attributes.micro_strategy_cubes @micro_strategy_cubes.setter - def micro_strategy_cubes(self, micro_strategy_cubes: Optional[List[MicroStrategyCube]]): + def micro_strategy_cubes( + self, micro_strategy_cubes: Optional[List[MicroStrategyCube]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_cubes = micro_strategy_cubes @property def micro_strategy_dossiers(self) -> Optional[List[MicroStrategyDossier]]: - return None if self.attributes is None else self.attributes.micro_strategy_dossiers + return ( + None if self.attributes is None else self.attributes.micro_strategy_dossiers + ) @micro_strategy_dossiers.setter - def micro_strategy_dossiers(self, micro_strategy_dossiers: Optional[List[MicroStrategyDossier]]): + def micro_strategy_dossiers( + self, micro_strategy_dossiers: Optional[List[MicroStrategyDossier]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_dossiers = micro_strategy_dossiers @property def micro_strategy_attributes(self) -> Optional[List[MicroStrategyAttribute]]: - return None if self.attributes is None else self.attributes.micro_strategy_attributes + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_attributes + ) @micro_strategy_attributes.setter - def micro_strategy_attributes(self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]]): + def micro_strategy_attributes( + self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attributes = micro_strategy_attributes @@ -159,17 +205,21 @@ class Attributes(MicroStrategy.Attributes): micro_strategy_reports: Optional[List[MicroStrategyReport]] = Field( default=None, description="" ) # relationship - micro_strategy_facts: Optional[List[MicroStrategyFact]] = Field(default=None, description="") # relationship - micro_strategy_metrics: Optional[List[MicroStrategyMetric]] = Field( + micro_strategy_facts: Optional[List[MicroStrategyFact]] = Field( default=None, description="" ) # relationship - micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] = Field( + micro_strategy_metrics: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship + micro_strategy_visualizations: Optional[List[MicroStrategyVisualization]] = ( + Field(default=None, description="") + ) # relationship micro_strategy_documents: Optional[List[MicroStrategyDocument]] = Field( default=None, description="" ) # relationship - micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field(default=None, description="") # relationship + micro_strategy_cubes: Optional[List[MicroStrategyCube]] = Field( + default=None, description="" + ) # relationship micro_strategy_dossiers: Optional[List[MicroStrategyDossier]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/micro_strategy_report.py b/pyatlan/model/assets/micro_strategy_report.py index f575a3f68..463f18fa8 100644 --- a/pyatlan/model/assets/micro_strategy_report.py +++ b/pyatlan/model/assets/micro_strategy_report.py @@ -36,15 +36,21 @@ def __setattr__(self, name, value): Type of report, for example: Grid or Chart. """ - MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField("microStrategyMetrics") + MICRO_STRATEGY_METRICS: ClassVar[RelationField] = RelationField( + "microStrategyMetrics" + ) """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( + "microStrategyProject" + ) """ TBC """ - MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField("microStrategyAttributes") + MICRO_STRATEGY_ATTRIBUTES: ClassVar[RelationField] = RelationField( + "microStrategyAttributes" + ) """ TBC """ @@ -58,7 +64,11 @@ def __setattr__(self, name, value): @property def micro_strategy_report_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.micro_strategy_report_type + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_report_type + ) @micro_strategy_report_type.setter def micro_strategy_report_type(self, micro_strategy_report_type: Optional[str]): @@ -68,30 +78,44 @@ def micro_strategy_report_type(self, micro_strategy_report_type: Optional[str]): @property def micro_strategy_metrics(self) -> Optional[List[MicroStrategyMetric]]: - return None if self.attributes is None else self.attributes.micro_strategy_metrics + return ( + None if self.attributes is None else self.attributes.micro_strategy_metrics + ) @micro_strategy_metrics.setter - def micro_strategy_metrics(self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]]): + def micro_strategy_metrics( + self, micro_strategy_metrics: Optional[List[MicroStrategyMetric]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_metrics = micro_strategy_metrics @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return None if self.attributes is None else self.attributes.micro_strategy_project + return ( + None if self.attributes is None else self.attributes.micro_strategy_project + ) @micro_strategy_project.setter - def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): + def micro_strategy_project( + self, micro_strategy_project: Optional[MicroStrategyProject] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project @property def micro_strategy_attributes(self) -> Optional[List[MicroStrategyAttribute]]: - return None if self.attributes is None else self.attributes.micro_strategy_attributes + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_attributes + ) @micro_strategy_attributes.setter - def micro_strategy_attributes(self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]]): + def micro_strategy_attributes( + self, micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_attributes = micro_strategy_attributes @@ -101,7 +125,9 @@ class Attributes(MicroStrategy.Attributes): micro_strategy_metrics: Optional[List[MicroStrategyMetric]] = Field( default=None, description="" ) # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field( + default=None, description="" + ) # relationship micro_strategy_attributes: Optional[List[MicroStrategyAttribute]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/micro_strategy_visualization.py b/pyatlan/model/assets/micro_strategy_visualization.py index 3071f3ec8..3486a1b74 100644 --- a/pyatlan/model/assets/micro_strategy_visualization.py +++ b/pyatlan/model/assets/micro_strategy_visualization.py @@ -39,10 +39,12 @@ def __setattr__(self, name, value): """ Type of visualization. """ - MICRO_STRATEGY_DOSSIER_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "microStrategyDossierQualifiedName", - "microStrategyDossierQualifiedName", - "microStrategyDossierQualifiedName.text", + MICRO_STRATEGY_DOSSIER_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( + KeywordTextField( + "microStrategyDossierQualifiedName", + "microStrategyDossierQualifiedName", + "microStrategyDossierQualifiedName.text", + ) ) """ Unique name of the dossier in which this visualization exists. @@ -56,11 +58,15 @@ def __setattr__(self, name, value): Simple name of the dossier in which this visualization exists. """ - MICRO_STRATEGY_DOSSIER: ClassVar[RelationField] = RelationField("microStrategyDossier") + MICRO_STRATEGY_DOSSIER: ClassVar[RelationField] = RelationField( + "microStrategyDossier" + ) """ TBC """ - MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField("microStrategyProject") + MICRO_STRATEGY_PROJECT: ClassVar[RelationField] = RelationField( + "microStrategyProject" + ) """ TBC """ @@ -75,27 +81,47 @@ def __setattr__(self, name, value): @property def micro_strategy_visualization_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.micro_strategy_visualization_type + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_visualization_type + ) @micro_strategy_visualization_type.setter - def micro_strategy_visualization_type(self, micro_strategy_visualization_type: Optional[str]): + def micro_strategy_visualization_type( + self, micro_strategy_visualization_type: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_visualization_type = micro_strategy_visualization_type + self.attributes.micro_strategy_visualization_type = ( + micro_strategy_visualization_type + ) @property def micro_strategy_dossier_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.micro_strategy_dossier_qualified_name + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_dossier_qualified_name + ) @micro_strategy_dossier_qualified_name.setter - def micro_strategy_dossier_qualified_name(self, micro_strategy_dossier_qualified_name: Optional[str]): + def micro_strategy_dossier_qualified_name( + self, micro_strategy_dossier_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.micro_strategy_dossier_qualified_name = micro_strategy_dossier_qualified_name + self.attributes.micro_strategy_dossier_qualified_name = ( + micro_strategy_dossier_qualified_name + ) @property def micro_strategy_dossier_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.micro_strategy_dossier_name + return ( + None + if self.attributes is None + else self.attributes.micro_strategy_dossier_name + ) @micro_strategy_dossier_name.setter def micro_strategy_dossier_name(self, micro_strategy_dossier_name: Optional[str]): @@ -105,30 +131,46 @@ def micro_strategy_dossier_name(self, micro_strategy_dossier_name: Optional[str] @property def micro_strategy_dossier(self) -> Optional[MicroStrategyDossier]: - return None if self.attributes is None else self.attributes.micro_strategy_dossier + return ( + None if self.attributes is None else self.attributes.micro_strategy_dossier + ) @micro_strategy_dossier.setter - def micro_strategy_dossier(self, micro_strategy_dossier: Optional[MicroStrategyDossier]): + def micro_strategy_dossier( + self, micro_strategy_dossier: Optional[MicroStrategyDossier] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_dossier = micro_strategy_dossier @property def micro_strategy_project(self) -> Optional[MicroStrategyProject]: - return None if self.attributes is None else self.attributes.micro_strategy_project + return ( + None if self.attributes is None else self.attributes.micro_strategy_project + ) @micro_strategy_project.setter - def micro_strategy_project(self, micro_strategy_project: Optional[MicroStrategyProject]): + def micro_strategy_project( + self, micro_strategy_project: Optional[MicroStrategyProject] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.micro_strategy_project = micro_strategy_project class Attributes(MicroStrategy.Attributes): - micro_strategy_visualization_type: Optional[str] = Field(default=None, description="") - micro_strategy_dossier_qualified_name: Optional[str] = Field(default=None, description="") + micro_strategy_visualization_type: Optional[str] = Field( + default=None, description="" + ) + micro_strategy_dossier_qualified_name: Optional[str] = Field( + default=None, description="" + ) micro_strategy_dossier_name: Optional[str] = Field(default=None, description="") - micro_strategy_dossier: Optional[MicroStrategyDossier] = Field(default=None, description="") # relationship - micro_strategy_project: Optional[MicroStrategyProject] = Field(default=None, description="") # relationship + micro_strategy_dossier: Optional[MicroStrategyDossier] = Field( + default=None, description="" + ) # relationship + micro_strategy_project: Optional[MicroStrategyProject] = Field( + default=None, description="" + ) # relationship attributes: MicroStrategyVisualization.Attributes = Field( default_factory=lambda: MicroStrategyVisualization.Attributes(), diff --git a/pyatlan/model/assets/mode.py b/pyatlan/model/assets/mode.py index aa8bcd423..3a6f706fe 100644 --- a/pyatlan/model/assets/mode.py +++ b/pyatlan/model/assets/mode.py @@ -33,7 +33,9 @@ def __setattr__(self, name, value): """ """ - MODE_TOKEN: ClassVar[KeywordTextField] = KeywordTextField("modeToken", "modeToken", "modeToken.text") + MODE_TOKEN: ClassVar[KeywordTextField] = KeywordTextField( + "modeToken", "modeToken", "modeToken.text" + ) """ """ @@ -130,7 +132,9 @@ def mode_workspace_name(self, mode_workspace_name: Optional[str]): @property def mode_workspace_username(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mode_workspace_username + return ( + None if self.attributes is None else self.attributes.mode_workspace_username + ) @mode_workspace_username.setter def mode_workspace_username(self, mode_workspace_username: Optional[str]): @@ -140,10 +144,16 @@ def mode_workspace_username(self, mode_workspace_username: Optional[str]): @property def mode_workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mode_workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.mode_workspace_qualified_name + ) @mode_workspace_qualified_name.setter - def mode_workspace_qualified_name(self, mode_workspace_qualified_name: Optional[str]): + def mode_workspace_qualified_name( + self, mode_workspace_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.mode_workspace_qualified_name = mode_workspace_qualified_name @@ -160,7 +170,11 @@ def mode_report_name(self, mode_report_name: Optional[str]): @property def mode_report_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mode_report_qualified_name + return ( + None + if self.attributes is None + else self.attributes.mode_report_qualified_name + ) @mode_report_qualified_name.setter def mode_report_qualified_name(self, mode_report_qualified_name: Optional[str]): @@ -180,7 +194,11 @@ def mode_query_name(self, mode_query_name: Optional[str]): @property def mode_query_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mode_query_qualified_name + return ( + None + if self.attributes is None + else self.attributes.mode_query_qualified_name + ) @mode_query_qualified_name.setter def mode_query_qualified_name(self, mode_query_qualified_name: Optional[str]): @@ -193,7 +211,9 @@ class Attributes(BI.Attributes): mode_token: Optional[str] = Field(default=None, description="") mode_workspace_name: Optional[str] = Field(default=None, description="") mode_workspace_username: Optional[str] = Field(default=None, description="") - mode_workspace_qualified_name: Optional[str] = Field(default=None, description="") + mode_workspace_qualified_name: Optional[str] = Field( + default=None, description="" + ) mode_report_name: Optional[str] = Field(default=None, description="") mode_report_qualified_name: Optional[str] = Field(default=None, description="") mode_query_name: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/mode_chart.py b/pyatlan/model/assets/mode_chart.py index 9c94728ca..80d3f76bf 100644 --- a/pyatlan/model/assets/mode_chart.py +++ b/pyatlan/model/assets/mode_chart.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODE_CHART_TYPE: ClassVar[KeywordField] = KeywordField("modeChartType", "modeChartType") + MODE_CHART_TYPE: ClassVar[KeywordField] = KeywordField( + "modeChartType", "modeChartType" + ) """ Type of chart. """ @@ -66,7 +68,9 @@ def mode_query(self, mode_query: Optional[ModeQuery]): class Attributes(Mode.Attributes): mode_chart_type: Optional[str] = Field(default=None, description="") - mode_query: Optional[ModeQuery] = Field(default=None, description="") # relationship + mode_query: Optional[ModeQuery] = Field( + default=None, description="" + ) # relationship attributes: ModeChart.Attributes = Field( default_factory=lambda: ModeChart.Attributes(), diff --git a/pyatlan/model/assets/mode_collection.py b/pyatlan/model/assets/mode_collection.py index 2c3c64593..02afbfadf 100644 --- a/pyatlan/model/assets/mode_collection.py +++ b/pyatlan/model/assets/mode_collection.py @@ -29,11 +29,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODE_COLLECTION_TYPE: ClassVar[KeywordField] = KeywordField("modeCollectionType", "modeCollectionType") + MODE_COLLECTION_TYPE: ClassVar[KeywordField] = KeywordField( + "modeCollectionType", "modeCollectionType" + ) """ Type of this collection. """ - MODE_COLLECTION_STATE: ClassVar[KeywordField] = KeywordField("modeCollectionState", "modeCollectionState") + MODE_COLLECTION_STATE: ClassVar[KeywordField] = KeywordField( + "modeCollectionState", "modeCollectionState" + ) """ State of this collection. """ @@ -66,7 +70,9 @@ def mode_collection_type(self, mode_collection_type: Optional[str]): @property def mode_collection_state(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mode_collection_state + return ( + None if self.attributes is None else self.attributes.mode_collection_state + ) @mode_collection_state.setter def mode_collection_state(self, mode_collection_state: Optional[str]): @@ -97,8 +103,12 @@ def mode_reports(self, mode_reports: Optional[List[ModeReport]]): class Attributes(Mode.Attributes): mode_collection_type: Optional[str] = Field(default=None, description="") mode_collection_state: Optional[str] = Field(default=None, description="") - mode_workspace: Optional[ModeWorkspace] = Field(default=None, description="") # relationship - mode_reports: Optional[List[ModeReport]] = Field(default=None, description="") # relationship + mode_workspace: Optional[ModeWorkspace] = Field( + default=None, description="" + ) # relationship + mode_reports: Optional[List[ModeReport]] = Field( + default=None, description="" + ) # relationship attributes: ModeCollection.Attributes = Field( default_factory=lambda: ModeCollection.Attributes(), diff --git a/pyatlan/model/assets/mode_query.py b/pyatlan/model/assets/mode_query.py index 867b73e30..4ff140c93 100644 --- a/pyatlan/model/assets/mode_query.py +++ b/pyatlan/model/assets/mode_query.py @@ -33,7 +33,9 @@ def __setattr__(self, name, value): """ """ - MODE_REPORT_IMPORT_COUNT: ClassVar[NumericField] = NumericField("modeReportImportCount", "modeReportImportCount") + MODE_REPORT_IMPORT_COUNT: ClassVar[NumericField] = NumericField( + "modeReportImportCount", "modeReportImportCount" + ) """ """ @@ -66,7 +68,11 @@ def mode_raw_query(self, mode_raw_query: Optional[str]): @property def mode_report_import_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mode_report_import_count + return ( + None + if self.attributes is None + else self.attributes.mode_report_import_count + ) @mode_report_import_count.setter def mode_report_import_count(self, mode_report_import_count: Optional[int]): @@ -97,8 +103,12 @@ def mode_charts(self, mode_charts: Optional[List[ModeChart]]): class Attributes(Mode.Attributes): mode_raw_query: Optional[str] = Field(default=None, description="") mode_report_import_count: Optional[int] = Field(default=None, description="") - mode_report: Optional[ModeReport] = Field(default=None, description="") # relationship - mode_charts: Optional[List[ModeChart]] = Field(default=None, description="") # relationship + mode_report: Optional[ModeReport] = Field( + default=None, description="" + ) # relationship + mode_charts: Optional[List[ModeChart]] = Field( + default=None, description="" + ) # relationship attributes: ModeQuery.Attributes = Field( default_factory=lambda: ModeQuery.Attributes(), diff --git a/pyatlan/model/assets/mode_report.py b/pyatlan/model/assets/mode_report.py index 2b0ba055c..e87807862 100644 --- a/pyatlan/model/assets/mode_report.py +++ b/pyatlan/model/assets/mode_report.py @@ -36,31 +36,45 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODE_COLLECTION_TOKEN: ClassVar[KeywordField] = KeywordField("modeCollectionToken", "modeCollectionToken") + MODE_COLLECTION_TOKEN: ClassVar[KeywordField] = KeywordField( + "modeCollectionToken", "modeCollectionToken" + ) """ """ - MODE_REPORT_PUBLISHED_AT: ClassVar[NumericField] = NumericField("modeReportPublishedAt", "modeReportPublishedAt") + MODE_REPORT_PUBLISHED_AT: ClassVar[NumericField] = NumericField( + "modeReportPublishedAt", "modeReportPublishedAt" + ) """ """ - MODE_QUERY_COUNT: ClassVar[NumericField] = NumericField("modeQueryCount", "modeQueryCount") + MODE_QUERY_COUNT: ClassVar[NumericField] = NumericField( + "modeQueryCount", "modeQueryCount" + ) """ """ - MODE_CHART_COUNT: ClassVar[NumericField] = NumericField("modeChartCount", "modeChartCount") + MODE_CHART_COUNT: ClassVar[NumericField] = NumericField( + "modeChartCount", "modeChartCount" + ) """ """ - MODE_QUERY_PREVIEW: ClassVar[TextField] = TextField("modeQueryPreview", "modeQueryPreview") + MODE_QUERY_PREVIEW: ClassVar[TextField] = TextField( + "modeQueryPreview", "modeQueryPreview" + ) """ """ - MODE_IS_PUBLIC: ClassVar[BooleanField] = BooleanField("modeIsPublic", "modeIsPublic") + MODE_IS_PUBLIC: ClassVar[BooleanField] = BooleanField( + "modeIsPublic", "modeIsPublic" + ) """ """ - MODE_IS_SHARED: ClassVar[BooleanField] = BooleanField("modeIsShared", "modeIsShared") + MODE_IS_SHARED: ClassVar[BooleanField] = BooleanField( + "modeIsShared", "modeIsShared" + ) """ """ @@ -88,7 +102,9 @@ def __setattr__(self, name, value): @property def mode_collection_token(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.mode_collection_token + return ( + None if self.attributes is None else self.attributes.mode_collection_token + ) @mode_collection_token.setter def mode_collection_token(self, mode_collection_token: Optional[str]): @@ -98,7 +114,11 @@ def mode_collection_token(self, mode_collection_token: Optional[str]): @property def mode_report_published_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.mode_report_published_at + return ( + None + if self.attributes is None + else self.attributes.mode_report_published_at + ) @mode_report_published_at.setter def mode_report_published_at(self, mode_report_published_at: Optional[datetime]): @@ -178,14 +198,20 @@ def mode_collections(self, mode_collections: Optional[List[ModeCollection]]): class Attributes(Mode.Attributes): mode_collection_token: Optional[str] = Field(default=None, description="") - mode_report_published_at: Optional[datetime] = Field(default=None, description="") + mode_report_published_at: Optional[datetime] = Field( + default=None, description="" + ) mode_query_count: Optional[int] = Field(default=None, description="") mode_chart_count: Optional[int] = Field(default=None, description="") mode_query_preview: Optional[str] = Field(default=None, description="") mode_is_public: Optional[bool] = Field(default=None, description="") mode_is_shared: Optional[bool] = Field(default=None, description="") - mode_queries: Optional[List[ModeQuery]] = Field(default=None, description="") # relationship - mode_collections: Optional[List[ModeCollection]] = Field(default=None, description="") # relationship + mode_queries: Optional[List[ModeQuery]] = Field( + default=None, description="" + ) # relationship + mode_collections: Optional[List[ModeCollection]] = Field( + default=None, description="" + ) # relationship attributes: ModeReport.Attributes = Field( default_factory=lambda: ModeReport.Attributes(), diff --git a/pyatlan/model/assets/mode_workspace.py b/pyatlan/model/assets/mode_workspace.py index d7a762566..bbd9e8240 100644 --- a/pyatlan/model/assets/mode_workspace.py +++ b/pyatlan/model/assets/mode_workspace.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - MODE_COLLECTION_COUNT: ClassVar[NumericField] = NumericField("modeCollectionCount", "modeCollectionCount") + MODE_COLLECTION_COUNT: ClassVar[NumericField] = NumericField( + "modeCollectionCount", "modeCollectionCount" + ) """ Number of collections in this workspace. """ @@ -46,7 +48,9 @@ def __setattr__(self, name, value): @property def mode_collection_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.mode_collection_count + return ( + None if self.attributes is None else self.attributes.mode_collection_count + ) @mode_collection_count.setter def mode_collection_count(self, mode_collection_count: Optional[int]): @@ -66,7 +70,9 @@ def mode_collections(self, mode_collections: Optional[List[ModeCollection]]): class Attributes(Mode.Attributes): mode_collection_count: Optional[int] = Field(default=None, description="") - mode_collections: Optional[List[ModeCollection]] = Field(default=None, description="") # relationship + mode_collections: Optional[List[ModeCollection]] = Field( + default=None, description="" + ) # relationship attributes: ModeWorkspace.Attributes = Field( default_factory=lambda: ModeWorkspace.Attributes(), diff --git a/pyatlan/model/assets/multi_dimensional_dataset.py b/pyatlan/model/assets/multi_dimensional_dataset.py index af58deb7f..2e328493a 100644 --- a/pyatlan/model/assets/multi_dimensional_dataset.py +++ b/pyatlan/model/assets/multi_dimensional_dataset.py @@ -29,11 +29,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - CUBE_NAME: ClassVar[KeywordTextField] = KeywordTextField("cubeName", "cubeName.keyword", "cubeName") + CUBE_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "cubeName", "cubeName.keyword", "cubeName" + ) """ Simple name of the cube in which this asset exists, or empty if it is itself a cube. """ - CUBE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("cubeQualifiedName", "cubeQualifiedName") + CUBE_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "cubeQualifiedName", "cubeQualifiedName" + ) """ Unique name of the cube in which this asset exists, or empty if it is itself a cube. """ @@ -103,10 +107,16 @@ def cube_dimension_name(self, cube_dimension_name: Optional[str]): @property def cube_dimension_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cube_dimension_qualified_name + return ( + None + if self.attributes is None + else self.attributes.cube_dimension_qualified_name + ) @cube_dimension_qualified_name.setter - def cube_dimension_qualified_name(self, cube_dimension_qualified_name: Optional[str]): + def cube_dimension_qualified_name( + self, cube_dimension_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cube_dimension_qualified_name = cube_dimension_qualified_name @@ -123,10 +133,16 @@ def cube_hierarchy_name(self, cube_hierarchy_name: Optional[str]): @property def cube_hierarchy_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.cube_hierarchy_qualified_name + return ( + None + if self.attributes is None + else self.attributes.cube_hierarchy_qualified_name + ) @cube_hierarchy_qualified_name.setter - def cube_hierarchy_qualified_name(self, cube_hierarchy_qualified_name: Optional[str]): + def cube_hierarchy_qualified_name( + self, cube_hierarchy_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.cube_hierarchy_qualified_name = cube_hierarchy_qualified_name @@ -135,9 +151,13 @@ class Attributes(Catalog.Attributes): cube_name: Optional[str] = Field(default=None, description="") cube_qualified_name: Optional[str] = Field(default=None, description="") cube_dimension_name: Optional[str] = Field(default=None, description="") - cube_dimension_qualified_name: Optional[str] = Field(default=None, description="") + cube_dimension_qualified_name: Optional[str] = Field( + default=None, description="" + ) cube_hierarchy_name: Optional[str] = Field(default=None, description="") - cube_hierarchy_qualified_name: Optional[str] = Field(default=None, description="") + cube_hierarchy_qualified_name: Optional[str] = Field( + default=None, description="" + ) attributes: MultiDimensionalDataset.Attributes = Field( default_factory=lambda: MultiDimensionalDataset.Attributes(), diff --git a/pyatlan/model/assets/preset.py b/pyatlan/model/assets/preset.py index 315e50093..04b98621c 100644 --- a/pyatlan/model/assets/preset.py +++ b/pyatlan/model/assets/preset.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - PRESET_WORKSPACE_ID: ClassVar[NumericField] = NumericField("presetWorkspaceId", "presetWorkspaceId") + PRESET_WORKSPACE_ID: ClassVar[NumericField] = NumericField( + "presetWorkspaceId", "presetWorkspaceId" + ) """ Identifier of the workspace in which this asset exists, in Preset. """ @@ -41,7 +43,9 @@ def __setattr__(self, name, value): """ Unique name of the workspace in which this asset exists. """ - PRESET_DASHBOARD_ID: ClassVar[NumericField] = NumericField("presetDashboardId", "presetDashboardId") + PRESET_DASHBOARD_ID: ClassVar[NumericField] = NumericField( + "presetDashboardId", "presetDashboardId" + ) """ Identifier of the dashboard in which this asset exists, in Preset. """ @@ -73,13 +77,21 @@ def preset_workspace_id(self, preset_workspace_id: Optional[int]): @property def preset_workspace_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.preset_workspace_qualified_name + return ( + None + if self.attributes is None + else self.attributes.preset_workspace_qualified_name + ) @preset_workspace_qualified_name.setter - def preset_workspace_qualified_name(self, preset_workspace_qualified_name: Optional[str]): + def preset_workspace_qualified_name( + self, preset_workspace_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_workspace_qualified_name = preset_workspace_qualified_name + self.attributes.preset_workspace_qualified_name = ( + preset_workspace_qualified_name + ) @property def preset_dashboard_id(self) -> Optional[int]: @@ -93,19 +105,31 @@ def preset_dashboard_id(self, preset_dashboard_id: Optional[int]): @property def preset_dashboard_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.preset_dashboard_qualified_name + return ( + None + if self.attributes is None + else self.attributes.preset_dashboard_qualified_name + ) @preset_dashboard_qualified_name.setter - def preset_dashboard_qualified_name(self, preset_dashboard_qualified_name: Optional[str]): + def preset_dashboard_qualified_name( + self, preset_dashboard_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_dashboard_qualified_name = preset_dashboard_qualified_name + self.attributes.preset_dashboard_qualified_name = ( + preset_dashboard_qualified_name + ) class Attributes(BI.Attributes): preset_workspace_id: Optional[int] = Field(default=None, description="") - preset_workspace_qualified_name: Optional[str] = Field(default=None, description="") + preset_workspace_qualified_name: Optional[str] = Field( + default=None, description="" + ) preset_dashboard_id: Optional[int] = Field(default=None, description="") - preset_dashboard_qualified_name: Optional[str] = Field(default=None, description="") + preset_dashboard_qualified_name: Optional[str] = Field( + default=None, description="" + ) attributes: Preset.Attributes = Field( default_factory=lambda: Preset.Attributes(), diff --git a/pyatlan/model/assets/preset_chart.py b/pyatlan/model/assets/preset_chart.py index 2157da924..69a447c0f 100644 --- a/pyatlan/model/assets/preset_chart.py +++ b/pyatlan/model/assets/preset_chart.py @@ -62,11 +62,15 @@ def creator( @init_guid def create(cls, *, name: str, preset_dashboard_qualified_name: str) -> PresetChart: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name) + return cls.creator( + name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name + ) type_name: str = Field(default="PresetChart", allow_mutation=False) @@ -87,7 +91,9 @@ def __setattr__(self, name, value): """ """ - PRESET_CHART_FORM_DATA: ClassVar[KeywordField] = KeywordField("presetChartFormData", "presetChartFormData") + PRESET_CHART_FORM_DATA: ClassVar[KeywordField] = KeywordField( + "presetChartFormData", "presetChartFormData" + ) """ """ @@ -105,17 +111,27 @@ def __setattr__(self, name, value): @property def preset_chart_description_markdown(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.preset_chart_description_markdown + return ( + None + if self.attributes is None + else self.attributes.preset_chart_description_markdown + ) @preset_chart_description_markdown.setter - def preset_chart_description_markdown(self, preset_chart_description_markdown: Optional[str]): + def preset_chart_description_markdown( + self, preset_chart_description_markdown: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_chart_description_markdown = preset_chart_description_markdown + self.attributes.preset_chart_description_markdown = ( + preset_chart_description_markdown + ) @property def preset_chart_form_data(self) -> Optional[Dict[str, str]]: - return None if self.attributes is None else self.attributes.preset_chart_form_data + return ( + None if self.attributes is None else self.attributes.preset_chart_form_data + ) @preset_chart_form_data.setter def preset_chart_form_data(self, preset_chart_form_data: Optional[Dict[str, str]]): @@ -134,9 +150,15 @@ def preset_dashboard(self, preset_dashboard: Optional[PresetDashboard]): self.attributes.preset_dashboard = preset_dashboard class Attributes(Preset.Attributes): - preset_chart_description_markdown: Optional[str] = Field(default=None, description="") - preset_chart_form_data: Optional[Dict[str, str]] = Field(default=None, description="") - preset_dashboard: Optional[PresetDashboard] = Field(default=None, description="") # relationship + preset_chart_description_markdown: Optional[str] = Field( + default=None, description="" + ) + preset_chart_form_data: Optional[Dict[str, str]] = Field( + default=None, description="" + ) + preset_dashboard: Optional[PresetDashboard] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -152,7 +174,9 @@ def create( [name, preset_dashboard_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( preset_dashboard_qualified_name, @@ -166,7 +190,9 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{preset_dashboard_qualified_name}/{name}", connector_name=connector_name, - preset_dashboard=PresetDashboard.ref_by_qualified_name(preset_dashboard_qualified_name), + preset_dashboard=PresetDashboard.ref_by_qualified_name( + preset_dashboard_qualified_name + ), ) attributes: PresetChart.Attributes = Field( diff --git a/pyatlan/model/assets/preset_dashboard.py b/pyatlan/model/assets/preset_dashboard.py index 70a6c13ff..ec80a2faf 100644 --- a/pyatlan/model/assets/preset_dashboard.py +++ b/pyatlan/model/assets/preset_dashboard.py @@ -66,13 +66,19 @@ def creator( @classmethod @init_guid - def create(cls, *, name: str, preset_workspace_qualified_name: str) -> PresetDashboard: + def create( + cls, *, name: str, preset_workspace_qualified_name: str + ) -> PresetDashboard: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, preset_workspace_qualified_name=preset_workspace_qualified_name) + return cls.creator( + name=name, preset_workspace_qualified_name=preset_workspace_qualified_name + ) type_name: str = Field(default="PresetDashboard", allow_mutation=False) @@ -87,11 +93,13 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - PRESET_DASHBOARD_CHANGED_BY_NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( - "presetDashboardChangedByName", - "presetDashboardChangedByName.keyword", - "presetDashboardChangedByName", - "presetDashboardChangedByName.stemmed", + PRESET_DASHBOARD_CHANGED_BY_NAME: ClassVar[KeywordTextStemmedField] = ( + KeywordTextStemmedField( + "presetDashboardChangedByName", + "presetDashboardChangedByName.keyword", + "presetDashboardChangedByName", + "presetDashboardChangedByName.stemmed", + ) ) """ @@ -154,57 +162,97 @@ def __setattr__(self, name, value): @property def preset_dashboard_changed_by_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.preset_dashboard_changed_by_name + return ( + None + if self.attributes is None + else self.attributes.preset_dashboard_changed_by_name + ) @preset_dashboard_changed_by_name.setter - def preset_dashboard_changed_by_name(self, preset_dashboard_changed_by_name: Optional[str]): + def preset_dashboard_changed_by_name( + self, preset_dashboard_changed_by_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_dashboard_changed_by_name = preset_dashboard_changed_by_name + self.attributes.preset_dashboard_changed_by_name = ( + preset_dashboard_changed_by_name + ) @property def preset_dashboard_changed_by_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.preset_dashboard_changed_by_url + return ( + None + if self.attributes is None + else self.attributes.preset_dashboard_changed_by_url + ) @preset_dashboard_changed_by_url.setter - def preset_dashboard_changed_by_url(self, preset_dashboard_changed_by_url: Optional[str]): + def preset_dashboard_changed_by_url( + self, preset_dashboard_changed_by_url: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_dashboard_changed_by_url = preset_dashboard_changed_by_url + self.attributes.preset_dashboard_changed_by_url = ( + preset_dashboard_changed_by_url + ) @property def preset_dashboard_is_managed_externally(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.preset_dashboard_is_managed_externally + return ( + None + if self.attributes is None + else self.attributes.preset_dashboard_is_managed_externally + ) @preset_dashboard_is_managed_externally.setter - def preset_dashboard_is_managed_externally(self, preset_dashboard_is_managed_externally: Optional[bool]): + def preset_dashboard_is_managed_externally( + self, preset_dashboard_is_managed_externally: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_dashboard_is_managed_externally = preset_dashboard_is_managed_externally + self.attributes.preset_dashboard_is_managed_externally = ( + preset_dashboard_is_managed_externally + ) @property def preset_dashboard_is_published(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.preset_dashboard_is_published + return ( + None + if self.attributes is None + else self.attributes.preset_dashboard_is_published + ) @preset_dashboard_is_published.setter - def preset_dashboard_is_published(self, preset_dashboard_is_published: Optional[bool]): + def preset_dashboard_is_published( + self, preset_dashboard_is_published: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.preset_dashboard_is_published = preset_dashboard_is_published @property def preset_dashboard_thumbnail_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.preset_dashboard_thumbnail_url + return ( + None + if self.attributes is None + else self.attributes.preset_dashboard_thumbnail_url + ) @preset_dashboard_thumbnail_url.setter - def preset_dashboard_thumbnail_url(self, preset_dashboard_thumbnail_url: Optional[str]): + def preset_dashboard_thumbnail_url( + self, preset_dashboard_thumbnail_url: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.preset_dashboard_thumbnail_url = preset_dashboard_thumbnail_url @property def preset_dashboard_chart_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.preset_dashboard_chart_count + return ( + None + if self.attributes is None + else self.attributes.preset_dashboard_chart_count + ) @preset_dashboard_chart_count.setter def preset_dashboard_chart_count(self, preset_dashboard_chart_count: Optional[int]): @@ -243,15 +291,33 @@ def preset_workspace(self, preset_workspace: Optional[PresetWorkspace]): self.attributes.preset_workspace = preset_workspace class Attributes(Preset.Attributes): - preset_dashboard_changed_by_name: Optional[str] = Field(default=None, description="") - preset_dashboard_changed_by_url: Optional[str] = Field(default=None, description="") - preset_dashboard_is_managed_externally: Optional[bool] = Field(default=None, description="") - preset_dashboard_is_published: Optional[bool] = Field(default=None, description="") - preset_dashboard_thumbnail_url: Optional[str] = Field(default=None, description="") - preset_dashboard_chart_count: Optional[int] = Field(default=None, description="") - preset_datasets: Optional[List[PresetDataset]] = Field(default=None, description="") # relationship - preset_charts: Optional[List[PresetChart]] = Field(default=None, description="") # relationship - preset_workspace: Optional[PresetWorkspace] = Field(default=None, description="") # relationship + preset_dashboard_changed_by_name: Optional[str] = Field( + default=None, description="" + ) + preset_dashboard_changed_by_url: Optional[str] = Field( + default=None, description="" + ) + preset_dashboard_is_managed_externally: Optional[bool] = Field( + default=None, description="" + ) + preset_dashboard_is_published: Optional[bool] = Field( + default=None, description="" + ) + preset_dashboard_thumbnail_url: Optional[str] = Field( + default=None, description="" + ) + preset_dashboard_chart_count: Optional[int] = Field( + default=None, description="" + ) + preset_datasets: Optional[List[PresetDataset]] = Field( + default=None, description="" + ) # relationship + preset_charts: Optional[List[PresetChart]] = Field( + default=None, description="" + ) # relationship + preset_workspace: Optional[PresetWorkspace] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -267,7 +333,9 @@ def create( [name, preset_workspace_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( preset_workspace_qualified_name, @@ -281,7 +349,9 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{preset_workspace_qualified_name}/{name}", connector_name=connector_name, - preset_workspace=PresetWorkspace.ref_by_qualified_name(preset_workspace_qualified_name), + preset_workspace=PresetWorkspace.ref_by_qualified_name( + preset_workspace_qualified_name + ), ) attributes: PresetDashboard.Attributes = Field( diff --git a/pyatlan/model/assets/preset_dataset.py b/pyatlan/model/assets/preset_dataset.py index bdb63fc2a..b2a546774 100644 --- a/pyatlan/model/assets/preset_dataset.py +++ b/pyatlan/model/assets/preset_dataset.py @@ -65,13 +65,19 @@ def creator( @classmethod @init_guid - def create(cls, *, name: str, preset_dashboard_qualified_name: str) -> PresetDataset: + def create( + cls, *, name: str, preset_dashboard_qualified_name: str + ) -> PresetDataset: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name) + return cls.creator( + name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name + ) type_name: str = Field(default="PresetDataset", allow_mutation=False) @@ -86,20 +92,26 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - PRESET_DATASET_DATASOURCE_NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( - "presetDatasetDatasourceName", - "presetDatasetDatasourceName.keyword", - "presetDatasetDatasourceName", - "presetDatasetDatasourceName.stemmed", + PRESET_DATASET_DATASOURCE_NAME: ClassVar[KeywordTextStemmedField] = ( + KeywordTextStemmedField( + "presetDatasetDatasourceName", + "presetDatasetDatasourceName.keyword", + "presetDatasetDatasourceName", + "presetDatasetDatasourceName.stemmed", + ) ) """ """ - PRESET_DATASET_ID: ClassVar[NumericField] = NumericField("presetDatasetId", "presetDatasetId") + PRESET_DATASET_ID: ClassVar[NumericField] = NumericField( + "presetDatasetId", "presetDatasetId" + ) """ """ - PRESET_DATASET_TYPE: ClassVar[KeywordField] = KeywordField("presetDatasetType", "presetDatasetType") + PRESET_DATASET_TYPE: ClassVar[KeywordField] = KeywordField( + "presetDatasetType", "presetDatasetType" + ) """ """ @@ -118,10 +130,16 @@ def __setattr__(self, name, value): @property def preset_dataset_datasource_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.preset_dataset_datasource_name + return ( + None + if self.attributes is None + else self.attributes.preset_dataset_datasource_name + ) @preset_dataset_datasource_name.setter - def preset_dataset_datasource_name(self, preset_dataset_datasource_name: Optional[str]): + def preset_dataset_datasource_name( + self, preset_dataset_datasource_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.preset_dataset_datasource_name = preset_dataset_datasource_name @@ -157,10 +175,14 @@ def preset_dashboard(self, preset_dashboard: Optional[PresetDashboard]): self.attributes.preset_dashboard = preset_dashboard class Attributes(Preset.Attributes): - preset_dataset_datasource_name: Optional[str] = Field(default=None, description="") + preset_dataset_datasource_name: Optional[str] = Field( + default=None, description="" + ) preset_dataset_id: Optional[int] = Field(default=None, description="") preset_dataset_type: Optional[str] = Field(default=None, description="") - preset_dashboard: Optional[PresetDashboard] = Field(default=None, description="") # relationship + preset_dashboard: Optional[PresetDashboard] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -176,7 +198,9 @@ def create( [name, preset_dashboard_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( preset_dashboard_qualified_name, @@ -190,7 +214,9 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{preset_dashboard_qualified_name}/{name}", connector_name=connector_name, - preset_dashboard=PresetDashboard.ref_by_qualified_name(preset_dashboard_qualified_name), + preset_dashboard=PresetDashboard.ref_by_qualified_name( + preset_dashboard_qualified_name + ), ) attributes: PresetDataset.Attributes = Field( diff --git a/pyatlan/model/assets/preset_workspace.py b/pyatlan/model/assets/preset_workspace.py index c6201034b..d1a67a658 100644 --- a/pyatlan/model/assets/preset_workspace.py +++ b/pyatlan/model/assets/preset_workspace.py @@ -28,19 +28,27 @@ class PresetWorkspace(Preset): @classmethod @init_guid def creator(cls, *, name: str, connection_qualified_name: str) -> PresetWorkspace: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) - attributes = PresetWorkspace.Attributes.create(name=name, connection_qualified_name=connection_qualified_name) + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) + attributes = PresetWorkspace.Attributes.create( + name=name, connection_qualified_name=connection_qualified_name + ) return cls(attributes=attributes) @classmethod @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> PresetWorkspace: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, connection_qualified_name=connection_qualified_name) + return cls.creator( + name=name, connection_qualified_name=connection_qualified_name + ) type_name: str = Field(default="PresetWorkspace", allow_mutation=False) @@ -88,7 +96,9 @@ def __setattr__(self, name, value): """ """ - PRESET_WORKSPACE_STATUS: ClassVar[KeywordField] = KeywordField("presetWorkspaceStatus", "presetWorkspaceStatus") + PRESET_WORKSPACE_STATUS: ClassVar[KeywordField] = KeywordField( + "presetWorkspaceStatus", "presetWorkspaceStatus" + ) """ """ @@ -131,17 +141,29 @@ def __setattr__(self, name, value): @property def preset_workspace_public_dashboards_allowed(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.preset_workspace_public_dashboards_allowed + return ( + None + if self.attributes is None + else self.attributes.preset_workspace_public_dashboards_allowed + ) @preset_workspace_public_dashboards_allowed.setter - def preset_workspace_public_dashboards_allowed(self, preset_workspace_public_dashboards_allowed: Optional[bool]): + def preset_workspace_public_dashboards_allowed( + self, preset_workspace_public_dashboards_allowed: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_workspace_public_dashboards_allowed = preset_workspace_public_dashboards_allowed + self.attributes.preset_workspace_public_dashboards_allowed = ( + preset_workspace_public_dashboards_allowed + ) @property def preset_workspace_cluster_id(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.preset_workspace_cluster_id + return ( + None + if self.attributes is None + else self.attributes.preset_workspace_cluster_id + ) @preset_workspace_cluster_id.setter def preset_workspace_cluster_id(self, preset_workspace_cluster_id: Optional[int]): @@ -151,7 +173,11 @@ def preset_workspace_cluster_id(self, preset_workspace_cluster_id: Optional[int] @property def preset_workspace_hostname(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.preset_workspace_hostname + return ( + None + if self.attributes is None + else self.attributes.preset_workspace_hostname + ) @preset_workspace_hostname.setter def preset_workspace_hostname(self, preset_workspace_hostname: Optional[str]): @@ -161,17 +187,27 @@ def preset_workspace_hostname(self, preset_workspace_hostname: Optional[str]): @property def preset_workspace_is_in_maintenance_mode(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.preset_workspace_is_in_maintenance_mode + return ( + None + if self.attributes is None + else self.attributes.preset_workspace_is_in_maintenance_mode + ) @preset_workspace_is_in_maintenance_mode.setter - def preset_workspace_is_in_maintenance_mode(self, preset_workspace_is_in_maintenance_mode: Optional[bool]): + def preset_workspace_is_in_maintenance_mode( + self, preset_workspace_is_in_maintenance_mode: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_workspace_is_in_maintenance_mode = preset_workspace_is_in_maintenance_mode + self.attributes.preset_workspace_is_in_maintenance_mode = ( + preset_workspace_is_in_maintenance_mode + ) @property def preset_workspace_region(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.preset_workspace_region + return ( + None if self.attributes is None else self.attributes.preset_workspace_region + ) @preset_workspace_region.setter def preset_workspace_region(self, preset_workspace_region: Optional[str]): @@ -181,7 +217,9 @@ def preset_workspace_region(self, preset_workspace_region: Optional[str]): @property def preset_workspace_status(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.preset_workspace_status + return ( + None if self.attributes is None else self.attributes.preset_workspace_status + ) @preset_workspace_status.setter def preset_workspace_status(self, preset_workspace_status: Optional[str]): @@ -191,30 +229,50 @@ def preset_workspace_status(self, preset_workspace_status: Optional[str]): @property def preset_workspace_deployment_id(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.preset_workspace_deployment_id + return ( + None + if self.attributes is None + else self.attributes.preset_workspace_deployment_id + ) @preset_workspace_deployment_id.setter - def preset_workspace_deployment_id(self, preset_workspace_deployment_id: Optional[int]): + def preset_workspace_deployment_id( + self, preset_workspace_deployment_id: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.preset_workspace_deployment_id = preset_workspace_deployment_id @property def preset_workspace_dashboard_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.preset_workspace_dashboard_count + return ( + None + if self.attributes is None + else self.attributes.preset_workspace_dashboard_count + ) @preset_workspace_dashboard_count.setter - def preset_workspace_dashboard_count(self, preset_workspace_dashboard_count: Optional[int]): + def preset_workspace_dashboard_count( + self, preset_workspace_dashboard_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.preset_workspace_dashboard_count = preset_workspace_dashboard_count + self.attributes.preset_workspace_dashboard_count = ( + preset_workspace_dashboard_count + ) @property def preset_workspace_dataset_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.preset_workspace_dataset_count + return ( + None + if self.attributes is None + else self.attributes.preset_workspace_dataset_count + ) @preset_workspace_dataset_count.setter - def preset_workspace_dataset_count(self, preset_workspace_dataset_count: Optional[int]): + def preset_workspace_dataset_count( + self, preset_workspace_dataset_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.preset_workspace_dataset_count = preset_workspace_dataset_count @@ -230,26 +288,44 @@ def preset_dashboards(self, preset_dashboards: Optional[List[PresetDashboard]]): self.attributes.preset_dashboards = preset_dashboards class Attributes(Preset.Attributes): - preset_workspace_public_dashboards_allowed: Optional[bool] = Field(default=None, description="") + preset_workspace_public_dashboards_allowed: Optional[bool] = Field( + default=None, description="" + ) preset_workspace_cluster_id: Optional[int] = Field(default=None, description="") preset_workspace_hostname: Optional[str] = Field(default=None, description="") - preset_workspace_is_in_maintenance_mode: Optional[bool] = Field(default=None, description="") + preset_workspace_is_in_maintenance_mode: Optional[bool] = Field( + default=None, description="" + ) preset_workspace_region: Optional[str] = Field(default=None, description="") preset_workspace_status: Optional[str] = Field(default=None, description="") - preset_workspace_deployment_id: Optional[int] = Field(default=None, description="") - preset_workspace_dashboard_count: Optional[int] = Field(default=None, description="") - preset_workspace_dataset_count: Optional[int] = Field(default=None, description="") - preset_dashboards: Optional[List[PresetDashboard]] = Field(default=None, description="") # relationship + preset_workspace_deployment_id: Optional[int] = Field( + default=None, description="" + ) + preset_workspace_dashboard_count: Optional[int] = Field( + default=None, description="" + ) + preset_workspace_dataset_count: Optional[int] = Field( + default=None, description="" + ) + preset_dashboards: Optional[List[PresetDashboard]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def create(cls, *, name: str, connection_qualified_name: str) -> PresetWorkspace.Attributes: - validate_required_fields(["name", "connection_qualified_name"], [name, connection_qualified_name]) + def create( + cls, *, name: str, connection_qualified_name: str + ) -> PresetWorkspace.Attributes: + validate_required_fields( + ["name", "connection_qualified_name"], [name, connection_qualified_name] + ) return PresetWorkspace.Attributes( name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: PresetWorkspace.Attributes = Field( diff --git a/pyatlan/model/assets/purpose.py b/pyatlan/model/assets/purpose.py index a64be34e6..f25a792c6 100644 --- a/pyatlan/model/assets/purpose.py +++ b/pyatlan/model/assets/purpose.py @@ -39,7 +39,9 @@ def creator(cls, *, name: str, atlan_tags: List[AtlanTagName]) -> Purpose: @init_guid def create(cls, *, name: str, atlan_tags: List[AtlanTagName]) -> Purpose: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -81,7 +83,9 @@ def create_metadata_policy( for group_name in policy_groups: if not GroupCache.get_id_for_name(group_name): - raise ValueError(f"Provided group name {group_name} was not found in Atlan.") + raise ValueError( + f"Provided group name {group_name} was not found in Atlan." + ) target_found = True policy.policy_groups = policy_groups else: @@ -91,7 +95,9 @@ def create_metadata_policy( for username in policy_users: if not UserCache.get_id_for_name(username): - raise ValueError(f"Provided username {username} was not found in Atlan.") + raise ValueError( + f"Provided username {username} was not found in Atlan." + ) target_found = True policy.policy_users = policy_users else: @@ -112,7 +118,9 @@ def create_data_policy( policy_users: Optional[Set[str]] = None, all_users: bool = False, ) -> AuthPolicy: - validate_required_fields(["name", "purpose_id", "policy_type"], [name, purpose_id, policy_type]) + validate_required_fields( + ["name", "purpose_id", "policy_type"], [name, purpose_id, policy_type] + ) policy = AuthPolicy._AuthPolicy__create(name=name) # type: ignore[attr-defined] policy.policy_actions = {DataAction.SELECT.value} policy.policy_category = AuthPolicyCategory.PURPOSE.value @@ -132,7 +140,9 @@ def create_data_policy( for group_name in policy_groups: if not GroupCache.get_id_for_name(group_name): - raise ValueError(f"Provided group name {group_name} was not found in Atlan.") + raise ValueError( + f"Provided group name {group_name} was not found in Atlan." + ) target_found = True policy.policy_groups = policy_groups else: @@ -142,7 +152,9 @@ def create_data_policy( for username in policy_users: if not UserCache.get_id_for_name(username): - raise ValueError(f"Provided username {username} was not found in Atlan.") + raise ValueError( + f"Provided username {username} was not found in Atlan." + ) target_found = True policy.policy_users = policy_users else: @@ -180,11 +192,15 @@ def create_for_modification( is_enabled: bool = True, ) -> Purpose: warn( - ("This method is deprecated, please use 'updater' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'updater' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.updater(qualified_name=qualified_name, name=name, is_enabled=is_enabled) + return cls.updater( + qualified_name=qualified_name, name=name, is_enabled=is_enabled + ) type_name: str = Field(default="Purpose", allow_mutation=False) @@ -199,7 +215,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - PURPOSE_CLASSIFICATIONS: ClassVar[KeywordField] = KeywordField("purposeClassifications", "purposeClassifications") + PURPOSE_CLASSIFICATIONS: ClassVar[KeywordField] = KeywordField( + "purposeClassifications", "purposeClassifications" + ) """ TBC """ @@ -219,11 +237,15 @@ def purpose_atlan_tags(self, purpose_atlan_tags: Optional[List[AtlanTagName]]): self.attributes.purpose_atlan_tags = purpose_atlan_tags class Attributes(AccessControl.Attributes): - purpose_atlan_tags: Optional[List[AtlanTagName]] = Field(default=None, description="") + purpose_atlan_tags: Optional[List[AtlanTagName]] = Field( + default=None, description="" + ) @classmethod @init_guid - def create(cls, name: str, atlan_tags: List[AtlanTagName]) -> Purpose.Attributes: + def create( + cls, name: str, atlan_tags: List[AtlanTagName] + ) -> Purpose.Attributes: validate_required_fields(["name", "atlan_tags"], [name, atlan_tags]) return Purpose.Attributes( qualified_name=name, diff --git a/pyatlan/model/assets/qlik.py b/pyatlan/model/assets/qlik.py index 7a2414b7c..4ba4da568 100644 --- a/pyatlan/model/assets/qlik.py +++ b/pyatlan/model/assets/qlik.py @@ -37,7 +37,9 @@ def __setattr__(self, name, value): """ Identifier of this asset, from Qlik. """ - QLIK_QRI: ClassVar[KeywordTextField] = KeywordTextField("qlikQRI", "qlikQRI", "qlikQRI.text") + QLIK_QRI: ClassVar[KeywordTextField] = KeywordTextField( + "qlikQRI", "qlikQRI", "qlikQRI.text" + ) """ Unique QRI of this asset, from Qlik. """ @@ -67,7 +69,9 @@ def __setattr__(self, name, value): """ Identifier of the owner of this asset, in Qlik. """ - QLIK_IS_PUBLISHED: ClassVar[BooleanField] = BooleanField("qlikIsPublished", "qlikIsPublished") + QLIK_IS_PUBLISHED: ClassVar[BooleanField] = BooleanField( + "qlikIsPublished", "qlikIsPublished" + ) """ Whether this asset is published in Qlik (true) or not (false). """ @@ -115,7 +119,11 @@ def qlik_space_id(self, qlik_space_id: Optional[str]): @property def qlik_space_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.qlik_space_qualified_name + return ( + None + if self.attributes is None + else self.attributes.qlik_space_qualified_name + ) @qlik_space_qualified_name.setter def qlik_space_qualified_name(self, qlik_space_qualified_name: Optional[str]): @@ -135,7 +143,9 @@ def qlik_app_id(self, qlik_app_id: Optional[str]): @property def qlik_app_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.qlik_app_qualified_name + return ( + None if self.attributes is None else self.attributes.qlik_app_qualified_name + ) @qlik_app_qualified_name.setter def qlik_app_qualified_name(self, qlik_app_qualified_name: Optional[str]): diff --git a/pyatlan/model/assets/qlik_app.py b/pyatlan/model/assets/qlik_app.py index 4b9134d33..3c1fac7c3 100644 --- a/pyatlan/model/assets/qlik_app.py +++ b/pyatlan/model/assets/qlik_app.py @@ -34,23 +34,33 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QLIK_HAS_SECTION_ACCESS: ClassVar[BooleanField] = BooleanField("qlikHasSectionAccess", "qlikHasSectionAccess") + QLIK_HAS_SECTION_ACCESS: ClassVar[BooleanField] = BooleanField( + "qlikHasSectionAccess", "qlikHasSectionAccess" + ) """ Whether section access or data masking is enabled on the source (true) or not (false). """ - QLIK_ORIGIN_APP_ID: ClassVar[KeywordField] = KeywordField("qlikOriginAppId", "qlikOriginAppId") + QLIK_ORIGIN_APP_ID: ClassVar[KeywordField] = KeywordField( + "qlikOriginAppId", "qlikOriginAppId" + ) """ Value of originAppId for this app. """ - QLIK_IS_ENCRYPTED: ClassVar[BooleanField] = BooleanField("qlikIsEncrypted", "qlikIsEncrypted") + QLIK_IS_ENCRYPTED: ClassVar[BooleanField] = BooleanField( + "qlikIsEncrypted", "qlikIsEncrypted" + ) """ Whether this app is encrypted (true) or not (false). """ - QLIK_IS_DIRECT_QUERY_MODE: ClassVar[BooleanField] = BooleanField("qlikIsDirectQueryMode", "qlikIsDirectQueryMode") + QLIK_IS_DIRECT_QUERY_MODE: ClassVar[BooleanField] = BooleanField( + "qlikIsDirectQueryMode", "qlikIsDirectQueryMode" + ) """ Whether this app is in direct query mode (true) or not (false). """ - QLIK_APP_STATIC_BYTE_SIZE: ClassVar[NumericField] = NumericField("qlikAppStaticByteSize", "qlikAppStaticByteSize") + QLIK_APP_STATIC_BYTE_SIZE: ClassVar[NumericField] = NumericField( + "qlikAppStaticByteSize", "qlikAppStaticByteSize" + ) """ Static space used by this app, in bytes. """ @@ -76,7 +86,9 @@ def __setattr__(self, name, value): @property def qlik_has_section_access(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.qlik_has_section_access + return ( + None if self.attributes is None else self.attributes.qlik_has_section_access + ) @qlik_has_section_access.setter def qlik_has_section_access(self, qlik_has_section_access: Optional[bool]): @@ -106,7 +118,11 @@ def qlik_is_encrypted(self, qlik_is_encrypted: Optional[bool]): @property def qlik_is_direct_query_mode(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.qlik_is_direct_query_mode + return ( + None + if self.attributes is None + else self.attributes.qlik_is_direct_query_mode + ) @qlik_is_direct_query_mode.setter def qlik_is_direct_query_mode(self, qlik_is_direct_query_mode: Optional[bool]): @@ -116,7 +132,11 @@ def qlik_is_direct_query_mode(self, qlik_is_direct_query_mode: Optional[bool]): @property def qlik_app_static_byte_size(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.qlik_app_static_byte_size + return ( + None + if self.attributes is None + else self.attributes.qlik_app_static_byte_size + ) @qlik_app_static_byte_size.setter def qlik_app_static_byte_size(self, qlik_app_static_byte_size: Optional[int]): @@ -150,8 +170,12 @@ class Attributes(Qlik.Attributes): qlik_is_encrypted: Optional[bool] = Field(default=None, description="") qlik_is_direct_query_mode: Optional[bool] = Field(default=None, description="") qlik_app_static_byte_size: Optional[int] = Field(default=None, description="") - qlik_space: Optional[QlikSpace] = Field(default=None, description="") # relationship - qlik_sheets: Optional[List[QlikSheet]] = Field(default=None, description="") # relationship + qlik_space: Optional[QlikSpace] = Field( + default=None, description="" + ) # relationship + qlik_sheets: Optional[List[QlikSheet]] = Field( + default=None, description="" + ) # relationship attributes: QlikApp.Attributes = Field( default_factory=lambda: QlikApp.Attributes(), diff --git a/pyatlan/model/assets/qlik_chart.py b/pyatlan/model/assets/qlik_chart.py index 15ff1e991..130361682 100644 --- a/pyatlan/model/assets/qlik_chart.py +++ b/pyatlan/model/assets/qlik_chart.py @@ -29,19 +29,27 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QLIK_CHART_SUBTITLE: ClassVar[TextField] = TextField("qlikChartSubtitle", "qlikChartSubtitle") + QLIK_CHART_SUBTITLE: ClassVar[TextField] = TextField( + "qlikChartSubtitle", "qlikChartSubtitle" + ) """ Subtitle of this chart. """ - QLIK_CHART_FOOTNOTE: ClassVar[TextField] = TextField("qlikChartFootnote", "qlikChartFootnote") + QLIK_CHART_FOOTNOTE: ClassVar[TextField] = TextField( + "qlikChartFootnote", "qlikChartFootnote" + ) """ Footnote of this chart. """ - QLIK_CHART_ORIENTATION: ClassVar[KeywordField] = KeywordField("qlikChartOrientation", "qlikChartOrientation") + QLIK_CHART_ORIENTATION: ClassVar[KeywordField] = KeywordField( + "qlikChartOrientation", "qlikChartOrientation" + ) """ Orientation of this chart. """ - QLIK_CHART_TYPE: ClassVar[KeywordField] = KeywordField("qlikChartType", "qlikChartType") + QLIK_CHART_TYPE: ClassVar[KeywordField] = KeywordField( + "qlikChartType", "qlikChartType" + ) """ Subtype of this chart, for example: bar, graph, pie, etc. """ @@ -81,7 +89,9 @@ def qlik_chart_footnote(self, qlik_chart_footnote: Optional[str]): @property def qlik_chart_orientation(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.qlik_chart_orientation + return ( + None if self.attributes is None else self.attributes.qlik_chart_orientation + ) @qlik_chart_orientation.setter def qlik_chart_orientation(self, qlik_chart_orientation: Optional[str]): @@ -114,7 +124,9 @@ class Attributes(Qlik.Attributes): qlik_chart_footnote: Optional[str] = Field(default=None, description="") qlik_chart_orientation: Optional[str] = Field(default=None, description="") qlik_chart_type: Optional[str] = Field(default=None, description="") - qlik_sheet: Optional[QlikSheet] = Field(default=None, description="") # relationship + qlik_sheet: Optional[QlikSheet] = Field( + default=None, description="" + ) # relationship attributes: QlikChart.Attributes = Field( default_factory=lambda: QlikChart.Attributes(), diff --git a/pyatlan/model/assets/qlik_dataset.py b/pyatlan/model/assets/qlik_dataset.py index 302887b69..68a8305d5 100644 --- a/pyatlan/model/assets/qlik_dataset.py +++ b/pyatlan/model/assets/qlik_dataset.py @@ -41,7 +41,9 @@ def __setattr__(self, name, value): """ Technical name of this asset. """ - QLIK_DATASET_TYPE: ClassVar[KeywordField] = KeywordField("qlikDatasetType", "qlikDatasetType") + QLIK_DATASET_TYPE: ClassVar[KeywordField] = KeywordField( + "qlikDatasetType", "qlikDatasetType" + ) """ Type of this data asset, for example: qix-df, snowflake, etc. """ @@ -51,7 +53,9 @@ def __setattr__(self, name, value): """ URI of this dataset. """ - QLIK_DATASET_SUBTYPE: ClassVar[KeywordField] = KeywordField("qlikDatasetSubtype", "qlikDatasetSubtype") + QLIK_DATASET_SUBTYPE: ClassVar[KeywordField] = KeywordField( + "qlikDatasetSubtype", "qlikDatasetSubtype" + ) """ Subtype this dataset asset. """ @@ -71,7 +75,11 @@ def __setattr__(self, name, value): @property def qlik_dataset_technical_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.qlik_dataset_technical_name + return ( + None + if self.attributes is None + else self.attributes.qlik_dataset_technical_name + ) @qlik_dataset_technical_name.setter def qlik_dataset_technical_name(self, qlik_dataset_technical_name: Optional[str]): @@ -124,7 +132,9 @@ class Attributes(Qlik.Attributes): qlik_dataset_type: Optional[str] = Field(default=None, description="") qlik_dataset_uri: Optional[str] = Field(default=None, description="") qlik_dataset_subtype: Optional[str] = Field(default=None, description="") - qlik_space: Optional[QlikSpace] = Field(default=None, description="") # relationship + qlik_space: Optional[QlikSpace] = Field( + default=None, description="" + ) # relationship attributes: QlikDataset.Attributes = Field( default_factory=lambda: QlikDataset.Attributes(), diff --git a/pyatlan/model/assets/qlik_sheet.py b/pyatlan/model/assets/qlik_sheet.py index 23f574556..f3983f062 100644 --- a/pyatlan/model/assets/qlik_sheet.py +++ b/pyatlan/model/assets/qlik_sheet.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QLIK_SHEET_IS_APPROVED: ClassVar[BooleanField] = BooleanField("qlikSheetIsApproved", "qlikSheetIsApproved") + QLIK_SHEET_IS_APPROVED: ClassVar[BooleanField] = BooleanField( + "qlikSheetIsApproved", "qlikSheetIsApproved" + ) """ Whether this is approved (true) or not (false). """ @@ -51,7 +53,9 @@ def __setattr__(self, name, value): @property def qlik_sheet_is_approved(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.qlik_sheet_is_approved + return ( + None if self.attributes is None else self.attributes.qlik_sheet_is_approved + ) @qlik_sheet_is_approved.setter def qlik_sheet_is_approved(self, qlik_sheet_is_approved: Optional[bool]): @@ -81,8 +85,12 @@ def qlik_charts(self, qlik_charts: Optional[List[QlikChart]]): class Attributes(Qlik.Attributes): qlik_sheet_is_approved: Optional[bool] = Field(default=None, description="") - qlik_app: Optional[QlikApp] = Field(default=None, description="") # relationship - qlik_charts: Optional[List[QlikChart]] = Field(default=None, description="") # relationship + qlik_app: Optional[QlikApp] = Field( + default=None, description="" + ) # relationship + qlik_charts: Optional[List[QlikChart]] = Field( + default=None, description="" + ) # relationship attributes: QlikSheet.Attributes = Field( default_factory=lambda: QlikSheet.Attributes(), diff --git a/pyatlan/model/assets/qlik_space.py b/pyatlan/model/assets/qlik_space.py index 04ce1485c..bc8ba1730 100644 --- a/pyatlan/model/assets/qlik_space.py +++ b/pyatlan/model/assets/qlik_space.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QLIK_SPACE_TYPE: ClassVar[KeywordField] = KeywordField("qlikSpaceType", "qlikSpaceType") + QLIK_SPACE_TYPE: ClassVar[KeywordField] = KeywordField( + "qlikSpaceType", "qlikSpaceType" + ) """ Type of this space, for exmaple: Private, Shared, etc. """ @@ -81,8 +83,12 @@ def qlik_apps(self, qlik_apps: Optional[List[QlikApp]]): class Attributes(Qlik.Attributes): qlik_space_type: Optional[str] = Field(default=None, description="") - qlik_datasets: Optional[List[QlikDataset]] = Field(default=None, description="") # relationship - qlik_apps: Optional[List[QlikApp]] = Field(default=None, description="") # relationship + qlik_datasets: Optional[List[QlikDataset]] = Field( + default=None, description="" + ) # relationship + qlik_apps: Optional[List[QlikApp]] = Field( + default=None, description="" + ) # relationship attributes: QlikSpace.Attributes = Field( default_factory=lambda: QlikSpace.Attributes(), diff --git a/pyatlan/model/assets/quick_sight.py b/pyatlan/model/assets/quick_sight.py index f5f2ff87d..0d2c9bab0 100644 --- a/pyatlan/model/assets/quick_sight.py +++ b/pyatlan/model/assets/quick_sight.py @@ -29,11 +29,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QUICK_SIGHT_ID: ClassVar[KeywordField] = KeywordField("quickSightId", "quickSightId") + QUICK_SIGHT_ID: ClassVar[KeywordField] = KeywordField( + "quickSightId", "quickSightId" + ) """ """ - QUICK_SIGHT_SHEET_ID: ClassVar[KeywordField] = KeywordField("quickSightSheetId", "quickSightSheetId") + QUICK_SIGHT_SHEET_ID: ClassVar[KeywordField] = KeywordField( + "quickSightSheetId", "quickSightSheetId" + ) """ """ @@ -72,7 +76,9 @@ def quick_sight_sheet_id(self, quick_sight_sheet_id: Optional[str]): @property def quick_sight_sheet_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.quick_sight_sheet_name + return ( + None if self.attributes is None else self.attributes.quick_sight_sheet_name + ) @quick_sight_sheet_name.setter def quick_sight_sheet_name(self, quick_sight_sheet_name: Optional[str]): diff --git a/pyatlan/model/assets/quick_sight_analysis.py b/pyatlan/model/assets/quick_sight_analysis.py index c46afddee..2d430a72f 100644 --- a/pyatlan/model/assets/quick_sight_analysis.py +++ b/pyatlan/model/assets/quick_sight_analysis.py @@ -100,11 +100,15 @@ def __setattr__(self, name, value): List of filter groups used for this analysis. """ - QUICK_SIGHT_ANALYSIS_VISUALS: ClassVar[RelationField] = RelationField("quickSightAnalysisVisuals") + QUICK_SIGHT_ANALYSIS_VISUALS: ClassVar[RelationField] = RelationField( + "quickSightAnalysisVisuals" + ) """ TBC """ - QUICK_SIGHT_ANALYSIS_FOLDERS: ClassVar[RelationField] = RelationField("quickSightAnalysisFolders") + QUICK_SIGHT_ANALYSIS_FOLDERS: ClassVar[RelationField] = RelationField( + "quickSightAnalysisFolders" + ) """ TBC """ @@ -120,27 +124,45 @@ def __setattr__(self, name, value): @property def quick_sight_analysis_status(self) -> Optional[QuickSightAnalysisStatus]: - return None if self.attributes is None else self.attributes.quick_sight_analysis_status + return ( + None + if self.attributes is None + else self.attributes.quick_sight_analysis_status + ) @quick_sight_analysis_status.setter - def quick_sight_analysis_status(self, quick_sight_analysis_status: Optional[QuickSightAnalysisStatus]): + def quick_sight_analysis_status( + self, quick_sight_analysis_status: Optional[QuickSightAnalysisStatus] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_analysis_status = quick_sight_analysis_status @property def quick_sight_analysis_calculated_fields(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.quick_sight_analysis_calculated_fields + return ( + None + if self.attributes is None + else self.attributes.quick_sight_analysis_calculated_fields + ) @quick_sight_analysis_calculated_fields.setter - def quick_sight_analysis_calculated_fields(self, quick_sight_analysis_calculated_fields: Optional[Set[str]]): + def quick_sight_analysis_calculated_fields( + self, quick_sight_analysis_calculated_fields: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_analysis_calculated_fields = quick_sight_analysis_calculated_fields + self.attributes.quick_sight_analysis_calculated_fields = ( + quick_sight_analysis_calculated_fields + ) @property def quick_sight_analysis_parameter_declarations(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.quick_sight_analysis_parameter_declarations + return ( + None + if self.attributes is None + else self.attributes.quick_sight_analysis_parameter_declarations + ) @quick_sight_analysis_parameter_declarations.setter def quick_sight_analysis_parameter_declarations( @@ -148,43 +170,73 @@ def quick_sight_analysis_parameter_declarations( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_analysis_parameter_declarations = quick_sight_analysis_parameter_declarations + self.attributes.quick_sight_analysis_parameter_declarations = ( + quick_sight_analysis_parameter_declarations + ) @property def quick_sight_analysis_filter_groups(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.quick_sight_analysis_filter_groups + return ( + None + if self.attributes is None + else self.attributes.quick_sight_analysis_filter_groups + ) @quick_sight_analysis_filter_groups.setter - def quick_sight_analysis_filter_groups(self, quick_sight_analysis_filter_groups: Optional[Set[str]]): + def quick_sight_analysis_filter_groups( + self, quick_sight_analysis_filter_groups: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_analysis_filter_groups = quick_sight_analysis_filter_groups + self.attributes.quick_sight_analysis_filter_groups = ( + quick_sight_analysis_filter_groups + ) @property def quick_sight_analysis_visuals(self) -> Optional[List[QuickSightAnalysisVisual]]: - return None if self.attributes is None else self.attributes.quick_sight_analysis_visuals + return ( + None + if self.attributes is None + else self.attributes.quick_sight_analysis_visuals + ) @quick_sight_analysis_visuals.setter - def quick_sight_analysis_visuals(self, quick_sight_analysis_visuals: Optional[List[QuickSightAnalysisVisual]]): + def quick_sight_analysis_visuals( + self, quick_sight_analysis_visuals: Optional[List[QuickSightAnalysisVisual]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_analysis_visuals = quick_sight_analysis_visuals @property def quick_sight_analysis_folders(self) -> Optional[List[QuickSightFolder]]: - return None if self.attributes is None else self.attributes.quick_sight_analysis_folders + return ( + None + if self.attributes is None + else self.attributes.quick_sight_analysis_folders + ) @quick_sight_analysis_folders.setter - def quick_sight_analysis_folders(self, quick_sight_analysis_folders: Optional[List[QuickSightFolder]]): + def quick_sight_analysis_folders( + self, quick_sight_analysis_folders: Optional[List[QuickSightFolder]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_analysis_folders = quick_sight_analysis_folders class Attributes(QuickSight.Attributes): - quick_sight_analysis_status: Optional[QuickSightAnalysisStatus] = Field(default=None, description="") - quick_sight_analysis_calculated_fields: Optional[Set[str]] = Field(default=None, description="") - quick_sight_analysis_parameter_declarations: Optional[Set[str]] = Field(default=None, description="") - quick_sight_analysis_filter_groups: Optional[Set[str]] = Field(default=None, description="") + quick_sight_analysis_status: Optional[QuickSightAnalysisStatus] = Field( + default=None, description="" + ) + quick_sight_analysis_calculated_fields: Optional[Set[str]] = Field( + default=None, description="" + ) + quick_sight_analysis_parameter_declarations: Optional[Set[str]] = Field( + default=None, description="" + ) + quick_sight_analysis_filter_groups: Optional[Set[str]] = Field( + default=None, description="" + ) quick_sight_analysis_visuals: Optional[List[QuickSightAnalysisVisual]] = Field( default=None, description="" ) # relationship @@ -218,7 +270,9 @@ def creator( quick_sight_id=quick_sight_id, qualified_name=f"{connection_qualified_name}/{quick_sight_id}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), quick_sight_analysis_folders=folders, ) diff --git a/pyatlan/model/assets/quick_sight_analysis_visual.py b/pyatlan/model/assets/quick_sight_analysis_visual.py index 4b452885d..60a05a982 100644 --- a/pyatlan/model/assets/quick_sight_analysis_visual.py +++ b/pyatlan/model/assets/quick_sight_analysis_visual.py @@ -115,13 +115,21 @@ def __setattr__(self, name, value): @property def quick_sight_analysis_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.quick_sight_analysis_qualified_name + return ( + None + if self.attributes is None + else self.attributes.quick_sight_analysis_qualified_name + ) @quick_sight_analysis_qualified_name.setter - def quick_sight_analysis_qualified_name(self, quick_sight_analysis_qualified_name: Optional[str]): + def quick_sight_analysis_qualified_name( + self, quick_sight_analysis_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_analysis_qualified_name = quick_sight_analysis_qualified_name + self.attributes.quick_sight_analysis_qualified_name = ( + quick_sight_analysis_qualified_name + ) @property def quick_sight_analysis(self) -> Optional[QuickSightAnalysis]: @@ -134,8 +142,12 @@ def quick_sight_analysis(self, quick_sight_analysis: Optional[QuickSightAnalysis self.attributes.quick_sight_analysis = quick_sight_analysis class Attributes(QuickSight.Attributes): - quick_sight_analysis_qualified_name: Optional[str] = Field(default=None, description="") - quick_sight_analysis: Optional[QuickSightAnalysis] = Field(default=None, description="") # relationship + quick_sight_analysis_qualified_name: Optional[str] = Field( + default=None, description="" + ) + quick_sight_analysis: Optional[QuickSightAnalysis] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -167,7 +179,9 @@ def creator( ) assert quick_sight_analysis_qualified_name if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( quick_sight_analysis_qualified_name, diff --git a/pyatlan/model/assets/quick_sight_dashboard.py b/pyatlan/model/assets/quick_sight_dashboard.py index a7fece74e..018c87481 100644 --- a/pyatlan/model/assets/quick_sight_dashboard.py +++ b/pyatlan/model/assets/quick_sight_dashboard.py @@ -75,9 +75,11 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QUICK_SIGHT_DASHBOARD_PUBLISHED_VERSION_NUMBER: ClassVar[NumericField] = NumericField( - "quickSightDashboardPublishedVersionNumber", - "quickSightDashboardPublishedVersionNumber", + QUICK_SIGHT_DASHBOARD_PUBLISHED_VERSION_NUMBER: ClassVar[NumericField] = ( + NumericField( + "quickSightDashboardPublishedVersionNumber", + "quickSightDashboardPublishedVersionNumber", + ) ) """ Version number of the published dashboard. @@ -89,11 +91,15 @@ def __setattr__(self, name, value): Time (epoch) at which this dashboard was last published, in milliseconds. """ - QUICK_SIGHT_DASHBOARD_FOLDERS: ClassVar[RelationField] = RelationField("quickSightDashboardFolders") + QUICK_SIGHT_DASHBOARD_FOLDERS: ClassVar[RelationField] = RelationField( + "quickSightDashboardFolders" + ) """ TBC """ - QUICK_SIGHT_DASHBOARD_VISUALS: ClassVar[RelationField] = RelationField("quickSightDashboardVisuals") + QUICK_SIGHT_DASHBOARD_VISUALS: ClassVar[RelationField] = RelationField( + "quickSightDashboardVisuals" + ) """ TBC """ @@ -107,7 +113,11 @@ def __setattr__(self, name, value): @property def quick_sight_dashboard_published_version_number(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.quick_sight_dashboard_published_version_number + return ( + None + if self.attributes is None + else self.attributes.quick_sight_dashboard_published_version_number + ) @quick_sight_dashboard_published_version_number.setter def quick_sight_dashboard_published_version_number( @@ -115,24 +125,40 @@ def quick_sight_dashboard_published_version_number( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dashboard_published_version_number = quick_sight_dashboard_published_version_number + self.attributes.quick_sight_dashboard_published_version_number = ( + quick_sight_dashboard_published_version_number + ) @property def quick_sight_dashboard_last_published_time(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.quick_sight_dashboard_last_published_time + return ( + None + if self.attributes is None + else self.attributes.quick_sight_dashboard_last_published_time + ) @quick_sight_dashboard_last_published_time.setter - def quick_sight_dashboard_last_published_time(self, quick_sight_dashboard_last_published_time: Optional[datetime]): + def quick_sight_dashboard_last_published_time( + self, quick_sight_dashboard_last_published_time: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dashboard_last_published_time = quick_sight_dashboard_last_published_time + self.attributes.quick_sight_dashboard_last_published_time = ( + quick_sight_dashboard_last_published_time + ) @property def quick_sight_dashboard_folders(self) -> Optional[List[QuickSightFolder]]: - return None if self.attributes is None else self.attributes.quick_sight_dashboard_folders + return ( + None + if self.attributes is None + else self.attributes.quick_sight_dashboard_folders + ) @quick_sight_dashboard_folders.setter - def quick_sight_dashboard_folders(self, quick_sight_dashboard_folders: Optional[List[QuickSightFolder]]): + def quick_sight_dashboard_folders( + self, quick_sight_dashboard_folders: Optional[List[QuickSightFolder]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dashboard_folders = quick_sight_dashboard_folders @@ -141,22 +167,32 @@ def quick_sight_dashboard_folders(self, quick_sight_dashboard_folders: Optional[ def quick_sight_dashboard_visuals( self, ) -> Optional[List[QuickSightDashboardVisual]]: - return None if self.attributes is None else self.attributes.quick_sight_dashboard_visuals + return ( + None + if self.attributes is None + else self.attributes.quick_sight_dashboard_visuals + ) @quick_sight_dashboard_visuals.setter - def quick_sight_dashboard_visuals(self, quick_sight_dashboard_visuals: Optional[List[QuickSightDashboardVisual]]): + def quick_sight_dashboard_visuals( + self, quick_sight_dashboard_visuals: Optional[List[QuickSightDashboardVisual]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dashboard_visuals = quick_sight_dashboard_visuals class Attributes(QuickSight.Attributes): - quick_sight_dashboard_published_version_number: Optional[int] = Field(default=None, description="") - quick_sight_dashboard_last_published_time: Optional[datetime] = Field(default=None, description="") + quick_sight_dashboard_published_version_number: Optional[int] = Field( + default=None, description="" + ) + quick_sight_dashboard_last_published_time: Optional[datetime] = Field( + default=None, description="" + ) quick_sight_dashboard_folders: Optional[List[QuickSightFolder]] = Field( default=None, description="" ) # relationship - quick_sight_dashboard_visuals: Optional[List[QuickSightDashboardVisual]] = Field( - default=None, description="" + quick_sight_dashboard_visuals: Optional[List[QuickSightDashboardVisual]] = ( + Field(default=None, description="") ) # relationship @classmethod @@ -185,7 +221,9 @@ def creator( quick_sight_id=quick_sight_id, qualified_name=f"{connection_qualified_name}/{quick_sight_id}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), quick_sight_dashboard_folders=folders, ) diff --git a/pyatlan/model/assets/quick_sight_dashboard_visual.py b/pyatlan/model/assets/quick_sight_dashboard_visual.py index 7c6e7f51f..29324002f 100644 --- a/pyatlan/model/assets/quick_sight_dashboard_visual.py +++ b/pyatlan/model/assets/quick_sight_dashboard_visual.py @@ -103,7 +103,9 @@ def __setattr__(self, name, value): Unique name of the dashboard in which this visual exists. """ - QUICK_SIGHT_DASHBOARD: ClassVar[RelationField] = RelationField("quickSightDashboard") + QUICK_SIGHT_DASHBOARD: ClassVar[RelationField] = RelationField( + "quickSightDashboard" + ) """ TBC """ @@ -115,27 +117,43 @@ def __setattr__(self, name, value): @property def quick_sight_dashboard_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.quick_sight_dashboard_qualified_name + return ( + None + if self.attributes is None + else self.attributes.quick_sight_dashboard_qualified_name + ) @quick_sight_dashboard_qualified_name.setter - def quick_sight_dashboard_qualified_name(self, quick_sight_dashboard_qualified_name: Optional[str]): + def quick_sight_dashboard_qualified_name( + self, quick_sight_dashboard_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dashboard_qualified_name = quick_sight_dashboard_qualified_name + self.attributes.quick_sight_dashboard_qualified_name = ( + quick_sight_dashboard_qualified_name + ) @property def quick_sight_dashboard(self) -> Optional[QuickSightDashboard]: - return None if self.attributes is None else self.attributes.quick_sight_dashboard + return ( + None if self.attributes is None else self.attributes.quick_sight_dashboard + ) @quick_sight_dashboard.setter - def quick_sight_dashboard(self, quick_sight_dashboard: Optional[QuickSightDashboard]): + def quick_sight_dashboard( + self, quick_sight_dashboard: Optional[QuickSightDashboard] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dashboard = quick_sight_dashboard class Attributes(QuickSight.Attributes): - quick_sight_dashboard_qualified_name: Optional[str] = Field(default=None, description="") - quick_sight_dashboard: Optional[QuickSightDashboard] = Field(default=None, description="") # relationship + quick_sight_dashboard_qualified_name: Optional[str] = Field( + default=None, description="" + ) + quick_sight_dashboard: Optional[QuickSightDashboard] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -167,7 +185,9 @@ def creator( ) assert quick_sight_dashboard_qualified_name if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( quick_sight_dashboard_qualified_name, @@ -182,7 +202,9 @@ def creator( quick_sight_sheet_id=quick_sight_sheet_id, quick_sight_sheet_name=quick_sight_sheet_name, quick_sight_dashboard_qualified_name=quick_sight_dashboard_qualified_name, - quick_sight_dashboard=QuickSightDashboard.ref_by_qualified_name(quick_sight_dashboard_qualified_name), + quick_sight_dashboard=QuickSightDashboard.ref_by_qualified_name( + quick_sight_dashboard_qualified_name + ), connection_qualified_name=connection_qualified_name, connector_name=connector_name, ) diff --git a/pyatlan/model/assets/quick_sight_dataset.py b/pyatlan/model/assets/quick_sight_dataset.py index 8fb5defb9..c1a2557ef 100644 --- a/pyatlan/model/assets/quick_sight_dataset.py +++ b/pyatlan/model/assets/quick_sight_dataset.py @@ -90,11 +90,15 @@ def __setattr__(self, name, value): Number of columns present in this dataset. """ - QUICK_SIGHT_DATASET_FOLDERS: ClassVar[RelationField] = RelationField("quickSightDatasetFolders") + QUICK_SIGHT_DATASET_FOLDERS: ClassVar[RelationField] = RelationField( + "quickSightDatasetFolders" + ) """ TBC """ - QUICK_SIGHT_DATASET_FIELDS: ClassVar[RelationField] = RelationField("quickSightDatasetFields") + QUICK_SIGHT_DATASET_FIELDS: ClassVar[RelationField] = RelationField( + "quickSightDatasetFields" + ) """ TBC """ @@ -108,47 +112,79 @@ def __setattr__(self, name, value): @property def quick_sight_dataset_import_mode(self) -> Optional[QuickSightDatasetImportMode]: - return None if self.attributes is None else self.attributes.quick_sight_dataset_import_mode + return ( + None + if self.attributes is None + else self.attributes.quick_sight_dataset_import_mode + ) @quick_sight_dataset_import_mode.setter - def quick_sight_dataset_import_mode(self, quick_sight_dataset_import_mode: Optional[QuickSightDatasetImportMode]): + def quick_sight_dataset_import_mode( + self, quick_sight_dataset_import_mode: Optional[QuickSightDatasetImportMode] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dataset_import_mode = quick_sight_dataset_import_mode + self.attributes.quick_sight_dataset_import_mode = ( + quick_sight_dataset_import_mode + ) @property def quick_sight_dataset_column_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.quick_sight_dataset_column_count + return ( + None + if self.attributes is None + else self.attributes.quick_sight_dataset_column_count + ) @quick_sight_dataset_column_count.setter - def quick_sight_dataset_column_count(self, quick_sight_dataset_column_count: Optional[int]): + def quick_sight_dataset_column_count( + self, quick_sight_dataset_column_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dataset_column_count = quick_sight_dataset_column_count + self.attributes.quick_sight_dataset_column_count = ( + quick_sight_dataset_column_count + ) @property def quick_sight_dataset_folders(self) -> Optional[List[QuickSightFolder]]: - return None if self.attributes is None else self.attributes.quick_sight_dataset_folders + return ( + None + if self.attributes is None + else self.attributes.quick_sight_dataset_folders + ) @quick_sight_dataset_folders.setter - def quick_sight_dataset_folders(self, quick_sight_dataset_folders: Optional[List[QuickSightFolder]]): + def quick_sight_dataset_folders( + self, quick_sight_dataset_folders: Optional[List[QuickSightFolder]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dataset_folders = quick_sight_dataset_folders @property def quick_sight_dataset_fields(self) -> Optional[List[QuickSightDatasetField]]: - return None if self.attributes is None else self.attributes.quick_sight_dataset_fields + return ( + None + if self.attributes is None + else self.attributes.quick_sight_dataset_fields + ) @quick_sight_dataset_fields.setter - def quick_sight_dataset_fields(self, quick_sight_dataset_fields: Optional[List[QuickSightDatasetField]]): + def quick_sight_dataset_fields( + self, quick_sight_dataset_fields: Optional[List[QuickSightDatasetField]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dataset_fields = quick_sight_dataset_fields class Attributes(QuickSight.Attributes): - quick_sight_dataset_import_mode: Optional[QuickSightDatasetImportMode] = Field(default=None, description="") - quick_sight_dataset_column_count: Optional[int] = Field(default=None, description="") + quick_sight_dataset_import_mode: Optional[QuickSightDatasetImportMode] = Field( + default=None, description="" + ) + quick_sight_dataset_column_count: Optional[int] = Field( + default=None, description="" + ) quick_sight_dataset_folders: Optional[List[QuickSightFolder]] = Field( default=None, description="" ) # relationship @@ -164,7 +200,9 @@ def creator( name: str, connection_qualified_name: str, quick_sight_id: str, - quick_sight_dataset_import_mode: Optional[QuickSightDatasetImportMode] = None, + quick_sight_dataset_import_mode: Optional[ + QuickSightDatasetImportMode + ] = None, quick_sight_dataset_folders: Optional[List[str]] = None, ) -> QuickSightDataset.Attributes: validate_required_fields( @@ -183,7 +221,9 @@ def creator( quick_sight_id=quick_sight_id, qualified_name=f"{connection_qualified_name}/{quick_sight_id}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), quick_sight_dataset_import_mode=quick_sight_dataset_import_mode, quick_sight_dataset_folders=folders, ) diff --git a/pyatlan/model/assets/quick_sight_dataset_field.py b/pyatlan/model/assets/quick_sight_dataset_field.py index de5aa0001..b3a1c7f5b 100644 --- a/pyatlan/model/assets/quick_sight_dataset_field.py +++ b/pyatlan/model/assets/quick_sight_dataset_field.py @@ -109,23 +109,37 @@ def __setattr__(self, name, value): @property def quick_sight_dataset_field_type(self) -> Optional[QuickSightDatasetFieldType]: - return None if self.attributes is None else self.attributes.quick_sight_dataset_field_type + return ( + None + if self.attributes is None + else self.attributes.quick_sight_dataset_field_type + ) @quick_sight_dataset_field_type.setter - def quick_sight_dataset_field_type(self, quick_sight_dataset_field_type: Optional[QuickSightDatasetFieldType]): + def quick_sight_dataset_field_type( + self, quick_sight_dataset_field_type: Optional[QuickSightDatasetFieldType] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dataset_field_type = quick_sight_dataset_field_type @property def quick_sight_dataset_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.quick_sight_dataset_qualified_name + return ( + None + if self.attributes is None + else self.attributes.quick_sight_dataset_qualified_name + ) @quick_sight_dataset_qualified_name.setter - def quick_sight_dataset_qualified_name(self, quick_sight_dataset_qualified_name: Optional[str]): + def quick_sight_dataset_qualified_name( + self, quick_sight_dataset_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.quick_sight_dataset_qualified_name = quick_sight_dataset_qualified_name + self.attributes.quick_sight_dataset_qualified_name = ( + quick_sight_dataset_qualified_name + ) @property def quick_sight_dataset(self) -> Optional[QuickSightDataset]: @@ -138,9 +152,15 @@ def quick_sight_dataset(self, quick_sight_dataset: Optional[QuickSightDataset]): self.attributes.quick_sight_dataset = quick_sight_dataset class Attributes(QuickSight.Attributes): - quick_sight_dataset_field_type: Optional[QuickSightDatasetFieldType] = Field(default=None, description="") - quick_sight_dataset_qualified_name: Optional[str] = Field(default=None, description="") - quick_sight_dataset: Optional[QuickSightDataset] = Field(default=None, description="") # relationship + quick_sight_dataset_field_type: Optional[QuickSightDatasetFieldType] = Field( + default=None, description="" + ) + quick_sight_dataset_qualified_name: Optional[str] = Field( + default=None, description="" + ) + quick_sight_dataset: Optional[QuickSightDataset] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -159,7 +179,9 @@ def creator( ) assert quick_sight_dataset_qualified_name if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( quick_sight_dataset_qualified_name, @@ -171,7 +193,9 @@ def creator( name=name, quick_sight_dataset_qualified_name=quick_sight_dataset_qualified_name, quick_sight_id=quick_sight_id, - quick_sight_dataset=QuickSightDataset.ref_by_qualified_name(quick_sight_dataset_qualified_name), + quick_sight_dataset=QuickSightDataset.ref_by_qualified_name( + quick_sight_dataset_qualified_name + ), qualified_name=f"{quick_sight_dataset_qualified_name}/{quick_sight_id}", connection_qualified_name=connection_qualified_name, connector_name=connector_name, diff --git a/pyatlan/model/assets/quick_sight_folder.py b/pyatlan/model/assets/quick_sight_folder.py index 8ab14f173..1fae18349 100644 --- a/pyatlan/model/assets/quick_sight_folder.py +++ b/pyatlan/model/assets/quick_sight_folder.py @@ -74,7 +74,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - QUICK_SIGHT_FOLDER_TYPE: ClassVar[KeywordField] = KeywordField("quickSightFolderType", "quickSightFolderType") + QUICK_SIGHT_FOLDER_TYPE: ClassVar[KeywordField] = KeywordField( + "quickSightFolderType", "quickSightFolderType" + ) """ Type of this folder, for example: SHARED. """ @@ -89,7 +91,9 @@ def __setattr__(self, name, value): """ TBC """ - QUICK_SIGHT_DASHBOARDS: ClassVar[RelationField] = RelationField("quickSightDashboards") + QUICK_SIGHT_DASHBOARDS: ClassVar[RelationField] = RelationField( + "quickSightDashboards" + ) """ TBC """ @@ -108,20 +112,30 @@ def __setattr__(self, name, value): @property def quick_sight_folder_type(self) -> Optional[QuickSightFolderType]: - return None if self.attributes is None else self.attributes.quick_sight_folder_type + return ( + None if self.attributes is None else self.attributes.quick_sight_folder_type + ) @quick_sight_folder_type.setter - def quick_sight_folder_type(self, quick_sight_folder_type: Optional[QuickSightFolderType]): + def quick_sight_folder_type( + self, quick_sight_folder_type: Optional[QuickSightFolderType] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_folder_type = quick_sight_folder_type @property def quick_sight_folder_hierarchy(self) -> Optional[List[Dict[str, str]]]: - return None if self.attributes is None else self.attributes.quick_sight_folder_hierarchy + return ( + None + if self.attributes is None + else self.attributes.quick_sight_folder_hierarchy + ) @quick_sight_folder_hierarchy.setter - def quick_sight_folder_hierarchy(self, quick_sight_folder_hierarchy: Optional[List[Dict[str, str]]]): + def quick_sight_folder_hierarchy( + self, quick_sight_folder_hierarchy: Optional[List[Dict[str, str]]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_folder_hierarchy = quick_sight_folder_hierarchy @@ -131,17 +145,23 @@ def quick_sight_analyses(self) -> Optional[List[QuickSightAnalysis]]: return None if self.attributes is None else self.attributes.quick_sight_analyses @quick_sight_analyses.setter - def quick_sight_analyses(self, quick_sight_analyses: Optional[List[QuickSightAnalysis]]): + def quick_sight_analyses( + self, quick_sight_analyses: Optional[List[QuickSightAnalysis]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_analyses = quick_sight_analyses @property def quick_sight_dashboards(self) -> Optional[List[QuickSightDashboard]]: - return None if self.attributes is None else self.attributes.quick_sight_dashboards + return ( + None if self.attributes is None else self.attributes.quick_sight_dashboards + ) @quick_sight_dashboards.setter - def quick_sight_dashboards(self, quick_sight_dashboards: Optional[List[QuickSightDashboard]]): + def quick_sight_dashboards( + self, quick_sight_dashboards: Optional[List[QuickSightDashboard]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_dashboards = quick_sight_dashboards @@ -151,19 +171,29 @@ def quick_sight_datasets(self) -> Optional[List[QuickSightDataset]]: return None if self.attributes is None else self.attributes.quick_sight_datasets @quick_sight_datasets.setter - def quick_sight_datasets(self, quick_sight_datasets: Optional[List[QuickSightDataset]]): + def quick_sight_datasets( + self, quick_sight_datasets: Optional[List[QuickSightDataset]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.quick_sight_datasets = quick_sight_datasets class Attributes(QuickSight.Attributes): - quick_sight_folder_type: Optional[QuickSightFolderType] = Field(default=None, description="") - quick_sight_folder_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") - quick_sight_analyses: Optional[List[QuickSightAnalysis]] = Field(default=None, description="") # relationship + quick_sight_folder_type: Optional[QuickSightFolderType] = Field( + default=None, description="" + ) + quick_sight_folder_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + quick_sight_analyses: Optional[List[QuickSightAnalysis]] = Field( + default=None, description="" + ) # relationship quick_sight_dashboards: Optional[List[QuickSightDashboard]] = Field( default=None, description="" ) # relationship - quick_sight_datasets: Optional[List[QuickSightDataset]] = Field(default=None, description="") # relationship + quick_sight_datasets: Optional[List[QuickSightDataset]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -184,7 +214,9 @@ def creator( quick_sight_id=quick_sight_id, qualified_name=f"{connection_qualified_name}/{quick_sight_id}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), quick_sight_folder_type=quick_sight_folder_type, ) diff --git a/pyatlan/model/assets/redash.py b/pyatlan/model/assets/redash.py index 81aa37bbc..602c9c4fa 100644 --- a/pyatlan/model/assets/redash.py +++ b/pyatlan/model/assets/redash.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - REDASH_IS_PUBLISHED: ClassVar[BooleanField] = BooleanField("redashIsPublished", "redashIsPublished") + REDASH_IS_PUBLISHED: ClassVar[BooleanField] = BooleanField( + "redashIsPublished", "redashIsPublished" + ) """ Whether this asset is published in Redash (true) or not (false). """ diff --git a/pyatlan/model/assets/redash_dashboard.py b/pyatlan/model/assets/redash_dashboard.py index de6938ad8..9f86e0a80 100644 --- a/pyatlan/model/assets/redash_dashboard.py +++ b/pyatlan/model/assets/redash_dashboard.py @@ -42,16 +42,24 @@ def __setattr__(self, name, value): @property def redash_dashboard_widget_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.redash_dashboard_widget_count + return ( + None + if self.attributes is None + else self.attributes.redash_dashboard_widget_count + ) @redash_dashboard_widget_count.setter - def redash_dashboard_widget_count(self, redash_dashboard_widget_count: Optional[int]): + def redash_dashboard_widget_count( + self, redash_dashboard_widget_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.redash_dashboard_widget_count = redash_dashboard_widget_count class Attributes(Redash.Attributes): - redash_dashboard_widget_count: Optional[int] = Field(default=None, description="") + redash_dashboard_widget_count: Optional[int] = Field( + default=None, description="" + ) attributes: RedashDashboard.Attributes = Field( default_factory=lambda: RedashDashboard.Attributes(), diff --git a/pyatlan/model/assets/redash_query.py b/pyatlan/model/assets/redash_query.py index ba03f8da9..5e18319f5 100644 --- a/pyatlan/model/assets/redash_query.py +++ b/pyatlan/model/assets/redash_query.py @@ -36,15 +36,21 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - REDASH_QUERY_SQL: ClassVar[TextField] = TextField("redashQuerySQL", "redashQuerySQL") + REDASH_QUERY_SQL: ClassVar[TextField] = TextField( + "redashQuerySQL", "redashQuerySQL" + ) """ SQL code of this query. """ - REDASH_QUERY_PARAMETERS: ClassVar[TextField] = TextField("redashQueryParameters", "redashQueryParameters") + REDASH_QUERY_PARAMETERS: ClassVar[TextField] = TextField( + "redashQueryParameters", "redashQueryParameters" + ) """ Parameters of this query. """ - REDASH_QUERY_SCHEDULE: ClassVar[KeywordField] = KeywordField("redashQuerySchedule", "redashQuerySchedule") + REDASH_QUERY_SCHEDULE: ClassVar[KeywordField] = KeywordField( + "redashQuerySchedule", "redashQuerySchedule" + ) """ Schedule for this query. """ @@ -69,7 +75,9 @@ def __setattr__(self, name, value): Schdule for this query in readable text for overview tab and filtering. """ - REDASH_VISUALIZATIONS: ClassVar[RelationField] = RelationField("redashVisualizations") + REDASH_VISUALIZATIONS: ClassVar[RelationField] = RelationField( + "redashVisualizations" + ) """ TBC """ @@ -96,7 +104,9 @@ def redash_query_s_q_l(self, redash_query_s_q_l: Optional[str]): @property def redash_query_parameters(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.redash_query_parameters + return ( + None if self.attributes is None else self.attributes.redash_query_parameters + ) @redash_query_parameters.setter def redash_query_parameters(self, redash_query_parameters: Optional[str]): @@ -106,7 +116,9 @@ def redash_query_parameters(self, redash_query_parameters: Optional[str]): @property def redash_query_schedule(self) -> Optional[Dict[str, str]]: - return None if self.attributes is None else self.attributes.redash_query_schedule + return ( + None if self.attributes is None else self.attributes.redash_query_schedule + ) @redash_query_schedule.setter def redash_query_schedule(self, redash_query_schedule: Optional[Dict[str, str]]): @@ -116,40 +128,66 @@ def redash_query_schedule(self, redash_query_schedule: Optional[Dict[str, str]]) @property def redash_query_last_execution_runtime(self) -> Optional[float]: - return None if self.attributes is None else self.attributes.redash_query_last_execution_runtime + return ( + None + if self.attributes is None + else self.attributes.redash_query_last_execution_runtime + ) @redash_query_last_execution_runtime.setter - def redash_query_last_execution_runtime(self, redash_query_last_execution_runtime: Optional[float]): + def redash_query_last_execution_runtime( + self, redash_query_last_execution_runtime: Optional[float] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.redash_query_last_execution_runtime = redash_query_last_execution_runtime + self.attributes.redash_query_last_execution_runtime = ( + redash_query_last_execution_runtime + ) @property def redash_query_last_executed_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.redash_query_last_executed_at + return ( + None + if self.attributes is None + else self.attributes.redash_query_last_executed_at + ) @redash_query_last_executed_at.setter - def redash_query_last_executed_at(self, redash_query_last_executed_at: Optional[datetime]): + def redash_query_last_executed_at( + self, redash_query_last_executed_at: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.redash_query_last_executed_at = redash_query_last_executed_at @property def redash_query_schedule_humanized(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.redash_query_schedule_humanized + return ( + None + if self.attributes is None + else self.attributes.redash_query_schedule_humanized + ) @redash_query_schedule_humanized.setter - def redash_query_schedule_humanized(self, redash_query_schedule_humanized: Optional[str]): + def redash_query_schedule_humanized( + self, redash_query_schedule_humanized: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.redash_query_schedule_humanized = redash_query_schedule_humanized + self.attributes.redash_query_schedule_humanized = ( + redash_query_schedule_humanized + ) @property def redash_visualizations(self) -> Optional[List[RedashVisualization]]: - return None if self.attributes is None else self.attributes.redash_visualizations + return ( + None if self.attributes is None else self.attributes.redash_visualizations + ) @redash_visualizations.setter - def redash_visualizations(self, redash_visualizations: Optional[List[RedashVisualization]]): + def redash_visualizations( + self, redash_visualizations: Optional[List[RedashVisualization]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.redash_visualizations = redash_visualizations @@ -157,11 +195,21 @@ def redash_visualizations(self, redash_visualizations: Optional[List[RedashVisua class Attributes(Redash.Attributes): redash_query_s_q_l: Optional[str] = Field(default=None, description="") redash_query_parameters: Optional[str] = Field(default=None, description="") - redash_query_schedule: Optional[Dict[str, str]] = Field(default=None, description="") - redash_query_last_execution_runtime: Optional[float] = Field(default=None, description="") - redash_query_last_executed_at: Optional[datetime] = Field(default=None, description="") - redash_query_schedule_humanized: Optional[str] = Field(default=None, description="") - redash_visualizations: Optional[List[RedashVisualization]] = Field(default=None, description="") # relationship + redash_query_schedule: Optional[Dict[str, str]] = Field( + default=None, description="" + ) + redash_query_last_execution_runtime: Optional[float] = Field( + default=None, description="" + ) + redash_query_last_executed_at: Optional[datetime] = Field( + default=None, description="" + ) + redash_query_schedule_humanized: Optional[str] = Field( + default=None, description="" + ) + redash_visualizations: Optional[List[RedashVisualization]] = Field( + default=None, description="" + ) # relationship attributes: RedashQuery.Attributes = Field( default_factory=lambda: RedashQuery.Attributes(), diff --git a/pyatlan/model/assets/redash_visualization.py b/pyatlan/model/assets/redash_visualization.py index c335e15de..9f097c8bd 100644 --- a/pyatlan/model/assets/redash_visualization.py +++ b/pyatlan/model/assets/redash_visualization.py @@ -68,7 +68,11 @@ def __setattr__(self, name, value): @property def redash_visualization_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.redash_visualization_type + return ( + None + if self.attributes is None + else self.attributes.redash_visualization_type + ) @redash_visualization_type.setter def redash_visualization_type(self, redash_visualization_type: Optional[str]): @@ -88,7 +92,11 @@ def redash_query_name(self, redash_query_name: Optional[str]): @property def redash_query_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.redash_query_qualified_name + return ( + None + if self.attributes is None + else self.attributes.redash_query_qualified_name + ) @redash_query_qualified_name.setter def redash_query_qualified_name(self, redash_query_qualified_name: Optional[str]): @@ -110,7 +118,9 @@ class Attributes(Redash.Attributes): redash_visualization_type: Optional[str] = Field(default=None, description="") redash_query_name: Optional[str] = Field(default=None, description="") redash_query_qualified_name: Optional[str] = Field(default=None, description="") - redash_query: Optional[RedashQuery] = Field(default=None, description="") # relationship + redash_query: Optional[RedashQuery] = Field( + default=None, description="" + ) # relationship attributes: RedashVisualization.Attributes = Field( default_factory=lambda: RedashVisualization.Attributes(), diff --git a/pyatlan/model/assets/s3.py b/pyatlan/model/assets/s3.py index 19140aeb1..8e4891389 100644 --- a/pyatlan/model/assets/s3.py +++ b/pyatlan/model/assets/s3.py @@ -30,7 +30,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - S3E_TAG: ClassVar[KeywordTextField] = KeywordTextField("s3ETag", "s3ETag", "s3ETag.text") + S3E_TAG: ClassVar[KeywordTextField] = KeywordTextField( + "s3ETag", "s3ETag", "s3ETag.text" + ) """ Entity tag for the asset. An entity tag is a hash of the object and represents changes to the contents of an object only, not its metadata. """ # noqa: E501 @@ -38,7 +40,9 @@ def __setattr__(self, name, value): """ """ - AWS_ARN: ClassVar[KeywordTextField] = KeywordTextField("awsArn", "awsArn", "awsArn.text") + AWS_ARN: ClassVar[KeywordTextField] = KeywordTextField( + "awsArn", "awsArn", "awsArn.text" + ) """ Amazon Resource Name (ARN) for this asset. This uniquely identifies the asset in AWS, and thus must be unique across all AWS asset instances. """ # noqa: E501 @@ -54,15 +58,21 @@ def __setattr__(self, name, value): """ Physical region where the data center in which the asset exists is clustered. """ - AWS_ACCOUNT_ID: ClassVar[KeywordField] = KeywordField("awsAccountId", "awsAccountId") + AWS_ACCOUNT_ID: ClassVar[KeywordField] = KeywordField( + "awsAccountId", "awsAccountId" + ) """ 12-digit number that uniquely identifies an AWS account. """ - AWS_RESOURCE_ID: ClassVar[KeywordField] = KeywordField("awsResourceId", "awsResourceId") + AWS_RESOURCE_ID: ClassVar[KeywordField] = KeywordField( + "awsResourceId", "awsResourceId" + ) """ Unique resource ID assigned when a new resource is created. """ - AWS_OWNER_NAME: ClassVar[KeywordTextField] = KeywordTextField("awsOwnerName", "awsOwnerName", "awsOwnerName.text") + AWS_OWNER_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "awsOwnerName", "awsOwnerName", "awsOwnerName.text" + ) """ Root user's name. """ diff --git a/pyatlan/model/assets/s3_bucket.py b/pyatlan/model/assets/s3_bucket.py index cf10dc475..078b27007 100644 --- a/pyatlan/model/assets/s3_bucket.py +++ b/pyatlan/model/assets/s3_bucket.py @@ -43,7 +43,9 @@ def creator( @classmethod @init_guid - def creator(cls, *, name: str, connection_qualified_name: str, aws_arn: Optional[str] = None) -> S3Bucket: + def creator( + cls, *, name: str, connection_qualified_name: str, aws_arn: Optional[str] = None + ) -> S3Bucket: validate_required_fields( ["name", "connection_qualified_name"], [name, connection_qualified_name], @@ -79,9 +81,13 @@ def create( @classmethod @init_guid - def create(cls, *, name: str, connection_qualified_name: str, aws_arn: Optional[str] = None) -> S3Bucket: + def create( + cls, *, name: str, connection_qualified_name: str, aws_arn: Optional[str] = None + ) -> S3Bucket: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -104,7 +110,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - S3OBJECT_COUNT: ClassVar[NumericField] = NumericField("s3ObjectCount", "s3ObjectCount") + S3OBJECT_COUNT: ClassVar[NumericField] = NumericField( + "s3ObjectCount", "s3ObjectCount" + ) """ Number of objects within the bucket. """ @@ -138,10 +146,16 @@ def s3_object_count(self, s3_object_count: Optional[int]): @property def s3_bucket_versioning_enabled(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.s3_bucket_versioning_enabled + return ( + None + if self.attributes is None + else self.attributes.s3_bucket_versioning_enabled + ) @s3_bucket_versioning_enabled.setter - def s3_bucket_versioning_enabled(self, s3_bucket_versioning_enabled: Optional[bool]): + def s3_bucket_versioning_enabled( + self, s3_bucket_versioning_enabled: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.s3_bucket_versioning_enabled = s3_bucket_versioning_enabled @@ -158,8 +172,12 @@ def objects(self, objects: Optional[List[S3Object]]): class Attributes(S3.Attributes): s3_object_count: Optional[int] = Field(default=None, description="") - s3_bucket_versioning_enabled: Optional[bool] = Field(default=None, description="") - objects: Optional[List[S3Object]] = Field(default=None, description="") # relationship + s3_bucket_versioning_enabled: Optional[bool] = Field( + default=None, description="" + ) + objects: Optional[List[S3Object]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid diff --git a/pyatlan/model/assets/s3_object.py b/pyatlan/model/assets/s3_object.py index 88740711c..cce6e9036 100644 --- a/pyatlan/model/assets/s3_object.py +++ b/pyatlan/model/assets/s3_object.py @@ -73,7 +73,9 @@ def create( s3_bucket_qualified_name: str, ) -> S3Object: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -140,11 +142,15 @@ def __setattr__(self, name, value): """ Time (epoch) at which this object was last updated, in milliseconds, or when it was created if it has never been modified. """ # noqa: E501 - S3BUCKET_NAME: ClassVar[KeywordTextField] = KeywordTextField("s3BucketName", "s3BucketName", "s3BucketName.text") + S3BUCKET_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "s3BucketName", "s3BucketName", "s3BucketName.text" + ) """ Simple name of the bucket in which this object exists. """ - S3BUCKET_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("s3BucketQualifiedName", "s3BucketQualifiedName") + S3BUCKET_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "s3BucketQualifiedName", "s3BucketQualifiedName" + ) """ Unique name of the bucket in which this object exists. """ @@ -152,15 +158,21 @@ def __setattr__(self, name, value): """ Object size in bytes. """ - S3OBJECT_STORAGE_CLASS: ClassVar[KeywordField] = KeywordField("s3ObjectStorageClass", "s3ObjectStorageClass") + S3OBJECT_STORAGE_CLASS: ClassVar[KeywordField] = KeywordField( + "s3ObjectStorageClass", "s3ObjectStorageClass" + ) """ Storage class used for storing this object, for example: standard, intelligent-tiering, glacier, etc. """ - S3OBJECT_KEY: ClassVar[KeywordTextField] = KeywordTextField("s3ObjectKey", "s3ObjectKey", "s3ObjectKey.text") + S3OBJECT_KEY: ClassVar[KeywordTextField] = KeywordTextField( + "s3ObjectKey", "s3ObjectKey", "s3ObjectKey.text" + ) """ Unique identity of this object in an S3 bucket. This is usually the concatenation of any prefix (folder) in the S3 bucket with the name of the object (file) itself. """ # noqa: E501 - S3OBJECT_CONTENT_TYPE: ClassVar[KeywordField] = KeywordField("s3ObjectContentType", "s3ObjectContentType") + S3OBJECT_CONTENT_TYPE: ClassVar[KeywordField] = KeywordField( + "s3ObjectContentType", "s3ObjectContentType" + ) """ Type of content in this object, for example: text/plain, application/json, etc. """ @@ -170,7 +182,9 @@ def __setattr__(self, name, value): """ Information about how this object's content should be presented. """ - S3OBJECT_VERSION_ID: ClassVar[KeywordField] = KeywordField("s3ObjectVersionId", "s3ObjectVersionId") + S3OBJECT_VERSION_ID: ClassVar[KeywordField] = KeywordField( + "s3ObjectVersionId", "s3ObjectVersionId" + ) """ Version of this object. This is only applicable when versioning is enabled on the bucket in which this object exists. """ # noqa: E501 @@ -195,10 +209,16 @@ def __setattr__(self, name, value): @property def s3_object_last_modified_time(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.s3_object_last_modified_time + return ( + None + if self.attributes is None + else self.attributes.s3_object_last_modified_time + ) @s3_object_last_modified_time.setter - def s3_object_last_modified_time(self, s3_object_last_modified_time: Optional[datetime]): + def s3_object_last_modified_time( + self, s3_object_last_modified_time: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.s3_object_last_modified_time = s3_object_last_modified_time @@ -215,7 +235,11 @@ def s3_bucket_name(self, s3_bucket_name: Optional[str]): @property def s3_bucket_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.s3_bucket_qualified_name + return ( + None + if self.attributes is None + else self.attributes.s3_bucket_qualified_name + ) @s3_bucket_qualified_name.setter def s3_bucket_qualified_name(self, s3_bucket_qualified_name: Optional[str]): @@ -235,7 +259,9 @@ def s3_object_size(self, s3_object_size: Optional[int]): @property def s3_object_storage_class(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.s3_object_storage_class + return ( + None if self.attributes is None else self.attributes.s3_object_storage_class + ) @s3_object_storage_class.setter def s3_object_storage_class(self, s3_object_storage_class: Optional[str]): @@ -255,7 +281,9 @@ def s3_object_key(self, s3_object_key: Optional[str]): @property def s3_object_content_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.s3_object_content_type + return ( + None if self.attributes is None else self.attributes.s3_object_content_type + ) @s3_object_content_type.setter def s3_object_content_type(self, s3_object_content_type: Optional[str]): @@ -265,10 +293,16 @@ def s3_object_content_type(self, s3_object_content_type: Optional[str]): @property def s3_object_content_disposition(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.s3_object_content_disposition + return ( + None + if self.attributes is None + else self.attributes.s3_object_content_disposition + ) @s3_object_content_disposition.setter - def s3_object_content_disposition(self, s3_object_content_disposition: Optional[str]): + def s3_object_content_disposition( + self, s3_object_content_disposition: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.s3_object_content_disposition = s3_object_content_disposition @@ -294,14 +328,18 @@ def bucket(self, bucket: Optional[S3Bucket]): self.attributes.bucket = bucket class Attributes(S3.Attributes): - s3_object_last_modified_time: Optional[datetime] = Field(default=None, description="") + s3_object_last_modified_time: Optional[datetime] = Field( + default=None, description="" + ) s3_bucket_name: Optional[str] = Field(default=None, description="") s3_bucket_qualified_name: Optional[str] = Field(default=None, description="") s3_object_size: Optional[int] = Field(default=None, description="") s3_object_storage_class: Optional[str] = Field(default=None, description="") s3_object_key: Optional[str] = Field(default=None, description="") s3_object_content_type: Optional[str] = Field(default=None, description="") - s3_object_content_disposition: Optional[str] = Field(default=None, description="") + s3_object_content_disposition: Optional[str] = Field( + default=None, description="" + ) s3_object_version_id: Optional[str] = Field(default=None, description="") bucket: Optional[S3Bucket] = Field(default=None, description="") # relationship diff --git a/pyatlan/model/assets/salesforce.py b/pyatlan/model/assets/salesforce.py index 22509bacc..32da0ae50 100644 --- a/pyatlan/model/assets/salesforce.py +++ b/pyatlan/model/assets/salesforce.py @@ -35,7 +35,9 @@ def __setattr__(self, name, value): """ Fully-qualified name of the organization in Salesforce. """ - API_NAME: ClassVar[KeywordTextField] = KeywordTextField("apiName", "apiName.keyword", "apiName") + API_NAME: ClassVar[KeywordTextField] = KeywordTextField( + "apiName", "apiName.keyword", "apiName" + ) """ Name of this asset in the Salesforce API. """ @@ -47,7 +49,11 @@ def __setattr__(self, name, value): @property def organization_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.organization_qualified_name + return ( + None + if self.attributes is None + else self.attributes.organization_qualified_name + ) @organization_qualified_name.setter def organization_qualified_name(self, organization_qualified_name: Optional[str]): diff --git a/pyatlan/model/assets/salesforce_dashboard.py b/pyatlan/model/assets/salesforce_dashboard.py index 0f435274b..c679a9a41 100644 --- a/pyatlan/model/assets/salesforce_dashboard.py +++ b/pyatlan/model/assets/salesforce_dashboard.py @@ -113,8 +113,12 @@ class Attributes(Salesforce.Attributes): source_id: Optional[str] = Field(default=None, description="") dashboard_type: Optional[str] = Field(default=None, description="") report_count: Optional[int] = Field(default=None, description="") - reports: Optional[List[SalesforceReport]] = Field(default=None, description="") # relationship - organization: Optional[SalesforceOrganization] = Field(default=None, description="") # relationship + reports: Optional[List[SalesforceReport]] = Field( + default=None, description="" + ) # relationship + organization: Optional[SalesforceOrganization] = Field( + default=None, description="" + ) # relationship attributes: SalesforceDashboard.Attributes = Field( default_factory=lambda: SalesforceDashboard.Attributes(), diff --git a/pyatlan/model/assets/salesforce_field.py b/pyatlan/model/assets/salesforce_field.py index 45014b6d3..74bac5d9f 100644 --- a/pyatlan/model/assets/salesforce_field.py +++ b/pyatlan/model/assets/salesforce_field.py @@ -36,11 +36,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - DATA_TYPE: ClassVar[KeywordTextField] = KeywordTextField("dataType", "dataType", "dataType.text") + DATA_TYPE: ClassVar[KeywordTextField] = KeywordTextField( + "dataType", "dataType", "dataType.text" + ) """ Data type of values in this field. """ - OBJECT_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField("objectQualifiedName", "objectQualifiedName") + OBJECT_QUALIFIED_NAME: ClassVar[KeywordField] = KeywordField( + "objectQualifiedName", "objectQualifiedName" + ) """ Unique name of the object in which this field exists. """ @@ -48,7 +52,9 @@ def __setattr__(self, name, value): """ Order (position) of this field within the object. """ - INLINE_HELP_TEXT: ClassVar[TextField] = TextField("inlineHelpText", "inlineHelpText.text") + INLINE_HELP_TEXT: ClassVar[TextField] = TextField( + "inlineHelpText", "inlineHelpText.text" + ) """ Help text for this field. """ @@ -60,7 +66,9 @@ def __setattr__(self, name, value): """ Formula for this field, if it is a calculated field. """ - IS_CASE_SENSITIVE: ClassVar[BooleanField] = BooleanField("isCaseSensitive", "isCaseSensitive") + IS_CASE_SENSITIVE: ClassVar[BooleanField] = BooleanField( + "isCaseSensitive", "isCaseSensitive" + ) """ Whether this field is case sensitive (true) or in-sensitive (false). """ @@ -98,7 +106,9 @@ def __setattr__(self, name, value): """ Whether this field references a record of multiple objects (true) or not (false). """ - DEFAULT_VALUE_FORMULA: ClassVar[TextField] = TextField("defaultValueFormula", "defaultValueFormula") + DEFAULT_VALUE_FORMULA: ClassVar[TextField] = TextField( + "defaultValueFormula", "defaultValueFormula" + ) """ Formula for the default value for this field. """ @@ -145,7 +155,9 @@ def data_type(self, data_type: Optional[str]): @property def object_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.object_qualified_name + return ( + None if self.attributes is None else self.attributes.object_qualified_name + ) @object_qualified_name.setter def object_qualified_name(self, object_qualified_name: Optional[str]): @@ -275,7 +287,11 @@ def picklist_values(self, picklist_values: Optional[Set[str]]): @property def is_polymorphic_foreign_key(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.is_polymorphic_foreign_key + return ( + None + if self.attributes is None + else self.attributes.is_polymorphic_foreign_key + ) @is_polymorphic_foreign_key.setter def is_polymorphic_foreign_key(self, is_polymorphic_foreign_key: Optional[bool]): @@ -285,7 +301,9 @@ def is_polymorphic_foreign_key(self, is_polymorphic_foreign_key: Optional[bool]) @property def default_value_formula(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.default_value_formula + return ( + None if self.attributes is None else self.attributes.default_value_formula + ) @default_value_formula.setter def default_value_formula(self, default_value_formula: Optional[str]): @@ -330,8 +348,12 @@ class Attributes(Salesforce.Attributes): picklist_values: Optional[Set[str]] = Field(default=None, description="") is_polymorphic_foreign_key: Optional[bool] = Field(default=None, description="") default_value_formula: Optional[str] = Field(default=None, description="") - lookup_objects: Optional[List[SalesforceObject]] = Field(default=None, description="") # relationship - object: Optional[SalesforceObject] = Field(default=None, description="") # relationship + lookup_objects: Optional[List[SalesforceObject]] = Field( + default=None, description="" + ) # relationship + object: Optional[SalesforceObject] = Field( + default=None, description="" + ) # relationship attributes: SalesforceField.Attributes = Field( default_factory=lambda: SalesforceField.Attributes(), diff --git a/pyatlan/model/assets/salesforce_object.py b/pyatlan/model/assets/salesforce_object.py index e468bee13..709638be8 100644 --- a/pyatlan/model/assets/salesforce_object.py +++ b/pyatlan/model/assets/salesforce_object.py @@ -144,9 +144,15 @@ class Attributes(Salesforce.Attributes): is_mergable: Optional[bool] = Field(default=None, description="") is_queryable: Optional[bool] = Field(default=None, description="") field_count: Optional[int] = Field(default=None, description="") - lookup_fields: Optional[List[SalesforceField]] = Field(default=None, description="") # relationship - organization: Optional[SalesforceOrganization] = Field(default=None, description="") # relationship - fields: Optional[List[SalesforceField]] = Field(default=None, description="") # relationship + lookup_fields: Optional[List[SalesforceField]] = Field( + default=None, description="" + ) # relationship + organization: Optional[SalesforceOrganization] = Field( + default=None, description="" + ) # relationship + fields: Optional[List[SalesforceField]] = Field( + default=None, description="" + ) # relationship attributes: SalesforceObject.Attributes = Field( default_factory=lambda: SalesforceObject.Attributes(), diff --git a/pyatlan/model/assets/salesforce_organization.py b/pyatlan/model/assets/salesforce_organization.py index abf4cf96c..ebae9fb6b 100644 --- a/pyatlan/model/assets/salesforce_organization.py +++ b/pyatlan/model/assets/salesforce_organization.py @@ -96,9 +96,15 @@ def dashboards(self, dashboards: Optional[List[SalesforceDashboard]]): class Attributes(Salesforce.Attributes): source_id: Optional[str] = Field(default=None, description="") - reports: Optional[List[SalesforceReport]] = Field(default=None, description="") # relationship - objects: Optional[List[SalesforceObject]] = Field(default=None, description="") # relationship - dashboards: Optional[List[SalesforceDashboard]] = Field(default=None, description="") # relationship + reports: Optional[List[SalesforceReport]] = Field( + default=None, description="" + ) # relationship + objects: Optional[List[SalesforceObject]] = Field( + default=None, description="" + ) # relationship + dashboards: Optional[List[SalesforceDashboard]] = Field( + default=None, description="" + ) # relationship attributes: SalesforceOrganization.Attributes = Field( default_factory=lambda: SalesforceOrganization.Attributes(), diff --git a/pyatlan/model/assets/salesforce_report.py b/pyatlan/model/assets/salesforce_report.py index 9569d563b..0972cdc9d 100644 --- a/pyatlan/model/assets/salesforce_report.py +++ b/pyatlan/model/assets/salesforce_report.py @@ -37,7 +37,9 @@ def __setattr__(self, name, value): """ Type of report in Salesforce. """ - DETAIL_COLUMNS: ClassVar[KeywordField] = KeywordField("detailColumns", "detailColumns") + DETAIL_COLUMNS: ClassVar[KeywordField] = KeywordField( + "detailColumns", "detailColumns" + ) """ List of column names on the report. """ @@ -113,8 +115,12 @@ class Attributes(Salesforce.Attributes): source_id: Optional[str] = Field(default=None, description="") report_type: Optional[Dict[str, str]] = Field(default=None, description="") detail_columns: Optional[Set[str]] = Field(default=None, description="") - dashboards: Optional[List[SalesforceDashboard]] = Field(default=None, description="") # relationship - organization: Optional[SalesforceOrganization] = Field(default=None, description="") # relationship + dashboards: Optional[List[SalesforceDashboard]] = Field( + default=None, description="" + ) # relationship + organization: Optional[SalesforceOrganization] = Field( + default=None, description="" + ) # relationship attributes: SalesforceReport.Attributes = Field( default_factory=lambda: SalesforceReport.Attributes(), diff --git a/pyatlan/model/assets/sigma.py b/pyatlan/model/assets/sigma.py index d1cc7053e..57497e5c0 100644 --- a/pyatlan/model/assets/sigma.py +++ b/pyatlan/model/assets/sigma.py @@ -83,10 +83,16 @@ def __setattr__(self, name, value): @property def sigma_workbook_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sigma_workbook_qualified_name + return ( + None + if self.attributes is None + else self.attributes.sigma_workbook_qualified_name + ) @sigma_workbook_qualified_name.setter - def sigma_workbook_qualified_name(self, sigma_workbook_qualified_name: Optional[str]): + def sigma_workbook_qualified_name( + self, sigma_workbook_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sigma_workbook_qualified_name = sigma_workbook_qualified_name @@ -103,7 +109,11 @@ def sigma_workbook_name(self, sigma_workbook_name: Optional[str]): @property def sigma_page_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sigma_page_qualified_name + return ( + None + if self.attributes is None + else self.attributes.sigma_page_qualified_name + ) @sigma_page_qualified_name.setter def sigma_page_qualified_name(self, sigma_page_qualified_name: Optional[str]): @@ -123,17 +133,27 @@ def sigma_page_name(self, sigma_page_name: Optional[str]): @property def sigma_data_element_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sigma_data_element_qualified_name + return ( + None + if self.attributes is None + else self.attributes.sigma_data_element_qualified_name + ) @sigma_data_element_qualified_name.setter - def sigma_data_element_qualified_name(self, sigma_data_element_qualified_name: Optional[str]): + def sigma_data_element_qualified_name( + self, sigma_data_element_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sigma_data_element_qualified_name = sigma_data_element_qualified_name + self.attributes.sigma_data_element_qualified_name = ( + sigma_data_element_qualified_name + ) @property def sigma_data_element_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sigma_data_element_name + return ( + None if self.attributes is None else self.attributes.sigma_data_element_name + ) @sigma_data_element_name.setter def sigma_data_element_name(self, sigma_data_element_name: Optional[str]): @@ -142,11 +162,15 @@ def sigma_data_element_name(self, sigma_data_element_name: Optional[str]): self.attributes.sigma_data_element_name = sigma_data_element_name class Attributes(BI.Attributes): - sigma_workbook_qualified_name: Optional[str] = Field(default=None, description="") + sigma_workbook_qualified_name: Optional[str] = Field( + default=None, description="" + ) sigma_workbook_name: Optional[str] = Field(default=None, description="") sigma_page_qualified_name: Optional[str] = Field(default=None, description="") sigma_page_name: Optional[str] = Field(default=None, description="") - sigma_data_element_qualified_name: Optional[str] = Field(default=None, description="") + sigma_data_element_qualified_name: Optional[str] = Field( + default=None, description="" + ) sigma_data_element_name: Optional[str] = Field(default=None, description="") attributes: Sigma.Attributes = Field( diff --git a/pyatlan/model/assets/sigma_data_element.py b/pyatlan/model/assets/sigma_data_element.py index c2011da3d..30db2720a 100644 --- a/pyatlan/model/assets/sigma_data_element.py +++ b/pyatlan/model/assets/sigma_data_element.py @@ -34,11 +34,15 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SIGMA_DATA_ELEMENT_QUERY: ClassVar[TextField] = TextField("sigmaDataElementQuery", "sigmaDataElementQuery") + SIGMA_DATA_ELEMENT_QUERY: ClassVar[TextField] = TextField( + "sigmaDataElementQuery", "sigmaDataElementQuery" + ) """ """ - SIGMA_DATA_ELEMENT_TYPE: ClassVar[KeywordField] = KeywordField("sigmaDataElementType", "sigmaDataElementType") + SIGMA_DATA_ELEMENT_TYPE: ClassVar[KeywordField] = KeywordField( + "sigmaDataElementType", "sigmaDataElementType" + ) """ """ @@ -53,7 +57,9 @@ def __setattr__(self, name, value): """ TBC """ - SIGMA_DATA_ELEMENT_FIELDS: ClassVar[RelationField] = RelationField("sigmaDataElementFields") + SIGMA_DATA_ELEMENT_FIELDS: ClassVar[RelationField] = RelationField( + "sigmaDataElementFields" + ) """ TBC """ @@ -68,7 +74,11 @@ def __setattr__(self, name, value): @property def sigma_data_element_query(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sigma_data_element_query + return ( + None + if self.attributes is None + else self.attributes.sigma_data_element_query + ) @sigma_data_element_query.setter def sigma_data_element_query(self, sigma_data_element_query: Optional[str]): @@ -78,7 +88,9 @@ def sigma_data_element_query(self, sigma_data_element_query: Optional[str]): @property def sigma_data_element_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sigma_data_element_type + return ( + None if self.attributes is None else self.attributes.sigma_data_element_type + ) @sigma_data_element_type.setter def sigma_data_element_type(self, sigma_data_element_type: Optional[str]): @@ -88,10 +100,16 @@ def sigma_data_element_type(self, sigma_data_element_type: Optional[str]): @property def sigma_data_element_field_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.sigma_data_element_field_count + return ( + None + if self.attributes is None + else self.attributes.sigma_data_element_field_count + ) @sigma_data_element_field_count.setter - def sigma_data_element_field_count(self, sigma_data_element_field_count: Optional[int]): + def sigma_data_element_field_count( + self, sigma_data_element_field_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sigma_data_element_field_count = sigma_data_element_field_count @@ -108,10 +126,16 @@ def sigma_page(self, sigma_page: Optional[SigmaPage]): @property def sigma_data_element_fields(self) -> Optional[List[SigmaDataElementField]]: - return None if self.attributes is None else self.attributes.sigma_data_element_fields + return ( + None + if self.attributes is None + else self.attributes.sigma_data_element_fields + ) @sigma_data_element_fields.setter - def sigma_data_element_fields(self, sigma_data_element_fields: Optional[List[SigmaDataElementField]]): + def sigma_data_element_fields( + self, sigma_data_element_fields: Optional[List[SigmaDataElementField]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sigma_data_element_fields = sigma_data_element_fields @@ -119,8 +143,12 @@ def sigma_data_element_fields(self, sigma_data_element_fields: Optional[List[Sig class Attributes(Sigma.Attributes): sigma_data_element_query: Optional[str] = Field(default=None, description="") sigma_data_element_type: Optional[str] = Field(default=None, description="") - sigma_data_element_field_count: Optional[int] = Field(default=None, description="") - sigma_page: Optional[SigmaPage] = Field(default=None, description="") # relationship + sigma_data_element_field_count: Optional[int] = Field( + default=None, description="" + ) + sigma_page: Optional[SigmaPage] = Field( + default=None, description="" + ) # relationship sigma_data_element_fields: Optional[List[SigmaDataElementField]] = Field( default=None, description="" ) # relationship diff --git a/pyatlan/model/assets/sigma_data_element_field.py b/pyatlan/model/assets/sigma_data_element_field.py index c57f26dff..7be2beb92 100644 --- a/pyatlan/model/assets/sigma_data_element_field.py +++ b/pyatlan/model/assets/sigma_data_element_field.py @@ -55,23 +55,39 @@ def __setattr__(self, name, value): @property def sigma_data_element_field_is_hidden(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.sigma_data_element_field_is_hidden + return ( + None + if self.attributes is None + else self.attributes.sigma_data_element_field_is_hidden + ) @sigma_data_element_field_is_hidden.setter - def sigma_data_element_field_is_hidden(self, sigma_data_element_field_is_hidden: Optional[bool]): + def sigma_data_element_field_is_hidden( + self, sigma_data_element_field_is_hidden: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sigma_data_element_field_is_hidden = sigma_data_element_field_is_hidden + self.attributes.sigma_data_element_field_is_hidden = ( + sigma_data_element_field_is_hidden + ) @property def sigma_data_element_field_formula(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sigma_data_element_field_formula + return ( + None + if self.attributes is None + else self.attributes.sigma_data_element_field_formula + ) @sigma_data_element_field_formula.setter - def sigma_data_element_field_formula(self, sigma_data_element_field_formula: Optional[str]): + def sigma_data_element_field_formula( + self, sigma_data_element_field_formula: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sigma_data_element_field_formula = sigma_data_element_field_formula + self.attributes.sigma_data_element_field_formula = ( + sigma_data_element_field_formula + ) @property def sigma_data_element(self) -> Optional[SigmaDataElement]: @@ -84,9 +100,15 @@ def sigma_data_element(self, sigma_data_element: Optional[SigmaDataElement]): self.attributes.sigma_data_element = sigma_data_element class Attributes(Sigma.Attributes): - sigma_data_element_field_is_hidden: Optional[bool] = Field(default=None, description="") - sigma_data_element_field_formula: Optional[str] = Field(default=None, description="") - sigma_data_element: Optional[SigmaDataElement] = Field(default=None, description="") # relationship + sigma_data_element_field_is_hidden: Optional[bool] = Field( + default=None, description="" + ) + sigma_data_element_field_formula: Optional[str] = Field( + default=None, description="" + ) + sigma_data_element: Optional[SigmaDataElement] = Field( + default=None, description="" + ) # relationship attributes: SigmaDataElementField.Attributes = Field( default_factory=lambda: SigmaDataElementField.Attributes(), diff --git a/pyatlan/model/assets/sigma_dataset.py b/pyatlan/model/assets/sigma_dataset.py index 3ab0e8cba..fbe9c6b7a 100644 --- a/pyatlan/model/assets/sigma_dataset.py +++ b/pyatlan/model/assets/sigma_dataset.py @@ -36,7 +36,9 @@ def __setattr__(self, name, value): Number of columns in this dataset. """ - SIGMA_DATASET_COLUMNS: ClassVar[RelationField] = RelationField("sigmaDatasetColumns") + SIGMA_DATASET_COLUMNS: ClassVar[RelationField] = RelationField( + "sigmaDatasetColumns" + ) """ TBC """ @@ -48,7 +50,11 @@ def __setattr__(self, name, value): @property def sigma_dataset_column_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.sigma_dataset_column_count + return ( + None + if self.attributes is None + else self.attributes.sigma_dataset_column_count + ) @sigma_dataset_column_count.setter def sigma_dataset_column_count(self, sigma_dataset_column_count: Optional[int]): @@ -58,17 +64,23 @@ def sigma_dataset_column_count(self, sigma_dataset_column_count: Optional[int]): @property def sigma_dataset_columns(self) -> Optional[List[SigmaDatasetColumn]]: - return None if self.attributes is None else self.attributes.sigma_dataset_columns + return ( + None if self.attributes is None else self.attributes.sigma_dataset_columns + ) @sigma_dataset_columns.setter - def sigma_dataset_columns(self, sigma_dataset_columns: Optional[List[SigmaDatasetColumn]]): + def sigma_dataset_columns( + self, sigma_dataset_columns: Optional[List[SigmaDatasetColumn]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sigma_dataset_columns = sigma_dataset_columns class Attributes(Sigma.Attributes): sigma_dataset_column_count: Optional[int] = Field(default=None, description="") - sigma_dataset_columns: Optional[List[SigmaDatasetColumn]] = Field(default=None, description="") # relationship + sigma_dataset_columns: Optional[List[SigmaDatasetColumn]] = Field( + default=None, description="" + ) # relationship attributes: SigmaDataset.Attributes = Field( default_factory=lambda: SigmaDataset.Attributes(), diff --git a/pyatlan/model/assets/sigma_dataset_column.py b/pyatlan/model/assets/sigma_dataset_column.py index d04e968e7..44de778ee 100644 --- a/pyatlan/model/assets/sigma_dataset_column.py +++ b/pyatlan/model/assets/sigma_dataset_column.py @@ -57,7 +57,11 @@ def __setattr__(self, name, value): @property def sigma_dataset_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sigma_dataset_qualified_name + return ( + None + if self.attributes is None + else self.attributes.sigma_dataset_qualified_name + ) @sigma_dataset_qualified_name.setter def sigma_dataset_qualified_name(self, sigma_dataset_qualified_name: Optional[str]): @@ -86,9 +90,13 @@ def sigma_dataset(self, sigma_dataset: Optional[SigmaDataset]): self.attributes.sigma_dataset = sigma_dataset class Attributes(Sigma.Attributes): - sigma_dataset_qualified_name: Optional[str] = Field(default=None, description="") + sigma_dataset_qualified_name: Optional[str] = Field( + default=None, description="" + ) sigma_dataset_name: Optional[str] = Field(default=None, description="") - sigma_dataset: Optional[SigmaDataset] = Field(default=None, description="") # relationship + sigma_dataset: Optional[SigmaDataset] = Field( + default=None, description="" + ) # relationship attributes: SigmaDatasetColumn.Attributes = Field( default_factory=lambda: SigmaDatasetColumn.Attributes(), diff --git a/pyatlan/model/assets/sigma_page.py b/pyatlan/model/assets/sigma_page.py index 87f04a789..a33b75215 100644 --- a/pyatlan/model/assets/sigma_page.py +++ b/pyatlan/model/assets/sigma_page.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SIGMA_DATA_ELEMENT_COUNT: ClassVar[NumericField] = NumericField("sigmaDataElementCount", "sigmaDataElementCount") + SIGMA_DATA_ELEMENT_COUNT: ClassVar[NumericField] = NumericField( + "sigmaDataElementCount", "sigmaDataElementCount" + ) """ Number of data elements on this page. """ @@ -51,7 +53,11 @@ def __setattr__(self, name, value): @property def sigma_data_element_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.sigma_data_element_count + return ( + None + if self.attributes is None + else self.attributes.sigma_data_element_count + ) @sigma_data_element_count.setter def sigma_data_element_count(self, sigma_data_element_count: Optional[int]): @@ -74,15 +80,21 @@ def sigma_data_elements(self) -> Optional[List[SigmaDataElement]]: return None if self.attributes is None else self.attributes.sigma_data_elements @sigma_data_elements.setter - def sigma_data_elements(self, sigma_data_elements: Optional[List[SigmaDataElement]]): + def sigma_data_elements( + self, sigma_data_elements: Optional[List[SigmaDataElement]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sigma_data_elements = sigma_data_elements class Attributes(Sigma.Attributes): sigma_data_element_count: Optional[int] = Field(default=None, description="") - sigma_workbook: Optional[SigmaWorkbook] = Field(default=None, description="") # relationship - sigma_data_elements: Optional[List[SigmaDataElement]] = Field(default=None, description="") # relationship + sigma_workbook: Optional[SigmaWorkbook] = Field( + default=None, description="" + ) # relationship + sigma_data_elements: Optional[List[SigmaDataElement]] = Field( + default=None, description="" + ) # relationship attributes: SigmaPage.Attributes = Field( default_factory=lambda: SigmaPage.Attributes(), diff --git a/pyatlan/model/assets/sigma_workbook.py b/pyatlan/model/assets/sigma_workbook.py index 1e01e9a66..6ecb9690d 100644 --- a/pyatlan/model/assets/sigma_workbook.py +++ b/pyatlan/model/assets/sigma_workbook.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SIGMA_PAGE_COUNT: ClassVar[NumericField] = NumericField("sigmaPageCount", "sigmaPageCount") + SIGMA_PAGE_COUNT: ClassVar[NumericField] = NumericField( + "sigmaPageCount", "sigmaPageCount" + ) """ Number of pages in this workbook. """ @@ -66,7 +68,9 @@ def sigma_pages(self, sigma_pages: Optional[List[SigmaPage]]): class Attributes(Sigma.Attributes): sigma_page_count: Optional[int] = Field(default=None, description="") - sigma_pages: Optional[List[SigmaPage]] = Field(default=None, description="") # relationship + sigma_pages: Optional[List[SigmaPage]] = Field( + default=None, description="" + ) # relationship attributes: SigmaWorkbook.Attributes = Field( default_factory=lambda: SigmaWorkbook.Attributes(), diff --git a/pyatlan/model/assets/sisense_dashboard.py b/pyatlan/model/assets/sisense_dashboard.py index 0454a9d19..e8c743631 100644 --- a/pyatlan/model/assets/sisense_dashboard.py +++ b/pyatlan/model/assets/sisense_dashboard.py @@ -33,10 +33,12 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SISENSE_DASHBOARD_FOLDER_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "sisenseDashboardFolderQualifiedName", - "sisenseDashboardFolderQualifiedName", - "sisenseDashboardFolderQualifiedName.text", + SISENSE_DASHBOARD_FOLDER_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( + KeywordTextField( + "sisenseDashboardFolderQualifiedName", + "sisenseDashboardFolderQualifiedName", + "sisenseDashboardFolderQualifiedName.text", + ) ) """ Unique name of the folder in which this dashboard exists. @@ -71,20 +73,34 @@ def __setattr__(self, name, value): @property def sisense_dashboard_folder_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_dashboard_folder_qualified_name + return ( + None + if self.attributes is None + else self.attributes.sisense_dashboard_folder_qualified_name + ) @sisense_dashboard_folder_qualified_name.setter - def sisense_dashboard_folder_qualified_name(self, sisense_dashboard_folder_qualified_name: Optional[str]): + def sisense_dashboard_folder_qualified_name( + self, sisense_dashboard_folder_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_dashboard_folder_qualified_name = sisense_dashboard_folder_qualified_name + self.attributes.sisense_dashboard_folder_qualified_name = ( + sisense_dashboard_folder_qualified_name + ) @property def sisense_dashboard_widget_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.sisense_dashboard_widget_count + return ( + None + if self.attributes is None + else self.attributes.sisense_dashboard_widget_count + ) @sisense_dashboard_widget_count.setter - def sisense_dashboard_widget_count(self, sisense_dashboard_widget_count: Optional[int]): + def sisense_dashboard_widget_count( + self, sisense_dashboard_widget_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sisense_dashboard_widget_count = sisense_dashboard_widget_count @@ -120,11 +136,21 @@ def sisense_folder(self, sisense_folder: Optional[SisenseFolder]): self.attributes.sisense_folder = sisense_folder class Attributes(Sisense.Attributes): - sisense_dashboard_folder_qualified_name: Optional[str] = Field(default=None, description="") - sisense_dashboard_widget_count: Optional[int] = Field(default=None, description="") - sisense_datamodels: Optional[List[SisenseDatamodel]] = Field(default=None, description="") # relationship - sisense_widgets: Optional[List[SisenseWidget]] = Field(default=None, description="") # relationship - sisense_folder: Optional[SisenseFolder] = Field(default=None, description="") # relationship + sisense_dashboard_folder_qualified_name: Optional[str] = Field( + default=None, description="" + ) + sisense_dashboard_widget_count: Optional[int] = Field( + default=None, description="" + ) + sisense_datamodels: Optional[List[SisenseDatamodel]] = Field( + default=None, description="" + ) # relationship + sisense_widgets: Optional[List[SisenseWidget]] = Field( + default=None, description="" + ) # relationship + sisense_folder: Optional[SisenseFolder] = Field( + default=None, description="" + ) # relationship attributes: SisenseDashboard.Attributes = Field( default_factory=lambda: SisenseDashboard.Attributes(), diff --git a/pyatlan/model/assets/sisense_datamodel.py b/pyatlan/model/assets/sisense_datamodel.py index 420d0cdb1..e08d11104 100644 --- a/pyatlan/model/assets/sisense_datamodel.py +++ b/pyatlan/model/assets/sisense_datamodel.py @@ -36,7 +36,9 @@ def __setattr__(self, name, value): """ Number of tables in this datamodel. """ - SISENSE_DATAMODEL_SERVER: ClassVar[KeywordField] = KeywordField("sisenseDatamodelServer", "sisenseDatamodelServer") + SISENSE_DATAMODEL_SERVER: ClassVar[KeywordField] = KeywordField( + "sisenseDatamodelServer", "sisenseDatamodelServer" + ) """ Hostname of the server on which this datamodel was created. """ @@ -65,7 +67,9 @@ def __setattr__(self, name, value): """ Time (epoch) when this datamodel was last published, in milliseconds. """ - SISENSE_DATAMODEL_TYPE: ClassVar[KeywordField] = KeywordField("sisenseDatamodelType", "sisenseDatamodelType") + SISENSE_DATAMODEL_TYPE: ClassVar[KeywordField] = KeywordField( + "sisenseDatamodelType", "sisenseDatamodelType" + ) """ Type of this datamodel, for example: 'extract' or 'custom'. """ @@ -76,7 +80,9 @@ def __setattr__(self, name, value): Default relation type for this datamodel. 'extract' type Datamodels have regular relations by default. 'live' type Datamodels have direct relations by default. """ # noqa: E501 - SISENSE_DATAMODEL_TABLES: ClassVar[RelationField] = RelationField("sisenseDatamodelTables") + SISENSE_DATAMODEL_TABLES: ClassVar[RelationField] = RelationField( + "sisenseDatamodelTables" + ) """ TBC """ @@ -100,17 +106,27 @@ def __setattr__(self, name, value): @property def sisense_datamodel_table_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.sisense_datamodel_table_count + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_table_count + ) @sisense_datamodel_table_count.setter - def sisense_datamodel_table_count(self, sisense_datamodel_table_count: Optional[int]): + def sisense_datamodel_table_count( + self, sisense_datamodel_table_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sisense_datamodel_table_count = sisense_datamodel_table_count @property def sisense_datamodel_server(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_datamodel_server + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_server + ) @sisense_datamodel_server.setter def sisense_datamodel_server(self, sisense_datamodel_server: Optional[str]): @@ -120,7 +136,11 @@ def sisense_datamodel_server(self, sisense_datamodel_server: Optional[str]): @property def sisense_datamodel_revision(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_datamodel_revision + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_revision + ) @sisense_datamodel_revision.setter def sisense_datamodel_revision(self, sisense_datamodel_revision: Optional[str]): @@ -130,17 +150,29 @@ def sisense_datamodel_revision(self, sisense_datamodel_revision: Optional[str]): @property def sisense_datamodel_last_build_time(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.sisense_datamodel_last_build_time + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_last_build_time + ) @sisense_datamodel_last_build_time.setter - def sisense_datamodel_last_build_time(self, sisense_datamodel_last_build_time: Optional[datetime]): + def sisense_datamodel_last_build_time( + self, sisense_datamodel_last_build_time: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_last_build_time = sisense_datamodel_last_build_time + self.attributes.sisense_datamodel_last_build_time = ( + sisense_datamodel_last_build_time + ) @property def sisense_datamodel_last_successful_build_time(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.sisense_datamodel_last_successful_build_time + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_last_successful_build_time + ) @sisense_datamodel_last_successful_build_time.setter def sisense_datamodel_last_successful_build_time( @@ -148,21 +180,33 @@ def sisense_datamodel_last_successful_build_time( ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_last_successful_build_time = sisense_datamodel_last_successful_build_time + self.attributes.sisense_datamodel_last_successful_build_time = ( + sisense_datamodel_last_successful_build_time + ) @property def sisense_datamodel_last_publish_time(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.sisense_datamodel_last_publish_time + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_last_publish_time + ) @sisense_datamodel_last_publish_time.setter - def sisense_datamodel_last_publish_time(self, sisense_datamodel_last_publish_time: Optional[datetime]): + def sisense_datamodel_last_publish_time( + self, sisense_datamodel_last_publish_time: Optional[datetime] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_last_publish_time = sisense_datamodel_last_publish_time + self.attributes.sisense_datamodel_last_publish_time = ( + sisense_datamodel_last_publish_time + ) @property def sisense_datamodel_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_datamodel_type + return ( + None if self.attributes is None else self.attributes.sisense_datamodel_type + ) @sisense_datamodel_type.setter def sisense_datamodel_type(self, sisense_datamodel_type: Optional[str]): @@ -172,20 +216,34 @@ def sisense_datamodel_type(self, sisense_datamodel_type: Optional[str]): @property def sisense_datamodel_relation_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_datamodel_relation_type + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_relation_type + ) @sisense_datamodel_relation_type.setter - def sisense_datamodel_relation_type(self, sisense_datamodel_relation_type: Optional[str]): + def sisense_datamodel_relation_type( + self, sisense_datamodel_relation_type: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_relation_type = sisense_datamodel_relation_type + self.attributes.sisense_datamodel_relation_type = ( + sisense_datamodel_relation_type + ) @property def sisense_datamodel_tables(self) -> Optional[List[SisenseDatamodelTable]]: - return None if self.attributes is None else self.attributes.sisense_datamodel_tables + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_tables + ) @sisense_datamodel_tables.setter - def sisense_datamodel_tables(self, sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]]): + def sisense_datamodel_tables( + self, sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sisense_datamodel_tables = sisense_datamodel_tables @@ -201,18 +259,30 @@ def sisense_dashboards(self, sisense_dashboards: Optional[List[SisenseDashboard] self.attributes.sisense_dashboards = sisense_dashboards class Attributes(Sisense.Attributes): - sisense_datamodel_table_count: Optional[int] = Field(default=None, description="") + sisense_datamodel_table_count: Optional[int] = Field( + default=None, description="" + ) sisense_datamodel_server: Optional[str] = Field(default=None, description="") sisense_datamodel_revision: Optional[str] = Field(default=None, description="") - sisense_datamodel_last_build_time: Optional[datetime] = Field(default=None, description="") - sisense_datamodel_last_successful_build_time: Optional[datetime] = Field(default=None, description="") - sisense_datamodel_last_publish_time: Optional[datetime] = Field(default=None, description="") + sisense_datamodel_last_build_time: Optional[datetime] = Field( + default=None, description="" + ) + sisense_datamodel_last_successful_build_time: Optional[datetime] = Field( + default=None, description="" + ) + sisense_datamodel_last_publish_time: Optional[datetime] = Field( + default=None, description="" + ) sisense_datamodel_type: Optional[str] = Field(default=None, description="") - sisense_datamodel_relation_type: Optional[str] = Field(default=None, description="") + sisense_datamodel_relation_type: Optional[str] = Field( + default=None, description="" + ) sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]] = Field( default=None, description="" ) # relationship - sisense_dashboards: Optional[List[SisenseDashboard]] = Field(default=None, description="") # relationship + sisense_dashboards: Optional[List[SisenseDashboard]] = Field( + default=None, description="" + ) # relationship attributes: SisenseDatamodel.Attributes = Field( default_factory=lambda: SisenseDatamodel.Attributes(), diff --git a/pyatlan/model/assets/sisense_datamodel_table.py b/pyatlan/model/assets/sisense_datamodel_table.py index 11948f677..ddaa5a5e3 100644 --- a/pyatlan/model/assets/sisense_datamodel_table.py +++ b/pyatlan/model/assets/sisense_datamodel_table.py @@ -112,27 +112,47 @@ def __setattr__(self, name, value): @property def sisense_datamodel_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_datamodel_qualified_name + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_qualified_name + ) @sisense_datamodel_qualified_name.setter - def sisense_datamodel_qualified_name(self, sisense_datamodel_qualified_name: Optional[str]): + def sisense_datamodel_qualified_name( + self, sisense_datamodel_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_qualified_name = sisense_datamodel_qualified_name + self.attributes.sisense_datamodel_qualified_name = ( + sisense_datamodel_qualified_name + ) @property def sisense_datamodel_table_column_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.sisense_datamodel_table_column_count + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_table_column_count + ) @sisense_datamodel_table_column_count.setter - def sisense_datamodel_table_column_count(self, sisense_datamodel_table_column_count: Optional[int]): + def sisense_datamodel_table_column_count( + self, sisense_datamodel_table_column_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_column_count = sisense_datamodel_table_column_count + self.attributes.sisense_datamodel_table_column_count = ( + sisense_datamodel_table_column_count + ) @property def sisense_datamodel_table_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_datamodel_table_type + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_table_type + ) @sisense_datamodel_table_type.setter def sisense_datamodel_table_type(self, sisense_datamodel_table_type: Optional[str]): @@ -142,53 +162,93 @@ def sisense_datamodel_table_type(self, sisense_datamodel_table_type: Optional[st @property def sisense_datamodel_table_expression(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_datamodel_table_expression + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_table_expression + ) @sisense_datamodel_table_expression.setter - def sisense_datamodel_table_expression(self, sisense_datamodel_table_expression: Optional[str]): + def sisense_datamodel_table_expression( + self, sisense_datamodel_table_expression: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_expression = sisense_datamodel_table_expression + self.attributes.sisense_datamodel_table_expression = ( + sisense_datamodel_table_expression + ) @property def sisense_datamodel_table_is_materialized(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.sisense_datamodel_table_is_materialized + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_table_is_materialized + ) @sisense_datamodel_table_is_materialized.setter - def sisense_datamodel_table_is_materialized(self, sisense_datamodel_table_is_materialized: Optional[bool]): + def sisense_datamodel_table_is_materialized( + self, sisense_datamodel_table_is_materialized: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_is_materialized = sisense_datamodel_table_is_materialized + self.attributes.sisense_datamodel_table_is_materialized = ( + sisense_datamodel_table_is_materialized + ) @property def sisense_datamodel_table_is_hidden(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.sisense_datamodel_table_is_hidden + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_table_is_hidden + ) @sisense_datamodel_table_is_hidden.setter - def sisense_datamodel_table_is_hidden(self, sisense_datamodel_table_is_hidden: Optional[bool]): + def sisense_datamodel_table_is_hidden( + self, sisense_datamodel_table_is_hidden: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_is_hidden = sisense_datamodel_table_is_hidden + self.attributes.sisense_datamodel_table_is_hidden = ( + sisense_datamodel_table_is_hidden + ) @property def sisense_datamodel_table_schedule(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_datamodel_table_schedule + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_table_schedule + ) @sisense_datamodel_table_schedule.setter - def sisense_datamodel_table_schedule(self, sisense_datamodel_table_schedule: Optional[str]): + def sisense_datamodel_table_schedule( + self, sisense_datamodel_table_schedule: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_schedule = sisense_datamodel_table_schedule + self.attributes.sisense_datamodel_table_schedule = ( + sisense_datamodel_table_schedule + ) @property def sisense_datamodel_table_live_query_settings(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_datamodel_table_live_query_settings + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_table_live_query_settings + ) @sisense_datamodel_table_live_query_settings.setter - def sisense_datamodel_table_live_query_settings(self, sisense_datamodel_table_live_query_settings: Optional[str]): + def sisense_datamodel_table_live_query_settings( + self, sisense_datamodel_table_live_query_settings: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_datamodel_table_live_query_settings = sisense_datamodel_table_live_query_settings + self.attributes.sisense_datamodel_table_live_query_settings = ( + sisense_datamodel_table_live_query_settings + ) @property def sisense_widgets(self) -> Optional[List[SisenseWidget]]: @@ -211,16 +271,36 @@ def sisense_datamodel(self, sisense_datamodel: Optional[SisenseDatamodel]): self.attributes.sisense_datamodel = sisense_datamodel class Attributes(Sisense.Attributes): - sisense_datamodel_qualified_name: Optional[str] = Field(default=None, description="") - sisense_datamodel_table_column_count: Optional[int] = Field(default=None, description="") - sisense_datamodel_table_type: Optional[str] = Field(default=None, description="") - sisense_datamodel_table_expression: Optional[str] = Field(default=None, description="") - sisense_datamodel_table_is_materialized: Optional[bool] = Field(default=None, description="") - sisense_datamodel_table_is_hidden: Optional[bool] = Field(default=None, description="") - sisense_datamodel_table_schedule: Optional[str] = Field(default=None, description="") - sisense_datamodel_table_live_query_settings: Optional[str] = Field(default=None, description="") - sisense_widgets: Optional[List[SisenseWidget]] = Field(default=None, description="") # relationship - sisense_datamodel: Optional[SisenseDatamodel] = Field(default=None, description="") # relationship + sisense_datamodel_qualified_name: Optional[str] = Field( + default=None, description="" + ) + sisense_datamodel_table_column_count: Optional[int] = Field( + default=None, description="" + ) + sisense_datamodel_table_type: Optional[str] = Field( + default=None, description="" + ) + sisense_datamodel_table_expression: Optional[str] = Field( + default=None, description="" + ) + sisense_datamodel_table_is_materialized: Optional[bool] = Field( + default=None, description="" + ) + sisense_datamodel_table_is_hidden: Optional[bool] = Field( + default=None, description="" + ) + sisense_datamodel_table_schedule: Optional[str] = Field( + default=None, description="" + ) + sisense_datamodel_table_live_query_settings: Optional[str] = Field( + default=None, description="" + ) + sisense_widgets: Optional[List[SisenseWidget]] = Field( + default=None, description="" + ) # relationship + sisense_datamodel: Optional[SisenseDatamodel] = Field( + default=None, description="" + ) # relationship attributes: SisenseDatamodelTable.Attributes = Field( default_factory=lambda: SisenseDatamodelTable.Attributes(), diff --git a/pyatlan/model/assets/sisense_folder.py b/pyatlan/model/assets/sisense_folder.py index 19f6660e8..000a59671 100644 --- a/pyatlan/model/assets/sisense_folder.py +++ b/pyatlan/model/assets/sisense_folder.py @@ -29,10 +29,12 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SISENSE_FOLDER_PARENT_FOLDER_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "sisenseFolderParentFolderQualifiedName", - "sisenseFolderParentFolderQualifiedName", - "sisenseFolderParentFolderQualifiedName.text", + SISENSE_FOLDER_PARENT_FOLDER_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( + KeywordTextField( + "sisenseFolderParentFolderQualifiedName", + "sisenseFolderParentFolderQualifiedName", + "sisenseFolderParentFolderQualifiedName.text", + ) ) """ Unique name of the parent folder in which this folder exists. @@ -42,7 +44,9 @@ def __setattr__(self, name, value): """ TBC """ - SISENSE_CHILD_FOLDERS: ClassVar[RelationField] = RelationField("sisenseChildFolders") + SISENSE_CHILD_FOLDERS: ClassVar[RelationField] = RelationField( + "sisenseChildFolders" + ) """ TBC """ @@ -50,7 +54,9 @@ def __setattr__(self, name, value): """ TBC """ - SISENSE_PARENT_FOLDER: ClassVar[RelationField] = RelationField("sisenseParentFolder") + SISENSE_PARENT_FOLDER: ClassVar[RelationField] = RelationField( + "sisenseParentFolder" + ) """ TBC """ @@ -65,13 +71,21 @@ def __setattr__(self, name, value): @property def sisense_folder_parent_folder_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_folder_parent_folder_qualified_name + return ( + None + if self.attributes is None + else self.attributes.sisense_folder_parent_folder_qualified_name + ) @sisense_folder_parent_folder_qualified_name.setter - def sisense_folder_parent_folder_qualified_name(self, sisense_folder_parent_folder_qualified_name: Optional[str]): + def sisense_folder_parent_folder_qualified_name( + self, sisense_folder_parent_folder_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_folder_parent_folder_qualified_name = sisense_folder_parent_folder_qualified_name + self.attributes.sisense_folder_parent_folder_qualified_name = ( + sisense_folder_parent_folder_qualified_name + ) @property def sisense_widgets(self) -> Optional[List[SisenseWidget]]: @@ -85,10 +99,14 @@ def sisense_widgets(self, sisense_widgets: Optional[List[SisenseWidget]]): @property def sisense_child_folders(self) -> Optional[List[SisenseFolder]]: - return None if self.attributes is None else self.attributes.sisense_child_folders + return ( + None if self.attributes is None else self.attributes.sisense_child_folders + ) @sisense_child_folders.setter - def sisense_child_folders(self, sisense_child_folders: Optional[List[SisenseFolder]]): + def sisense_child_folders( + self, sisense_child_folders: Optional[List[SisenseFolder]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sisense_child_folders = sisense_child_folders @@ -105,7 +123,9 @@ def sisense_dashboards(self, sisense_dashboards: Optional[List[SisenseDashboard] @property def sisense_parent_folder(self) -> Optional[SisenseFolder]: - return None if self.attributes is None else self.attributes.sisense_parent_folder + return ( + None if self.attributes is None else self.attributes.sisense_parent_folder + ) @sisense_parent_folder.setter def sisense_parent_folder(self, sisense_parent_folder: Optional[SisenseFolder]): @@ -114,11 +134,21 @@ def sisense_parent_folder(self, sisense_parent_folder: Optional[SisenseFolder]): self.attributes.sisense_parent_folder = sisense_parent_folder class Attributes(Sisense.Attributes): - sisense_folder_parent_folder_qualified_name: Optional[str] = Field(default=None, description="") - sisense_widgets: Optional[List[SisenseWidget]] = Field(default=None, description="") # relationship - sisense_child_folders: Optional[List[SisenseFolder]] = Field(default=None, description="") # relationship - sisense_dashboards: Optional[List[SisenseDashboard]] = Field(default=None, description="") # relationship - sisense_parent_folder: Optional[SisenseFolder] = Field(default=None, description="") # relationship + sisense_folder_parent_folder_qualified_name: Optional[str] = Field( + default=None, description="" + ) + sisense_widgets: Optional[List[SisenseWidget]] = Field( + default=None, description="" + ) # relationship + sisense_child_folders: Optional[List[SisenseFolder]] = Field( + default=None, description="" + ) # relationship + sisense_dashboards: Optional[List[SisenseDashboard]] = Field( + default=None, description="" + ) # relationship + sisense_parent_folder: Optional[SisenseFolder] = Field( + default=None, description="" + ) # relationship attributes: SisenseFolder.Attributes = Field( default_factory=lambda: SisenseFolder.Attributes(), diff --git a/pyatlan/model/assets/sisense_widget.py b/pyatlan/model/assets/sisense_widget.py index c97353958..7750faa3b 100644 --- a/pyatlan/model/assets/sisense_widget.py +++ b/pyatlan/model/assets/sisense_widget.py @@ -40,18 +40,24 @@ def __setattr__(self, name, value): """ Number of columns used in this widget. """ - SISENSE_WIDGET_SUB_TYPE: ClassVar[KeywordField] = KeywordField("sisenseWidgetSubType", "sisenseWidgetSubType") + SISENSE_WIDGET_SUB_TYPE: ClassVar[KeywordField] = KeywordField( + "sisenseWidgetSubType", "sisenseWidgetSubType" + ) """ Subtype of this widget. """ - SISENSE_WIDGET_SIZE: ClassVar[KeywordField] = KeywordField("sisenseWidgetSize", "sisenseWidgetSize") + SISENSE_WIDGET_SIZE: ClassVar[KeywordField] = KeywordField( + "sisenseWidgetSize", "sisenseWidgetSize" + ) """ Size of this widget. """ - SISENSE_WIDGET_DASHBOARD_QUALIFIED_NAME: ClassVar[KeywordTextField] = KeywordTextField( - "sisenseWidgetDashboardQualifiedName", - "sisenseWidgetDashboardQualifiedName", - "sisenseWidgetDashboardQualifiedName.text", + SISENSE_WIDGET_DASHBOARD_QUALIFIED_NAME: ClassVar[KeywordTextField] = ( + KeywordTextField( + "sisenseWidgetDashboardQualifiedName", + "sisenseWidgetDashboardQualifiedName", + "sisenseWidgetDashboardQualifiedName.text", + ) ) """ Unique name of the dashboard in which this widget exists. @@ -65,7 +71,9 @@ def __setattr__(self, name, value): Unique name of the folder in which this widget exists. """ - SISENSE_DATAMODEL_TABLES: ClassVar[RelationField] = RelationField("sisenseDatamodelTables") + SISENSE_DATAMODEL_TABLES: ClassVar[RelationField] = RelationField( + "sisenseDatamodelTables" + ) """ TBC """ @@ -91,7 +99,11 @@ def __setattr__(self, name, value): @property def sisense_widget_column_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.sisense_widget_column_count + return ( + None + if self.attributes is None + else self.attributes.sisense_widget_column_count + ) @sisense_widget_column_count.setter def sisense_widget_column_count(self, sisense_widget_column_count: Optional[int]): @@ -101,7 +113,9 @@ def sisense_widget_column_count(self, sisense_widget_column_count: Optional[int] @property def sisense_widget_sub_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_widget_sub_type + return ( + None if self.attributes is None else self.attributes.sisense_widget_sub_type + ) @sisense_widget_sub_type.setter def sisense_widget_sub_type(self, sisense_widget_sub_type: Optional[str]): @@ -121,30 +135,52 @@ def sisense_widget_size(self, sisense_widget_size: Optional[str]): @property def sisense_widget_dashboard_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_widget_dashboard_qualified_name + return ( + None + if self.attributes is None + else self.attributes.sisense_widget_dashboard_qualified_name + ) @sisense_widget_dashboard_qualified_name.setter - def sisense_widget_dashboard_qualified_name(self, sisense_widget_dashboard_qualified_name: Optional[str]): + def sisense_widget_dashboard_qualified_name( + self, sisense_widget_dashboard_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_widget_dashboard_qualified_name = sisense_widget_dashboard_qualified_name + self.attributes.sisense_widget_dashboard_qualified_name = ( + sisense_widget_dashboard_qualified_name + ) @property def sisense_widget_folder_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.sisense_widget_folder_qualified_name + return ( + None + if self.attributes is None + else self.attributes.sisense_widget_folder_qualified_name + ) @sisense_widget_folder_qualified_name.setter - def sisense_widget_folder_qualified_name(self, sisense_widget_folder_qualified_name: Optional[str]): + def sisense_widget_folder_qualified_name( + self, sisense_widget_folder_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.sisense_widget_folder_qualified_name = sisense_widget_folder_qualified_name + self.attributes.sisense_widget_folder_qualified_name = ( + sisense_widget_folder_qualified_name + ) @property def sisense_datamodel_tables(self) -> Optional[List[SisenseDatamodelTable]]: - return None if self.attributes is None else self.attributes.sisense_datamodel_tables + return ( + None + if self.attributes is None + else self.attributes.sisense_datamodel_tables + ) @sisense_datamodel_tables.setter - def sisense_datamodel_tables(self, sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]]): + def sisense_datamodel_tables( + self, sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.sisense_datamodel_tables = sisense_datamodel_tables @@ -173,13 +209,21 @@ class Attributes(Sisense.Attributes): sisense_widget_column_count: Optional[int] = Field(default=None, description="") sisense_widget_sub_type: Optional[str] = Field(default=None, description="") sisense_widget_size: Optional[str] = Field(default=None, description="") - sisense_widget_dashboard_qualified_name: Optional[str] = Field(default=None, description="") - sisense_widget_folder_qualified_name: Optional[str] = Field(default=None, description="") + sisense_widget_dashboard_qualified_name: Optional[str] = Field( + default=None, description="" + ) + sisense_widget_folder_qualified_name: Optional[str] = Field( + default=None, description="" + ) sisense_datamodel_tables: Optional[List[SisenseDatamodelTable]] = Field( default=None, description="" ) # relationship - sisense_folder: Optional[SisenseFolder] = Field(default=None, description="") # relationship - sisense_dashboard: Optional[SisenseDashboard] = Field(default=None, description="") # relationship + sisense_folder: Optional[SisenseFolder] = Field( + default=None, description="" + ) # relationship + sisense_dashboard: Optional[SisenseDashboard] = Field( + default=None, description="" + ) # relationship attributes: SisenseWidget.Attributes = Field( default_factory=lambda: SisenseWidget.Attributes(), diff --git a/pyatlan/model/assets/superset.py b/pyatlan/model/assets/superset.py index 602f9c926..3e6fdcf01 100644 --- a/pyatlan/model/assets/superset.py +++ b/pyatlan/model/assets/superset.py @@ -29,7 +29,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SUPERSET_DASHBOARD_ID: ClassVar[NumericField] = NumericField("supersetDashboardId", "supersetDashboardId") + SUPERSET_DASHBOARD_ID: ClassVar[NumericField] = NumericField( + "supersetDashboardId", "supersetDashboardId" + ) """ Identifier of the dashboard in which this asset exists, in Superset. """ @@ -49,7 +51,9 @@ def __setattr__(self, name, value): @property def superset_dashboard_id(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.superset_dashboard_id + return ( + None if self.attributes is None else self.attributes.superset_dashboard_id + ) @superset_dashboard_id.setter def superset_dashboard_id(self, superset_dashboard_id: Optional[int]): @@ -59,17 +63,27 @@ def superset_dashboard_id(self, superset_dashboard_id: Optional[int]): @property def superset_dashboard_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.superset_dashboard_qualified_name + return ( + None + if self.attributes is None + else self.attributes.superset_dashboard_qualified_name + ) @superset_dashboard_qualified_name.setter - def superset_dashboard_qualified_name(self, superset_dashboard_qualified_name: Optional[str]): + def superset_dashboard_qualified_name( + self, superset_dashboard_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_qualified_name = superset_dashboard_qualified_name + self.attributes.superset_dashboard_qualified_name = ( + superset_dashboard_qualified_name + ) class Attributes(BI.Attributes): superset_dashboard_id: Optional[int] = Field(default=None, description="") - superset_dashboard_qualified_name: Optional[str] = Field(default=None, description="") + superset_dashboard_qualified_name: Optional[str] = Field( + default=None, description="" + ) attributes: Superset.Attributes = Field( default_factory=lambda: Superset.Attributes(), diff --git a/pyatlan/model/assets/superset_chart.py b/pyatlan/model/assets/superset_chart.py index b9b2b77ca..3b4578a85 100644 --- a/pyatlan/model/assets/superset_chart.py +++ b/pyatlan/model/assets/superset_chart.py @@ -60,9 +60,13 @@ def creator( @classmethod @init_guid - def create(cls, *, name: str, superset_dashboard_qualified_name: str) -> SupersetChart: + def create( + cls, *, name: str, superset_dashboard_qualified_name: str + ) -> SupersetChart: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -90,7 +94,9 @@ def __setattr__(self, name, value): """ Description markdown of the chart. """ - SUPERSET_CHART_FORM_DATA: ClassVar[KeywordField] = KeywordField("supersetChartFormData", "supersetChartFormData") + SUPERSET_CHART_FORM_DATA: ClassVar[KeywordField] = KeywordField( + "supersetChartFormData", "supersetChartFormData" + ) """ Data stored for the chart in key value pairs. """ @@ -108,20 +114,34 @@ def __setattr__(self, name, value): @property def superset_chart_description_markdown(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.superset_chart_description_markdown + return ( + None + if self.attributes is None + else self.attributes.superset_chart_description_markdown + ) @superset_chart_description_markdown.setter - def superset_chart_description_markdown(self, superset_chart_description_markdown: Optional[str]): + def superset_chart_description_markdown( + self, superset_chart_description_markdown: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_chart_description_markdown = superset_chart_description_markdown + self.attributes.superset_chart_description_markdown = ( + superset_chart_description_markdown + ) @property def superset_chart_form_data(self) -> Optional[Dict[str, str]]: - return None if self.attributes is None else self.attributes.superset_chart_form_data + return ( + None + if self.attributes is None + else self.attributes.superset_chart_form_data + ) @superset_chart_form_data.setter - def superset_chart_form_data(self, superset_chart_form_data: Optional[Dict[str, str]]): + def superset_chart_form_data( + self, superset_chart_form_data: Optional[Dict[str, str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.superset_chart_form_data = superset_chart_form_data @@ -137,9 +157,15 @@ def superset_dashboard(self, superset_dashboard: Optional[SupersetDashboard]): self.attributes.superset_dashboard = superset_dashboard class Attributes(Superset.Attributes): - superset_chart_description_markdown: Optional[str] = Field(default=None, description="") - superset_chart_form_data: Optional[Dict[str, str]] = Field(default=None, description="") - superset_dashboard: Optional[SupersetDashboard] = Field(default=None, description="") # relationship + superset_chart_description_markdown: Optional[str] = Field( + default=None, description="" + ) + superset_chart_form_data: Optional[Dict[str, str]] = Field( + default=None, description="" + ) + superset_dashboard: Optional[SupersetDashboard] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -155,7 +181,9 @@ def create( [name, superset_dashboard_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( superset_dashboard_qualified_name, @@ -169,7 +197,9 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{superset_dashboard_qualified_name}/{name}", connector_name=connector_name, - superset_dashboard=SupersetDashboard.ref_by_qualified_name(superset_dashboard_qualified_name), + superset_dashboard=SupersetDashboard.ref_by_qualified_name( + superset_dashboard_qualified_name + ), ) attributes: SupersetChart.Attributes = Field( diff --git a/pyatlan/model/assets/superset_dashboard.py b/pyatlan/model/assets/superset_dashboard.py index 69b3293a4..a94c52b93 100644 --- a/pyatlan/model/assets/superset_dashboard.py +++ b/pyatlan/model/assets/superset_dashboard.py @@ -42,11 +42,15 @@ def creator(cls, *, name: str, connection_qualified_name: str) -> SupersetDashbo @init_guid def create(cls, *, name: str, connection_qualified_name: str) -> SupersetDashboard: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) - return cls.creator(name=name, connection_qualified_name=connection_qualified_name) + return cls.creator( + name=name, connection_qualified_name=connection_qualified_name + ) type_name: str = Field(default="SupersetDashboard", allow_mutation=False) @@ -61,11 +65,13 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SUPERSET_DASHBOARD_CHANGED_BY_NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( - "supersetDashboardChangedByName", - "supersetDashboardChangedByName.keyword", - "supersetDashboardChangedByName", - "supersetDashboardChangedByName.stemmed", + SUPERSET_DASHBOARD_CHANGED_BY_NAME: ClassVar[KeywordTextStemmedField] = ( + KeywordTextStemmedField( + "supersetDashboardChangedByName", + "supersetDashboardChangedByName.keyword", + "supersetDashboardChangedByName", + "supersetDashboardChangedByName.stemmed", + ) ) """ Name of the user who changed the dashboard. @@ -123,60 +129,106 @@ def __setattr__(self, name, value): @property def superset_dashboard_changed_by_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.superset_dashboard_changed_by_name + return ( + None + if self.attributes is None + else self.attributes.superset_dashboard_changed_by_name + ) @superset_dashboard_changed_by_name.setter - def superset_dashboard_changed_by_name(self, superset_dashboard_changed_by_name: Optional[str]): + def superset_dashboard_changed_by_name( + self, superset_dashboard_changed_by_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_changed_by_name = superset_dashboard_changed_by_name + self.attributes.superset_dashboard_changed_by_name = ( + superset_dashboard_changed_by_name + ) @property def superset_dashboard_changed_by_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.superset_dashboard_changed_by_url + return ( + None + if self.attributes is None + else self.attributes.superset_dashboard_changed_by_url + ) @superset_dashboard_changed_by_url.setter - def superset_dashboard_changed_by_url(self, superset_dashboard_changed_by_url: Optional[str]): + def superset_dashboard_changed_by_url( + self, superset_dashboard_changed_by_url: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_changed_by_url = superset_dashboard_changed_by_url + self.attributes.superset_dashboard_changed_by_url = ( + superset_dashboard_changed_by_url + ) @property def superset_dashboard_is_managed_externally(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.superset_dashboard_is_managed_externally + return ( + None + if self.attributes is None + else self.attributes.superset_dashboard_is_managed_externally + ) @superset_dashboard_is_managed_externally.setter - def superset_dashboard_is_managed_externally(self, superset_dashboard_is_managed_externally: Optional[bool]): + def superset_dashboard_is_managed_externally( + self, superset_dashboard_is_managed_externally: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_is_managed_externally = superset_dashboard_is_managed_externally + self.attributes.superset_dashboard_is_managed_externally = ( + superset_dashboard_is_managed_externally + ) @property def superset_dashboard_is_published(self) -> Optional[bool]: - return None if self.attributes is None else self.attributes.superset_dashboard_is_published + return ( + None + if self.attributes is None + else self.attributes.superset_dashboard_is_published + ) @superset_dashboard_is_published.setter - def superset_dashboard_is_published(self, superset_dashboard_is_published: Optional[bool]): + def superset_dashboard_is_published( + self, superset_dashboard_is_published: Optional[bool] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_is_published = superset_dashboard_is_published + self.attributes.superset_dashboard_is_published = ( + superset_dashboard_is_published + ) @property def superset_dashboard_thumbnail_url(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.superset_dashboard_thumbnail_url + return ( + None + if self.attributes is None + else self.attributes.superset_dashboard_thumbnail_url + ) @superset_dashboard_thumbnail_url.setter - def superset_dashboard_thumbnail_url(self, superset_dashboard_thumbnail_url: Optional[str]): + def superset_dashboard_thumbnail_url( + self, superset_dashboard_thumbnail_url: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dashboard_thumbnail_url = superset_dashboard_thumbnail_url + self.attributes.superset_dashboard_thumbnail_url = ( + superset_dashboard_thumbnail_url + ) @property def superset_dashboard_chart_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.superset_dashboard_chart_count + return ( + None + if self.attributes is None + else self.attributes.superset_dashboard_chart_count + ) @superset_dashboard_chart_count.setter - def superset_dashboard_chart_count(self, superset_dashboard_chart_count: Optional[int]): + def superset_dashboard_chart_count( + self, superset_dashboard_chart_count: Optional[int] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.superset_dashboard_chart_count = superset_dashboard_chart_count @@ -202,18 +254,36 @@ def superset_charts(self, superset_charts: Optional[List[SupersetChart]]): self.attributes.superset_charts = superset_charts class Attributes(Superset.Attributes): - superset_dashboard_changed_by_name: Optional[str] = Field(default=None, description="") - superset_dashboard_changed_by_url: Optional[str] = Field(default=None, description="") - superset_dashboard_is_managed_externally: Optional[bool] = Field(default=None, description="") - superset_dashboard_is_published: Optional[bool] = Field(default=None, description="") - superset_dashboard_thumbnail_url: Optional[str] = Field(default=None, description="") - superset_dashboard_chart_count: Optional[int] = Field(default=None, description="") - superset_datasets: Optional[List[SupersetDataset]] = Field(default=None, description="") # relationship - superset_charts: Optional[List[SupersetChart]] = Field(default=None, description="") # relationship + superset_dashboard_changed_by_name: Optional[str] = Field( + default=None, description="" + ) + superset_dashboard_changed_by_url: Optional[str] = Field( + default=None, description="" + ) + superset_dashboard_is_managed_externally: Optional[bool] = Field( + default=None, description="" + ) + superset_dashboard_is_published: Optional[bool] = Field( + default=None, description="" + ) + superset_dashboard_thumbnail_url: Optional[str] = Field( + default=None, description="" + ) + superset_dashboard_chart_count: Optional[int] = Field( + default=None, description="" + ) + superset_datasets: Optional[List[SupersetDataset]] = Field( + default=None, description="" + ) # relationship + superset_charts: Optional[List[SupersetChart]] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid - def create(cls, *, name: str, connection_qualified_name: str) -> SupersetDashboard.Attributes: + def create( + cls, *, name: str, connection_qualified_name: str + ) -> SupersetDashboard.Attributes: validate_required_fields( ["name", "connection_qualified_name"], [name, connection_qualified_name], @@ -222,7 +292,9 @@ def create(cls, *, name: str, connection_qualified_name: str) -> SupersetDashboa name=name, qualified_name=f"{connection_qualified_name}/{name}", connection_qualified_name=connection_qualified_name, - connector_name=AtlanConnectorType.get_connector_name(connection_qualified_name), + connector_name=AtlanConnectorType.get_connector_name( + connection_qualified_name + ), ) attributes: SupersetDashboard.Attributes = Field( diff --git a/pyatlan/model/assets/superset_dataset.py b/pyatlan/model/assets/superset_dataset.py index 46b19e814..81726be67 100644 --- a/pyatlan/model/assets/superset_dataset.py +++ b/pyatlan/model/assets/superset_dataset.py @@ -65,9 +65,13 @@ def creator( @classmethod @init_guid - def create(cls, *, name: str, superset_dashboard_qualified_name: str) -> SupersetDataset: + def create( + cls, *, name: str, superset_dashboard_qualified_name: str + ) -> SupersetDataset: warn( - ("This method is deprecated, please use 'creator' instead, which offers identical functionality."), + ( + "This method is deprecated, please use 'creator' instead, which offers identical functionality." + ), DeprecationWarning, stacklevel=2, ) @@ -89,20 +93,26 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SUPERSET_DATASET_DATASOURCE_NAME: ClassVar[KeywordTextStemmedField] = KeywordTextStemmedField( - "supersetDatasetDatasourceName", - "supersetDatasetDatasourceName.keyword", - "supersetDatasetDatasourceName", - "supersetDatasetDatasourceName.stemmed", + SUPERSET_DATASET_DATASOURCE_NAME: ClassVar[KeywordTextStemmedField] = ( + KeywordTextStemmedField( + "supersetDatasetDatasourceName", + "supersetDatasetDatasourceName.keyword", + "supersetDatasetDatasourceName", + "supersetDatasetDatasourceName.stemmed", + ) ) """ Name of the datasource for the dataset. """ - SUPERSET_DATASET_ID: ClassVar[NumericField] = NumericField("supersetDatasetId", "supersetDatasetId") + SUPERSET_DATASET_ID: ClassVar[NumericField] = NumericField( + "supersetDatasetId", "supersetDatasetId" + ) """ Id of the dataset in superset. """ - SUPERSET_DATASET_TYPE: ClassVar[KeywordField] = KeywordField("supersetDatasetType", "supersetDatasetType") + SUPERSET_DATASET_TYPE: ClassVar[KeywordField] = KeywordField( + "supersetDatasetType", "supersetDatasetType" + ) """ Type of the dataset in superset. """ @@ -121,13 +131,21 @@ def __setattr__(self, name, value): @property def superset_dataset_datasource_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.superset_dataset_datasource_name + return ( + None + if self.attributes is None + else self.attributes.superset_dataset_datasource_name + ) @superset_dataset_datasource_name.setter - def superset_dataset_datasource_name(self, superset_dataset_datasource_name: Optional[str]): + def superset_dataset_datasource_name( + self, superset_dataset_datasource_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.superset_dataset_datasource_name = superset_dataset_datasource_name + self.attributes.superset_dataset_datasource_name = ( + superset_dataset_datasource_name + ) @property def superset_dataset_id(self) -> Optional[int]: @@ -141,7 +159,9 @@ def superset_dataset_id(self, superset_dataset_id: Optional[int]): @property def superset_dataset_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.superset_dataset_type + return ( + None if self.attributes is None else self.attributes.superset_dataset_type + ) @superset_dataset_type.setter def superset_dataset_type(self, superset_dataset_type: Optional[str]): @@ -160,10 +180,14 @@ def superset_dashboard(self, superset_dashboard: Optional[SupersetDashboard]): self.attributes.superset_dashboard = superset_dashboard class Attributes(Superset.Attributes): - superset_dataset_datasource_name: Optional[str] = Field(default=None, description="") + superset_dataset_datasource_name: Optional[str] = Field( + default=None, description="" + ) superset_dataset_id: Optional[int] = Field(default=None, description="") superset_dataset_type: Optional[str] = Field(default=None, description="") - superset_dashboard: Optional[SupersetDashboard] = Field(default=None, description="") # relationship + superset_dashboard: Optional[SupersetDashboard] = Field( + default=None, description="" + ) # relationship @classmethod @init_guid @@ -179,7 +203,9 @@ def create( [name, superset_dashboard_qualified_name], ) if connection_qualified_name: - connector_name = AtlanConnectorType.get_connector_name(connection_qualified_name) + connector_name = AtlanConnectorType.get_connector_name( + connection_qualified_name + ) else: connection_qn, connector_name = AtlanConnectorType.get_connector_name( superset_dashboard_qualified_name, @@ -193,7 +219,9 @@ def create( connection_qualified_name=connection_qualified_name or connection_qn, qualified_name=f"{superset_dashboard_qualified_name}/{name}", connector_name=connector_name, - superset_dashboard=SupersetDashboard.ref_by_qualified_name(superset_dashboard_qualified_name), + superset_dashboard=SupersetDashboard.ref_by_qualified_name( + superset_dashboard_qualified_name + ), ) attributes: SupersetDataset.Attributes = Field( diff --git a/pyatlan/model/assets/tableau_calculated_field.py b/pyatlan/model/assets/tableau_calculated_field.py index 6dbc154e7..789e13d1a 100644 --- a/pyatlan/model/assets/tableau_calculated_field.py +++ b/pyatlan/model/assets/tableau_calculated_field.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "siteQualifiedName", "siteQualifiedName" + ) """ Unique name of the site in which this calculated field exists. """ @@ -50,15 +52,21 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this calculated field exists. """ - WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField("workbookQualifiedName", "workbookQualifiedName") + WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "workbookQualifiedName", "workbookQualifiedName" + ) """ Unique name of the workbook in which this calculated field exists. """ - DATASOURCE_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasourceQualifiedName", "datasourceQualifiedName") + DATASOURCE_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "datasourceQualifiedName", "datasourceQualifiedName" + ) """ Unique name of the datasource in which this calculated field exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( + "projectHierarchy", "projectHierarchy" + ) """ List of top-level projects and their nested projects. """ @@ -80,7 +88,9 @@ def __setattr__(self, name, value): """ Formula for this calculated field. """ - UPSTREAM_FIELDS: ClassVar[KeywordField] = KeywordField("upstreamFields", "upstreamFields") + UPSTREAM_FIELDS: ClassVar[KeywordField] = KeywordField( + "upstreamFields", "upstreamFields" + ) """ List of fields that are upstream to this calculated field. """ @@ -122,7 +132,9 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.project_qualified_name + return ( + None if self.attributes is None else self.attributes.project_qualified_name + ) @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -132,17 +144,27 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.top_level_project_qualified_name + return ( + None + if self.attributes is None + else self.attributes.top_level_project_qualified_name + ) @top_level_project_qualified_name.setter - def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): + def top_level_project_qualified_name( + self, top_level_project_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = top_level_project_qualified_name + self.attributes.top_level_project_qualified_name = ( + top_level_project_qualified_name + ) @property def workbook_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workbook_qualified_name + return ( + None if self.attributes is None else self.attributes.workbook_qualified_name + ) @workbook_qualified_name.setter def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @@ -152,7 +174,11 @@ def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @property def datasource_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.datasource_qualified_name + return ( + None + if self.attributes is None + else self.attributes.datasource_qualified_name + ) @datasource_qualified_name.setter def datasource_qualified_name(self, datasource_qualified_name: Optional[str]): @@ -243,17 +269,27 @@ def datasource(self, datasource: Optional[TableauDatasource]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field(default=None, description="") + top_level_project_qualified_name: Optional[str] = Field( + default=None, description="" + ) workbook_qualified_name: Optional[str] = Field(default=None, description="") datasource_qualified_name: Optional[str] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + project_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) data_category: Optional[str] = Field(default=None, description="") role: Optional[str] = Field(default=None, description="") tableau_data_type: Optional[str] = Field(default=None, description="") formula: Optional[str] = Field(default=None, description="") - upstream_fields: Optional[List[Dict[str, str]]] = Field(default=None, description="") - worksheets: Optional[List[TableauWorksheet]] = Field(default=None, description="") # relationship - datasource: Optional[TableauDatasource] = Field(default=None, description="") # relationship + upstream_fields: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + worksheets: Optional[List[TableauWorksheet]] = Field( + default=None, description="" + ) # relationship + datasource: Optional[TableauDatasource] = Field( + default=None, description="" + ) # relationship attributes: TableauCalculatedField.Attributes = Field( default_factory=lambda: TableauCalculatedField.Attributes(), diff --git a/pyatlan/model/assets/tableau_dashboard.py b/pyatlan/model/assets/tableau_dashboard.py index b7a377a21..7878a9da6 100644 --- a/pyatlan/model/assets/tableau_dashboard.py +++ b/pyatlan/model/assets/tableau_dashboard.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "siteQualifiedName", "siteQualifiedName" + ) """ Unique name of the site in which this dashboard exists. """ @@ -44,7 +46,9 @@ def __setattr__(self, name, value): """ Unique name of the project in which this dashboard exists. """ - WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField("workbookQualifiedName", "workbookQualifiedName") + WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "workbookQualifiedName", "workbookQualifiedName" + ) """ Unique name of the workbook in which this dashboard exists. """ @@ -54,7 +58,9 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this dashboard exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( + "projectHierarchy", "projectHierarchy" + ) """ List of top-level projects and their nested child projects. """ @@ -90,7 +96,9 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.project_qualified_name + return ( + None if self.attributes is None else self.attributes.project_qualified_name + ) @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -100,7 +108,9 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def workbook_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workbook_qualified_name + return ( + None if self.attributes is None else self.attributes.workbook_qualified_name + ) @workbook_qualified_name.setter def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @@ -110,13 +120,21 @@ def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.top_level_project_qualified_name + return ( + None + if self.attributes is None + else self.attributes.top_level_project_qualified_name + ) @top_level_project_qualified_name.setter - def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): + def top_level_project_qualified_name( + self, top_level_project_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = top_level_project_qualified_name + self.attributes.top_level_project_qualified_name = ( + top_level_project_qualified_name + ) @property def project_hierarchy(self) -> Optional[List[Dict[str, str]]]: @@ -152,10 +170,18 @@ class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") workbook_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") - workbook: Optional[TableauWorkbook] = Field(default=None, description="") # relationship - worksheets: Optional[List[TableauWorksheet]] = Field(default=None, description="") # relationship + top_level_project_qualified_name: Optional[str] = Field( + default=None, description="" + ) + project_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + workbook: Optional[TableauWorkbook] = Field( + default=None, description="" + ) # relationship + worksheets: Optional[List[TableauWorksheet]] = Field( + default=None, description="" + ) # relationship attributes: TableauDashboard.Attributes = Field( default_factory=lambda: TableauDashboard.Attributes(), diff --git a/pyatlan/model/assets/tableau_datasource.py b/pyatlan/model/assets/tableau_datasource.py index 4dd3b5f1c..c06bb8985 100644 --- a/pyatlan/model/assets/tableau_datasource.py +++ b/pyatlan/model/assets/tableau_datasource.py @@ -35,7 +35,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "siteQualifiedName", "siteQualifiedName" + ) """ Unique name of the site in which this datasource exists. """ @@ -51,11 +53,15 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this datasource exists. """ - WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField("workbookQualifiedName", "workbookQualifiedName") + WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "workbookQualifiedName", "workbookQualifiedName" + ) """ Unique name of the workbook in which this datasource exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( + "projectHierarchy", "projectHierarchy" + ) """ List of top-level projects with their nested child projects. """ @@ -75,19 +81,27 @@ def __setattr__(self, name, value): """ Users that have marked this datasource as cerified, in Tableau. """ - CERTIFICATION_NOTE: ClassVar[TextField] = TextField("certificationNote", "certificationNote") + CERTIFICATION_NOTE: ClassVar[TextField] = TextField( + "certificationNote", "certificationNote" + ) """ Notes related to this datasource being cerfified, in Tableau. """ - CERTIFIER_DISPLAY_NAME: ClassVar[TextField] = TextField("certifierDisplayName", "certifierDisplayName") + CERTIFIER_DISPLAY_NAME: ClassVar[TextField] = TextField( + "certifierDisplayName", "certifierDisplayName" + ) """ Name of the user who cerified this datasource, in Tableau. """ - UPSTREAM_TABLES: ClassVar[KeywordField] = KeywordField("upstreamTables", "upstreamTables") + UPSTREAM_TABLES: ClassVar[KeywordField] = KeywordField( + "upstreamTables", "upstreamTables" + ) """ List of tables that are upstream of this datasource. """ - UPSTREAM_DATASOURCES: ClassVar[KeywordField] = KeywordField("upstreamDatasources", "upstreamDatasources") + UPSTREAM_DATASOURCES: ClassVar[KeywordField] = KeywordField( + "upstreamDatasources", "upstreamDatasources" + ) """ List of datasources that are upstream of this datasource. """ @@ -136,7 +150,9 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.project_qualified_name + return ( + None if self.attributes is None else self.attributes.project_qualified_name + ) @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -146,17 +162,27 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.top_level_project_qualified_name + return ( + None + if self.attributes is None + else self.attributes.top_level_project_qualified_name + ) @top_level_project_qualified_name.setter - def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): + def top_level_project_qualified_name( + self, top_level_project_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = top_level_project_qualified_name + self.attributes.top_level_project_qualified_name = ( + top_level_project_qualified_name + ) @property def workbook_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workbook_qualified_name + return ( + None if self.attributes is None else self.attributes.workbook_qualified_name + ) @workbook_qualified_name.setter def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @@ -226,7 +252,9 @@ def certification_note(self, certification_note: Optional[str]): @property def certifier_display_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.certifier_display_name + return ( + None if self.attributes is None else self.attributes.certifier_display_name + ) @certifier_display_name.setter def certifier_display_name(self, certifier_display_name: Optional[str]): @@ -239,7 +267,9 @@ def upstream_tables(self) -> Optional[List[Dict[str, Optional[str]]]]: return None if self.attributes is None else self.attributes.upstream_tables @upstream_tables.setter - def upstream_tables(self, upstream_tables: Optional[List[Dict[str, Optional[str]]]]): + def upstream_tables( + self, upstream_tables: Optional[List[Dict[str, Optional[str]]]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.upstream_tables = upstream_tables @@ -249,7 +279,9 @@ def upstream_datasources(self) -> Optional[List[Dict[str, Optional[str]]]]: return None if self.attributes is None else self.attributes.upstream_datasources @upstream_datasources.setter - def upstream_datasources(self, upstream_datasources: Optional[List[Dict[str, Optional[str]]]]): + def upstream_datasources( + self, upstream_datasources: Optional[List[Dict[str, Optional[str]]]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.upstream_datasources = upstream_datasources @@ -287,20 +319,34 @@ def fields(self, fields: Optional[List[TableauDatasourceField]]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field(default=None, description="") + top_level_project_qualified_name: Optional[str] = Field( + default=None, description="" + ) workbook_qualified_name: Optional[str] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + project_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) is_published: Optional[bool] = Field(default=None, description="") has_extracts: Optional[bool] = Field(default=None, description="") is_certified: Optional[bool] = Field(default=None, description="") certifier: Optional[Dict[str, str]] = Field(default=None, description="") certification_note: Optional[str] = Field(default=None, description="") certifier_display_name: Optional[str] = Field(default=None, description="") - upstream_tables: Optional[List[Dict[str, Optional[str]]]] = Field(default=None, description="") - upstream_datasources: Optional[List[Dict[str, Optional[str]]]] = Field(default=None, description="") - project: Optional[TableauProject] = Field(default=None, description="") # relationship - workbook: Optional[TableauWorkbook] = Field(default=None, description="") # relationship - fields: Optional[List[TableauDatasourceField]] = Field(default=None, description="") # relationship + upstream_tables: Optional[List[Dict[str, Optional[str]]]] = Field( + default=None, description="" + ) + upstream_datasources: Optional[List[Dict[str, Optional[str]]]] = Field( + default=None, description="" + ) + project: Optional[TableauProject] = Field( + default=None, description="" + ) # relationship + workbook: Optional[TableauWorkbook] = Field( + default=None, description="" + ) # relationship + fields: Optional[List[TableauDatasourceField]] = Field( + default=None, description="" + ) # relationship attributes: TableauDatasource.Attributes = Field( default_factory=lambda: TableauDatasource.Attributes(), diff --git a/pyatlan/model/assets/tableau_datasource_field.py b/pyatlan/model/assets/tableau_datasource_field.py index 4bac0e80d..bc11d6f3f 100644 --- a/pyatlan/model/assets/tableau_datasource_field.py +++ b/pyatlan/model/assets/tableau_datasource_field.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "siteQualifiedName", "siteQualifiedName" + ) """ Unique name of the site in which this datasource field exists. """ @@ -50,19 +52,27 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this datasource field exists. """ - WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField("workbookQualifiedName", "workbookQualifiedName") + WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "workbookQualifiedName", "workbookQualifiedName" + ) """ Unique name of the workbook in which this datasource field exists. """ - DATASOURCE_QUALIFIED_NAME: ClassVar[TextField] = TextField("datasourceQualifiedName", "datasourceQualifiedName") + DATASOURCE_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "datasourceQualifiedName", "datasourceQualifiedName" + ) """ Unique name of the datasource in which this datasource field exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( + "projectHierarchy", "projectHierarchy" + ) """ List of top-level projects and their nested child projects. """ - FULLY_QUALIFIED_NAME: ClassVar[TextField] = TextField("fullyQualifiedName", "fullyQualifiedName") + FULLY_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "fullyQualifiedName", "fullyQualifiedName" + ) """ Name used internally in Tableau to uniquely identify this field. """ @@ -86,7 +96,9 @@ def __setattr__(self, name, value): """ Data type of this field. """ - UPSTREAM_TABLES: ClassVar[KeywordField] = KeywordField("upstreamTables", "upstreamTables") + UPSTREAM_TABLES: ClassVar[KeywordField] = KeywordField( + "upstreamTables", "upstreamTables" + ) """ Tables upstream to this datasource field. """ @@ -102,15 +114,21 @@ def __setattr__(self, name, value): """ Bin size of this field. """ - UPSTREAM_COLUMNS: ClassVar[KeywordField] = KeywordField("upstreamColumns", "upstreamColumns") + UPSTREAM_COLUMNS: ClassVar[KeywordField] = KeywordField( + "upstreamColumns", "upstreamColumns" + ) """ Columns upstream to this field. """ - UPSTREAM_FIELDS: ClassVar[KeywordField] = KeywordField("upstreamFields", "upstreamFields") + UPSTREAM_FIELDS: ClassVar[KeywordField] = KeywordField( + "upstreamFields", "upstreamFields" + ) """ Fields upstream to this field. """ - DATASOURCE_FIELD_TYPE: ClassVar[TextField] = TextField("datasourceFieldType", "datasourceFieldType") + DATASOURCE_FIELD_TYPE: ClassVar[TextField] = TextField( + "datasourceFieldType", "datasourceFieldType" + ) """ Type of this datasource field. """ @@ -157,7 +175,9 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.project_qualified_name + return ( + None if self.attributes is None else self.attributes.project_qualified_name + ) @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -167,17 +187,27 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.top_level_project_qualified_name + return ( + None + if self.attributes is None + else self.attributes.top_level_project_qualified_name + ) @top_level_project_qualified_name.setter - def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): + def top_level_project_qualified_name( + self, top_level_project_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = top_level_project_qualified_name + self.attributes.top_level_project_qualified_name = ( + top_level_project_qualified_name + ) @property def workbook_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workbook_qualified_name + return ( + None if self.attributes is None else self.attributes.workbook_qualified_name + ) @workbook_qualified_name.setter def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @@ -187,7 +217,11 @@ def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @property def datasource_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.datasource_qualified_name + return ( + None + if self.attributes is None + else self.attributes.datasource_qualified_name + ) @datasource_qualified_name.setter def datasource_qualified_name(self, datasource_qualified_name: Optional[str]): @@ -217,63 +251,103 @@ def fully_qualified_name(self, fully_qualified_name: Optional[str]): @property def tableau_datasource_field_data_category(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.tableau_datasource_field_data_category + return ( + None + if self.attributes is None + else self.attributes.tableau_datasource_field_data_category + ) @tableau_datasource_field_data_category.setter - def tableau_datasource_field_data_category(self, tableau_datasource_field_data_category: Optional[str]): + def tableau_datasource_field_data_category( + self, tableau_datasource_field_data_category: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.tableau_datasource_field_data_category = tableau_datasource_field_data_category + self.attributes.tableau_datasource_field_data_category = ( + tableau_datasource_field_data_category + ) @property def tableau_datasource_field_role(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.tableau_datasource_field_role + return ( + None + if self.attributes is None + else self.attributes.tableau_datasource_field_role + ) @tableau_datasource_field_role.setter - def tableau_datasource_field_role(self, tableau_datasource_field_role: Optional[str]): + def tableau_datasource_field_role( + self, tableau_datasource_field_role: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.tableau_datasource_field_role = tableau_datasource_field_role @property def tableau_datasource_field_data_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.tableau_datasource_field_data_type + return ( + None + if self.attributes is None + else self.attributes.tableau_datasource_field_data_type + ) @tableau_datasource_field_data_type.setter - def tableau_datasource_field_data_type(self, tableau_datasource_field_data_type: Optional[str]): + def tableau_datasource_field_data_type( + self, tableau_datasource_field_data_type: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.tableau_datasource_field_data_type = tableau_datasource_field_data_type + self.attributes.tableau_datasource_field_data_type = ( + tableau_datasource_field_data_type + ) @property def upstream_tables(self) -> Optional[List[Dict[str, Optional[str]]]]: return None if self.attributes is None else self.attributes.upstream_tables @upstream_tables.setter - def upstream_tables(self, upstream_tables: Optional[List[Dict[str, Optional[str]]]]): + def upstream_tables( + self, upstream_tables: Optional[List[Dict[str, Optional[str]]]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.upstream_tables = upstream_tables @property def tableau_datasource_field_formula(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.tableau_datasource_field_formula + return ( + None + if self.attributes is None + else self.attributes.tableau_datasource_field_formula + ) @tableau_datasource_field_formula.setter - def tableau_datasource_field_formula(self, tableau_datasource_field_formula: Optional[str]): + def tableau_datasource_field_formula( + self, tableau_datasource_field_formula: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.tableau_datasource_field_formula = tableau_datasource_field_formula + self.attributes.tableau_datasource_field_formula = ( + tableau_datasource_field_formula + ) @property def tableau_datasource_field_bin_size(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.tableau_datasource_field_bin_size + return ( + None + if self.attributes is None + else self.attributes.tableau_datasource_field_bin_size + ) @tableau_datasource_field_bin_size.setter - def tableau_datasource_field_bin_size(self, tableau_datasource_field_bin_size: Optional[str]): + def tableau_datasource_field_bin_size( + self, tableau_datasource_field_bin_size: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.tableau_datasource_field_bin_size = tableau_datasource_field_bin_size + self.attributes.tableau_datasource_field_bin_size = ( + tableau_datasource_field_bin_size + ) @property def upstream_columns(self) -> Optional[List[Dict[str, str]]]: @@ -297,7 +371,9 @@ def upstream_fields(self, upstream_fields: Optional[List[Dict[str, str]]]): @property def datasource_field_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.datasource_field_type + return ( + None if self.attributes is None else self.attributes.datasource_field_type + ) @datasource_field_type.setter def datasource_field_type(self, datasource_field_type: Optional[str]): @@ -328,22 +404,46 @@ def datasource(self, datasource: Optional[TableauDatasource]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field(default=None, description="") + top_level_project_qualified_name: Optional[str] = Field( + default=None, description="" + ) workbook_qualified_name: Optional[str] = Field(default=None, description="") datasource_qualified_name: Optional[str] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + project_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) fully_qualified_name: Optional[str] = Field(default=None, description="") - tableau_datasource_field_data_category: Optional[str] = Field(default=None, description="") - tableau_datasource_field_role: Optional[str] = Field(default=None, description="") - tableau_datasource_field_data_type: Optional[str] = Field(default=None, description="") - upstream_tables: Optional[List[Dict[str, Optional[str]]]] = Field(default=None, description="") - tableau_datasource_field_formula: Optional[str] = Field(default=None, description="") - tableau_datasource_field_bin_size: Optional[str] = Field(default=None, description="") - upstream_columns: Optional[List[Dict[str, str]]] = Field(default=None, description="") - upstream_fields: Optional[List[Dict[str, str]]] = Field(default=None, description="") + tableau_datasource_field_data_category: Optional[str] = Field( + default=None, description="" + ) + tableau_datasource_field_role: Optional[str] = Field( + default=None, description="" + ) + tableau_datasource_field_data_type: Optional[str] = Field( + default=None, description="" + ) + upstream_tables: Optional[List[Dict[str, Optional[str]]]] = Field( + default=None, description="" + ) + tableau_datasource_field_formula: Optional[str] = Field( + default=None, description="" + ) + tableau_datasource_field_bin_size: Optional[str] = Field( + default=None, description="" + ) + upstream_columns: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + upstream_fields: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) datasource_field_type: Optional[str] = Field(default=None, description="") - worksheets: Optional[List[TableauWorksheet]] = Field(default=None, description="") # relationship - datasource: Optional[TableauDatasource] = Field(default=None, description="") # relationship + worksheets: Optional[List[TableauWorksheet]] = Field( + default=None, description="" + ) # relationship + datasource: Optional[TableauDatasource] = Field( + default=None, description="" + ) # relationship attributes: TableauDatasourceField.Attributes = Field( default_factory=lambda: TableauDatasourceField.Attributes(), diff --git a/pyatlan/model/assets/tableau_flow.py b/pyatlan/model/assets/tableau_flow.py index 4f938868c..ecbe98676 100644 --- a/pyatlan/model/assets/tableau_flow.py +++ b/pyatlan/model/assets/tableau_flow.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "siteQualifiedName", "siteQualifiedName" + ) """ Unique name of the site in which this flow exists. """ @@ -50,7 +52,9 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this flow exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( + "projectHierarchy", "projectHierarchy" + ) """ List of top-level projects with their nested child projects. """ @@ -95,7 +99,9 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.project_qualified_name + return ( + None if self.attributes is None else self.attributes.project_qualified_name + ) @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -105,13 +111,21 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.top_level_project_qualified_name + return ( + None + if self.attributes is None + else self.attributes.top_level_project_qualified_name + ) @top_level_project_qualified_name.setter - def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): + def top_level_project_qualified_name( + self, top_level_project_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = top_level_project_qualified_name + self.attributes.top_level_project_qualified_name = ( + top_level_project_qualified_name + ) @property def project_hierarchy(self) -> Optional[List[Dict[str, str]]]: @@ -166,12 +180,24 @@ def project(self, project: Optional[TableauProject]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") - input_fields: Optional[List[Dict[str, str]]] = Field(default=None, description="") - output_fields: Optional[List[Dict[str, str]]] = Field(default=None, description="") - output_steps: Optional[List[Dict[str, str]]] = Field(default=None, description="") - project: Optional[TableauProject] = Field(default=None, description="") # relationship + top_level_project_qualified_name: Optional[str] = Field( + default=None, description="" + ) + project_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + input_fields: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + output_fields: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + output_steps: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + project: Optional[TableauProject] = Field( + default=None, description="" + ) # relationship attributes: TableauFlow.Attributes = Field( default_factory=lambda: TableauFlow.Attributes(), diff --git a/pyatlan/model/assets/tableau_metric.py b/pyatlan/model/assets/tableau_metric.py index c471896d4..5bf7689da 100644 --- a/pyatlan/model/assets/tableau_metric.py +++ b/pyatlan/model/assets/tableau_metric.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "siteQualifiedName", "siteQualifiedName" + ) """ Unique name of the site in which this metric exists. """ @@ -50,7 +52,9 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this metric exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( + "projectHierarchy", "projectHierarchy" + ) """ List of top-level projects with their nested child projects. """ @@ -80,7 +84,9 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.project_qualified_name + return ( + None if self.attributes is None else self.attributes.project_qualified_name + ) @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -90,13 +96,21 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.top_level_project_qualified_name + return ( + None + if self.attributes is None + else self.attributes.top_level_project_qualified_name + ) @top_level_project_qualified_name.setter - def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): + def top_level_project_qualified_name( + self, top_level_project_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = top_level_project_qualified_name + self.attributes.top_level_project_qualified_name = ( + top_level_project_qualified_name + ) @property def project_hierarchy(self) -> Optional[List[Dict[str, str]]]: @@ -121,9 +135,15 @@ def project(self, project: Optional[TableauProject]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") - project: Optional[TableauProject] = Field(default=None, description="") # relationship + top_level_project_qualified_name: Optional[str] = Field( + default=None, description="" + ) + project_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + project: Optional[TableauProject] = Field( + default=None, description="" + ) # relationship attributes: TableauMetric.Attributes = Field( default_factory=lambda: TableauMetric.Attributes(), diff --git a/pyatlan/model/assets/tableau_project.py b/pyatlan/model/assets/tableau_project.py index 5ea1bcb34..ecfbfc439 100644 --- a/pyatlan/model/assets/tableau_project.py +++ b/pyatlan/model/assets/tableau_project.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "siteQualifiedName", "siteQualifiedName" + ) """ Unique name of the site in which this project exists. """ @@ -44,11 +46,15 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this project exists, if this is a nested project. """ - IS_TOP_LEVEL_PROJECT: ClassVar[BooleanField] = BooleanField("isTopLevelProject", "isTopLevelProject") + IS_TOP_LEVEL_PROJECT: ClassVar[BooleanField] = BooleanField( + "isTopLevelProject", "isTopLevelProject" + ) """ Whether this project is a top-level project (true) or not (false). """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( + "projectHierarchy", "projectHierarchy" + ) """ List of top-level projects with their nested child projects. """ @@ -103,13 +109,21 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.top_level_project_qualified_name + return ( + None + if self.attributes is None + else self.attributes.top_level_project_qualified_name + ) @top_level_project_qualified_name.setter - def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): + def top_level_project_qualified_name( + self, top_level_project_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = top_level_project_qualified_name + self.attributes.top_level_project_qualified_name = ( + top_level_project_qualified_name + ) @property def is_top_level_project(self) -> Optional[bool]: @@ -193,15 +207,31 @@ def datasources(self, datasources: Optional[List[TableauDatasource]]): class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field(default=None, description="") + top_level_project_qualified_name: Optional[str] = Field( + default=None, description="" + ) is_top_level_project: Optional[bool] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") - workbooks: Optional[List[TableauWorkbook]] = Field(default=None, description="") # relationship - flows: Optional[List[TableauFlow]] = Field(default=None, description="") # relationship - child_projects: Optional[List[TableauProject]] = Field(default=None, description="") # relationship - parent_project: Optional[TableauProject] = Field(default=None, description="") # relationship - site: Optional[TableauSite] = Field(default=None, description="") # relationship - datasources: Optional[List[TableauDatasource]] = Field(default=None, description="") # relationship + project_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + workbooks: Optional[List[TableauWorkbook]] = Field( + default=None, description="" + ) # relationship + flows: Optional[List[TableauFlow]] = Field( + default=None, description="" + ) # relationship + child_projects: Optional[List[TableauProject]] = Field( + default=None, description="" + ) # relationship + parent_project: Optional[TableauProject] = Field( + default=None, description="" + ) # relationship + site: Optional[TableauSite] = Field( + default=None, description="" + ) # relationship + datasources: Optional[List[TableauDatasource]] = Field( + default=None, description="" + ) # relationship attributes: TableauProject.Attributes = Field( default_factory=lambda: TableauProject.Attributes(), diff --git a/pyatlan/model/assets/tableau_site.py b/pyatlan/model/assets/tableau_site.py index b8f3a1056..03660f335 100644 --- a/pyatlan/model/assets/tableau_site.py +++ b/pyatlan/model/assets/tableau_site.py @@ -49,7 +49,9 @@ def projects(self, projects: Optional[List[TableauProject]]): self.attributes.projects = projects class Attributes(Tableau.Attributes): - projects: Optional[List[TableauProject]] = Field(default=None, description="") # relationship + projects: Optional[List[TableauProject]] = Field( + default=None, description="" + ) # relationship attributes: TableauSite.Attributes = Field( default_factory=lambda: TableauSite.Attributes(), diff --git a/pyatlan/model/assets/tableau_workbook.py b/pyatlan/model/assets/tableau_workbook.py index 45db92cf4..d315aa5ef 100644 --- a/pyatlan/model/assets/tableau_workbook.py +++ b/pyatlan/model/assets/tableau_workbook.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "siteQualifiedName", "siteQualifiedName" + ) """ Unique name of the site in which this workbook exists. """ @@ -44,7 +46,9 @@ def __setattr__(self, name, value): """ Unique name of the project in which this workbook exists. """ - TOP_LEVEL_PROJECT_NAME: ClassVar[TextField] = TextField("topLevelProjectName", "topLevelProjectName") + TOP_LEVEL_PROJECT_NAME: ClassVar[TextField] = TextField( + "topLevelProjectName", "topLevelProjectName" + ) """ Simple name of the top-level project in which this workbook exists. """ @@ -54,7 +58,9 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this workbook exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( + "projectHierarchy", "projectHierarchy" + ) """ List of top-level projects with their nested child projects. """ @@ -100,7 +106,9 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.project_qualified_name + return ( + None if self.attributes is None else self.attributes.project_qualified_name + ) @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -110,7 +118,9 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.top_level_project_name + return ( + None if self.attributes is None else self.attributes.top_level_project_name + ) @top_level_project_name.setter def top_level_project_name(self, top_level_project_name: Optional[str]): @@ -120,13 +130,21 @@ def top_level_project_name(self, top_level_project_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.top_level_project_qualified_name + return ( + None + if self.attributes is None + else self.attributes.top_level_project_qualified_name + ) @top_level_project_qualified_name.setter - def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): + def top_level_project_qualified_name( + self, top_level_project_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = top_level_project_qualified_name + self.attributes.top_level_project_qualified_name = ( + top_level_project_qualified_name + ) @property def project_hierarchy(self) -> Optional[List[Dict[str, str]]]: @@ -182,12 +200,24 @@ class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") top_level_project_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") - project: Optional[TableauProject] = Field(default=None, description="") # relationship - dashboards: Optional[List[TableauDashboard]] = Field(default=None, description="") # relationship - worksheets: Optional[List[TableauWorksheet]] = Field(default=None, description="") # relationship - datasources: Optional[List[TableauDatasource]] = Field(default=None, description="") # relationship + top_level_project_qualified_name: Optional[str] = Field( + default=None, description="" + ) + project_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) + project: Optional[TableauProject] = Field( + default=None, description="" + ) # relationship + dashboards: Optional[List[TableauDashboard]] = Field( + default=None, description="" + ) # relationship + worksheets: Optional[List[TableauWorksheet]] = Field( + default=None, description="" + ) # relationship + datasources: Optional[List[TableauDatasource]] = Field( + default=None, description="" + ) # relationship attributes: TableauWorkbook.Attributes = Field( default_factory=lambda: TableauWorkbook.Attributes(), diff --git a/pyatlan/model/assets/tableau_worksheet.py b/pyatlan/model/assets/tableau_worksheet.py index 476846166..55920a4bb 100644 --- a/pyatlan/model/assets/tableau_worksheet.py +++ b/pyatlan/model/assets/tableau_worksheet.py @@ -34,7 +34,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField("siteQualifiedName", "siteQualifiedName") + SITE_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "siteQualifiedName", "siteQualifiedName" + ) """ Unique name of the site in which this worksheet exists. """ @@ -50,11 +52,15 @@ def __setattr__(self, name, value): """ Unique name of the top-level project in which this worksheet exists. """ - PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField("projectHierarchy", "projectHierarchy") + PROJECT_HIERARCHY: ClassVar[KeywordField] = KeywordField( + "projectHierarchy", "projectHierarchy" + ) """ List of top-level projects with their nested child projects. """ - WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField("workbookQualifiedName", "workbookQualifiedName") + WORKBOOK_QUALIFIED_NAME: ClassVar[TextField] = TextField( + "workbookQualifiedName", "workbookQualifiedName" + ) """ Unique name of the workbook in which this worksheet exists. """ @@ -100,7 +106,9 @@ def site_qualified_name(self, site_qualified_name: Optional[str]): @property def project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.project_qualified_name + return ( + None if self.attributes is None else self.attributes.project_qualified_name + ) @project_qualified_name.setter def project_qualified_name(self, project_qualified_name: Optional[str]): @@ -110,13 +118,21 @@ def project_qualified_name(self, project_qualified_name: Optional[str]): @property def top_level_project_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.top_level_project_qualified_name + return ( + None + if self.attributes is None + else self.attributes.top_level_project_qualified_name + ) @top_level_project_qualified_name.setter - def top_level_project_qualified_name(self, top_level_project_qualified_name: Optional[str]): + def top_level_project_qualified_name( + self, top_level_project_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.top_level_project_qualified_name = top_level_project_qualified_name + self.attributes.top_level_project_qualified_name = ( + top_level_project_qualified_name + ) @property def project_hierarchy(self) -> Optional[List[Dict[str, str]]]: @@ -130,7 +146,9 @@ def project_hierarchy(self, project_hierarchy: Optional[List[Dict[str, str]]]): @property def workbook_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workbook_qualified_name + return ( + None if self.attributes is None else self.attributes.workbook_qualified_name + ) @workbook_qualified_name.setter def workbook_qualified_name(self, workbook_qualified_name: Optional[str]): @@ -143,7 +161,9 @@ def datasource_fields(self) -> Optional[List[TableauDatasourceField]]: return None if self.attributes is None else self.attributes.datasource_fields @datasource_fields.setter - def datasource_fields(self, datasource_fields: Optional[List[TableauDatasourceField]]): + def datasource_fields( + self, datasource_fields: Optional[List[TableauDatasourceField]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.datasource_fields = datasource_fields @@ -173,7 +193,9 @@ def calculated_fields(self) -> Optional[List[TableauCalculatedField]]: return None if self.attributes is None else self.attributes.calculated_fields @calculated_fields.setter - def calculated_fields(self, calculated_fields: Optional[List[TableauCalculatedField]]): + def calculated_fields( + self, calculated_fields: Optional[List[TableauCalculatedField]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.calculated_fields = calculated_fields @@ -181,13 +203,25 @@ def calculated_fields(self, calculated_fields: Optional[List[TableauCalculatedFi class Attributes(Tableau.Attributes): site_qualified_name: Optional[str] = Field(default=None, description="") project_qualified_name: Optional[str] = Field(default=None, description="") - top_level_project_qualified_name: Optional[str] = Field(default=None, description="") - project_hierarchy: Optional[List[Dict[str, str]]] = Field(default=None, description="") + top_level_project_qualified_name: Optional[str] = Field( + default=None, description="" + ) + project_hierarchy: Optional[List[Dict[str, str]]] = Field( + default=None, description="" + ) workbook_qualified_name: Optional[str] = Field(default=None, description="") - datasource_fields: Optional[List[TableauDatasourceField]] = Field(default=None, description="") # relationship - dashboards: Optional[List[TableauDashboard]] = Field(default=None, description="") # relationship - workbook: Optional[TableauWorkbook] = Field(default=None, description="") # relationship - calculated_fields: Optional[List[TableauCalculatedField]] = Field(default=None, description="") # relationship + datasource_fields: Optional[List[TableauDatasourceField]] = Field( + default=None, description="" + ) # relationship + dashboards: Optional[List[TableauDashboard]] = Field( + default=None, description="" + ) # relationship + workbook: Optional[TableauWorkbook] = Field( + default=None, description="" + ) # relationship + calculated_fields: Optional[List[TableauCalculatedField]] = Field( + default=None, description="" + ) # relationship attributes: TableauWorksheet.Attributes = Field( default_factory=lambda: TableauWorksheet.Attributes(), diff --git a/pyatlan/model/assets/tag_attachment.py b/pyatlan/model/assets/tag_attachment.py index 35dca3844..ecd43303e 100644 --- a/pyatlan/model/assets/tag_attachment.py +++ b/pyatlan/model/assets/tag_attachment.py @@ -61,7 +61,11 @@ def tag_qualified_name(self, tag_qualified_name: Optional[str]): @property def tag_attachment_string_value(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.tag_attachment_string_value + return ( + None + if self.attributes is None + else self.attributes.tag_attachment_string_value + ) @tag_attachment_string_value.setter def tag_attachment_string_value(self, tag_attachment_string_value: Optional[str]): diff --git a/pyatlan/model/assets/task.py b/pyatlan/model/assets/task.py index d83a8d438..d16acd39c 100644 --- a/pyatlan/model/assets/task.py +++ b/pyatlan/model/assets/task.py @@ -36,7 +36,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - TASK_RECIPIENT: ClassVar[KeywordField] = KeywordField("taskRecipient", "taskRecipient") + TASK_RECIPIENT: ClassVar[KeywordField] = KeywordField( + "taskRecipient", "taskRecipient" + ) """ recipient of the task """ @@ -44,7 +46,9 @@ def __setattr__(self, name, value): """ type of task """ - TASK_REQUESTOR: ClassVar[KeywordField] = KeywordField("taskRequestor", "taskRequestor") + TASK_REQUESTOR: ClassVar[KeywordField] = KeywordField( + "taskRequestor", "taskRequestor" + ) """ requestor of the task """ @@ -52,11 +56,15 @@ def __setattr__(self, name, value): """ flag to make task read/unread """ - TASK_REQUESTOR_COMMENT: ClassVar[TextField] = TextField("taskRequestorComment", "taskRequestorComment") + TASK_REQUESTOR_COMMENT: ClassVar[TextField] = TextField( + "taskRequestorComment", "taskRequestorComment" + ) """ comment of requestor for the task """ - TASK_RELATED_ASSET_GUID: ClassVar[KeywordField] = KeywordField("taskRelatedAssetGuid", "taskRelatedAssetGuid") + TASK_RELATED_ASSET_GUID: ClassVar[KeywordField] = KeywordField( + "taskRelatedAssetGuid", "taskRelatedAssetGuid" + ) """ assetId to preview """ @@ -64,7 +72,9 @@ def __setattr__(self, name, value): """ contains the payload that is proposed to the task """ - TASK_EXPIRES_AT: ClassVar[NumericField] = NumericField("taskExpiresAt", "taskExpiresAt") + TASK_EXPIRES_AT: ClassVar[NumericField] = NumericField( + "taskExpiresAt", "taskExpiresAt" + ) """ Time (epoch) at which the task expires . """ @@ -72,23 +82,33 @@ def __setattr__(self, name, value): """ List of actions associated with this task. """ - TASK_EXECUTION_COMMENT: ClassVar[TextField] = TextField("taskExecutionComment", "taskExecutionComment") + TASK_EXECUTION_COMMENT: ClassVar[TextField] = TextField( + "taskExecutionComment", "taskExecutionComment" + ) """ comment for the action executed by user """ - TASK_EXECUTION_ACTION: ClassVar[KeywordField] = KeywordField("taskExecutionAction", "taskExecutionAction") + TASK_EXECUTION_ACTION: ClassVar[KeywordField] = KeywordField( + "taskExecutionAction", "taskExecutionAction" + ) """ action executed by the recipient """ - TASK_INTEGRATION_CONFIG: ClassVar[TextField] = TextField("taskIntegrationConfig", "taskIntegrationConfig") + TASK_INTEGRATION_CONFIG: ClassVar[TextField] = TextField( + "taskIntegrationConfig", "taskIntegrationConfig" + ) """ contains external integration config for the task """ - TASK_CREATED_BY: ClassVar[KeywordField] = KeywordField("taskCreatedBy", "taskCreatedBy") + TASK_CREATED_BY: ClassVar[KeywordField] = KeywordField( + "taskCreatedBy", "taskCreatedBy" + ) """ username of the user who created this task """ - TASK_UPDATED_BY: ClassVar[KeywordField] = KeywordField("taskUpdatedBy", "taskUpdatedBy") + TASK_UPDATED_BY: ClassVar[KeywordField] = KeywordField( + "taskUpdatedBy", "taskUpdatedBy" + ) """ username of the user who updated this task """ @@ -152,7 +172,9 @@ def task_is_read(self, task_is_read: Optional[bool]): @property def task_requestor_comment(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.task_requestor_comment + return ( + None if self.attributes is None else self.attributes.task_requestor_comment + ) @task_requestor_comment.setter def task_requestor_comment(self, task_requestor_comment: Optional[str]): @@ -162,7 +184,9 @@ def task_requestor_comment(self, task_requestor_comment: Optional[str]): @property def task_related_asset_guid(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.task_related_asset_guid + return ( + None if self.attributes is None else self.attributes.task_related_asset_guid + ) @task_related_asset_guid.setter def task_related_asset_guid(self, task_related_asset_guid: Optional[str]): @@ -202,7 +226,9 @@ def task_actions(self, task_actions: Optional[List[Action]]): @property def task_execution_comment(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.task_execution_comment + return ( + None if self.attributes is None else self.attributes.task_execution_comment + ) @task_execution_comment.setter def task_execution_comment(self, task_execution_comment: Optional[str]): @@ -212,7 +238,9 @@ def task_execution_comment(self, task_execution_comment: Optional[str]): @property def task_execution_action(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.task_execution_action + return ( + None if self.attributes is None else self.attributes.task_execution_action + ) @task_execution_action.setter def task_execution_action(self, task_execution_action: Optional[str]): @@ -222,7 +250,9 @@ def task_execution_action(self, task_execution_action: Optional[str]): @property def task_integration_config(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.task_integration_config + return ( + None if self.attributes is None else self.attributes.task_integration_config + ) @task_integration_config.setter def task_integration_config(self, task_integration_config: Optional[str]): diff --git a/pyatlan/model/assets/thoughtspot.py b/pyatlan/model/assets/thoughtspot.py index e89ee4949..a95f63d31 100644 --- a/pyatlan/model/assets/thoughtspot.py +++ b/pyatlan/model/assets/thoughtspot.py @@ -29,19 +29,27 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - THOUGHTSPOT_CHART_TYPE: ClassVar[KeywordField] = KeywordField("thoughtspotChartType", "thoughtspotChartType") + THOUGHTSPOT_CHART_TYPE: ClassVar[KeywordField] = KeywordField( + "thoughtspotChartType", "thoughtspotChartType" + ) """ """ - THOUGHTSPOT_QUESTION_TEXT: ClassVar[TextField] = TextField("thoughtspotQuestionText", "thoughtspotQuestionText") + THOUGHTSPOT_QUESTION_TEXT: ClassVar[TextField] = TextField( + "thoughtspotQuestionText", "thoughtspotQuestionText" + ) """ """ - THOUGHTSPOT_JOIN_COUNT: ClassVar[NumericField] = NumericField("thoughtspotJoinCount", "thoughtspotJoinCount") + THOUGHTSPOT_JOIN_COUNT: ClassVar[NumericField] = NumericField( + "thoughtspotJoinCount", "thoughtspotJoinCount" + ) """ Total number of data table joins executed for analysis. """ - THOUGHTSPOT_COLUMN_COUNT: ClassVar[NumericField] = NumericField("thoughtspotColumnCount", "thoughtspotColumnCount") + THOUGHTSPOT_COLUMN_COUNT: ClassVar[NumericField] = NumericField( + "thoughtspotColumnCount", "thoughtspotColumnCount" + ) """ Number of Columns. """ @@ -55,7 +63,9 @@ def __setattr__(self, name, value): @property def thoughtspot_chart_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.thoughtspot_chart_type + return ( + None if self.attributes is None else self.attributes.thoughtspot_chart_type + ) @thoughtspot_chart_type.setter def thoughtspot_chart_type(self, thoughtspot_chart_type: Optional[str]): @@ -65,7 +75,11 @@ def thoughtspot_chart_type(self, thoughtspot_chart_type: Optional[str]): @property def thoughtspot_question_text(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.thoughtspot_question_text + return ( + None + if self.attributes is None + else self.attributes.thoughtspot_question_text + ) @thoughtspot_question_text.setter def thoughtspot_question_text(self, thoughtspot_question_text: Optional[str]): @@ -75,7 +89,9 @@ def thoughtspot_question_text(self, thoughtspot_question_text: Optional[str]): @property def thoughtspot_join_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.thoughtspot_join_count + return ( + None if self.attributes is None else self.attributes.thoughtspot_join_count + ) @thoughtspot_join_count.setter def thoughtspot_join_count(self, thoughtspot_join_count: Optional[int]): @@ -85,7 +101,11 @@ def thoughtspot_join_count(self, thoughtspot_join_count: Optional[int]): @property def thoughtspot_column_count(self) -> Optional[int]: - return None if self.attributes is None else self.attributes.thoughtspot_column_count + return ( + None + if self.attributes is None + else self.attributes.thoughtspot_column_count + ) @thoughtspot_column_count.setter def thoughtspot_column_count(self, thoughtspot_column_count: Optional[int]): diff --git a/pyatlan/model/assets/thoughtspot_column.py b/pyatlan/model/assets/thoughtspot_column.py index 4194a2a90..9ce4150d2 100644 --- a/pyatlan/model/assets/thoughtspot_column.py +++ b/pyatlan/model/assets/thoughtspot_column.py @@ -63,7 +63,9 @@ def __setattr__(self, name, value): """ Specifies the technical format of data stored in a column such as integer, float, string, date, boolean etc. """ - THOUGHTSPOT_COLUMN_TYPE: ClassVar[KeywordField] = KeywordField("thoughtspotColumnType", "thoughtspotColumnType") + THOUGHTSPOT_COLUMN_TYPE: ClassVar[KeywordField] = KeywordField( + "thoughtspotColumnType", "thoughtspotColumnType" + ) """ Defines the analytical role of a column in data analysis categorizing it as a dimension, measure, or attribute. """ @@ -72,7 +74,9 @@ def __setattr__(self, name, value): """ TBC """ - THOUGHTSPOT_WORKSHEET: ClassVar[RelationField] = RelationField("thoughtspotWorksheet") + THOUGHTSPOT_WORKSHEET: ClassVar[RelationField] = RelationField( + "thoughtspotWorksheet" + ) """ TBC """ @@ -94,37 +98,65 @@ def __setattr__(self, name, value): @property def thoughtspot_table_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.thoughtspot_table_qualified_name + return ( + None + if self.attributes is None + else self.attributes.thoughtspot_table_qualified_name + ) @thoughtspot_table_qualified_name.setter - def thoughtspot_table_qualified_name(self, thoughtspot_table_qualified_name: Optional[str]): + def thoughtspot_table_qualified_name( + self, thoughtspot_table_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.thoughtspot_table_qualified_name = thoughtspot_table_qualified_name + self.attributes.thoughtspot_table_qualified_name = ( + thoughtspot_table_qualified_name + ) @property def thoughtspot_view_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.thoughtspot_view_qualified_name + return ( + None + if self.attributes is None + else self.attributes.thoughtspot_view_qualified_name + ) @thoughtspot_view_qualified_name.setter - def thoughtspot_view_qualified_name(self, thoughtspot_view_qualified_name: Optional[str]): + def thoughtspot_view_qualified_name( + self, thoughtspot_view_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.thoughtspot_view_qualified_name = thoughtspot_view_qualified_name + self.attributes.thoughtspot_view_qualified_name = ( + thoughtspot_view_qualified_name + ) @property def thoughtspot_worksheet_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.thoughtspot_worksheet_qualified_name + return ( + None + if self.attributes is None + else self.attributes.thoughtspot_worksheet_qualified_name + ) @thoughtspot_worksheet_qualified_name.setter - def thoughtspot_worksheet_qualified_name(self, thoughtspot_worksheet_qualified_name: Optional[str]): + def thoughtspot_worksheet_qualified_name( + self, thoughtspot_worksheet_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.thoughtspot_worksheet_qualified_name = thoughtspot_worksheet_qualified_name + self.attributes.thoughtspot_worksheet_qualified_name = ( + thoughtspot_worksheet_qualified_name + ) @property def thoughtspot_column_data_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.thoughtspot_column_data_type + return ( + None + if self.attributes is None + else self.attributes.thoughtspot_column_data_type + ) @thoughtspot_column_data_type.setter def thoughtspot_column_data_type(self, thoughtspot_column_data_type: Optional[str]): @@ -134,7 +166,9 @@ def thoughtspot_column_data_type(self, thoughtspot_column_data_type: Optional[st @property def thoughtspot_column_type(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.thoughtspot_column_type + return ( + None if self.attributes is None else self.attributes.thoughtspot_column_type + ) @thoughtspot_column_type.setter def thoughtspot_column_type(self, thoughtspot_column_type: Optional[str]): @@ -154,10 +188,14 @@ def thoughtspot_view(self, thoughtspot_view: Optional[ThoughtspotView]): @property def thoughtspot_worksheet(self) -> Optional[ThoughtspotWorksheet]: - return None if self.attributes is None else self.attributes.thoughtspot_worksheet + return ( + None if self.attributes is None else self.attributes.thoughtspot_worksheet + ) @thoughtspot_worksheet.setter - def thoughtspot_worksheet(self, thoughtspot_worksheet: Optional[ThoughtspotWorksheet]): + def thoughtspot_worksheet( + self, thoughtspot_worksheet: Optional[ThoughtspotWorksheet] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_worksheet = thoughtspot_worksheet @@ -173,14 +211,28 @@ def thoughtspot_table(self, thoughtspot_table: Optional[ThoughtspotTable]): self.attributes.thoughtspot_table = thoughtspot_table class Attributes(Thoughtspot.Attributes): - thoughtspot_table_qualified_name: Optional[str] = Field(default=None, description="") - thoughtspot_view_qualified_name: Optional[str] = Field(default=None, description="") - thoughtspot_worksheet_qualified_name: Optional[str] = Field(default=None, description="") - thoughtspot_column_data_type: Optional[str] = Field(default=None, description="") + thoughtspot_table_qualified_name: Optional[str] = Field( + default=None, description="" + ) + thoughtspot_view_qualified_name: Optional[str] = Field( + default=None, description="" + ) + thoughtspot_worksheet_qualified_name: Optional[str] = Field( + default=None, description="" + ) + thoughtspot_column_data_type: Optional[str] = Field( + default=None, description="" + ) thoughtspot_column_type: Optional[str] = Field(default=None, description="") - thoughtspot_view: Optional[ThoughtspotView] = Field(default=None, description="") # relationship - thoughtspot_worksheet: Optional[ThoughtspotWorksheet] = Field(default=None, description="") # relationship - thoughtspot_table: Optional[ThoughtspotTable] = Field(default=None, description="") # relationship + thoughtspot_view: Optional[ThoughtspotView] = Field( + default=None, description="" + ) # relationship + thoughtspot_worksheet: Optional[ThoughtspotWorksheet] = Field( + default=None, description="" + ) # relationship + thoughtspot_table: Optional[ThoughtspotTable] = Field( + default=None, description="" + ) # relationship attributes: ThoughtspotColumn.Attributes = Field( default_factory=lambda: ThoughtspotColumn.Attributes(), diff --git a/pyatlan/model/assets/thoughtspot_dashlet.py b/pyatlan/model/assets/thoughtspot_dashlet.py index fdd41bee6..6bb567ed4 100644 --- a/pyatlan/model/assets/thoughtspot_dashlet.py +++ b/pyatlan/model/assets/thoughtspot_dashlet.py @@ -46,7 +46,9 @@ def __setattr__(self, name, value): Unique name of the liveboard in which this dashlet exists. """ - THOUGHTSPOT_LIVEBOARD: ClassVar[RelationField] = RelationField("thoughtspotLiveboard") + THOUGHTSPOT_LIVEBOARD: ClassVar[RelationField] = RelationField( + "thoughtspotLiveboard" + ) """ TBC """ @@ -59,7 +61,11 @@ def __setattr__(self, name, value): @property def thoughtspot_liveboard_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.thoughtspot_liveboard_name + return ( + None + if self.attributes is None + else self.attributes.thoughtspot_liveboard_name + ) @thoughtspot_liveboard_name.setter def thoughtspot_liveboard_name(self, thoughtspot_liveboard_name: Optional[str]): @@ -69,28 +75,44 @@ def thoughtspot_liveboard_name(self, thoughtspot_liveboard_name: Optional[str]): @property def thoughtspot_liveboard_qualified_name(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.thoughtspot_liveboard_qualified_name + return ( + None + if self.attributes is None + else self.attributes.thoughtspot_liveboard_qualified_name + ) @thoughtspot_liveboard_qualified_name.setter - def thoughtspot_liveboard_qualified_name(self, thoughtspot_liveboard_qualified_name: Optional[str]): + def thoughtspot_liveboard_qualified_name( + self, thoughtspot_liveboard_qualified_name: Optional[str] + ): if self.attributes is None: self.attributes = self.Attributes() - self.attributes.thoughtspot_liveboard_qualified_name = thoughtspot_liveboard_qualified_name + self.attributes.thoughtspot_liveboard_qualified_name = ( + thoughtspot_liveboard_qualified_name + ) @property def thoughtspot_liveboard(self) -> Optional[ThoughtspotLiveboard]: - return None if self.attributes is None else self.attributes.thoughtspot_liveboard + return ( + None if self.attributes is None else self.attributes.thoughtspot_liveboard + ) @thoughtspot_liveboard.setter - def thoughtspot_liveboard(self, thoughtspot_liveboard: Optional[ThoughtspotLiveboard]): + def thoughtspot_liveboard( + self, thoughtspot_liveboard: Optional[ThoughtspotLiveboard] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_liveboard = thoughtspot_liveboard class Attributes(Thoughtspot.Attributes): thoughtspot_liveboard_name: Optional[str] = Field(default=None, description="") - thoughtspot_liveboard_qualified_name: Optional[str] = Field(default=None, description="") - thoughtspot_liveboard: Optional[ThoughtspotLiveboard] = Field(default=None, description="") # relationship + thoughtspot_liveboard_qualified_name: Optional[str] = Field( + default=None, description="" + ) + thoughtspot_liveboard: Optional[ThoughtspotLiveboard] = Field( + default=None, description="" + ) # relationship attributes: ThoughtspotDashlet.Attributes = Field( default_factory=lambda: ThoughtspotDashlet.Attributes(), diff --git a/pyatlan/model/assets/thoughtspot_liveboard.py b/pyatlan/model/assets/thoughtspot_liveboard.py index bcf560a09..07ec3537a 100644 --- a/pyatlan/model/assets/thoughtspot_liveboard.py +++ b/pyatlan/model/assets/thoughtspot_liveboard.py @@ -43,13 +43,17 @@ def thoughtspot_dashlets(self) -> Optional[List[ThoughtspotDashlet]]: return None if self.attributes is None else self.attributes.thoughtspot_dashlets @thoughtspot_dashlets.setter - def thoughtspot_dashlets(self, thoughtspot_dashlets: Optional[List[ThoughtspotDashlet]]): + def thoughtspot_dashlets( + self, thoughtspot_dashlets: Optional[List[ThoughtspotDashlet]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_dashlets = thoughtspot_dashlets class Attributes(Thoughtspot.Attributes): - thoughtspot_dashlets: Optional[List[ThoughtspotDashlet]] = Field(default=None, description="") # relationship + thoughtspot_dashlets: Optional[List[ThoughtspotDashlet]] = Field( + default=None, description="" + ) # relationship attributes: ThoughtspotLiveboard.Attributes = Field( default_factory=lambda: ThoughtspotLiveboard.Attributes(), diff --git a/pyatlan/model/assets/thoughtspot_table.py b/pyatlan/model/assets/thoughtspot_table.py index 60794b277..b2bf33d25 100644 --- a/pyatlan/model/assets/thoughtspot_table.py +++ b/pyatlan/model/assets/thoughtspot_table.py @@ -43,13 +43,17 @@ def thoughtspot_columns(self) -> Optional[List[ThoughtspotColumn]]: return None if self.attributes is None else self.attributes.thoughtspot_columns @thoughtspot_columns.setter - def thoughtspot_columns(self, thoughtspot_columns: Optional[List[ThoughtspotColumn]]): + def thoughtspot_columns( + self, thoughtspot_columns: Optional[List[ThoughtspotColumn]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_columns = thoughtspot_columns class Attributes(Thoughtspot.Attributes): - thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field(default=None, description="") # relationship + thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field( + default=None, description="" + ) # relationship attributes: ThoughtspotTable.Attributes = Field( default_factory=lambda: ThoughtspotTable.Attributes(), diff --git a/pyatlan/model/assets/thoughtspot_view.py b/pyatlan/model/assets/thoughtspot_view.py index c38ff55fe..d38eba813 100644 --- a/pyatlan/model/assets/thoughtspot_view.py +++ b/pyatlan/model/assets/thoughtspot_view.py @@ -43,13 +43,17 @@ def thoughtspot_columns(self) -> Optional[List[ThoughtspotColumn]]: return None if self.attributes is None else self.attributes.thoughtspot_columns @thoughtspot_columns.setter - def thoughtspot_columns(self, thoughtspot_columns: Optional[List[ThoughtspotColumn]]): + def thoughtspot_columns( + self, thoughtspot_columns: Optional[List[ThoughtspotColumn]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_columns = thoughtspot_columns class Attributes(Thoughtspot.Attributes): - thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field(default=None, description="") # relationship + thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field( + default=None, description="" + ) # relationship attributes: ThoughtspotView.Attributes = Field( default_factory=lambda: ThoughtspotView.Attributes(), diff --git a/pyatlan/model/assets/thoughtspot_worksheet.py b/pyatlan/model/assets/thoughtspot_worksheet.py index 49ee15f37..f4a8f1399 100644 --- a/pyatlan/model/assets/thoughtspot_worksheet.py +++ b/pyatlan/model/assets/thoughtspot_worksheet.py @@ -43,13 +43,17 @@ def thoughtspot_columns(self) -> Optional[List[ThoughtspotColumn]]: return None if self.attributes is None else self.attributes.thoughtspot_columns @thoughtspot_columns.setter - def thoughtspot_columns(self, thoughtspot_columns: Optional[List[ThoughtspotColumn]]): + def thoughtspot_columns( + self, thoughtspot_columns: Optional[List[ThoughtspotColumn]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.thoughtspot_columns = thoughtspot_columns class Attributes(Thoughtspot.Attributes): - thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field(default=None, description="") # relationship + thoughtspot_columns: Optional[List[ThoughtspotColumn]] = Field( + default=None, description="" + ) # relationship attributes: ThoughtspotWorksheet.Attributes = Field( default_factory=lambda: ThoughtspotWorksheet.Attributes(), diff --git a/pyatlan/model/assets/workflow.py b/pyatlan/model/assets/workflow.py index 3a3f770dd..3e116a4bd 100644 --- a/pyatlan/model/assets/workflow.py +++ b/pyatlan/model/assets/workflow.py @@ -31,7 +31,9 @@ def __setattr__(self, name, value): return object.__setattr__(self, name, value) super().__setattr__(name, value) - WORKFLOW_TEMPLATE_GUID: ClassVar[KeywordField] = KeywordField("workflowTemplateGuid", "workflowTemplateGuid") + WORKFLOW_TEMPLATE_GUID: ClassVar[KeywordField] = KeywordField( + "workflowTemplateGuid", "workflowTemplateGuid" + ) """ GUID of the workflow template from which this workflow was created. """ @@ -39,7 +41,9 @@ def __setattr__(self, name, value): """ Type of the workflow. """ - WORKFLOW_ACTION_CHOICES: ClassVar[KeywordField] = KeywordField("workflowActionChoices", "workflowActionChoices") + WORKFLOW_ACTION_CHOICES: ClassVar[KeywordField] = KeywordField( + "workflowActionChoices", "workflowActionChoices" + ) """ List of workflow action choices. """ @@ -47,23 +51,33 @@ def __setattr__(self, name, value): """ Details of the workflow. """ - WORKFLOW_STATUS: ClassVar[KeywordField] = KeywordField("workflowStatus", "workflowStatus") + WORKFLOW_STATUS: ClassVar[KeywordField] = KeywordField( + "workflowStatus", "workflowStatus" + ) """ Status of the workflow. """ - WORKFLOW_RUN_EXPIRES_IN: ClassVar[TextField] = TextField("workflowRunExpiresIn", "workflowRunExpiresIn") + WORKFLOW_RUN_EXPIRES_IN: ClassVar[TextField] = TextField( + "workflowRunExpiresIn", "workflowRunExpiresIn" + ) """ Time duration after which a run of this workflow will expire. """ - WORKFLOW_CREATED_BY: ClassVar[KeywordField] = KeywordField("workflowCreatedBy", "workflowCreatedBy") + WORKFLOW_CREATED_BY: ClassVar[KeywordField] = KeywordField( + "workflowCreatedBy", "workflowCreatedBy" + ) """ Username of the user who created this workflow. """ - WORKFLOW_UPDATED_BY: ClassVar[KeywordField] = KeywordField("workflowUpdatedBy", "workflowUpdatedBy") + WORKFLOW_UPDATED_BY: ClassVar[KeywordField] = KeywordField( + "workflowUpdatedBy", "workflowUpdatedBy" + ) """ Username of the user who updated this workflow. """ - WORKFLOW_DELETED_AT: ClassVar[NumericField] = NumericField("workflowDeletedAt", "workflowDeletedAt") + WORKFLOW_DELETED_AT: ClassVar[NumericField] = NumericField( + "workflowDeletedAt", "workflowDeletedAt" + ) """ Deletion time of this workflow. """ @@ -82,7 +96,9 @@ def __setattr__(self, name, value): @property def workflow_template_guid(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workflow_template_guid + return ( + None if self.attributes is None else self.attributes.workflow_template_guid + ) @workflow_template_guid.setter def workflow_template_guid(self, workflow_template_guid: Optional[str]): @@ -102,7 +118,9 @@ def workflow_type(self, workflow_type: Optional[WorkflowType]): @property def workflow_action_choices(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.workflow_action_choices + return ( + None if self.attributes is None else self.attributes.workflow_action_choices + ) @workflow_action_choices.setter def workflow_action_choices(self, workflow_action_choices: Optional[Set[str]]): @@ -132,7 +150,9 @@ def workflow_status(self, workflow_status: Optional[WorkflowStatus]): @property def workflow_run_expires_in(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workflow_run_expires_in + return ( + None if self.attributes is None else self.attributes.workflow_run_expires_in + ) @workflow_run_expires_in.setter def workflow_run_expires_in(self, workflow_run_expires_in: Optional[str]): @@ -173,7 +193,9 @@ def workflow_deleted_at(self, workflow_deleted_at: Optional[datetime]): class Attributes(Asset.Attributes): workflow_template_guid: Optional[str] = Field(default=None, description="") workflow_type: Optional[WorkflowType] = Field(default=None, description="") - workflow_action_choices: Optional[Set[str]] = Field(default=None, description="") + workflow_action_choices: Optional[Set[str]] = Field( + default=None, description="" + ) workflow_config: Optional[str] = Field(default=None, description="") workflow_status: Optional[WorkflowStatus] = Field(default=None, description="") workflow_run_expires_in: Optional[str] = Field(default=None, description="") diff --git a/pyatlan/model/assets/workflow_run.py b/pyatlan/model/assets/workflow_run.py index e23647d73..29768cebf 100644 --- a/pyatlan/model/assets/workflow_run.py +++ b/pyatlan/model/assets/workflow_run.py @@ -37,7 +37,9 @@ def __setattr__(self, name, value): """ GUID of the workflow from which this run was created. """ - WORKFLOW_RUN_TYPE: ClassVar[KeywordField] = KeywordField("workflowRunType", "workflowRunType") + WORKFLOW_RUN_TYPE: ClassVar[KeywordField] = KeywordField( + "workflowRunType", "workflowRunType" + ) """ Type of the workflow from which this run was created. """ @@ -53,31 +55,45 @@ def __setattr__(self, name, value): """ The asset for which this run was created. """ - WORKFLOW_RUN_COMMENT: ClassVar[TextField] = TextField("workflowRunComment", "workflowRunComment") + WORKFLOW_RUN_COMMENT: ClassVar[TextField] = TextField( + "workflowRunComment", "workflowRunComment" + ) """ The comment added by the requester """ - WORKFLOW_RUN_CONFIG: ClassVar[TextField] = TextField("workflowRunConfig", "workflowRunConfig") + WORKFLOW_RUN_CONFIG: ClassVar[TextField] = TextField( + "workflowRunConfig", "workflowRunConfig" + ) """ Details of the approval workflow run. """ - WORKFLOW_RUN_STATUS: ClassVar[KeywordField] = KeywordField("workflowRunStatus", "workflowRunStatus") + WORKFLOW_RUN_STATUS: ClassVar[KeywordField] = KeywordField( + "workflowRunStatus", "workflowRunStatus" + ) """ Status of the run. """ - WORKFLOW_RUN_EXPIRES_AT: ClassVar[NumericField] = NumericField("workflowRunExpiresAt", "workflowRunExpiresAt") + WORKFLOW_RUN_EXPIRES_AT: ClassVar[NumericField] = NumericField( + "workflowRunExpiresAt", "workflowRunExpiresAt" + ) """ Time at which this run will expire. """ - WORKFLOW_RUN_CREATED_BY: ClassVar[KeywordField] = KeywordField("workflowRunCreatedBy", "workflowRunCreatedBy") + WORKFLOW_RUN_CREATED_BY: ClassVar[KeywordField] = KeywordField( + "workflowRunCreatedBy", "workflowRunCreatedBy" + ) """ Username of the user who created this workflow run. """ - WORKFLOW_RUN_UPDATED_BY: ClassVar[KeywordField] = KeywordField("workflowRunUpdatedBy", "workflowRunUpdatedBy") + WORKFLOW_RUN_UPDATED_BY: ClassVar[KeywordField] = KeywordField( + "workflowRunUpdatedBy", "workflowRunUpdatedBy" + ) """ Username of the user who updated this workflow run. """ - WORKFLOW_RUN_DELETED_AT: ClassVar[NumericField] = NumericField("workflowRunDeletedAt", "workflowRunDeletedAt") + WORKFLOW_RUN_DELETED_AT: ClassVar[NumericField] = NumericField( + "workflowRunDeletedAt", "workflowRunDeletedAt" + ) """ Deletion time of this workflow run. """ @@ -98,7 +114,11 @@ def __setattr__(self, name, value): @property def workflow_run_workflow_guid(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workflow_run_workflow_guid + return ( + None + if self.attributes is None + else self.attributes.workflow_run_workflow_guid + ) @workflow_run_workflow_guid.setter def workflow_run_workflow_guid(self, workflow_run_workflow_guid: Optional[str]): @@ -118,17 +138,27 @@ def workflow_run_type(self, workflow_run_type: Optional[WorkflowRunType]): @property def workflow_run_action_choices(self) -> Optional[Set[str]]: - return None if self.attributes is None else self.attributes.workflow_run_action_choices + return ( + None + if self.attributes is None + else self.attributes.workflow_run_action_choices + ) @workflow_run_action_choices.setter - def workflow_run_action_choices(self, workflow_run_action_choices: Optional[Set[str]]): + def workflow_run_action_choices( + self, workflow_run_action_choices: Optional[Set[str]] + ): if self.attributes is None: self.attributes = self.Attributes() self.attributes.workflow_run_action_choices = workflow_run_action_choices @property def workflow_run_on_asset_guid(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workflow_run_on_asset_guid + return ( + None + if self.attributes is None + else self.attributes.workflow_run_on_asset_guid + ) @workflow_run_on_asset_guid.setter def workflow_run_on_asset_guid(self, workflow_run_on_asset_guid: Optional[str]): @@ -168,7 +198,9 @@ def workflow_run_status(self, workflow_run_status: Optional[WorkflowRunStatus]): @property def workflow_run_expires_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.workflow_run_expires_at + return ( + None if self.attributes is None else self.attributes.workflow_run_expires_at + ) @workflow_run_expires_at.setter def workflow_run_expires_at(self, workflow_run_expires_at: Optional[datetime]): @@ -178,7 +210,9 @@ def workflow_run_expires_at(self, workflow_run_expires_at: Optional[datetime]): @property def workflow_run_created_by(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workflow_run_created_by + return ( + None if self.attributes is None else self.attributes.workflow_run_created_by + ) @workflow_run_created_by.setter def workflow_run_created_by(self, workflow_run_created_by: Optional[str]): @@ -188,7 +222,9 @@ def workflow_run_created_by(self, workflow_run_created_by: Optional[str]): @property def workflow_run_updated_by(self) -> Optional[str]: - return None if self.attributes is None else self.attributes.workflow_run_updated_by + return ( + None if self.attributes is None else self.attributes.workflow_run_updated_by + ) @workflow_run_updated_by.setter def workflow_run_updated_by(self, workflow_run_updated_by: Optional[str]): @@ -198,7 +234,9 @@ def workflow_run_updated_by(self, workflow_run_updated_by: Optional[str]): @property def workflow_run_deleted_at(self) -> Optional[datetime]: - return None if self.attributes is None else self.attributes.workflow_run_deleted_at + return ( + None if self.attributes is None else self.attributes.workflow_run_deleted_at + ) @workflow_run_deleted_at.setter def workflow_run_deleted_at(self, workflow_run_deleted_at: Optional[datetime]): @@ -208,16 +246,26 @@ def workflow_run_deleted_at(self, workflow_run_deleted_at: Optional[datetime]): class Attributes(Asset.Attributes): workflow_run_workflow_guid: Optional[str] = Field(default=None, description="") - workflow_run_type: Optional[WorkflowRunType] = Field(default=None, description="") - workflow_run_action_choices: Optional[Set[str]] = Field(default=None, description="") + workflow_run_type: Optional[WorkflowRunType] = Field( + default=None, description="" + ) + workflow_run_action_choices: Optional[Set[str]] = Field( + default=None, description="" + ) workflow_run_on_asset_guid: Optional[str] = Field(default=None, description="") workflow_run_comment: Optional[str] = Field(default=None, description="") workflow_run_config: Optional[str] = Field(default=None, description="") - workflow_run_status: Optional[WorkflowRunStatus] = Field(default=None, description="") - workflow_run_expires_at: Optional[datetime] = Field(default=None, description="") + workflow_run_status: Optional[WorkflowRunStatus] = Field( + default=None, description="" + ) + workflow_run_expires_at: Optional[datetime] = Field( + default=None, description="" + ) workflow_run_created_by: Optional[str] = Field(default=None, description="") workflow_run_updated_by: Optional[str] = Field(default=None, description="") - workflow_run_deleted_at: Optional[datetime] = Field(default=None, description="") + workflow_run_deleted_at: Optional[datetime] = Field( + default=None, description="" + ) attributes: WorkflowRun.Attributes = Field( default_factory=lambda: WorkflowRun.Attributes(), diff --git a/pyatlan/model/atlan_image.py b/pyatlan/model/atlan_image.py index 74802a838..0276769e6 100644 --- a/pyatlan/model/atlan_image.py +++ b/pyatlan/model/atlan_image.py @@ -10,17 +10,37 @@ class AtlanImage(AtlanObject): - id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the image.") + id: Optional[str] = Field( + default=None, description="Unique identifier (GUID) of the image." + ) version: Optional[str] = Field(default=None, description="TBC") - created_at: Optional[int] = Field(description="Time at which the image was uploaded (epoch), in milliseconds.") - updated_at: Optional[int] = Field(description="Time at which the image was last modified (epoch), in milliseconds.") - file_name: Optional[str] = Field(default=None, description="Generated name of the image that was uploaded.") - raw_name: Optional[str] = Field(default=None, description="Generated name of the image that was uploaded.") - key: Optional[str] = Field(default=None, description="Generated name of the image that was uploaded.") - extension: Optional[str] = Field(default=None, description="Filename extension for the image that was uploaded.") - content_type: Optional[str] = Field(default=None, description="MIME type for the image that was uploaded.") - file_size: Optional[str] = Field(default=None, description="Size of the image that was uploaded, in bytes.") - is_encrypted: Optional[bool] = Field(description="Whether the image is encrypted (true) or not (false).") + created_at: Optional[int] = Field( + description="Time at which the image was uploaded (epoch), in milliseconds." + ) + updated_at: Optional[int] = Field( + description="Time at which the image was last modified (epoch), in milliseconds." + ) + file_name: Optional[str] = Field( + default=None, description="Generated name of the image that was uploaded." + ) + raw_name: Optional[str] = Field( + default=None, description="Generated name of the image that was uploaded." + ) + key: Optional[str] = Field( + default=None, description="Generated name of the image that was uploaded." + ) + extension: Optional[str] = Field( + default=None, description="Filename extension for the image that was uploaded." + ) + content_type: Optional[str] = Field( + default=None, description="MIME type for the image that was uploaded." + ) + file_size: Optional[str] = Field( + default=None, description="Size of the image that was uploaded, in bytes." + ) + is_encrypted: Optional[bool] = Field( + description="Whether the image is encrypted (true) or not (false)." + ) redirect_url: Optional[str] = Field(default=None, description="TBC") is_uploaded: Optional[bool] = Field(default=None, description="TBC") uploaded_at: Optional[str] = Field(default=None, description="TBC") diff --git a/pyatlan/model/audit.py b/pyatlan/model/audit.py index 062dc9f21..ae9930e8b 100644 --- a/pyatlan/model/audit.py +++ b/pyatlan/model/audit.py @@ -175,7 +175,9 @@ def convert(cls, values): CustomMetadataCache.get_attr_name_for_id(cm_id, attr_id): properties for attr_id, properties in values[ATTRIBUTES].items() } - archived_attributes = {key: value for key, value in attributes.items() if "-archived-" in key} + archived_attributes = { + key: value for key, value in attributes.items() if "-archived-" in key + } for key in archived_attributes: del attributes[key] values[ATTRIBUTES] = attributes @@ -194,8 +196,12 @@ class EntityAudit(AtlanObject): entity_qualified_name: str = Field(description="Unique name of the asset.") type_name: str = Field(description="Type of the asset.") entity_id: str = Field(description="Unique identifier (GUID) of the asset.") - timestamp: datetime = Field(description="Time (epoch) at which the activity started, in milliseconds.") - created: datetime = Field(description="Time (epoch) at which the activity completed, in milliseconds.") + timestamp: datetime = Field( + description="Time (epoch) at which the activity started, in milliseconds." + ) + created: datetime = Field( + description="Time (epoch) at which the activity completed, in milliseconds." + ) user: str = Field(description="User who carried out the activity.") action: AuditActionType = Field(description="The type of activity that was done.") details: Optional[Any] = Field(default=None, description="Unused.") @@ -271,7 +277,9 @@ def next_page(self, start=None, size=None) -> bool: :returns: True if there is a next page of results, otherwise False """ self._start = start or self._start + self._size - is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + is_bulk_search = ( + self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + ) if size: self._size = size @@ -281,7 +289,9 @@ def next_page(self, start=None, size=None) -> bool: # in a previous page of results. # If it has,then exclude it from the current results; # otherwise, we may encounter duplicate audit entity records. - self._processed_entity_keys.update(entity.event_key for entity in self._entity_audits) + self._processed_entity_keys.update( + entity.event_key for entity in self._entity_audits + ) return self._get_next_page() if self._entity_audits else False def _get_next_page(self): @@ -293,7 +303,9 @@ def _get_next_page(self): query = self._criteria.dsl.query self._criteria.dsl.size = self._size self._criteria.dsl.from_ = self._start - is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + is_bulk_search = ( + self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + ) if is_bulk_search: self._prepare_query_for_timestamp_paging(query) @@ -318,13 +330,17 @@ def _get_next_page_json(self, is_bulk_search: bool = False): return None try: - self._entity_audits = parse_obj_as(List[EntityAudit], raw_json[ENTITY_AUDITS]) + self._entity_audits = parse_obj_as( + List[EntityAudit], raw_json[ENTITY_AUDITS] + ) if is_bulk_search: self._update_first_last_record_creation_times() self._filter_processed_entities() return raw_json except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err def _prepare_query_for_timestamp_paging(self, query: Query): """ @@ -338,7 +354,9 @@ def _prepare_query_for_timestamp_paging(self, query: Query): rewritten_filters.append(filter_) if self._first_record_creation_time != self._last_record_creation_time: - rewritten_filters.append(self._get_paging_timestamp_query(self._last_record_creation_time)) + rewritten_filters.append( + self._get_paging_timestamp_query(self._last_record_creation_time) + ) if isinstance(query, Bool): rewritten_query = Bool( filter=rewritten_filters, @@ -377,7 +395,11 @@ def _get_paging_timestamp_query(last_timestamp: int) -> Query: @staticmethod def _is_paging_timestamp_query(filter_: Query) -> bool: - return isinstance(filter_, Range) and filter_.field == "created" and filter_.gte is not None + return ( + isinstance(filter_, Range) + and filter_.field == "created" + and filter_.gte is not None + ) def _update_first_last_record_creation_times(self): self._first_record_creation_time = self._last_record_creation_time = -2 @@ -400,7 +422,8 @@ def _filter_processed_entities(self): self._entity_audits = [ entity for entity in self._entity_audits - if entity is not None and entity.event_key not in self._processed_entity_keys + if entity is not None + and entity.event_key not in self._processed_entity_keys ] @staticmethod @@ -433,7 +456,9 @@ def sort_by_timestamp_first(sorts: List[SortItem]) -> List[SortItem]: return creation_asc_sort rewritten_sorts = [ - sort for sort in sorts if (not sort.field) or (sort.field != Asset.CREATE_TIME.internal_field_name) + sort + for sort in sorts + if (not sort.field) or (sort.field != Asset.CREATE_TIME.internal_field_name) ] return creation_asc_sort + rewritten_sorts diff --git a/pyatlan/model/contract.py b/pyatlan/model/contract.py index 870e21216..4f9761d84 100644 --- a/pyatlan/model/contract.py +++ b/pyatlan/model/contract.py @@ -25,14 +25,18 @@ class DataContractSpec(AtlanYamlModel): description="Controls the specification as one for a data contract.", ) status: Union[DataContractStatus, str] = Field(description="State of the contract.") - template_version: str = Field(default="0.0.2", description="Version of the template for the data contract.") + template_version: str = Field( + default="0.0.2", description="Version of the template for the data contract." + ) type: str = Field(description="Type of the dataset in Atlan.") dataset: str = Field(description="Name of the asset as it exists inside Atlan.") data_source: Optional[str] = Field( default=None, description="Name that must match a data source defined in your config file.", ) - description: Optional[str] = Field(default=None, description="Description of this dataset.") + description: Optional[str] = Field( + default=None, description="Description of this dataset." + ) owners: Optional[DataContractSpec.Owners] = Field( default=None, description=( @@ -45,7 +49,9 @@ class DataContractSpec(AtlanYamlModel): announcement: Optional[DataContractSpec.Announcement] = Field( default=None, description="Announcement to apply to the dataset." ) - terms: Optional[List[str]] = Field(default_factory=list, description="Glossary terms to assign to the dataset.") + terms: Optional[List[str]] = Field( + default_factory=list, description="Glossary terms to assign to the dataset." + ) tags: Optional[List[DataContractSpec.DCTag]] = Field( default_factory=list, description="Atlan tags for the dataset." ) @@ -72,33 +78,51 @@ class Owners(AtlanYamlModel): Owners of the dataset. """ - users: Optional[List[str]] = Field(default_factory=list, description="Individual users who own the dataset.") - groups: Optional[List[str]] = Field(default_factory=list, description="Groups that own the dataset.") + users: Optional[List[str]] = Field( + default_factory=list, description="Individual users who own the dataset." + ) + groups: Optional[List[str]] = Field( + default_factory=list, description="Groups that own the dataset." + ) class Certification(AtlanYamlModel): """ Certification information for the dataset. """ - status: Optional[Union[CertificateStatus, str]] = Field(default=None, description="State of the certification.") - message: Optional[str] = Field(default=None, description="Message to accompany the certification.") + status: Optional[Union[CertificateStatus, str]] = Field( + default=None, description="State of the certification." + ) + message: Optional[str] = Field( + default=None, description="Message to accompany the certification." + ) class Announcement(AtlanYamlModel): """ Announcement details for the dataset. """ - type: Optional[Union[CertificateStatus, str]] = Field(default=None, description="Type of announcement.") - title: Optional[str] = Field(default=None, description="Title to use for the announcement.") - description: Optional[str] = Field(default=None, description="Message to accompany the announcement.") + type: Optional[Union[CertificateStatus, str]] = Field( + default=None, description="Type of announcement." + ) + title: Optional[str] = Field( + default=None, description="Title to use for the announcement." + ) + description: Optional[str] = Field( + default=None, description="Message to accompany the announcement." + ) class DCTag(AtlanYamlModel): """ Tagging details for the dataset. """ - name: Optional[str] = Field(default=None, description="Human-readable name of the Atlan tag.") - propagate: Optional[str] = Field(default=None, description="Whether to propagate the tag or not.") + name: Optional[str] = Field( + default=None, description="Human-readable name of the Atlan tag." + ) + propagate: Optional[str] = Field( + default=None, description="Whether to propagate the tag or not." + ) propagate_through_lineage: Optional[bool] = Field( default=None, alias="restrict_propagation_through_lineage", @@ -140,10 +164,18 @@ class DCColumn(AtlanYamlModel): default=None, description="Logical data type of values in this column (e.g. string).", ) - invalid_type: Optional[str] = Field(default=None, description="Format of data to consider invalid.") - invalid_format: Optional[str] = Field(default=None, description="Format of data to consider valid.") - valid_regex: Optional[str] = Field(default=None, description="Regular expression to match valid values.") - missing_regex: Optional[str] = Field(default=None, description="Regular expression to match missing values.") + invalid_type: Optional[str] = Field( + default=None, description="Format of data to consider invalid." + ) + invalid_format: Optional[str] = Field( + default=None, description="Format of data to consider valid." + ) + valid_regex: Optional[str] = Field( + default=None, description="Regular expression to match valid values." + ) + missing_regex: Optional[str] = Field( + default=None, description="Regular expression to match missing values." + ) invalid_values: Optional[List[str]] = Field( default_factory=list, description="Enumeration of values that should be considered invalid.", @@ -156,15 +188,23 @@ class DCColumn(AtlanYamlModel): default_factory=list, description="Enumeration of values that should be considered missing.", ) - not_null: Optional[bool] = Field(default=None, description="When true, this column cannot be empty.") + not_null: Optional[bool] = Field( + default=None, description="When true, this column cannot be empty." + ) valid_length: Optional[int] = Field( default=None, description="Fixed length for a string to be considered valid.", ) - valid_min: Optional[int] = Field(default=None, description="Minimum numeric value considered valid.") - valid_max: Optional[int] = Field(default=None, description="Maximum numeric value considered valid.") + valid_min: Optional[int] = Field( + default=None, description="Minimum numeric value considered valid." + ) + valid_max: Optional[int] = Field( + default=None, description="Maximum numeric value considered valid." + ) valid_min_length: Optional[int] = Field( default=None, description="Minimum length for a string to be considered valid.", ) - unique: Optional[bool] = Field(default=None, description="When true, this column must have unique values.") + unique: Optional[bool] = Field( + default=None, description="When true, this column must have unique values." + ) diff --git a/pyatlan/model/core.py b/pyatlan/model/core.py index 188ade767..c93a91a9a 100644 --- a/pyatlan/model/core.py +++ b/pyatlan/model/core.py @@ -70,7 +70,10 @@ def __hash__(self): return self._display_text.__hash__() def __eq__(self, other): - return isinstance(other, AtlanTagName) and self._display_text == other._display_text + return ( + isinstance(other, AtlanTagName) + and self._display_text == other._display_text + ) @classmethod def _convert_to_display_text(cls, data): @@ -137,7 +140,9 @@ class Config: validate_assignment = True allow_population_by_field_name = True - def to_yaml(self, by_alias: bool = True, exclude_unset: bool = True, sort_keys: bool = False) -> str: + def to_yaml( + self, by_alias: bool = True, exclude_unset: bool = True, sort_keys: bool = False + ) -> str: """ Serialize the Pydantic model instance to a YAML string. """ @@ -166,8 +171,12 @@ class SearchRequest(AtlanObject, ABC): default_factory=list, description="List of attributes to be returned for each result.", ) - offset: Optional[int] = Field(default=None, description="Starting point for pagination.", alias="from") - size: Optional[int] = Field(default=None, description="How many results to include in each page of results.") + offset: Optional[int] = Field( + default=None, description="Starting point for pagination.", alias="from" + ) + size: Optional[int] = Field( + default=None, description="How many results to include in each page of results." + ) @dataclass @@ -214,7 +223,9 @@ class Config: alias="restrictPropagationThroughHierarchy", ) validity_periods: Optional[List[str]] = Field(default=None, alias="validityPeriods") - _source_tag_attachements: List[SourceTagAttachment] = PrivateAttr(default_factory=list) + _source_tag_attachements: List[SourceTagAttachment] = PrivateAttr( + default_factory=list + ) attributes: Optional[Dict[str, Any]] = None @@ -269,14 +280,18 @@ def of( tag.entity_guid = entity_guid tag.entity_status = EntityStatus.ACTIVE if source_tag_attachment: - source_tag_attr_id = AtlanTagCache.get_source_tags_attr_id(atlan_tag_name.id) or "" + source_tag_attr_id = ( + AtlanTagCache.get_source_tags_attr_id(atlan_tag_name.id) or "" + ) tag.attributes = {source_tag_attr_id: [source_tag_attachment]} tag._source_tag_attachements.append(source_tag_attachment) return tag class AtlanTags(AtlanObject): - __root__: List[AtlanTag] = Field(default_factory=list, description="classifications") + __root__: List[AtlanTag] = Field( + default_factory=list, description="classifications" + ) class Meaning(AtlanObject): @@ -340,7 +355,9 @@ def process_attributes_and_flush_cm(cls, asset): asset.append_relationship_attributes = {} # Process relationship attributes set by the user and update exclusion set for attribute in asset.attributes.__fields_set__: - exclude_attributes.update(cls.process_relationship_attributes(asset, attribute)) + exclude_attributes.update( + cls.process_relationship_attributes(asset, attribute) + ) # Determine relationship attributes to exclude # https://docs.pydantic.dev/1.10/usage/exporting_models/#advanced-include-and-exclude exclude_relationship_attributes = { @@ -376,7 +393,10 @@ def process_relationship_attributes(cls, asset, attribute): # Updated to use `asset.attribute` instead of `asset` to align with the API. # This change ensures the correct value is retrieved regardless of the naming conventions. - attribute_name, attribute_value = attribute, getattr(asset.attributes, attribute, None) + attribute_name, attribute_value = ( + attribute, + getattr(asset.attributes, attribute, None), + ) # Process list of relationship attributes if attribute_value and isinstance(attribute_value, list): @@ -391,9 +411,13 @@ def process_relationship_attributes(cls, asset, attribute): # Update asset based on processed relationship attributes if remove_attributes: - asset.remove_relationship_attributes.update({to_camel_case(attribute_name): remove_attributes}) + asset.remove_relationship_attributes.update( + {to_camel_case(attribute_name): remove_attributes} + ) if append_attributes: - asset.append_relationship_attributes.update({to_camel_case(attribute_name): append_attributes}) + asset.append_relationship_attributes.update( + {to_camel_case(attribute_name): append_attributes} + ) if replace_attributes: # Updated to use `asset.attribute` instead of `asset` to align with the API. # This change ensures the correct value is retrieved regardless of the naming conventions. @@ -413,12 +437,16 @@ def process_relationship_attributes(cls, asset, attribute): # We only want to include this attribute under # "remove_relationship_attributes", not both. exclude_attributes.add(attribute_name) - asset.remove_relationship_attributes = {to_camel_case(attribute_name): attribute_value} + asset.remove_relationship_attributes = { + to_camel_case(attribute_name): attribute_value + } elif attribute_value.semantic == SaveSemantic.APPEND: # Add the replace attribute to the set to exclude it # from the "attributes" property in the request payload. # We only want to include this attribute under # "append_relationship_attributes", not both. exclude_attributes.add(attribute_name) - asset.append_relationship_attributes = {to_camel_case(attribute_name): attribute_value} + asset.append_relationship_attributes = { + to_camel_case(attribute_name): attribute_value + } return exclude_attributes diff --git a/pyatlan/model/credential.py b/pyatlan/model/credential.py index d3beaff1d..bfcf641df 100644 --- a/pyatlan/model/credential.py +++ b/pyatlan/model/credential.py @@ -6,14 +6,20 @@ class Credential(AtlanObject): - id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the credential.") + id: Optional[str] = Field( + default=None, description="Unique identifier (GUID) of the credential." + ) name: Optional[str] = Field(default=None, description="Name of the credential.") - description: Optional[str] = Field(default=None, description="Description of the credential.") + description: Optional[str] = Field( + default=None, description="Description of the credential." + ) host: Optional[str] = Field( default=None, description="Hostname for which connectivity is defined by the credential.", ) - port: Optional[int] = Field(default=None, description="Port number on which connectivity should be done.") + port: Optional[int] = Field( + default=None, description="Port number on which connectivity should be done." + ) auth_type: Optional[str] = Field( default=None, description="Authentication mechanism represented by the credential.", diff --git a/pyatlan/model/custom_metadata.py b/pyatlan/model/custom_metadata.py index f1eee8374..3bd87d224 100644 --- a/pyatlan/model/custom_metadata.py +++ b/pyatlan/model/custom_metadata.py @@ -38,7 +38,9 @@ def __init__(self, name: str): _id = CustomMetadataCache.get_id_for_name(name) self._names = { value - for key, value in CustomMetadataCache.get_cache().map_attr_id_to_name[_id].items() + for key, value in CustomMetadataCache.get_cache() + .map_attr_id_to_name[_id] + .items() if not CustomMetadataCache.is_attr_archived(attr_id=key) } @@ -47,7 +49,9 @@ def get_deleted_sentinel(cls) -> "CustomMetadataDict": """Will return an CustomMetadataDict that is a sentinel object to represent deleted custom meta data.""" if cls._sentinel is not None: return cls._sentinel - return cls.__new__(cls, DELETED_SENTINEL) # Because __new__ is being invoked directly __init__ won't be invoked + return cls.__new__( + cls, DELETED_SENTINEL + ) # Because __new__ is being invoked directly __init__ won't be invoked @property def modified(self): @@ -95,7 +99,10 @@ def is_set(self, key: str): def business_attributes(self) -> Dict[str, Any]: """Returns a dict containing the metadata set with the human-readable set name and property names resolved to their internal values""" - return {CustomMetadataCache.get_attr_id_for_name(self._name, key): value for (key, value) in self.data.items()} + return { + CustomMetadataCache.get_attr_id_for_name(self._name, key): value + for (key, value) in self.data.items() + } class CustomMetadataProxy: @@ -160,7 +167,9 @@ class CustomMetadataRequest(AtlanObject): @classmethod def create(cls, custom_metadata_dict: CustomMetadataDict): ret_val = cls(__root__=custom_metadata_dict.business_attributes) - ret_val._set_id = CustomMetadataCache.get_id_for_name(custom_metadata_dict._name) + ret_val._set_id = CustomMetadataCache.get_id_for_name( + custom_metadata_dict._name + ) return ret_val @property diff --git a/pyatlan/model/data_mesh.py b/pyatlan/model/data_mesh.py index 4838bbf35..cea541666 100644 --- a/pyatlan/model/data_mesh.py +++ b/pyatlan/model/data_mesh.py @@ -12,7 +12,9 @@ class DataProductsAssetsDSL(AtlanObject): query: IndexSearchRequest = Field(description="Parameters for the search itself.") - filter_scrubbed: bool = Field(default=True, description="Whether or not to filter scrubbed records.") + filter_scrubbed: bool = Field( + default=True, description="Whether or not to filter scrubbed records." + ) _ATTR_LIST = [ "__traitNames", "connectorName", @@ -75,14 +77,20 @@ class DataProductsAssetsDSL(AtlanObject): ] def _exclude_nulls(self, dict_: Dict[str, Any]) -> Dict[str, Any]: - return {key: value for key, value in dict_.items() if value not in (None, [], {})} + return { + key: value for key, value in dict_.items() if value not in (None, [], {}) + } def _contruct_dsl_str(self, asset_selection_dsl: Dict[str, Any]) -> str: try: # For data products -- these require a `filter` as a nested dict construct within # an outer bool, not a list (which is all the default Elastic client will serialize) - filter_condition = asset_selection_dsl["query"]["dsl"]["query"]["bool"].pop("filter") - asset_selection_dsl["query"]["dsl"]["query"]["bool"]["filter"] = {"bool": {"filter": filter_condition}} + filter_condition = asset_selection_dsl["query"]["dsl"]["query"]["bool"].pop( + "filter" + ) + asset_selection_dsl["query"]["dsl"]["query"]["bool"]["filter"] = { + "bool": {"filter": filter_condition} + } except KeyError: raise ErrorCode.UNABLE_TO_TRANSLATE_ASSETS_DSL.exception_with_parameters() from None return dumps(asset_selection_dsl) diff --git a/pyatlan/model/enums.py b/pyatlan/model/enums.py index aef7b0f18..08a794063 100644 --- a/pyatlan/model/enums.py +++ b/pyatlan/model/enums.py @@ -144,10 +144,14 @@ class AtlanConnectorType(str, Enum): category: AtlanConnectionCategory @classmethod - def _get_connector_type_from_qualified_name(cls, qualified_name: str) -> "AtlanConnectorType": + def _get_connector_type_from_qualified_name( + cls, qualified_name: str + ) -> "AtlanConnectorType": tokens = qualified_name.split("/") if len(tokens) < 2: - raise ValueError(f"Qualified name '{qualified_name}' does not contain enough segments.") + raise ValueError( + f"Qualified name '{qualified_name}' does not contain enough segments." + ) connector_type_key = tokens[1].upper() # Check if the connector_type_key exists in AtlanConnectorType if connector_type_key not in AtlanConnectorType.__members__: @@ -157,7 +161,9 @@ def _get_connector_type_from_qualified_name(cls, qualified_name: str) -> "AtlanC ) return AtlanConnectorType[connector_type_key] - def __new__(cls, value: str, category: AtlanConnectionCategory) -> "AtlanConnectorType": + def __new__( + cls, value: str, category: AtlanConnectionCategory + ) -> "AtlanConnectorType": obj = str.__new__(cls, value) obj._value_ = value obj.category = category @@ -2099,7 +2105,9 @@ class PersonaDomainAction(str, Enum): UPDATE_PRODUCTS = "persona-domain-product-update" DELETE_PRODUCTS = "persona-domain-product-delete" UPDATE_DOMAIN_CUSTOM_METADATA = "persona-domain-business-update-metadata" - UPDATE_SUBDOMAIN_CUSTOM_METADATA = "persona-domain-sub-domain-business-update-metadata" + UPDATE_SUBDOMAIN_CUSTOM_METADATA = ( + "persona-domain-sub-domain-business-update-metadata" + ) UPDATE_PRODUCT_CUSTOM_METADATA = "persona-domain-product-business-update-metadata" @@ -2341,12 +2349,20 @@ class AtlanTaskType(str, Enum): CLASSIFICATION_PROPAGATION_ADD = "CLASSIFICATION_PROPAGATION_ADD" CLASSIFICATION_PROPAGATION_DELETE = "CLASSIFICATION_PROPAGATION_DELETE" CLASSIFICATION_ONLY_PROPAGATION_DELETE = "CLASSIFICATION_ONLY_PROPAGATION_DELETE" - CLASSIFICATION_ONLY_PROPAGATION_DELETE_ON_HARD_DELETE = "CLASSIFICATION_ONLY_PROPAGATION_DELETE_ON_HARD_DELETE" + CLASSIFICATION_ONLY_PROPAGATION_DELETE_ON_HARD_DELETE = ( + "CLASSIFICATION_ONLY_PROPAGATION_DELETE_ON_HARD_DELETE" + ) CLASSIFICATION_REFRESH_PROPAGATION = "CLASSIFICATION_REFRESH_PROPAGATION" - CLASSIFICATION_PROPAGATION_RELATIONSHIP_UPDATE = "CLASSIFICATION_PROPAGATION_RELATIONSHIP_UPDATE" + CLASSIFICATION_PROPAGATION_RELATIONSHIP_UPDATE = ( + "CLASSIFICATION_PROPAGATION_RELATIONSHIP_UPDATE" + ) UPDATE_ENTITY_MEANINGS_ON_TERM_UPDATE = "UPDATE_ENTITY_MEANINGS_ON_TERM_UPDATE" - UPDATE_ENTITY_MEANINGS_ON_TERM_SOFT_DELETE = "UPDATE_ENTITY_MEANINGS_ON_TERM_SOFT_DELETE" - UPDATE_ENTITY_MEANINGS_ON_TERM_HARD_DELETE = "UPDATE_ENTITY_MEANINGS_ON_TERM_HARD_DELETE" + UPDATE_ENTITY_MEANINGS_ON_TERM_SOFT_DELETE = ( + "UPDATE_ENTITY_MEANINGS_ON_TERM_SOFT_DELETE" + ) + UPDATE_ENTITY_MEANINGS_ON_TERM_HARD_DELETE = ( + "UPDATE_ENTITY_MEANINGS_ON_TERM_HARD_DELETE" + ) class AtlanMeshColor(str, Enum): diff --git a/pyatlan/model/events.py b/pyatlan/model/events.py index e230af19b..e8a41336a 100644 --- a/pyatlan/model/events.py +++ b/pyatlan/model/events.py @@ -11,14 +11,18 @@ class AtlanEventPayload(AtlanObject): _subtypes_: Dict[str, type] = dict() - def __init_subclass__(cls, event_type="ENTITY_NOTIFICATION_V2", operation_type=None): + def __init_subclass__( + cls, event_type="ENTITY_NOTIFICATION_V2", operation_type=None + ): cls._subtypes_[operation_type or cls.__name__.lower()] = cls def __init__(__pydantic_self__, **data: Any) -> None: super().__init__(**data) __pydantic_self__.__fields_set__.update(["type", "operation_type"]) - event_type: Optional[str] = Field(default=None, description="Type of the event payload.", alias="type") + event_type: Optional[str] = Field( + default=None, description="Type of the event payload.", alias="type" + ) operation_type: Literal[ "ENTITY_CREATE", "ENTITY_UPDATE", @@ -48,7 +52,9 @@ class AssetUpdatePayload(AtlanEventPayload): operation_type: Literal["ENTITY_UPDATE"] = Field( description="Type of the operation the event contains a payload for." ) - mutated_details: Optional[Asset] = Field(description="Details of what was updated on the asset.") + mutated_details: Optional[Asset] = Field( + description="Details of what was updated on the asset." + ) class AssetDeletePayload(AtlanEventPayload): @@ -100,7 +106,9 @@ class AtlanEvent(AtlanObject): msg_compression_kind: Optional[str] = Field(default=None, description="TBC") msg_split_idx: Optional[int] = Field(description="TBC") msg_split_count: Optional[int] = Field(description="TBC") - msg_source_ip: Optional[str] = Field(default=None, description="Originating IP address for the event.") + msg_source_ip: Optional[str] = Field( + default=None, description="Originating IP address for the event." + ) msg_created_by: Optional[str] = Field(default=None, description="TBC") msg_creation_time: Optional[int] = Field( description="Timestamp (epoch) for when the event was created, in milliseconds." @@ -123,7 +131,9 @@ class AtlanEvent(AtlanObject): class AwsRequestContext(AtlanObject): - account_id: Optional[str] = Field(default=None, description="Account from which the request originated.") + account_id: Optional[str] = Field( + default=None, description="Account from which the request originated." + ) api_id: Optional[str] = Field(default=None, description="TBC") domain_name: Optional[str] = Field(default=None, description="TBC") domain_prefix: Optional[str] = Field(default=None, description="TBC") @@ -135,7 +145,9 @@ class AwsRequestContext(AtlanObject): default=None, description="Time at which the event was received, as a formatted string.", ) - time_epoch: Optional[int] = Field(description="Time at which the event was received, epoch-based, in milliseconds.") + time_epoch: Optional[int] = Field( + description="Time at which the event was received, epoch-based, in milliseconds." + ) class AwsEventWrapper(AtlanObject): @@ -147,7 +159,9 @@ class AwsEventWrapper(AtlanObject): description="Headers that were used when sending the event through to the Lambda URL." ) request_context: Optional[AwsRequestContext] = Field(description="TBC") - body: Optional[str] = Field(default=None, description="Actual contents of the event that was sent by Atlan.") + body: Optional[str] = Field( + default=None, description="Actual contents of the event that was sent by Atlan." + ) is_base_64_encoded: Optional[bool] = Field( description="Whether the contents are base64-encoded (True) or plain text (False)." ) diff --git a/pyatlan/model/fields/atlan_fields.py b/pyatlan/model/fields/atlan_fields.py index 3edde7a69..1d3a99b31 100644 --- a/pyatlan/model/fields/atlan_fields.py +++ b/pyatlan/model/fields/atlan_fields.py @@ -622,12 +622,20 @@ def __init__(self, set_name: str, attribute_name: str): from pyatlan.cache.custom_metadata_cache import CustomMetadataCache super().__init__( - StrictStr(CustomMetadataCache.get_attribute_for_search_results(set_name, attribute_name)), - StrictStr(CustomMetadataCache.get_attr_id_for_name(set_name, attribute_name)), + StrictStr( + CustomMetadataCache.get_attribute_for_search_results( + set_name, attribute_name + ) + ), + StrictStr( + CustomMetadataCache.get_attr_id_for_name(set_name, attribute_name) + ), ) self.set_name = set_name self.attribute_name = attribute_name - self.attribute_def = CustomMetadataCache.get_attribute_def(self.elastic_field_name) + self.attribute_def = CustomMetadataCache.get_attribute_def( + self.elastic_field_name + ) def eq(self, value: SearchFieldType, case_insensitive: bool = False) -> Query: """ @@ -775,7 +783,9 @@ def has_any_value(self) -> LineageFilter: :returns: a filter that will match all assets whose provided field has any value at all (non-null). """ - return LineageFilter(field=self._field, operator=AtlanComparisonOperator.NOT_NULL, value="") + return LineageFilter( + field=self._field, operator=AtlanComparisonOperator.NOT_NULL, value="" + ) def has_no_value(self) -> LineageFilter: """ @@ -783,7 +793,9 @@ def has_no_value(self) -> LineageFilter: :returns: a filter that will only match assets that have no value at all for the field (null). """ - return LineageFilter(field=self._field, operator=AtlanComparisonOperator.IS_NULL, value="") + return LineageFilter( + field=self._field, operator=AtlanComparisonOperator.IS_NULL, value="" + ) class LineageFilterFieldBoolean(LineageFilterField): @@ -798,7 +810,9 @@ def eq(self, value: bool) -> LineageFilter: :param value: the value to check the field's value equals :returns: a filter that will only match assets whose value for the field is exactly the value provided """ - return LineageFilter(field=self._field, operator=AtlanComparisonOperator.EQ, value=str(value)) + return LineageFilter( + field=self._field, operator=AtlanComparisonOperator.EQ, value=str(value) + ) def neq(self, value: bool) -> LineageFilter: """ @@ -808,7 +822,9 @@ def neq(self, value: bool) -> LineageFilter: :param value: the value to check the field's value does not equal :returns: a filter that will only match assets whose value for the field is not exactly the value provided """ - return LineageFilter(field=self._field, operator=AtlanComparisonOperator.NEQ, value=str(value)) + return LineageFilter( + field=self._field, operator=AtlanComparisonOperator.NEQ, value=str(value) + ) class LineageFilterFieldCM(LineageFilterField): @@ -879,14 +895,20 @@ def eq(self, value: Union[str, Enum, int, float, date]): value=value.value, ) if isinstance(value, str): - return LineageFilter(field=self._field, operator=AtlanComparisonOperator.EQ, value=value) + return LineageFilter( + field=self._field, operator=AtlanComparisonOperator.EQ, value=value + ) if isinstance(value, bool): - if not is_comparable_type(self._cm_field.attribute_def.type_name or "", ComparisonCategory.BOOLEAN): + if not is_comparable_type( + self._cm_field.attribute_def.type_name or "", ComparisonCategory.BOOLEAN + ): raise ErrorCode.INVALID_QUERY.exception_with_parameters( AtlanComparisonOperator.EQ.value, f"{self._cm_field.set_name}.{self._cm_field.attribute_name}", ) - return LineageFilter(field=self._field, operator=AtlanComparisonOperator.EQ, value=str(value)) + return LineageFilter( + field=self._field, operator=AtlanComparisonOperator.EQ, value=str(value) + ) return self._with_numeric_comparison( value=value, comparison_operator=AtlanComparisonOperator.EQ, @@ -947,9 +969,13 @@ def neq(self, value: Union[str, Enum, int, float, date]): value=value.value, ) if isinstance(value, str): - return LineageFilter(field=self._field, operator=AtlanComparisonOperator.NEQ, value=value) + return LineageFilter( + field=self._field, operator=AtlanComparisonOperator.NEQ, value=value + ) if isinstance(value, bool): - if not is_comparable_type(self._cm_field.attribute_def.type_name or "", ComparisonCategory.BOOLEAN): + if not is_comparable_type( + self._cm_field.attribute_def.type_name or "", ComparisonCategory.BOOLEAN + ): raise ErrorCode.INVALID_QUERY.exception_with_parameters( AtlanComparisonOperator.NEQ.value, f"{self._cm_field.set_name}.{self._cm_field.attribute_name}", @@ -973,7 +999,9 @@ def starts_with(self, value: str) -> LineageFilter: :param value: the value (prefix) to check the field's value starts with (case-sensitive) :return: a filter that will only match assets whose value for the field starts with the value provided """ - return self._with_string_comparison(value=value, comparison_operator=AtlanComparisonOperator.STARTS_WITH) + return self._with_string_comparison( + value=value, comparison_operator=AtlanComparisonOperator.STARTS_WITH + ) def ends_with(self, value: str) -> LineageFilter: """ @@ -983,7 +1011,9 @@ def ends_with(self, value: str) -> LineageFilter: :param value: the value (suffix) to check the field's value starts with (case-sensitive) :return: a filter that will only match assets whose value for the field ends with the value provided """ - return self._with_string_comparison(value=value, comparison_operator=AtlanComparisonOperator.ENDS_WITH) + return self._with_string_comparison( + value=value, comparison_operator=AtlanComparisonOperator.ENDS_WITH + ) def contains(self, value: str) -> LineageFilter: """ @@ -993,7 +1023,9 @@ def contains(self, value: str) -> LineageFilter: :param value: the value (suffix) to check the field's value contains (case-sensitive) :return: a filter that will only match assets whose value for the field contains the value provided """ - return self._with_string_comparison(value=value, comparison_operator=AtlanComparisonOperator.CONTAINS) + return self._with_string_comparison( + value=value, comparison_operator=AtlanComparisonOperator.CONTAINS + ) def does_not_contain(self, value: str) -> LineageFilter: """ @@ -1003,7 +1035,9 @@ def does_not_contain(self, value: str) -> LineageFilter: :param value: the value (suffix) to check the field's value does not contain (case-sensitive) :return: a filter that will only match assets whose value for the field does not contain the value provided """ - return self._with_string_comparison(value=value, comparison_operator=AtlanComparisonOperator.NOT_CONTAINS) + return self._with_string_comparison( + value=value, comparison_operator=AtlanComparisonOperator.NOT_CONTAINS + ) @overload def lt(self, value: int) -> LineageFilter: @@ -1043,7 +1077,9 @@ def lt(self, value: Union[int, float, date]) -> LineageFilter: :return value: a filter that will only match assets whose value for the field is strictly less than the value provided """ - return self._with_numeric_comparison(value=value, comparison_operator=AtlanComparisonOperator.LT) + return self._with_numeric_comparison( + value=value, comparison_operator=AtlanComparisonOperator.LT + ) @overload def gt(self, value: int) -> LineageFilter: @@ -1083,7 +1119,9 @@ def gt(self, value: Union[int, float, date]) -> LineageFilter: :return value: a filter that will only match assets whose value for the field is strictly greater than the value provided """ - return self._with_numeric_comparison(value=value, comparison_operator=AtlanComparisonOperator.GT) + return self._with_numeric_comparison( + value=value, comparison_operator=AtlanComparisonOperator.GT + ) @overload def lte(self, value: int) -> LineageFilter: @@ -1123,7 +1161,9 @@ def lte(self, value: Union[int, float, date]) -> LineageFilter: :return value: a filter that will only match assets whose value for the field is strictly less than or equal to the value provided """ - return self._with_numeric_comparison(value=value, comparison_operator=AtlanComparisonOperator.LTE) + return self._with_numeric_comparison( + value=value, comparison_operator=AtlanComparisonOperator.LTE + ) @overload def gte(self, value: int) -> LineageFilter: @@ -1163,7 +1203,9 @@ def gte(self, value: Union[int, float, date]) -> LineageFilter: :return value: a filter that will only match assets whose value for the field is strictly greater than or equal to the value provided """ - return self._with_numeric_comparison(value=value, comparison_operator=AtlanComparisonOperator.GTE) + return self._with_numeric_comparison( + value=value, comparison_operator=AtlanComparisonOperator.GTE + ) def _with_numeric_comparison( self, @@ -1171,27 +1213,48 @@ def _with_numeric_comparison( comparison_operator: AtlanComparisonOperator, expected_types: str = "int, float or date", ): - if isinstance( - value, - bool, # needed because isinstance(value, int) evaluates to true when value is bool - ) or (not isinstance(value, int) and not isinstance(value, float) and not isinstance(value, date)): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters(type(value).__name__, expected_types) - if not is_comparable_type(self._cm_field.attribute_def.type_name or "", ComparisonCategory.NUMBER): + if ( + isinstance( + value, + bool, # needed because isinstance(value, int) evaluates to true when value is bool + ) + or ( + not isinstance(value, int) + and not isinstance(value, float) + and not isinstance(value, date) + ) + ): + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + type(value).__name__, expected_types + ) + if not is_comparable_type( + self._cm_field.attribute_def.type_name or "", ComparisonCategory.NUMBER + ): raise ErrorCode.INVALID_QUERY.exception_with_parameters( comparison_operator.value, f"{self._cm_field.set_name}.{self._cm_field.attribute_name}", ) - return LineageFilter(field=self._field, operator=comparison_operator, value=str(value)) + return LineageFilter( + field=self._field, operator=comparison_operator, value=str(value) + ) - def _with_string_comparison(self, value: str, comparison_operator: AtlanComparisonOperator): + def _with_string_comparison( + self, value: str, comparison_operator: AtlanComparisonOperator + ): if not isinstance(value, str): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters(type(value).__name__, "str") - if not is_comparable_type(self._cm_field.attribute_def.type_name or "", ComparisonCategory.STRING): + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + type(value).__name__, "str" + ) + if not is_comparable_type( + self._cm_field.attribute_def.type_name or "", ComparisonCategory.STRING + ): raise ErrorCode.INVALID_QUERY.exception_with_parameters( comparison_operator.value, f"{self._cm_field.set_name}.{self._cm_field.attribute_name}", ) - return LineageFilter(field=self._field, operator=comparison_operator, value=value) + return LineageFilter( + field=self._field, operator=comparison_operator, value=value + ) class LineageFilterFieldNumeric(LineageFilterField): @@ -1418,12 +1481,23 @@ def gte(self, value: Union[int, float, date]) -> LineageFilter: """ return self._get_filter(value=value, operator=AtlanComparisonOperator.GTE) - def _get_filter(self, value: Union[int, float, date], operator: AtlanComparisonOperator): - if isinstance( - value, - bool, # needed because isinstance(value, int) evaluates to true when value is bool - ) or (not isinstance(value, int) and not isinstance(value, float) and not isinstance(value, date)): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters(type(value).__name__, "int, float or date") + def _get_filter( + self, value: Union[int, float, date], operator: AtlanComparisonOperator + ): + if ( + isinstance( + value, + bool, # needed because isinstance(value, int) evaluates to true when value is bool + ) + or ( + not isinstance(value, int) + and not isinstance(value, float) + and not isinstance(value, date) + ) + ): + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + type(value).__name__, "int, float or date" + ) return LineageFilter(field=self._field, operator=operator, value=str(value)) @@ -1492,7 +1566,9 @@ def starts_with(self, value: Union[str, Enum]) -> LineageFilter: value. Note that this is a case-sensitive match. :param value: the value to check the field's value equals (case-sensitive)""" - return self._get_filter(value=value, operator=AtlanComparisonOperator.STARTS_WITH) + return self._get_filter( + value=value, operator=AtlanComparisonOperator.STARTS_WITH + ) @overload def ends_with(self, value: str) -> LineageFilter: @@ -1555,11 +1631,17 @@ def does_not_contain(self, value: Union[str, Enum]) -> LineageFilter: provided value. Note that this is a case-sensitive match. :param value: the value to check the field's value equals (case-sensitive)""" - return self._get_filter(value=value, operator=AtlanComparisonOperator.NOT_CONTAINS) + return self._get_filter( + value=value, operator=AtlanComparisonOperator.NOT_CONTAINS + ) def _get_filter(self, value: Union[str, Enum], operator: AtlanComparisonOperator): if isinstance(value, Enum): - return LineageFilter(field=self._field, operator=operator, value=value.value) + return LineageFilter( + field=self._field, operator=operator, value=value.value + ) if isinstance(value, str): return LineageFilter(field=self._field, operator=operator, value=value) - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters(type(value).__name__, "int, float or date") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + type(value).__name__, "int, float or date" + ) diff --git a/pyatlan/model/fluent_search.py b/pyatlan/model/fluent_search.py index fcc02bfae..a90440c58 100644 --- a/pyatlan/model/fluent_search.py +++ b/pyatlan/model/fluent_search.py @@ -88,11 +88,15 @@ def super_types(one_of: Union[type, List[type]]) -> Query: :returns: a query that will only match assets of a subtype of the types provided """ if isinstance(one_of, list): - return Referenceable.SUPER_TYPE_NAMES.within(list(map(lambda x: x.__name__, one_of))) + return Referenceable.SUPER_TYPE_NAMES.within( + list(map(lambda x: x.__name__, one_of)) + ) return Referenceable.SUPER_TYPE_NAMES.eq(one_of.__name__) @staticmethod - def tagged(with_one_of: Optional[List[str]] = None, directly: bool = False) -> Query: + def tagged( + with_one_of: Optional[List[str]] = None, directly: bool = False + ) -> Query: """ Returns a query that will only match assets that have at least one of the Atlan tags provided. This will match irrespective of the Atlan tag being directly applied to the @@ -111,11 +115,17 @@ def tagged(with_one_of: Optional[List[str]] = None, directly: bool = False) -> Q if tag_id := AtlanTagCache.get_id_for_name(name): values.append(tag_id) else: - raise ErrorCode.ATLAN_TAG_NOT_FOUND_BY_NAME.exception_with_parameters(name) + raise ErrorCode.ATLAN_TAG_NOT_FOUND_BY_NAME.exception_with_parameters( + name + ) if directly: if values: - return FluentSearch(wheres=[Referenceable.ATLAN_TAGS.within(values)]).to_query() - return FluentSearch(wheres=[Referenceable.ATLAN_TAGS.has_any_value()]).to_query() + return FluentSearch( + wheres=[Referenceable.ATLAN_TAGS.within(values)] + ).to_query() + return FluentSearch( + wheres=[Referenceable.ATLAN_TAGS.has_any_value()] + ).to_query() if values: return FluentSearch( where_somes=[ @@ -133,7 +143,9 @@ def tagged(with_one_of: Optional[List[str]] = None, directly: bool = False) -> Q ).to_query() @staticmethod - def tagged_with_value(atlan_tag_name: str, value: str, directly: bool = False) -> Query: + def tagged_with_value( + atlan_tag_name: str, value: str, directly: bool = False + ) -> Query: """ Returns a query that will match assets that have a specific value for the specified tag (for source-synced tags). @@ -154,12 +166,19 @@ def tagged_with_value(atlan_tag_name: str, value: str, directly: bool = False) - client = AtlanClient.get_default_client() synced_tags = [ tag - for tag in (FluentSearch().select().where(Tag.MAPPED_CLASSIFICATION_NAME.eq(tag_id)).execute(client=client)) + for tag in ( + FluentSearch() + .select() + .where(Tag.MAPPED_CLASSIFICATION_NAME.eq(tag_id)) + .execute(client=client) + ) ] if len(synced_tags) > 1: synced_tag_qn = synced_tags[0].qualified_name or "" LOGGER.warning( - ("Multiple mapped source-synced tags found for tag %s -- using only the first: %s",), + ( + "Multiple mapped source-synced tags found for tag %s -- using only the first: %s", + ), atlan_tag_name, synced_tag_qn, ) @@ -169,14 +188,22 @@ def tagged_with_value(atlan_tag_name: str, value: str, directly: bool = False) - synced_tag_qn = "NON_EXISTENT" # Contruct little spans - little_spans.append(SpanTerm(field="__classificationsText.text", value="tagAttachmentValue")) + little_spans.append( + SpanTerm(field="__classificationsText.text", value="tagAttachmentValue") + ) for token in value.split(" "): - little_spans.append(SpanTerm(field="__classificationsText.text", value=token)) - little_spans.append(SpanTerm(field="__classificationsText.text", value="tagAttachmentKey")) + little_spans.append( + SpanTerm(field="__classificationsText.text", value=token) + ) + little_spans.append( + SpanTerm(field="__classificationsText.text", value="tagAttachmentKey") + ) # Contruct big spans big_spans.append(SpanTerm(field="__classificationsText.text", value=tag_id)) - big_spans.append(SpanTerm(field="__classificationsText.text", value=synced_tag_qn)) + big_spans.append( + SpanTerm(field="__classificationsText.text", value=synced_tag_qn) + ) # Contruct final span query span = SpanWithin( @@ -186,7 +213,12 @@ def tagged_with_value(atlan_tag_name: str, value: str, directly: bool = False) - # Without atlan tag propagation if directly: - return FluentSearch().where(Referenceable.ATLAN_TAGS.eq(tag_id)).where(span).to_query() + return ( + FluentSearch() + .where(Referenceable.ATLAN_TAGS.eq(tag_id)) + .where(span) + .to_query() + ) # With atlan tag propagation return ( FluentSearch() diff --git a/pyatlan/model/group.py b/pyatlan/model/group.py index ae7a25f22..724dc58ab 100644 --- a/pyatlan/model/group.py +++ b/pyatlan/model/group.py @@ -14,34 +14,58 @@ class AtlanGroup(AtlanObject): class Attributes(AtlanObject): - alias: Optional[List[str]] = Field(default=None, description="Name of the group as it appears in the UI.") + alias: Optional[List[str]] = Field( + default=None, description="Name of the group as it appears in the UI." + ) created_at: Optional[List[str]] = Field( default=None, description="Time (epoch) at which the group was created, in milliseconds.", ) - created_by: Optional[List[str]] = Field(default=None, description="User who created the group.") + created_by: Optional[List[str]] = Field( + default=None, description="User who created the group." + ) updated_at: Optional[List[str]] = Field( default=None, description="Time (epoch) at which the group was last updated, in milliseconds.", ) - updated_by: Optional[List[str]] = Field(default=None, description="User who last updated the group.") - description: Optional[List[str]] = Field(default=None, description="Description of the group.") + updated_by: Optional[List[str]] = Field( + default=None, description="User who last updated the group." + ) + description: Optional[List[str]] = Field( + default=None, description="Description of the group." + ) is_default: Optional[List[str]] = Field( default=None, description="Whether this group should be auto-assigned to all new users or not.", ) - channels: Optional[List[str]] = Field(default=None, description="Slack channels for this group.") + channels: Optional[List[str]] = Field( + default=None, description="Slack channels for this group." + ) - alias: Optional[str] = Field(default=None, description="Name of the group as it appears in the UI.") - attributes: Optional[AtlanGroup.Attributes] = Field(default=None, description="Detailed attributes of the group.") + alias: Optional[str] = Field( + default=None, description="Name of the group as it appears in the UI." + ) + attributes: Optional[AtlanGroup.Attributes] = Field( + default=None, description="Detailed attributes of the group." + ) roles: Optional[List[str]] = Field(default=None, description="TBC") decentralized_roles: Optional[List[Any]] = Field(default=None, description="TBC") - id: Optional[str] = Field(default=None, description="Unique identifier for the group (GUID).") - name: Optional[str] = Field(default=None, description="Unique (internal) name for the group.") + id: Optional[str] = Field( + default=None, description="Unique identifier for the group (GUID)." + ) + name: Optional[str] = Field( + default=None, description="Unique (internal) name for the group." + ) path: Optional[str] = Field(default=None, description="TBC") - personas: Optional[List[Any]] = Field(default=None, description="Personas the group is associated with.") - purposes: Optional[List[Any]] = Field(default=None, description="Purposes the group is associated with.") - user_count: Optional[int] = Field(default=None, description="Number of users in the group.") + personas: Optional[List[Any]] = Field( + default=None, description="Personas the group is associated with." + ) + purposes: Optional[List[Any]] = Field( + default=None, description="Purposes the group is associated with." + ) + user_count: Optional[int] = Field( + default=None, description="Number of users in the group." + ) def is_default(self) -> bool: return ( @@ -102,7 +126,9 @@ class GroupResponse(AtlanObject): filter_record: Optional[int] = Field( description="Number of groups in the filtered response.", ) - records: Optional[List[AtlanGroup]] = Field(description="Details of each group included in the response.") + records: Optional[List[AtlanGroup]] = Field( + description="Details of each group included in the response." + ) def __init__(self, **data: Any): super().__init__(**data) @@ -134,7 +160,9 @@ def _get_next_page(self): try: self.records = parse_obj_as(List[AtlanGroup], raw_json.get("records")) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err return True def __iter__(self) -> Generator[AtlanGroup, None, None]: # type: ignore[override] @@ -216,7 +244,9 @@ def was_successful(self) -> bool: self.status_message is not None and self.status_message == "success" ) - group: str = Field(description="Unique identifier (GUID) of the group that was created.") + group: str = Field( + description="Unique identifier (GUID) of the group that was created." + ) users: Optional[Dict[str, CreateGroupResponse.UserStatus]] = Field( default=None, description="Map of user association statuses, keyed by unique identifier (GUID) of the user.", diff --git a/pyatlan/model/keycloak_events.py b/pyatlan/model/keycloak_events.py index 2ee40d5f2..297753353 100644 --- a/pyatlan/model/keycloak_events.py +++ b/pyatlan/model/keycloak_events.py @@ -15,7 +15,9 @@ class AuthDetails(AtlanObject): default=None, description="Unique identifier (GUID) of the client that carried out the operation.", ) - ip_address: Optional[str] = Field(default=None, description="IP address from which the operation was carried out.") + ip_address: Optional[str] = Field( + default=None, description="IP address from which the operation was carried out." + ) realm_id: Optional[str] = Field( default=None, description="Unique name of the realm from which the operation was carried out.", @@ -27,17 +29,27 @@ class AuthDetails(AtlanObject): class KeycloakEvent(AtlanObject): - client_id: Optional[str] = Field(default=None, description="Where the login occurred (usually 'atlan-frontend').") + client_id: Optional[str] = Field( + default=None, description="Where the login occurred (usually 'atlan-frontend')." + ) details: Any = Field(description="TBC") - ip_address: Optional[str] = Field(default=None, description="IP address from which the user logged in.") + ip_address: Optional[str] = Field( + default=None, description="IP address from which the user logged in." + ) realm_id: Optional[str] = Field(default=None, description="TBC") session_id: Optional[str] = Field( default=None, description="Unique identifier (GUID) of the session for the login.", ) - time: Optional[int] = Field(description="Time (epoch) when the login occurred, in milliseconds.") - type: Optional[KeycloakEventType] = Field(description="Type of login event that occurred (usually 'LOGIN').") - user_id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the user that logged in.") + time: Optional[int] = Field( + description="Time (epoch) when the login occurred, in milliseconds." + ) + type: Optional[KeycloakEventType] = Field( + description="Type of login event that occurred (usually 'LOGIN')." + ) + user_id: Optional[str] = Field( + default=None, description="Unique identifier (GUID) of the user that logged in." + ) class AdminEvent(AtlanObject): @@ -60,13 +72,21 @@ class AdminEvent(AtlanObject): default=None, description="Type of resource for the admin operation that occurred.", ) - time: Optional[int] = Field(description="Time (epoch) when the admin operation occurred, in milliseconds.") - auth_details: Optional[AuthDetails] = Field(default=None, description="Details of who carried out the operation.") + time: Optional[int] = Field( + description="Time (epoch) when the admin operation occurred, in milliseconds." + ) + auth_details: Optional[AuthDetails] = Field( + default=None, description="Details of who carried out the operation." + ) class KeycloakEventRequest(AtlanObject): - client: Optional[str] = Field(default=None, description="Application or OAuth client name.") - ip_address: Optional[str] = Field(default=None, description="IP address from which the event was triggered.") + client: Optional[str] = Field( + default=None, description="Application or OAuth client name." + ) + ip_address: Optional[str] = Field( + default=None, description="IP address from which the event was triggered." + ) date_from: Optional[str] = Field( default=None, description="Earliest date from which to include events (format: yyyy-MM-dd).", @@ -75,8 +95,12 @@ class KeycloakEventRequest(AtlanObject): default=None, description="Latest date up to which to include events (format: yyyy-MM-dd).", ) - offset: Optional[int] = Field(default=None, description="Starting point for the events (for paging).") - size: Optional[int] = Field(default=None, description="Maximum number of events to retrieve (per page).") + offset: Optional[int] = Field( + default=None, description="Starting point for the events (for paging)." + ) + size: Optional[int] = Field( + default=None, description="Maximum number of events to retrieve (per page)." + ) types: Optional[List[KeycloakEventType]] = Field( default=None, description="Include events only of the supplied types." ) @@ -154,7 +178,9 @@ class AdminEventRequest(AtlanObject): default=None, description="Unique identifier (GUID) of the client that carried out the operation.", ) - ip_address: Optional[str] = Field(default=None, description="IP address from which the operation was carried out.") + ip_address: Optional[str] = Field( + default=None, description="IP address from which the operation was carried out." + ) realm_id: Optional[str] = Field( default=None, description="Unique name of the realm from which the operation was carried out.", @@ -171,13 +197,19 @@ class AdminEventRequest(AtlanObject): default=None, description="Latest date up to which to include events (format: yyyy-MM-dd).", ) - offset: Optional[int] = Field(default=None, description="Starting point for the events (for paging).") - size: Optional[int] = Field(default=None, description="Maximum number of events to retrieve (per page).") + offset: Optional[int] = Field( + default=None, description="Starting point for the events (for paging)." + ) + size: Optional[int] = Field( + default=None, description="Maximum number of events to retrieve (per page)." + ) operation_types: Optional[List[AdminOperationType]] = Field( default=None, description="Include events only with the supplied types of operations.", ) - resource_path: Optional[str] = Field(default=None, description="Include events only against the supplied resource.") + resource_path: Optional[str] = Field( + default=None, description="Include events only against the supplied resource." + ) resource_types: Optional[List[AdminResourceType]] = Field( default=None, description="Include events only against the supplied types of resources.", diff --git a/pyatlan/model/lineage.py b/pyatlan/model/lineage.py index 732d4c128..3e4c5a35e 100644 --- a/pyatlan/model/lineage.py +++ b/pyatlan/model/lineage.py @@ -50,7 +50,11 @@ def create(cls, relations: List[LineageRelation]) -> "LineageGraph": upstream_list: Dict[str, Dict[DirectedPair, None]] = {} def add_relation(_relation: LineageRelation): - if _relation.from_entity_id and _relation.process_id and _relation.to_entity_id: + if ( + _relation.from_entity_id + and _relation.process_id + and _relation.to_entity_id + ): add_edges( _relation.from_entity_id, _relation.process_id, @@ -62,8 +66,12 @@ def add_edges(source_guid: str, process_guid: str, target_guid: str): downstream_list[source_guid] = {} if target_guid not in upstream_list: upstream_list[target_guid] = {} - downstream_list[source_guid][DirectedPair(process_guid=process_guid, target_guid=target_guid)] = None - upstream_list[target_guid][DirectedPair(process_guid=process_guid, target_guid=source_guid)] = None + downstream_list[source_guid][ + DirectedPair(process_guid=process_guid, target_guid=target_guid) + ] = None + upstream_list[target_guid][ + DirectedPair(process_guid=process_guid, target_guid=source_guid) + ] = None for relation in relations: if relation.is_full_link: @@ -73,13 +81,17 @@ def add_edges(source_guid: str, process_guid: str, target_guid: str): return cls(downstream_list=downstream_list, upstream_list=upstream_list) @staticmethod - def get_asset_guids(guid: str, guids: Dict[str, Dict[DirectedPair, None]]) -> List[str]: + def get_asset_guids( + guid: str, guids: Dict[str, Dict[DirectedPair, None]] + ) -> List[str]: if guid in guids: return list({pair.target_guid: None for pair in guids[guid].keys()}.keys()) return [] @staticmethod - def get_process_guids(guid: str, guids: Dict[str, Dict[DirectedPair, None]]) -> List[str]: + def get_process_guids( + guid: str, guids: Dict[str, Dict[DirectedPair, None]] + ) -> List[str]: if guid in guids: return list({pair.process_guid: None for pair in guids[guid].keys()}.keys()) return [] @@ -141,35 +153,51 @@ def get_graph(self): self.graph = LineageGraph.create(self.relations) return self.graph - def get_all_downstream_asset_guids_dfs(self, guid: Optional[str] = None) -> List[str]: - return self.get_graph().get_all_downstream_asset_guids_dfs(guid or self.base_entity_guid) + def get_all_downstream_asset_guids_dfs( + self, guid: Optional[str] = None + ) -> List[str]: + return self.get_graph().get_all_downstream_asset_guids_dfs( + guid or self.base_entity_guid + ) def get_all_downstream_assets_dfs(self, guid: Optional[str] = None) -> List[Asset]: return [ self.guid_entity_map[guid] - for guid in self.get_graph().get_all_downstream_asset_guids_dfs(guid or self.base_entity_guid) + for guid in self.get_graph().get_all_downstream_asset_guids_dfs( + guid or self.base_entity_guid + ) ] def get_all_upstream_asset_guids_dfs(self, guid: Optional[str] = None) -> List[str]: - return self.get_graph().get_all_upstream_asset_guids_dfs(guid or self.base_entity_guid) + return self.get_graph().get_all_upstream_asset_guids_dfs( + guid or self.base_entity_guid + ) def get_all_upstream_assets_dfs(self, guid: Optional[str] = None) -> List[Asset]: return [ self.guid_entity_map[guid] - for guid in self.get_graph().get_all_upstream_asset_guids_dfs(guid or self.base_entity_guid) + for guid in self.get_graph().get_all_upstream_asset_guids_dfs( + guid or self.base_entity_guid + ) ] def get_downstream_asset_guids(self, guid: Optional[str] = None) -> List[str]: - return self.get_graph().get_downstream_asset_guids(guid or self.base_entity_guid) + return self.get_graph().get_downstream_asset_guids( + guid or self.base_entity_guid + ) def get_downstream_assets(self, guid: Optional[str] = None) -> List[Asset]: return [ self.guid_entity_map[guid] - for guid in self.get_graph().get_downstream_asset_guids(guid or self.base_entity_guid) + for guid in self.get_graph().get_downstream_asset_guids( + guid or self.base_entity_guid + ) ] def get_downstream_process_guids(self, guid: Optional[str] = None) -> List[str]: - return self.get_graph().get_downstream_process_guids(guid or self.base_entity_guid) + return self.get_graph().get_downstream_process_guids( + guid or self.base_entity_guid + ) def get_upstream_asset_guids(self, guid: Optional[str] = None) -> List[str]: return self.get_graph().get_upstream_asset_guids(guid or self.base_entity_guid) @@ -177,11 +205,15 @@ def get_upstream_asset_guids(self, guid: Optional[str] = None) -> List[str]: def get_upstream_assets(self, guid: Optional[str] = None) -> List[Asset]: return [ self.guid_entity_map[guid] - for guid in self.get_graph().get_upstream_asset_guids(guid or self.base_entity_guid) + for guid in self.get_graph().get_upstream_asset_guids( + guid or self.base_entity_guid + ) ] def get_upstream_process_guids(self, guid: Optional[str] = None) -> List[str]: - return self.get_graph().get_upstream_process_guids(guid or self.base_entity_guid) + return self.get_graph().get_upstream_process_guids( + guid or self.base_entity_guid + ) class LineageRequest(AtlanObject): @@ -193,11 +225,15 @@ class LineageRequest(AtlanObject): class EntityFilter(AtlanObject): - attribute_name: str = Field(description="Name of the attribute on which filtering should be applied.") + attribute_name: str = Field( + description="Name of the attribute on which filtering should be applied." + ) operator: AtlanComparisonOperator = Field( description="Comparison that should be used when checking attribute_name against the provided attribute_value." ) - attribute_value: str = Field(description="Value that attribute_name should be compared against.") + attribute_value: str = Field( + description="Value that attribute_name should be compared against." + ) class FilterList(AtlanObject): @@ -216,7 +252,9 @@ class Condition(str, Enum): class LineageListRequest(SearchRequest): - guid: str = Field(description="Unique identifier of the asset for which to retrieve lineage.") + guid: str = Field( + description="Unique identifier of the asset for which to retrieve lineage." + ) depth: int = Field( description="Number of degrees of separation (hops) across which lineage should be fetched." "A depth of 1 will fetch the immediate upstream or downstream assets, while 2" @@ -229,7 +267,9 @@ class LineageListRequest(SearchRequest): description="Indicates whether to fetch upstream lineage only, or downstream lineage only. " "Note that you cannot fetch both upstream and downstream at the same time." ) - entity_filters: Optional[FilterList] = Field(default=None, description="Filters to apply on entities.") + entity_filters: Optional[FilterList] = Field( + default=None, description="Filters to apply on entities." + ) entity_traversal_filters: Optional[FilterList] = Field( default=None, description="Filters to apply for skipping traversal based on entities." @@ -246,8 +286,12 @@ class LineageListRequest(SearchRequest): "Any sub-graphs beyond the relationships filtered out by these filters will not be included" "in the lineage result.", ) - offset: Optional[int] = Field(default=None, description="Starting point for pagination.", alias="from") - size: Optional[int] = Field(default=None, description="How many results to include in each page of results.") + offset: Optional[int] = Field( + default=None, description="Starting point for pagination.", alias="from" + ) + size: Optional[int] = Field( + default=None, description="How many results to include in each page of results." + ) exclude_meanings: Optional[bool] = Field( default=None, description="Whether to include assigned terms for assets (false) or not (true).", @@ -301,9 +345,13 @@ def __init__( exclude_meanings: StrictBool = True, exclude_atlan_tags: StrictBool = True, immediate_neighbors: StrictBool = False, - includes_on_results: Optional[Union[List[str], str, List[AtlanField], AtlanField]] = None, + includes_on_results: Optional[ + Union[List[str], str, List[AtlanField], AtlanField] + ] = None, includes_in_results: Optional[Union[List[LineageFilter], LineageFilter]] = None, - includes_on_relations: Optional[Union[List[str], str, List[AtlanField], AtlanField]] = None, + includes_on_relations: Optional[ + Union[List[str], str, List[AtlanField], AtlanField] + ] = None, includes_condition: FilterList.Condition = FilterList.Condition.AND, where_assets: Optional[Union[List[LineageFilter], LineageFilter]] = None, assets_condition: FilterList.Condition = FilterList.Condition.AND, @@ -345,15 +393,23 @@ def __init__( self._exclude_atlan_tags: bool = exclude_atlan_tags self._exclude_meanings: bool = exclude_meanings self._immediate_neighbors: bool = immediate_neighbors - self._includes_on_results: List[Union[str, AtlanField]] = self._to_list(includes_on_results) - self._includes_in_results: List[LineageFilter] = self._to_list(includes_in_results) - self._includes_on_relations: List[Union[str, AtlanField]] = self._to_list(includes_on_relations) + self._includes_on_results: List[Union[str, AtlanField]] = self._to_list( + includes_on_results + ) + self._includes_in_results: List[LineageFilter] = self._to_list( + includes_in_results + ) + self._includes_on_relations: List[Union[str, AtlanField]] = self._to_list( + includes_on_relations + ) self._includes_condition: FilterList.Condition = includes_condition self._size: int = size self._starting_guid = starting_guid self._where_assets: List[LineageFilter] = self._to_list(where_assets) self._assets_condition: FilterList.Condition = assets_condition - self._where_relationships: List[LineageFilter] = self._to_list(where_relationships) + self._where_relationships: List[LineageFilter] = self._to_list( + where_relationships + ) self._relationships_condition: FilterList.Condition = relationships_condition @staticmethod @@ -482,7 +538,9 @@ def include_on_relations(self, field: Union[str, AtlanField]) -> "FluentLineage" clone._includes_on_relations.append(field) return clone - def includes_condition(self, includes_condition: FilterList.Condition) -> "FluentLineage": + def includes_condition( + self, includes_condition: FilterList.Condition + ) -> "FluentLineage": """ Adds the filter condition to `include_on_results`. @@ -512,7 +570,9 @@ def where_assets(self, lineage_filter: LineageFilter) -> "FluentLineage": clone._where_assets.append(lineage_filter) return clone - def assets_condition(self, assets_condition: FilterList.Condition) -> "FluentLineage": + def assets_condition( + self, assets_condition: FilterList.Condition + ) -> "FluentLineage": """ Adds the filter condition to `where_assets`. @@ -542,7 +602,9 @@ def where_relationships(self, lineage_filter: LineageFilter) -> "FluentLineage": clone._where_relationships.append(lineage_filter) return clone - def relationships_condition(self, relationships_condition: FilterList.Condition) -> "FluentLineage": + def relationships_condition( + self, relationships_condition: FilterList.Condition + ) -> "FluentLineage": """ Adds the filter condition to `where_relationships`. @@ -585,7 +647,9 @@ def request(self) -> LineageListRequest: ) for _filter in self._includes_in_results ] - request.entity_filters = FilterList(condition=self._includes_condition, criteria=criteria) # type: ignore + request.entity_filters = FilterList( + condition=self._includes_condition, criteria=criteria + ) # type: ignore if self._includes_on_results: request.attributes = [ field.atlan_field_name if isinstance(field, AtlanField) else field @@ -607,7 +671,9 @@ def request(self) -> LineageListRequest: ) for _filter in self._where_assets ] - request.entity_traversal_filters = FilterList(condition=self._assets_condition, criteria=criteria) # type: ignore[call-arg] + request.entity_traversal_filters = FilterList( + condition=self._assets_condition, criteria=criteria + ) # type: ignore[call-arg] if self._where_relationships: criteria = [ EntityFilter( diff --git a/pyatlan/model/lineage_ref.py b/pyatlan/model/lineage_ref.py index 54bf2a8a3..32579ad3f 100644 --- a/pyatlan/model/lineage_ref.py +++ b/pyatlan/model/lineage_ref.py @@ -8,6 +8,10 @@ class LineageRef(AtlanObject): - qualified_name: str = Field(default=None, description="Unique name of the asset being referenced.") - name: str = Field(default=None, description="Simple name of the asset being referenced.") + qualified_name: str = Field( + default=None, description="Unique name of the asset being referenced." + ) + name: str = Field( + default=None, description="Simple name of the asset being referenced." + ) guid: str = Field(default=None, description="UUID of the asset being referenced.") diff --git a/pyatlan/model/open_lineage/base.py b/pyatlan/model/open_lineage/base.py index 724302106..0a83156ae 100644 --- a/pyatlan/model/open_lineage/base.py +++ b/pyatlan/model/open_lineage/base.py @@ -12,7 +12,9 @@ class OpenLineageBaseEvent(AtlanObject): Base model for OpenLineage events. """ - event_time: Optional[str] = Field(default=None, description="time the event occurred at", alias="eventTime") + event_time: Optional[str] = Field( + default=None, description="time the event occurred at", alias="eventTime" + ) producer: Optional[str] = Field(default=None, description="producer of the event") schema_url: Optional[str] = Field( default="https://openlineage.io/spec/2-0-2/OpenLineage.json#/$defs/RunEvent", diff --git a/pyatlan/model/open_lineage/column_lineage_dataset.py b/pyatlan/model/open_lineage/column_lineage_dataset.py index e2fc7492e..b1cb55495 100644 --- a/pyatlan/model/open_lineage/column_lineage_dataset.py +++ b/pyatlan/model/open_lineage/column_lineage_dataset.py @@ -10,13 +10,21 @@ class OpenLineageTransformation(AtlanObject): default=None, description="Type of the transformation. Allowed values are: DIRECT, INDIRECT", ) - subtype: Optional[str] = Field(default=None, description="Subtype of the transformation") - description: Optional[str] = Field(default=None, description="String representation of the transformation applied") - masking: Optional[bool] = Field(default=None, description="Is the transformation masking the data or not") + subtype: Optional[str] = Field( + default=None, description="Subtype of the transformation" + ) + description: Optional[str] = Field( + default=None, description="String representation of the transformation applied" + ) + masking: Optional[bool] = Field( + default=None, description="Is the transformation masking the data or not" + ) class OpenLineageInputField(AtlanObject): - namespace: Optional[str] = Field(default=None, description="Input dataset namespace") + namespace: Optional[str] = Field( + default=None, description="Input dataset namespace" + ) name: Optional[str] = Field(default=None, description="Input dataset name") field: Optional[str] = Field(default=None, description="Input field") transformations: Optional[List[OpenLineageTransformation]] = Field( diff --git a/pyatlan/model/open_lineage/dataset.py b/pyatlan/model/open_lineage/dataset.py index 099ab4161..827321563 100644 --- a/pyatlan/model/open_lineage/dataset.py +++ b/pyatlan/model/open_lineage/dataset.py @@ -13,7 +13,9 @@ class OpenLineageDataset(AtlanObject): Model for handling OpenLineage datasets. """ - name: Optional[str] = Field(default=None, description="Unique name for that dataset within that namespace.") + name: Optional[str] = Field( + default=None, description="Unique name for that dataset within that namespace." + ) namespace: Optional[str] = Field( default=None, description="Namespace containing that dataset.", diff --git a/pyatlan/model/open_lineage/event.py b/pyatlan/model/open_lineage/event.py index 74ec1b080..bb30dc95e 100644 --- a/pyatlan/model/open_lineage/event.py +++ b/pyatlan/model/open_lineage/event.py @@ -54,7 +54,9 @@ def set_default_schema_url(cls, values): return values @classmethod - def creator(self, run: OpenLineageRun, event_type: OpenLineageEventType) -> OpenLineageEvent: + def creator( + self, run: OpenLineageRun, event_type: OpenLineageEventType + ) -> OpenLineageEvent: """ Builds the minimal object necessary to create an OpenLineage event. @@ -78,4 +80,6 @@ def emit(self, client: Optional[AtlanClient] = None) -> None: from pyatlan.client.atlan import AtlanClient client = client or AtlanClient.get_default_client() - return client.open_lineage.send(request=self, connector_type=AtlanConnectorType.SPARK) + return client.open_lineage.send( + request=self, connector_type=AtlanConnectorType.SPARK + ) diff --git a/pyatlan/model/open_lineage/facet.py b/pyatlan/model/open_lineage/facet.py index a31e7f2cc..8c1a70ca3 100644 --- a/pyatlan/model/open_lineage/facet.py +++ b/pyatlan/model/open_lineage/facet.py @@ -15,9 +15,9 @@ class OpenLineageColumnLineageDatasetFacetFieldsAdditionalInputFields(AtlanObjec class OpenLineageColumnLineageDatasetFacetFieldsAdditional(AtlanObject): - input_fields: Optional[List[OpenLineageColumnLineageDatasetFacetFieldsAdditionalInputFields]] = Field( - default_factory=list - ) + input_fields: Optional[ + List[OpenLineageColumnLineageDatasetFacetFieldsAdditionalInputFields] + ] = Field(default_factory=list) transformation_description: Optional[str] = Field(default=None) transformation_type: Optional[str] = Field(default=None) @@ -43,13 +43,13 @@ class OpenLineageColumnLineageDatasetFacet(OpenLineageBaseFacet): This facet contains column lineage of a dataset. """ - fields: Dict[str, OpenLineageColumnLineageDatasetFacetFieldsAdditional] = Field(default_factory=dict) + fields: Dict[str, OpenLineageColumnLineageDatasetFacetFieldsAdditional] = Field( + default_factory=dict + ) @staticmethod def _get_schema() -> str: - return ( - "https://openlineage.io/spec/facets/1-1-0/ColumnLineageDatasetFacet.json#/$defs/ColumnLineageDatasetFacet" - ) + return "https://openlineage.io/spec/facets/1-1-0/ColumnLineageDatasetFacet.json#/$defs/ColumnLineageDatasetFacet" class OpenLineageDatasetFacets(AtlanObject): diff --git a/pyatlan/model/open_lineage/input_dataset.py b/pyatlan/model/open_lineage/input_dataset.py index 1efc02323..97a718e70 100644 --- a/pyatlan/model/open_lineage/input_dataset.py +++ b/pyatlan/model/open_lineage/input_dataset.py @@ -35,7 +35,9 @@ def creator(cls, namespace: str, asset_name: str) -> OpenLineageInputDataset: """ return OpenLineageInputDataset(namespace=namespace, name=asset_name, facets={}) - def from_field(self, field_name: str) -> OpenLineageColumnLineageDatasetFacetFieldsAdditionalInputFields: + def from_field( + self, field_name: str + ) -> OpenLineageColumnLineageDatasetFacetFieldsAdditionalInputFields: """ Create a new reference to a field within this input dataset. diff --git a/pyatlan/model/open_lineage/job.py b/pyatlan/model/open_lineage/job.py index 7dd83686c..ec33ebf35 100644 --- a/pyatlan/model/open_lineage/job.py +++ b/pyatlan/model/open_lineage/job.py @@ -24,7 +24,9 @@ class OpenLineageJob(AtlanObject): https://openlineage.io/docs/spec/object-model#job """ - name: Optional[str] = Field(default=None, description="Unique name for that job within that namespace.") + name: Optional[str] = Field( + default=None, description="Unique name for that job within that namespace." + ) namespace: Optional[str] = Field( default=None, description="Namespace containing that job.", @@ -42,7 +44,9 @@ def _get_schema() -> str: return "https://openlineage.io/spec/2-0-2/OpenLineage.json#/$defs/Job" @classmethod - def creator(cls, connection_name: str, job_name: str, producer: str) -> OpenLineageJob: + def creator( + cls, connection_name: str, job_name: str, producer: str + ) -> OpenLineageJob: """ Builds the minimal object necessary to create an OpenLineage job. @@ -51,7 +55,9 @@ def creator(cls, connection_name: str, job_name: str, producer: str) -> OpenLine :param producer: URI indicating the code or software that implements this job :returns: the minimal request necessary to create the job """ - return OpenLineageJob(namespace=connection_name, name=job_name, producer=producer, facets={}) + return OpenLineageJob( + namespace=connection_name, name=job_name, producer=producer, facets={} + ) # TODO: provide some intuitive way to manage the facets of the job diff --git a/pyatlan/model/open_lineage/output_dataset.py b/pyatlan/model/open_lineage/output_dataset.py index c55c6fefc..47fee5e7a 100644 --- a/pyatlan/model/open_lineage/output_dataset.py +++ b/pyatlan/model/open_lineage/output_dataset.py @@ -37,7 +37,9 @@ def _get_schema() -> str: return "https://openlineage.io/spec/2-0-2/OpenLineage.json#/$defs/OutputDataset" @classmethod - def creator(cls, namespace: str, asset_name: str, producer: str) -> OpenLineageOutputDataset: + def creator( + cls, namespace: str, asset_name: str, producer: str + ) -> OpenLineageOutputDataset: """ Builds the minimal object necessary to create an OpenLineage dataset use-able as a lineage target. @@ -49,7 +51,9 @@ def creator(cls, namespace: str, asset_name: str, producer: str) -> OpenLineageO :returns: the minimal request necessary to create the output dataset """ - return OpenLineageOutputDataset(namespace=namespace, name=asset_name, producer=producer) + return OpenLineageOutputDataset( + namespace=namespace, name=asset_name, producer=producer + ) @root_validator(pre=True) def transform_to_fields_into_facets(cls, values: dict) -> dict: @@ -65,7 +69,11 @@ def transform_to_fields_into_facets(cls, values: dict) -> dict: for entry in to_fields: for key, value in entry.items(): # Build the OpenLineageColumnLineageDatasetFacet with input_fields - fields_additional = OpenLineageColumnLineageDatasetFacetFieldsAdditional(input_fields=value) + fields_additional = ( + OpenLineageColumnLineageDatasetFacetFieldsAdditional( + input_fields=value + ) + ) # Add to the column lineage dict column_lineage_data[key] = fields_additional diff --git a/pyatlan/model/open_lineage/run.py b/pyatlan/model/open_lineage/run.py index a267a5451..2c7df6c3f 100644 --- a/pyatlan/model/open_lineage/run.py +++ b/pyatlan/model/open_lineage/run.py @@ -29,7 +29,9 @@ class OpenLineageRun(AtlanObject): default=None, description="Globally unique ID of the run associated with the job.", ) - facets: Optional[Dict[str, Any]] = Field(default_factory=dict, description="Run facets.") + facets: Optional[Dict[str, Any]] = Field( + default_factory=dict, description="Run facets." + ) @staticmethod def _get_schema() -> str: diff --git a/pyatlan/model/open_lineage/utils.py b/pyatlan/model/open_lineage/utils.py index dc2f46cf6..1d2bc4cab 100644 --- a/pyatlan/model/open_lineage/utils.py +++ b/pyatlan/model/open_lineage/utils.py @@ -43,6 +43,8 @@ def generate_new_uuid(instant: datetime | None = None) -> UUID: :return: UUID """ - timestamp_ms = int(instant.timestamp() * 1000) if instant else time.time_ns() // 10**6 + timestamp_ms = ( + int(instant.timestamp() * 1000) if instant else time.time_ns() // 10**6 + ) node = secrets.randbits(76) return _build_uuidv7(timestamp_ms, node) diff --git a/pyatlan/model/packages/api_token_connection_admin.py b/pyatlan/model/packages/api_token_connection_admin.py index c61e6e365..770584429 100644 --- a/pyatlan/model/packages/api_token_connection_admin.py +++ b/pyatlan/model/packages/api_token_connection_admin.py @@ -16,7 +16,9 @@ class APITokenConnectionAdmin(AbstractCustomPackage): _PACKAGE_ICON = "http://assets.atlan.com/assets/ph-key-light.svg" _PACKAGE_LOGO = "http://assets.atlan.com/assets/ph-key-light.svg" - def config(self, connection_qualified_name: str, api_token_guid: str) -> APITokenConnectionAdmin: + def config( + self, connection_qualified_name: str, api_token_guid: str + ) -> APITokenConnectionAdmin: """ Set up the API token connection admin with the specified configuration. @@ -26,7 +28,9 @@ def config(self, connection_qualified_name: str, api_token_guid: str) -> APIToke :returns: package, with the specified configuration. """ - self._parameters.append({"name": "connection_qualified_name", "value": connection_qualified_name}) + self._parameters.append( + {"name": "connection_qualified_name", "value": connection_qualified_name} + ) self._parameters.append({"name": "api_token_guid", "value": api_token_guid}) return self diff --git a/pyatlan/model/packages/asset_export_basic.py b/pyatlan/model/packages/asset_export_basic.py index d337497a1..6c5973274 100644 --- a/pyatlan/model/packages/asset_export_basic.py +++ b/pyatlan/model/packages/asset_export_basic.py @@ -27,7 +27,9 @@ def __init__( self._export_scope = None self._parameters = [] - def glossaries_only(self, include_archived: Optional[bool] = None) -> AssetExportBasic: + def glossaries_only( + self, include_archived: Optional[bool] = None + ) -> AssetExportBasic: """ Set up the package to export only glossaries. @@ -80,7 +82,9 @@ def enriched_only( self._add_optional_params(params) return self - def products_only(self, include_archived: Optional[bool] = None) -> AssetExportBasic: + def products_only( + self, include_archived: Optional[bool] = None + ) -> AssetExportBasic: """ Set up the package to export only data products. @@ -204,7 +208,9 @@ def s3( ) return self - def gcs(self, project_id: str, service_account_json: str, bucket: str) -> AssetExportBasic: + def gcs( + self, project_id: str, service_account_json: str, bucket: str + ) -> AssetExportBasic: """ Set up package to export to Google Cloud Storage. @@ -277,7 +283,9 @@ def _add_delivery_parameters(self): self._parameters.append( { "name": "email_addresses", - "value": ",".join(self._email_addresses), # Join the email addresses if they are in a list + "value": ",".join( + self._email_addresses + ), # Join the email addresses if they are in a list } ) diff --git a/pyatlan/model/packages/asset_import.py b/pyatlan/model/packages/asset_import.py index 8cdc1b6a5..049f9ea89 100644 --- a/pyatlan/model/packages/asset_import.py +++ b/pyatlan/model/packages/asset_import.py @@ -68,7 +68,9 @@ def s3( self._credentials_body.update(local_creds) return self - def gcs(self, project_id: str, service_account_json: str, bucket: str) -> AssetImport: + def gcs( + self, project_id: str, service_account_json: str, bucket: str + ) -> AssetImport: """ Set up package to import metadata from GCS. @@ -146,7 +148,9 @@ def assets( """ self._parameters.append({"name": "assets_prefix", "value": prefix}) self._parameters.append({"name": "assets_key", "value": object_key}) - self._parameters.append({"name": "assets_upsert_semantic", "value": input_handling}) + self._parameters.append( + {"name": "assets_upsert_semantic", "value": input_handling} + ) return self def assets_advanced( @@ -180,7 +184,9 @@ def assets_advanced( :returns: package, configured to import assets with advanced configuration. """ - if isinstance(remove_attributes, list) and all(isinstance(field, AtlanField) for field in remove_attributes): + if isinstance(remove_attributes, list) and all( + isinstance(field, AtlanField) for field in remove_attributes + ): remove_attributes = [field.atlan_field_name for field in remove_attributes] # type: ignore params = { "assets_attr_to_overwrite": dumps(remove_attributes, separators=(",", ":")), @@ -215,7 +221,9 @@ def glossaries( """ self._parameters.append({"name": "glossaries_prefix", "value": prefix}) self._parameters.append({"name": "glossaries_key", "value": object_key}) - self._parameters.append({"name": "glossaries_upsert_semantic", "value": input_handling}) + self._parameters.append( + {"name": "glossaries_upsert_semantic", "value": input_handling} + ) return self def glossaries_advanced( @@ -241,10 +249,14 @@ def glossaries_advanced( :returns: package, configured to import glossaries with advanced configuration. """ - if isinstance(remove_attributes, list) and all(isinstance(field, AtlanField) for field in remove_attributes): + if isinstance(remove_attributes, list) and all( + isinstance(field, AtlanField) for field in remove_attributes + ): remove_attributes = [field.atlan_field_name for field in remove_attributes] # type: ignore params = { - "glossaries_attr_to_overwrite": dumps(remove_attributes, separators=(",", ":")), + "glossaries_attr_to_overwrite": dumps( + remove_attributes, separators=(",", ":") + ), "glossaries_fail_on_errors": fail_on_errors, "glossaries_field_separator": field_separator, "glossaries_batch_size": batch_size, @@ -273,7 +285,9 @@ def data_products( """ self._parameters.append({"name": "data_products_prefix", "value": prefix}) self._parameters.append({"name": "data_products_key", "value": object_key}) - self._parameters.append({"name": "data_products_upsert_semantic", "value": input_handling}) + self._parameters.append( + {"name": "data_products_upsert_semantic", "value": input_handling} + ) return self def data_product_advanced( @@ -300,10 +314,14 @@ def data_product_advanced( :returns: package, configured to import data domain and data products with advanced configuration. """ - if isinstance(remove_attributes, list) and all(isinstance(field, AtlanField) for field in remove_attributes): + if isinstance(remove_attributes, list) and all( + isinstance(field, AtlanField) for field in remove_attributes + ): remove_attributes = [field.atlan_field_name for field in remove_attributes] # type: ignore params = { - "data_products_attr_to_overwrite": dumps(remove_attributes, separators=(",", ":")), + "data_products_attr_to_overwrite": dumps( + remove_attributes, separators=(",", ":") + ), "data_products_fail_on_errors": fail_on_errors, "data_products_field_separator": field_separator, "data_products_batch_size": batch_size, diff --git a/pyatlan/model/packages/base/miner.py b/pyatlan/model/packages/base/miner.py index 7bc517826..ffb2e993f 100644 --- a/pyatlan/model/packages/base/miner.py +++ b/pyatlan/model/packages/base/miner.py @@ -18,7 +18,9 @@ def __init__( ): super().__init__() self._epoch = int(utils.get_epoch_timestamp()) - self._parameters.append(dict(name="connection-qualified-name", value=connection_qualified_name)) + self._parameters.append( + dict(name="connection-qualified-name", value=connection_qualified_name) + ) def _add_optional_params(self, params: Dict[str, Optional[Any]]) -> None: """ diff --git a/pyatlan/model/packages/base/package.py b/pyatlan/model/packages/base/package.py index cf2179e63..a0e8e28a2 100644 --- a/pyatlan/model/packages/base/package.py +++ b/pyatlan/model/packages/base/package.py @@ -45,7 +45,9 @@ def to_workflow(self) -> Workflow: WorkflowTask( name="run", arguments=WorkflowParameters( - parameters=parse_obj_as(List[NameValuePair], self._parameters) + parameters=parse_obj_as( + List[NameValuePair], self._parameters + ) ), template_ref=WorkflowTemplateRef( name=self._PACKAGE_PREFIX, @@ -57,13 +59,19 @@ def to_workflow(self) -> Workflow: ), ) ], - workflow_metadata=WorkflowMetadata(annotations={"package.argoproj.io/name": self._PACKAGE_NAME}), + workflow_metadata=WorkflowMetadata( + annotations={"package.argoproj.io/name": self._PACKAGE_NAME} + ), ) payload = [ PackageParameter( parameter="credentialGuid", type="credential", - body=loads(Credential(**self._credentials_body).json(by_alias=True, exclude_none=True)), + body=loads( + Credential(**self._credentials_body).json( + by_alias=True, exclude_none=True + ) + ), ) ] return Workflow( diff --git a/pyatlan/model/packages/big_query_crawler.py b/pyatlan/model/packages/big_query_crawler.py index bea620190..7ac5a6c78 100644 --- a/pyatlan/model/packages/big_query_crawler.py +++ b/pyatlan/model/packages/big_query_crawler.py @@ -132,13 +132,19 @@ def custom_config(self, config: Dict) -> BigQueryCrawler: assets with case-sensitive identifiers. :returns: miner, set to include custom configuration """ - config and self._parameters.append(dict(name="control-config", value=str(config))) + config and self._parameters.append( + dict(name="control-config", value=str(config)) + ) self._advanced_config = True return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credentials-fetch-strategy", "value": "credential_guid"}) - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credentials-fetch-strategy", "value": "credential_guid"} + ) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append( dict( name="control-config-strategy", @@ -148,7 +154,9 @@ def _set_required_metadata_params(self): self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) self._parameters.append(dict(name="publish-mode", value="production")) diff --git a/pyatlan/model/packages/confluent_kafka_crawler.py b/pyatlan/model/packages/confluent_kafka_crawler.py index 2b0bcc025..9bad856f7 100644 --- a/pyatlan/model/packages/confluent_kafka_crawler.py +++ b/pyatlan/model/packages/confluent_kafka_crawler.py @@ -64,7 +64,9 @@ def direct(self, bootstrap: str, encrypted: bool = True) -> ConfluentKafkaCrawle "name": f"default-{self._NAME}-{self._epoch}-0", "host": bootstrap, "port": 9092, - "extra": {"security_protocol": "SASL_SSL" if encrypted else "SASL_PLAINTEXT"}, + "extra": { + "security_protocol": "SASL_SSL" if encrypted else "SASL_PLAINTEXT" + }, "connector_config_name": "atlan-connectors-kafka-confluent-cloud", } self._credentials_body.update(local_creds) @@ -135,11 +137,15 @@ def skip_internal(self, enabled: bool = True) -> ConfluentKafkaCrawler: return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) self._parameters.append(dict(name="publish-mode", value="production")) diff --git a/pyatlan/model/packages/connection_delete.py b/pyatlan/model/packages/connection_delete.py index ae2cb9cbe..3b9a787d6 100644 --- a/pyatlan/model/packages/connection_delete.py +++ b/pyatlan/model/packages/connection_delete.py @@ -28,7 +28,9 @@ def __init__( ): super().__init__(connection_qualified_name=qualified_name) self._parameters.append(dict(name="delete-assets", value="true")) - self._parameters.append(dict(name="delete-type", value="PURGE" if purge else "SOFT")) + self._parameters.append( + dict(name="delete-type", value="PURGE" if purge else "SOFT") + ) def _get_metadata(self) -> WorkflowMetadata: return WorkflowMetadata( diff --git a/pyatlan/model/packages/databricks_crawler.py b/pyatlan/model/packages/databricks_crawler.py index 913b951ba..021f33c20 100644 --- a/pyatlan/model/packages/databricks_crawler.py +++ b/pyatlan/model/packages/databricks_crawler.py @@ -93,12 +93,20 @@ def s3( :returns: crawler, set up to extract from S3 bucket """ self._parameters.append(dict(name="extraction-method", value="s3")) - self._parameters.append(dict(name="offline-extraction-bucket", value=bucket_name)) - self._parameters.append(dict(name="offline-extraction-prefix", value=bucket_prefix)) - self._parameters.append(dict(name="offline-extraction-region", value=bucket_region)) + self._parameters.append( + dict(name="offline-extraction-bucket", value=bucket_name) + ) + self._parameters.append( + dict(name="offline-extraction-prefix", value=bucket_prefix) + ) + self._parameters.append( + dict(name="offline-extraction-region", value=bucket_region) + ) return self - def basic_auth(self, personal_access_token: str, http_path: str) -> DatabricksCrawler: + def basic_auth( + self, personal_access_token: str, http_path: str + ) -> DatabricksCrawler: """ Set up the crawler to use basic authentication. @@ -135,7 +143,9 @@ def aws_service(self, client_id: str, client_secret: str) -> DatabricksCrawler: self._credentials_body.update(local_creds) return self - def azure_service(self, client_id: str, client_secret: str, tenant_id: str) -> DatabricksCrawler: + def azure_service( + self, client_id: str, client_secret: str, tenant_id: str + ) -> DatabricksCrawler: """ Set up the crawler to use Azure service principal. @@ -213,7 +223,9 @@ def include(self, assets: dict) -> DatabricksCrawler: """ include_assets = assets or {} to_include = self.build_hierarchical_filter(include_assets) - self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) + self._parameters.append( + dict(dict(name="include-filter", value=to_include or "{}")) + ) return self def exclude(self, assets: dict) -> DatabricksCrawler: @@ -242,7 +254,9 @@ def include_for_rest_api(self, assets: List[str]) -> DatabricksCrawler: """ include_assets = assets or [] to_include = self.build_flat_hierarchical_filter(include_assets) - self._parameters.append(dict(dict(name="include-filter-rest", value=to_include or "{}"))) + self._parameters.append( + dict(dict(name="include-filter-rest", value=to_include or "{}")) + ) return self def exclude_for_rest_api(self, assets: List[str]) -> DatabricksCrawler: @@ -257,7 +271,9 @@ def exclude_for_rest_api(self, assets: List[str]) -> DatabricksCrawler: """ exclude_assets = assets or [] to_exclude = self.build_flat_hierarchical_filter(exclude_assets) - self._parameters.append(dict(name="exclude-filter-rest", value=to_exclude or "{}")) + self._parameters.append( + dict(name="exclude-filter-rest", value=to_exclude or "{}") + ) return self def sql_warehouse(self, warehouse_ids: List[str]) -> DatabricksCrawler: @@ -301,8 +317,12 @@ def exclude_regex(self, regex: str) -> DatabricksCrawler: return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credentials-fetch-strategy", "value": "credential_guid"}) - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credentials-fetch-strategy", "value": "credential_guid"} + ) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append( dict( name="advanced-config-strategy", @@ -312,7 +332,9 @@ def _set_required_metadata_params(self): self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) diff --git a/pyatlan/model/packages/databricks_miner.py b/pyatlan/model/packages/databricks_miner.py index e1b71778a..b4b302353 100644 --- a/pyatlan/model/packages/databricks_miner.py +++ b/pyatlan/model/packages/databricks_miner.py @@ -49,7 +49,9 @@ def rest_api(self): :returns: miner, configured to use the REST API extraction method from Databricks. """ - self._parameters.append(dict(name="extraction-method", value=self.ExtractionMethod.REST_API.value)) + self._parameters.append( + dict(name="extraction-method", value=self.ExtractionMethod.REST_API.value) + ) return self def offline(self, bucket_name: str, bucket_prefix: str): @@ -64,8 +66,12 @@ def offline(self, bucket_name: str, bucket_prefix: str): :returns: miner, configured for offline extraction. """ self._parameters.append(dict(name="extraction-method", value="offline")) - self._parameters.append(dict(name="offline-extraction-bucket", value=bucket_name)) - self._parameters.append(dict(name="offline-extraction-prefix", value=bucket_prefix)) + self._parameters.append( + dict(name="offline-extraction-bucket", value=bucket_name) + ) + self._parameters.append( + dict(name="offline-extraction-prefix", value=bucket_prefix) + ) return self def system_table(self, warehouse_id: str): @@ -79,7 +85,9 @@ def system_table(self, warehouse_id: str): warehouse to be used for system table extraction. :returns: miner, configured for system table extraction. """ - self._parameters.append(dict(name="extraction-method", value=self.ExtractionMethod.SYSTEM_TABLE)) + self._parameters.append( + dict(name="extraction-method", value=self.ExtractionMethod.SYSTEM_TABLE) + ) self._parameters.append(dict(name="sql-warehouse", value=warehouse_id)) return self @@ -117,9 +125,13 @@ def popularity_configuration( for param in self._parameters: if param["name"] in config_map: param["value"] = config_map[param["name"]] - self._parameters.append(dict(name="popularity-exclude-user-config", value=dumps(excluded_users))) + self._parameters.append( + dict(name="popularity-exclude-user-config", value=dumps(excluded_users)) + ) if extraction_method == self.ExtractionMethod.SYSTEM_TABLE: - self._parameters.append(dict(name="sql-warehouse-popularity", value=warehouse_id)) + self._parameters.append( + dict(name="sql-warehouse-popularity", value=warehouse_id) + ) return self def _get_metadata(self) -> WorkflowMetadata: diff --git a/pyatlan/model/packages/dbt_crawler.py b/pyatlan/model/packages/dbt_crawler.py index b9b9d85a4..020ff6838 100644 --- a/pyatlan/model/packages/dbt_crawler.py +++ b/pyatlan/model/packages/dbt_crawler.py @@ -78,8 +78,12 @@ def cloud( } self._credentials_body.update(local_creds) self._parameters.append(dict(name="extraction-method", value="api")) - self._parameters.append(dict(name="deployment-type", value="multi" if multi_tenant else "single")) - self._parameters.append({"name": "api-credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + dict(name="deployment-type", value="multi" if multi_tenant else "single") + ) + self._parameters.append( + {"name": "api-credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append(dict(name="control-config-strategy", value="default")) return self @@ -160,8 +164,12 @@ def include(self, filter: str = "") -> DbtCrawler: expression and for dbt Cloud provide a string-encoded map :returns: crawler, set to include only those assets specified """ - self._parameters.append(dict(name="include-filter", value=filter if filter else "{}")) - self._parameters.append(dict(name="include-filter-core", value=filter if filter else "*")) + self._parameters.append( + dict(name="include-filter", value=filter if filter else "{}") + ) + self._parameters.append( + dict(name="include-filter-core", value=filter if filter else "*") + ) return self def exclude(self, filter: str = "") -> DbtCrawler: @@ -172,15 +180,21 @@ def exclude(self, filter: str = "") -> DbtCrawler: expression and for dbt Cloud provide a string-encoded map :return: the builder, set to exclude only those assets specified """ - self._parameters.append(dict(name="exclude-filter", value=filter if filter else "{}")) - self._parameters.append(dict(name="exclude-filter-core", value=filter if filter else "*")) + self._parameters.append( + dict(name="exclude-filter", value=filter if filter else "{}") + ) + self._parameters.append( + dict(name="exclude-filter-core", value=filter if filter else "*") + ) return self def _set_required_metadata_params(self): self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) diff --git a/pyatlan/model/packages/dynamo_d_b_crawler.py b/pyatlan/model/packages/dynamo_d_b_crawler.py index e2b2ee0a2..44cef54d8 100644 --- a/pyatlan/model/packages/dynamo_d_b_crawler.py +++ b/pyatlan/model/packages/dynamo_d_b_crawler.py @@ -99,7 +99,9 @@ def iam_role_auth(self, arn: str, external_id: str) -> DynamoDBCrawler: "auth_type": "role", "connector_type": "sdk", } - self._credentials_body["extra"].update({"aws_role_arn": arn, "aws_external_id": external_id}) + self._credentials_body["extra"].update( + {"aws_role_arn": arn, "aws_external_id": external_id} + ) self._credentials_body.update(local_creds) return self @@ -129,12 +131,18 @@ def exclude_regex(self, regex: str) -> DynamoDBCrawler: return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credentials-fetch-strategy", "value": "credential_guid"}) - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credentials-fetch-strategy", "value": "credential_guid"} + ) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) self._parameters.append(dict(name="publish-mode", value="production")) diff --git a/pyatlan/model/packages/glue_crawler.py b/pyatlan/model/packages/glue_crawler.py index 59df41838..427821834 100644 --- a/pyatlan/model/packages/glue_crawler.py +++ b/pyatlan/model/packages/glue_crawler.py @@ -30,8 +30,12 @@ class GlueCrawler(AbstractCrawler): _PACKAGE_PREFIX = WorkflowPackage.GLUE.value _CONNECTOR_TYPE = AtlanConnectorType.GLUE _AWS_DATA_CATALOG = "AwsDataCatalog" - _PACKAGE_ICON = "https://atlan-public.s3.eu-west-1.amazonaws.com/atlan/logos/aws-glue.png" - _PACKAGE_LOGO = "https://atlan-public.s3.eu-west-1.amazonaws.com/atlan/logos/aws-glue.png" + _PACKAGE_ICON = ( + "https://atlan-public.s3.eu-west-1.amazonaws.com/atlan/logos/aws-glue.png" + ) + _PACKAGE_LOGO = ( + "https://atlan-public.s3.eu-west-1.amazonaws.com/atlan/logos/aws-glue.png" + ) def __init__( self, @@ -98,7 +102,9 @@ def _build_asset_filter(self, filter_type: str, filter_assets: List[str]) -> Non for asset in filter_assets: filter_dict[self._AWS_DATA_CATALOG][asset] = {} filter_values = dumps(filter_dict) - self._parameters.append({"name": f"{filter_type}-filter", "value": filter_values}) + self._parameters.append( + {"name": f"{filter_type}-filter", "value": filter_values} + ) except TypeError: raise ErrorCode.UNABLE_TO_TRANSLATE_FILTERS.exception_with_parameters() @@ -127,12 +133,18 @@ def exclude(self, assets: List[str]) -> GlueCrawler: return self def _set_required_metadata_params(self): - self._parameters.append(dict(name="credentials-fetch-strategy", value="credential_guid")) - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + dict(name="credentials-fetch-strategy", value="credential_guid") + ) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) self._parameters.append(dict(name="publish-mode", value="production")) diff --git a/pyatlan/model/packages/lineage_builder.py b/pyatlan/model/packages/lineage_builder.py index b83547066..07c8ef9c8 100644 --- a/pyatlan/model/packages/lineage_builder.py +++ b/pyatlan/model/packages/lineage_builder.py @@ -70,7 +70,9 @@ def s3( self._credentials_body.update(local_creds) return self - def gcs(self, project_id: str, service_account_json: str, bucket: str) -> LineageBuilder: + def gcs( + self, project_id: str, service_account_json: str, bucket: str + ) -> LineageBuilder: """ Set up package to import lineage details from GCS. diff --git a/pyatlan/model/packages/mongodb_crawler.py b/pyatlan/model/packages/mongodb_crawler.py index 67e25fcb3..d464611ad 100644 --- a/pyatlan/model/packages/mongodb_crawler.py +++ b/pyatlan/model/packages/mongodb_crawler.py @@ -116,7 +116,9 @@ def include(self, assets: List[str]) -> MongoDBCrawler: assets = assets or [] include_assets: Dict[str, List[str]] = {asset: [] for asset in assets} to_include = self.build_hierarchical_filter(include_assets) - self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) + self._parameters.append( + dict(dict(name="include-filter", value=to_include or "{}")) + ) return self def exclude(self, assets: List[str]) -> MongoDBCrawler: @@ -147,12 +149,18 @@ def exclude_regex(self, regex: str) -> MongoDBCrawler: return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credentials-fetch-strategy", "value": "credential_guid"}) - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credentials-fetch-strategy", "value": "credential_guid"} + ) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) self._parameters.append(dict(name="publish-mode", value="production")) diff --git a/pyatlan/model/packages/oracle_crawler.py b/pyatlan/model/packages/oracle_crawler.py index 425d0da2e..a08016e33 100644 --- a/pyatlan/model/packages/oracle_crawler.py +++ b/pyatlan/model/packages/oracle_crawler.py @@ -27,8 +27,12 @@ class OracleCrawler(AbstractCrawler): _PACKAGE_NAME = "@atlan/oracle" _PACKAGE_PREFIX = WorkflowPackage.ORACLE.value _CONNECTOR_TYPE = AtlanConnectorType.ORACLE - _PACKAGE_ICON = "https://docs.oracle.com/sp_common/book-template/ohc-common/img/favicon.ico" - _PACKAGE_LOGO = "https://docs.oracle.com/sp_common/book-template/ohc-common/img/favicon.ico" + _PACKAGE_ICON = ( + "https://docs.oracle.com/sp_common/book-template/ohc-common/img/favicon.ico" + ) + _PACKAGE_LOGO = ( + "https://docs.oracle.com/sp_common/book-template/ohc-common/img/favicon.ico" + ) def __init__( self, @@ -128,7 +132,9 @@ def include(self, assets: dict) -> OracleCrawler: """ include_assets = assets or {} to_include = self.build_hierarchical_filter(include_assets) - self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) + self._parameters.append( + dict(dict(name="include-filter", value=to_include or "{}")) + ) return self def exclude(self, assets: dict) -> OracleCrawler: @@ -167,7 +173,9 @@ def jdbc_internal_methods(self, enable: bool) -> OracleCrawler: :returns: crawler, with jdbc internal methods for data extraction """ self._advanced_config = True - self._parameters.append(dict(name="use-jdbc-internal-methods", value="true" if enable else "false")) + self._parameters.append( + dict(name="use-jdbc-internal-methods", value="true" if enable else "false") + ) return self def source_level_filtering(self, enable: bool) -> OracleCrawler: @@ -180,12 +188,20 @@ def source_level_filtering(self, enable: bool) -> OracleCrawler: :returns: crawler, with schema level filtering on source """ self._advanced_config = True - self._parameters.append(dict(name="use-source-schema-filtering", value="true" if enable else "false")) + self._parameters.append( + dict( + name="use-source-schema-filtering", value="true" if enable else "false" + ) + ) return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credentials-fetch-strategy", "value": "credential_guid"}) - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credentials-fetch-strategy", "value": "credential_guid"} + ) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append(dict(name="publish-mode", value="production")) self._parameters.append(dict(name="atlas-auth-type", value="internal")) self._parameters.append( @@ -197,7 +213,9 @@ def _set_required_metadata_params(self): self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) diff --git a/pyatlan/model/packages/postgres_crawler.py b/pyatlan/model/packages/postgres_crawler.py index f71bb3e1c..591156614 100644 --- a/pyatlan/model/packages/postgres_crawler.py +++ b/pyatlan/model/packages/postgres_crawler.py @@ -115,7 +115,9 @@ def basic_auth(self, username: str, password: str) -> PostgresCrawler: self._credentials_body.update(local_creds) return self - def iam_user_auth(self, username: str, access_key: str, secret_key: str) -> PostgresCrawler: + def iam_user_auth( + self, username: str, access_key: str, secret_key: str + ) -> PostgresCrawler: """ Set up the crawler to use IAM user-based authentication. @@ -134,7 +136,9 @@ def iam_user_auth(self, username: str, access_key: str, secret_key: str) -> Post self._credentials_body.update(local_creds) return self - def iam_role_auth(self, username: str, arn: str, external_id: str) -> PostgresCrawler: + def iam_role_auth( + self, username: str, arn: str, external_id: str + ) -> PostgresCrawler: """ Set up the crawler to use IAM role-based authentication. @@ -218,11 +222,15 @@ def jdbc_internal_methods(self, enable: bool) -> PostgresCrawler: return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) self._parameters.append(dict(name="publish-mode", value="production")) diff --git a/pyatlan/model/packages/powerbi_crawler.py b/pyatlan/model/packages/powerbi_crawler.py index 4cdb27b69..b463adfbd 100644 --- a/pyatlan/model/packages/powerbi_crawler.py +++ b/pyatlan/model/packages/powerbi_crawler.py @@ -27,8 +27,12 @@ class PowerBICrawler(AbstractCrawler): _PACKAGE_NAME = "@atlan/powerbi" _PACKAGE_PREFIX = WorkflowPackage.POWERBI.value _CONNECTOR_TYPE = AtlanConnectorType.POWERBI - _PACKAGE_ICON = "https://powerbi.microsoft.com/pictures/application-logos/svg/powerbi.svg" - _PACKAGE_LOGO = "https://powerbi.microsoft.com/pictures/application-logos/svg/powerbi.svg" + _PACKAGE_ICON = ( + "https://powerbi.microsoft.com/pictures/application-logos/svg/powerbi.svg" + ) + _PACKAGE_LOGO = ( + "https://powerbi.microsoft.com/pictures/application-logos/svg/powerbi.svg" + ) def __init__( self, @@ -98,7 +102,9 @@ def delegated_user( self._credentials_body.update(local_creds) return self - def service_principal(self, tenant_id: str, client_id: str, client_secret: str) -> PowerBICrawler: + def service_principal( + self, tenant_id: str, client_id: str, client_secret: str + ) -> PowerBICrawler: """ Set up the crawler to use service principal authentication. @@ -130,7 +136,9 @@ def include(self, workspaces: List[str]) -> PowerBICrawler: """ include_workspaces = workspaces or [] to_include = self.build_flat_filter(include_workspaces) - self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) + self._parameters.append( + dict(dict(name="include-filter", value=to_include or "{}")) + ) return self def exclude(self, workspaces: List[str]) -> PowerBICrawler: @@ -165,11 +173,15 @@ def direct_endorsements(self, enabled: bool = True) -> PowerBICrawler: return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) self._parameters.append(dict(name="atlas-auth-type", value="internal")) diff --git a/pyatlan/model/packages/relational_assets_builder.py b/pyatlan/model/packages/relational_assets_builder.py index dda7269a5..99ebdeca5 100644 --- a/pyatlan/model/packages/relational_assets_builder.py +++ b/pyatlan/model/packages/relational_assets_builder.py @@ -37,7 +37,9 @@ def direct(self) -> RelationalAssetsBuilder: self._parameters.append({"name": "import_type", "value": "DIRECT"}) return self - def object_store(self, prefix: Optional[str] = None, object_key: Optional[str] = None) -> RelationalAssetsBuilder: + def object_store( + self, prefix: Optional[str] = None, object_key: Optional[str] = None + ) -> RelationalAssetsBuilder: """ Set up the package to import metadata directly from the object store. @@ -85,7 +87,9 @@ def s3( self._credentials_body.update(local_creds) return self - def gcs(self, project_id: str, service_account_json: str, bucket: str) -> RelationalAssetsBuilder: + def gcs( + self, project_id: str, service_account_json: str, bucket: str + ) -> RelationalAssetsBuilder: """ Set up package to import metadata from GCS. @@ -161,12 +165,18 @@ def assets_semantics( :returns: package, set up to import metadata with semantics """ - self._parameters.append({"name": "assets_upsert_semantic", "value": input_handling}) + self._parameters.append( + {"name": "assets_upsert_semantic", "value": input_handling} + ) self._parameters.append({"name": "delta_semantic", "value": delta_handling}) if delta_handling == AssetDeltaHandling.FULL_REPLACEMENT: - self._parameters.append({"name": "delta_removal_type", "value": removal_type}) + self._parameters.append( + {"name": "delta_removal_type", "value": removal_type} + ) else: - self._parameters.append({"name": "delta_removal_type", "value": AssetRemovalType.ARCHIVE}) + self._parameters.append( + {"name": "delta_removal_type", "value": AssetRemovalType.ARCHIVE} + ) return self def options( @@ -192,7 +202,9 @@ def options( :returns: package, set up to import assets with advanced configuration """ - if isinstance(remove_attributes, list) and all(isinstance(field, AtlanField) for field in remove_attributes): + if isinstance(remove_attributes, list) and all( + isinstance(field, AtlanField) for field in remove_attributes + ): remove_attributes = [field.atlan_field_name for field in remove_attributes] # type: ignore params = { "assets_attr_to_overwrite": dumps(remove_attributes, separators=(",", ":")), diff --git a/pyatlan/model/packages/s_q_l_server_crawler.py b/pyatlan/model/packages/s_q_l_server_crawler.py index 9dbb79f05..792666638 100644 --- a/pyatlan/model/packages/s_q_l_server_crawler.py +++ b/pyatlan/model/packages/s_q_l_server_crawler.py @@ -27,12 +27,8 @@ class SQLServerCrawler(AbstractCrawler): _PACKAGE_NAME = "@atlan/mssql" _PACKAGE_PREFIX = WorkflowPackage.MSSQL.value _CONNECTOR_TYPE = AtlanConnectorType.MSSQL - _PACKAGE_ICON = ( - "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa - ) - _PACKAGE_LOGO = ( - "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa - ) + _PACKAGE_ICON = "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa + _PACKAGE_LOGO = "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa def __init__( self, @@ -56,7 +52,9 @@ def __init__( source_logo=self._PACKAGE_LOGO, ) - def direct(self, hostname: str, database: str, port: int = 1433) -> SQLServerCrawler: + def direct( + self, hostname: str, database: str, port: int = 1433 + ) -> SQLServerCrawler: """ Set up the crawler to extract directly from the database. @@ -122,17 +120,23 @@ def exclude(self, assets: dict) -> SQLServerCrawler: return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append(dict(name="publish-mode", value="production")) self._parameters.append(dict(name="extraction-method", value="direct")) self._parameters.append(dict(name="atlas-auth-type", value="internal")) self._parameters.append(dict(name="use-jdbc-internal-methods", value="true")) self._parameters.append(dict(name="use-source-schema-filtering", value="false")) - self._parameters.append(dict(name="credentials-fetch-strategy", value="credential_guid")) + self._parameters.append( + dict(name="credentials-fetch-strategy", value="credential_guid") + ) self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) diff --git a/pyatlan/model/packages/sigma_crawler.py b/pyatlan/model/packages/sigma_crawler.py index eb00133d5..3622af2ec 100644 --- a/pyatlan/model/packages/sigma_crawler.py +++ b/pyatlan/model/packages/sigma_crawler.py @@ -110,7 +110,9 @@ def include(self, workbooks: List[str]) -> SigmaCrawler: """ include_workbooks = workbooks or [] to_include = self.build_flat_filter(include_workbooks) - self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) + self._parameters.append( + dict(dict(name="include-filter", value=to_include or "{}")) + ) return self def exclude(self, workbooks: List[str]) -> SigmaCrawler: @@ -129,11 +131,15 @@ def exclude(self, workbooks: List[str]) -> SigmaCrawler: return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) self._parameters.append(dict(name="publish-mode", value="production")) diff --git a/pyatlan/model/packages/snowflake_crawler.py b/pyatlan/model/packages/snowflake_crawler.py index a7e3824b9..31653e7c9 100644 --- a/pyatlan/model/packages/snowflake_crawler.py +++ b/pyatlan/model/packages/snowflake_crawler.py @@ -28,9 +28,7 @@ class SnowflakeCrawler(AbstractCrawler): _PACKAGE_PREFIX = WorkflowPackage.SNOWFLAKE.value _CONNECTOR_TYPE = AtlanConnectorType.SNOWFLAKE _PACKAGE_ICON = "https://docs.snowflake.com/en/_images/logo-snowflake-sans-text.png" - _PACKAGE_LOGO = ( - "https://1amiydhcmj36tz3733v94f15-wpengine.netdna-ssl.com/wp-content/themes/snowflake/assets/img/logo-blue.svg" # noqa - ) + _PACKAGE_LOGO = "https://1amiydhcmj36tz3733v94f15-wpengine.netdna-ssl.com/wp-content/themes/snowflake/assets/img/logo-blue.svg" # noqa def __init__( self, @@ -54,7 +52,9 @@ def __init__( source_logo=self._PACKAGE_LOGO, ) - def basic_auth(self, username: str, password: str, role: str, warehouse: str) -> SnowflakeCrawler: + def basic_auth( + self, username: str, password: str, role: str, warehouse: str + ) -> SnowflakeCrawler: """ Set up the crawler to use basic authentication. @@ -125,7 +125,9 @@ def information_schema(self, hostname: str) -> SnowflakeCrawler: self._parameters.append(parameters) return self - def account_usage(self, hostname: str, database_name: str, schema_name: str) -> SnowflakeCrawler: + def account_usage( + self, hostname: str, database_name: str, schema_name: str + ) -> SnowflakeCrawler: """ Set the crawler to extract using Snowflake's account usage database and schema. @@ -140,8 +142,12 @@ def account_usage(self, hostname: str, database_name: str, schema_name: str) -> "connector_config_name": "atlan-connectors-snowflake", } self._credentials_body.update(local_creds) - self._parameters.append({"name": "account-usage-database-name", "value": database_name}) - self._parameters.append({"name": "account-usage-schema-name", "value": schema_name}) + self._parameters.append( + {"name": "account-usage-database-name", "value": database_name} + ) + self._parameters.append( + {"name": "account-usage-schema-name", "value": schema_name} + ) return self def lineage(self, include: bool = True) -> SnowflakeCrawler: @@ -151,7 +157,9 @@ def lineage(self, include: bool = True) -> SnowflakeCrawler: :param include: if True, lineage will be included while crawling Snowflake, default: True :returns: crawler, set to include or exclude lineage """ - self._parameters.append({"name": "enable-lineage", "value": "true" if include else "false"}) + self._parameters.append( + {"name": "enable-lineage", "value": "true" if include else "false"} + ) return self def tags(self, include: bool = False) -> SnowflakeCrawler: @@ -161,7 +169,9 @@ def tags(self, include: bool = False) -> SnowflakeCrawler: :param include: Whether true, tags in Snowflake will be included while crawling Snowflake :returns: crawler, set to include or exclude Snowflake tags """ - self._parameters.append({"name": "enable-snowflake-tag", "value": "true" if include else "false"}) + self._parameters.append( + {"name": "enable-snowflake-tag", "value": "true" if include else "false"} + ) return self def include(self, assets: dict) -> SnowflakeCrawler: @@ -175,7 +185,9 @@ def include(self, assets: dict) -> SnowflakeCrawler: """ include_assets = assets or {} to_include = self.build_hierarchical_filter(include_assets) - self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) + self._parameters.append( + dict(dict(name="include-filter", value=to_include or "{}")) + ) return self def exclude(self, assets: dict) -> SnowflakeCrawler: @@ -193,12 +205,16 @@ def exclude(self, assets: dict) -> SnowflakeCrawler: return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append(dict(name="control-config-strategy", value="default")) self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) diff --git a/pyatlan/model/packages/snowflake_miner.py b/pyatlan/model/packages/snowflake_miner.py index 203431400..ed82f91b1 100644 --- a/pyatlan/model/packages/snowflake_miner.py +++ b/pyatlan/model/packages/snowflake_miner.py @@ -20,9 +20,7 @@ class SnowflakeMiner(AbstractMiner): _PACKAGE_NAME = "@atlan/snowflake-miner" _PACKAGE_PREFIX = WorkflowPackage.SNOWFLAKE_MINER.value _PACKAGE_ICON = "https://docs.snowflake.com/en/_images/logo-snowflake-sans-text.png" - _PACKAGE_LOGO = ( - "https://1amiydhcmj36tz3733v94f15-wpengine.netdna-ssl.com/wp-content/themes/snowflake/assets/img/logo-blue.svg" # noqa - ) + _PACKAGE_LOGO = "https://1amiydhcmj36tz3733v94f15-wpengine.netdna-ssl.com/wp-content/themes/snowflake/assets/img/logo-blue.svg" # noqa def __init__( self, @@ -53,7 +51,9 @@ def direct( self._parameters.append(dict(name="database-name", value=database)) self._parameters.append(dict(name="schema-name", value=schema)) self._parameters.append(dict(name="extraction-method", value="query_history")) - self._parameters.append(dict(name="miner-start-time-epoch", value=str(start_epoch))) + self._parameters.append( + dict(name="miner-start-time-epoch", value=str(start_epoch)) + ) return self def s3( @@ -85,10 +85,14 @@ def s3( self._parameters.append(dict(name="extraction-s3-bucket", value=s3_bucket)) self._parameters.append(dict(name="extraction-s3-prefix", value=s3_prefix)) self._parameters.append(dict(name="sql-json-key", value=sql_query_key)) - self._parameters.append(dict(name="catalog-json-key", value=default_database_key)) + self._parameters.append( + dict(name="catalog-json-key", value=default_database_key) + ) self._parameters.append(dict(name="schema-json-key", value=default_schema_key)) self._parameters.append(dict(name="session-json-key", value=session_id_key)) - s3_bucket_region and self._parameters.append(dict(name="extraction-s3-region", value=s3_bucket_region)) + s3_bucket_region and self._parameters.append( + dict(name="extraction-s3-region", value=s3_bucket_region) + ) return self def exclude_users(self, users: List[str]) -> SnowflakeMiner: @@ -131,7 +135,9 @@ def native_lineage(self, enabled: bool) -> SnowflakeMiner: :returns: miner, set to include / exclude native lineage from Snowflake """ self._advanced_config = True - self._parameters.append(dict(name="native-lineage-active", value="true" if enabled else "false")) + self._parameters.append( + dict(name="native-lineage-active", value="true" if enabled else "false") + ) return self def custom_config(self, config: Dict) -> SnowflakeMiner: @@ -142,7 +148,9 @@ def custom_config(self, config: Dict) -> SnowflakeMiner: :param config: custom configuration dict :returns: miner, set to include custom configuration """ - config and self._parameters.append(dict(name="control-config", value=dumps(config))) + config and self._parameters.append( + dict(name="control-config", value=dumps(config)) + ) self._advanced_config = True return self diff --git a/pyatlan/model/packages/sql_server_crawler.py b/pyatlan/model/packages/sql_server_crawler.py index 75c186420..33cf1bef1 100644 --- a/pyatlan/model/packages/sql_server_crawler.py +++ b/pyatlan/model/packages/sql_server_crawler.py @@ -27,12 +27,8 @@ class SQLServerCrawler(AbstractCrawler): _PACKAGE_NAME = "@atlan/mssql" _PACKAGE_PREFIX = WorkflowPackage.MSSQL.value _CONNECTOR_TYPE = AtlanConnectorType.MSSQL - _PACKAGE_ICON = ( - "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa - ) - _PACKAGE_LOGO = ( - "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa - ) + _PACKAGE_ICON = "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa + _PACKAGE_LOGO = "https://user-images.githubusercontent.com/4249331/52232852-e2c4f780-28bd-11e9-835d-1e3cf3e43888.png" # noqa def __init__( self, @@ -56,7 +52,9 @@ def __init__( source_logo=self._PACKAGE_LOGO, ) - def direct(self, hostname: str, database: str, port: int = 1433) -> SQLServerCrawler: + def direct( + self, hostname: str, database: str, port: int = 1433 + ) -> SQLServerCrawler: """ Set up the crawler to extract directly from the database. @@ -103,7 +101,9 @@ def include(self, assets: dict) -> SQLServerCrawler: """ include_assets = assets or {} to_include = self.build_hierarchical_filter(include_assets) - self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) + self._parameters.append( + dict(dict(name="include-filter", value=to_include or "{}")) + ) return self def exclude(self, assets: dict) -> SQLServerCrawler: @@ -122,17 +122,23 @@ def exclude(self, assets: dict) -> SQLServerCrawler: return self def _set_required_metadata_params(self): - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) self._parameters.append(dict(name="publish-mode", value="production")) self._parameters.append(dict(name="extraction-method", value="direct")) self._parameters.append(dict(name="atlas-auth-type", value="internal")) self._parameters.append(dict(name="use-jdbc-internal-methods", value="true")) self._parameters.append(dict(name="use-source-schema-filtering", value="false")) - self._parameters.append(dict(name="credentials-fetch-strategy", value="credential_guid")) + self._parameters.append( + dict(name="credentials-fetch-strategy", value="credential_guid") + ) self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) diff --git a/pyatlan/model/packages/tableau_crawler.py b/pyatlan/model/packages/tableau_crawler.py index 10288c758..401dc6a5d 100644 --- a/pyatlan/model/packages/tableau_crawler.py +++ b/pyatlan/model/packages/tableau_crawler.py @@ -52,7 +52,9 @@ def __init__( source_logo=self._PACKAGE_LOGO, ) - def s3(self, bucket_name: str, bucket_prefix: str, bucket_region: Optional[str] = None) -> TableauCrawler: + def s3( + self, bucket_name: str, bucket_prefix: str, bucket_region: Optional[str] = None + ) -> TableauCrawler: """ Set up the crawler to fetch metadata directly from the S3 bucket. @@ -100,7 +102,9 @@ def direct( } self._credentials_body.update(local_creds) self._parameters.append({"name": "extraction-method", "value": "direct"}) - self._parameters.append({"name": "credential-guid", "value": "{{credentialGuid}}"}) + self._parameters.append( + {"name": "credential-guid", "value": "{{credentialGuid}}"} + ) return self def basic_auth(self, username: str, password: str) -> TableauCrawler: @@ -146,7 +150,9 @@ def include(self, projects: List[str]) -> TableauCrawler: """ include_projects = projects or [] to_include = self.build_flat_filter(include_projects) - self._parameters.append(dict(dict(name="include-filter", value=to_include or "{}"))) + self._parameters.append( + dict(dict(name="include-filter", value=to_include or "{}")) + ) return self def exclude(self, projects: List[str]) -> TableauCrawler: @@ -209,7 +215,9 @@ def _set_required_metadata_params(self): self._parameters.append( { "name": "connection", - "value": self._get_connection().json(by_alias=True, exclude_unset=True, exclude_none=True), + "value": self._get_connection().json( + by_alias=True, exclude_unset=True, exclude_none=True + ), } ) self._parameters.append(dict(name="atlas-auth-type", value="internal")) diff --git a/pyatlan/model/query.py b/pyatlan/model/query.py index 4d41a9564..096565794 100644 --- a/pyatlan/model/query.py +++ b/pyatlan/model/query.py @@ -17,8 +17,12 @@ class ParsedQuery(AtlanObject): class DatabaseColumn(AtlanObject): - id: Optional[str] = Field(default=None, description="Numeric identifier for the column.") - name: Optional[str] = Field(default=None, description="Name of the column (unqualified).") + id: Optional[str] = Field( + default=None, description="Numeric identifier for the column." + ) + name: Optional[str] = Field( + default=None, description="Name of the column (unqualified)." + ) source: Optional[str] = Field(default=None, description="TBC") class RelationshipEndpoint(AtlanObject): @@ -40,19 +44,29 @@ class RelationshipEndpoint(AtlanObject): ) class ParserError(AtlanObject): - error_message: Optional[str] = Field(default=None, description="Description of the error.") - error_type: Optional[str] = Field(default=None, description="Type of the error.") + error_message: Optional[str] = Field( + default=None, description="Description of the error." + ) + error_type: Optional[str] = Field( + default=None, description="Type of the error." + ) coordinates: Optional[List[Any]] = Field(description="TBC") class Relationship(AtlanObject): - id: Optional[str] = Field(default=None, description="Numeric identifier for the relationship.") - type: Optional[str] = Field(default=None, description="Type of the relationship.") + id: Optional[str] = Field( + default=None, description="Numeric identifier for the relationship." + ) + type: Optional[str] = Field( + default=None, description="Type of the relationship." + ) effect_type: Optional[str] = Field( default=None, description="Type of effect made by the query (for example, select vs insert).", ) target: Optional[ParsedQuery.RelationshipEndpoint] = Field(description="TBC") - sources: Optional[List[ParsedQuery.RelationshipEndpoint]] = Field(description="TBC") + sources: Optional[List[ParsedQuery.RelationshipEndpoint]] = Field( + description="TBC" + ) process_id: Optional[str] = Field( default=None, description="Numeric identifier for the procedure (if any) that manages this relationship.", @@ -67,10 +81,16 @@ class DatabaseObject(AtlanObject): default=None, description="Fully-qualified name of the SQL object. (Only present on non-process objects.)", ) - id: Optional[str] = Field(default=None, description="Numeric identifier for the object.") - name: Optional[str] = Field(default=None, description="Name of the object (unqualified).") + id: Optional[str] = Field( + default=None, description="Numeric identifier for the object." + ) + name: Optional[str] = Field( + default=None, description="Name of the object (unqualified)." + ) type: Optional[str] = Field(default=None, description="Type of the object.") - database: Optional[str] = Field(default=None, description="Name of the database the object exists within.") + database: Optional[str] = Field( + default=None, description="Name of the database the object exists within." + ) db_schema: Optional[str] = Field( default=None, description="Name of the schema the object exists within.", @@ -95,12 +115,16 @@ class DatabaseObject(AtlanObject): relationships: Optional[List[ParsedQuery.Relationship]] = Field( description="All the relationship objects detected in the query." ) - errors: Optional[List[ParsedQuery.ParserError]] = Field(description="Any errors during parsing.") + errors: Optional[List[ParsedQuery.ParserError]] = Field( + description="Any errors during parsing." + ) class QueryParserRequest(AtlanObject): sql: str = Field(description="SQL query to be parsed.") - source: QueryParserSourceType = Field(description="Dialect to use when parsing the SQL.") + source: QueryParserSourceType = Field( + description="Dialect to use when parsing the SQL." + ) default_database: Optional[str] = Field( default=None, description="Default database name to use for unqualified objects in the SQL.", @@ -142,7 +166,9 @@ def create( class QueryRequest(AtlanObject): sql: str = Field(description="SQL query to run.") - data_source_name: str = Field(description="Unique name of the connection to use for the query.") + data_source_name: str = Field( + description="Unique name of the connection to use for the query." + ) default_schema: str = Field( description="Default schema name to use for unqualified objects in the SQL, in the form `DB.SCHEMA`." ) @@ -182,9 +208,15 @@ def __init__(self, events: Optional[List[Dict[str, Any]]] = None): default=None, description="Unique identifier for the request, if there was any error.", ) - error_name: Optional[str] = Field(default=None, description="Unique name for the error, if there was any error.") - error_message: Optional[str] = Field(default=None, description="Explanation of the error, if there was any error.") - error_code: Optional[str] = Field(default=None, description="Unique code for the error, if there was any error.") + error_name: Optional[str] = Field( + default=None, description="Unique name for the error, if there was any error." + ) + error_message: Optional[str] = Field( + default=None, description="Explanation of the error, if there was any error." + ) + error_code: Optional[str] = Field( + default=None, description="Unique code for the error, if there was any error." + ) query_id: Optional[str] = Field( default=None, description="Unique identifier (GUID) for the specific run of the query.", @@ -196,8 +228,12 @@ def __init__(self, events: Optional[List[Dict[str, Any]]] = None): ) class ColumnType(AtlanObject): - id: Optional[int] = Field(description="Unique identifier for the request, if there was any error.") - name: Optional[str] = Field(default=None, description="SQL name of the data type for this column..") + id: Optional[int] = Field( + description="Unique identifier for the request, if there was any error." + ) + name: Optional[str] = Field( + default=None, description="SQL name of the data type for this column.." + ) rep: Optional[str] class ColumnDetails(AtlanObject): @@ -213,8 +249,12 @@ class ColumnDetails(AtlanObject): nullable: Optional[int] = Field(description="TBC") signed: Optional[bool] = Field(description="TBC") display_size: Optional[int] = Field(description="TBC") - label: Optional[str] = Field(default=None, description="Display value for the column's name.") - column_name: Optional[str] = Field(default=None, description="Name of the column (technical).") + label: Optional[str] = Field( + default=None, description="Display value for the column's name." + ) + column_name: Optional[str] = Field( + default=None, description="Name of the column (technical)." + ) schema_name: Optional[str] = Field( default=None, description="Name of the schema in which this column's table is contained.", @@ -236,7 +276,9 @@ class ColumnDetails(AtlanObject): default=None, description="Canonical name of the Java class representing this column's values.", ) - type: Optional[QueryResponse.ColumnType] = Field(description="Details about the (SQL) data type of the column.") + type: Optional[QueryResponse.ColumnType] = Field( + description="Details about the (SQL) data type of the column." + ) columns: Optional[List[QueryResponse.ColumnDetails]] = Field( description="Columns that are present in each row of the results. " @@ -245,29 +287,47 @@ class ColumnDetails(AtlanObject): ) class AssetDetails(AtlanObject): - connection_name: Optional[str] = Field(default=None, description="Simple name of the connection.") - connection_qn: Optional[str] = Field(default=None, description="Unique name of the connection.") - database: Optional[str] = Field(default=None, description="Simple name of the database.") - schema_: Optional[str] = Field(default=None, alias="schema", description="Simple name of the schema.") - table: Optional[str] = Field(default=None, description="Simple name of the table.") + connection_name: Optional[str] = Field( + default=None, description="Simple name of the connection." + ) + connection_qn: Optional[str] = Field( + default=None, description="Unique name of the connection." + ) + database: Optional[str] = Field( + default=None, description="Simple name of the database." + ) + schema_: Optional[str] = Field( + default=None, alias="schema", description="Simple name of the schema." + ) + table: Optional[str] = Field( + default=None, description="Simple name of the table." + ) class QueryDetails(AtlanObject): """ Details about a query that was run. """ - total_rows_streamed: Optional[int] = Field(description="Total number of results returned by the query.") + total_rows_streamed: Optional[int] = Field( + description="Total number of results returned by the query." + ) status: Optional[QueryStatus] = Field(description="Status of the query.") parsed_query: Optional[str] = Field(default=None, description="TBC") - pushdown_query: Optional[str] = Field(default=None, description="Query that was sent to the data store.") - execution_time: Optional[int] = Field(description="How long the query took to run, in milliseconds.") + pushdown_query: Optional[str] = Field( + default=None, description="Query that was sent to the data store." + ) + execution_time: Optional[int] = Field( + description="How long the query took to run, in milliseconds." + ) source_query_id: Optional[str] = Field(default=None, description="TBC") result_output_location: Optional[str] = Field(default=None, description="TBC") warnings: Optional[List[str]] = Field( default=None, description="List of any warnings produced when running the query.", ) - parsing_flow: Optional[ParsingFlow] = Field(description="How the query was parsed prior to running.") + parsing_flow: Optional[ParsingFlow] = Field( + description="How the query was parsed prior to running." + ) heka_flow: Optional[HekaFlow] = Field(description="How the query was run.") s3_upload_path: Optional[str] = Field(default=None, description="TBC") source_first_connection_time: Optional[int] = Field(description="TBC") @@ -307,14 +367,20 @@ class QueryDetails(AtlanObject): default=None, description="Detailed back-end error message that could be helpful for developers.", ) - line: Optional[int] = Field(description="Line number of the query that had a validation error, if any.") - column: Optional[int] = Field(description="Column position of the validation error, if any.") + line: Optional[int] = Field( + description="Line number of the query that had a validation error, if any." + ) + column: Optional[int] = Field( + description="Column position of the validation error, if any." + ) obj: Optional[str] = Field( default=None, description="Name of the object that caused the validation error, if any.", ) - details: Optional[QueryResponse.QueryDetails] = Field(description="Details about the query.") + details: Optional[QueryResponse.QueryDetails] = Field( + description="Details about the query." + ) QueryResponse.ColumnType.update_forward_refs() diff --git a/pyatlan/model/response.py b/pyatlan/model/response.py index eac085211..ad548dce5 100644 --- a/pyatlan/model/response.py +++ b/pyatlan/model/response.py @@ -44,29 +44,47 @@ class AssetMutationResponse(AtlanObject): default=None, description="Map of assigned unique identifiers for the changed assets.", ) - mutated_entities: Optional[MutatedEntities] = Field(default=None, description="Assets that were changed.") + mutated_entities: Optional[MutatedEntities] = Field( + default=None, description="Assets that were changed." + ) partial_updated_entities: Optional[List[Asset]] = Field( default=None, description="Assets that were partially updated" ) def assets_created(self, asset_type: Type[A]) -> List[A]: if self.mutated_entities and self.mutated_entities.CREATE: - return [asset for asset in self.mutated_entities.CREATE if isinstance(asset, asset_type)] + return [ + asset + for asset in self.mutated_entities.CREATE + if isinstance(asset, asset_type) + ] return [] def assets_updated(self, asset_type: Type[A]) -> List[A]: if self.mutated_entities and self.mutated_entities.UPDATE: - return [asset for asset in self.mutated_entities.UPDATE if isinstance(asset, asset_type)] + return [ + asset + for asset in self.mutated_entities.UPDATE + if isinstance(asset, asset_type) + ] return [] def assets_deleted(self, asset_type: Type[A]) -> List[A]: if self.mutated_entities and self.mutated_entities.DELETE: - return [asset for asset in self.mutated_entities.DELETE if isinstance(asset, asset_type)] + return [ + asset + for asset in self.mutated_entities.DELETE + if isinstance(asset, asset_type) + ] return [] def assets_partially_updated(self, asset_type: Type[A]) -> List[A]: if self.mutated_entities and self.mutated_entities.PARTIAL_UPDATE: - return [asset for asset in self.mutated_entities.PARTIAL_UPDATE if isinstance(asset, asset_type)] + return [ + asset + for asset in self.mutated_entities.PARTIAL_UPDATE + if isinstance(asset, asset_type) + ] return [] diff --git a/pyatlan/model/role.py b/pyatlan/model/role.py index ad8e9094f..183ba599a 100644 --- a/pyatlan/model/role.py +++ b/pyatlan/model/role.py @@ -13,17 +13,25 @@ class AtlanRole(AtlanObject): id: str = Field(description="Unique identifier for the role (GUID).\n") """Unique identifier for the role (GUID).""" name: str = Field(description="Unique name for the role.\n") - description: Optional[str] = Field(default=None, description="Description of the role.\n") + description: Optional[str] = Field( + default=None, description="Description of the role.\n" + ) client_role: Optional[bool] = Field(default=None, description="TBC\n") level: Optional[str] = Field(default=None, description="TBC\n") - member_count: Optional[str] = Field(default=None, description="Number of users with this role.\n") + member_count: Optional[str] = Field( + default=None, description="Number of users with this role.\n" + ) user_count: Optional[str] = Field(default=None, description="TBC\n") class RoleResponse(AtlanObject): - total_record: Optional[int] = Field(default=None, description="Total number of roles.\n") + total_record: Optional[int] = Field( + default=None, description="Total number of roles.\n" + ) filter_record: Optional[int] = Field( None, description="Number of roles in the filtered response.\n", ) - records: List["AtlanRole"] = Field(description="Details of each role included in the response.\n") + records: List["AtlanRole"] = Field( + description="Details of each role included in the response.\n" + ) diff --git a/pyatlan/model/search.py b/pyatlan/model/search.py index 53372aa5e..a6d5ac335 100644 --- a/pyatlan/model/search.py +++ b/pyatlan/model/search.py @@ -183,10 +183,14 @@ class Exists(Query): def with_custom_metadata(cls, set_name: StrictStr, attr_name: StrictStr): from pyatlan.cache.custom_metadata_cache import CustomMetadataCache - if attr_id := CustomMetadataCache.get_attr_id_for_name(set_name=set_name, attr_name=attr_name): + if attr_id := CustomMetadataCache.get_attr_id_for_name( + set_name=set_name, attr_name=attr_name + ): return cls(field=attr_id) else: - raise ValueError(f"No custom metadata with the name {set_name} or property {attr_name} exists") + raise ValueError( + f"No custom metadata with the name {set_name} or property {attr_name} exists" + ) @classmethod @validate_arguments() @@ -361,13 +365,19 @@ class Term(Query): @classmethod @validate_arguments() - def with_custom_metadata(cls, set_name: StrictStr, attr_name: StrictStr, value: SearchFieldType): + def with_custom_metadata( + cls, set_name: StrictStr, attr_name: StrictStr, value: SearchFieldType + ): from pyatlan.cache.custom_metadata_cache import CustomMetadataCache - if attr_id := CustomMetadataCache.get_attr_id_for_name(set_name=set_name, attr_name=attr_name): + if attr_id := CustomMetadataCache.get_attr_id_for_name( + set_name=set_name, attr_name=attr_name + ): return cls(field=attr_id, value=value) else: - raise ValueError(f"No custom metadata with the name {set_name} or property {attr_name} exists") + raise ValueError( + f"No custom metadata with the name {set_name} or property {attr_name} exists" + ) @classmethod @validate_arguments() @@ -663,7 +673,9 @@ def __and__(self, other): q.should.extend(qx.should) # not all are required, add a should list to the must with proper min_should_match else: - q.must.append(Bool(should=qx.should, minimum_should_match=min_should_match)) + q.must.append( + Bool(should=qx.should, minimum_should_match=min_should_match) + ) else: if not q.must and not q.filter and q.should: q.minimum_should_match = 1 @@ -771,7 +783,11 @@ def with_type_name(cls, value: StrictStr): def to_dict(self) -> Dict[Any, Any]: parameters: Dict[str, Any] = { - "value": (int(self.value.timestamp() * 1000) if isinstance(self.value, datetime) else self.value) + "value": ( + int(self.value.timestamp() * 1000) + if isinstance(self.value, datetime) + else self.value + ) } if self.case_insensitive is not None: @@ -1803,7 +1819,9 @@ def to_dict(self): if self.analyzer is not None: parameters["analyzer"] = self.analyzer if self.auto_generate_synonyms_phrase_query is not None: - parameters["auto_generate_synonyms_phrase_query"] = self.auto_generate_synonyms_phrase_query + parameters["auto_generate_synonyms_phrase_query"] = ( + self.auto_generate_synonyms_phrase_query + ) if self.fuzziness is not None: parameters["fuzziness"] = self.fuzziness if self.fuzzy_transpositions is not None: @@ -1904,7 +1922,9 @@ def validate_sort(cls, sort, values): class IndexSearchRequest(SearchRequest): dsl: DSL - relation_attributes: Optional[List[str]] = Field(default_factory=list, alias="relationAttributes") + relation_attributes: Optional[List[str]] = Field( + default_factory=list, alias="relationAttributes" + ) suppress_logs: Optional[bool] = Field(default=None, alias="suppressLogs") show_search_score: Optional[bool] = Field( default=None, @@ -1939,7 +1959,9 @@ class IndexSearchRequest(SearchRequest): ) class Metadata(AtlanObject): - save_search_log: bool = Field(default=True, description="Whether to log this search (True) or not (False)") + save_search_log: bool = Field( + default=True, description="Whether to log this search (True) or not (False)" + ) utm_tags: List[str] = Field( default_factory=list, description="Tags to associate with the search request", @@ -1967,7 +1989,11 @@ def __init__(__pydantic_self__, **data: Any) -> None: def with_active_glossary(name: StrictStr) -> "Bool": - return Term.with_state("ACTIVE") + Term.with_type_name("AtlasGlossary") + Term.with_name(name) + return ( + Term.with_state("ACTIVE") + + Term.with_type_name("AtlasGlossary") + + Term.with_name(name) + ) def with_active_category( diff --git a/pyatlan/model/search_log.py b/pyatlan/model/search_log.py index 97929946e..ca329416d 100644 --- a/pyatlan/model/search_log.py +++ b/pyatlan/model/search_log.py @@ -98,11 +98,15 @@ def _get_recent_viewers_aggs(max_users: int) -> Dict[str, object]: }, "aggregations": {"latest_timestamp": {"max": {"field": "timestamp"}}}, }, - "totalDistinctUsers": {"cardinality": {"field": "userName", "precision_threshold": 1000}}, + "totalDistinctUsers": { + "cardinality": {"field": "userName", "precision_threshold": 1000} + }, } @staticmethod - def _get_most_viewed_assets_aggs(max_assets: int, by_diff_user: bool) -> Dict[str, object]: + def _get_most_viewed_assets_aggs( + max_assets: int, by_diff_user: bool + ) -> Dict[str, object]: aggs_terms = { "field": "entityGuidsAll", "size": max_assets, @@ -121,7 +125,9 @@ def _get_most_viewed_assets_aggs(max_assets: int, by_diff_user: bool) -> Dict[st }, "terms": aggs_terms, }, - "totalDistinctUsers": {"cardinality": {"field": "userName", "precision_threshold": 1000}}, + "totalDistinctUsers": { + "cardinality": {"field": "userName", "precision_threshold": 1000} + }, } @classmethod @@ -140,9 +146,13 @@ def most_recent_viewers( :returns: A SearchLogRequest that can be used to perform the search. """ - query_filter = [Term(field="entityGuidsAll", value=guid, case_insensitive=False)] + query_filter = [ + Term(field="entityGuidsAll", value=guid, case_insensitive=False) + ] dsl = DSL( - **cls._get_view_dsl_kwargs(size=0, from_=0, query_filter=query_filter, exclude_users=exclude_users), + **cls._get_view_dsl_kwargs( + size=0, from_=0, query_filter=query_filter, exclude_users=exclude_users + ), aggregations=cls._get_recent_viewers_aggs(max_users), ) return SearchLogRequest(dsl=dsl) @@ -166,7 +176,9 @@ def most_viewed_assets( """ dsl = DSL( **cls._get_view_dsl_kwargs(size=0, from_=0, exclude_users=exclude_users), - aggregations=cls._get_most_viewed_assets_aggs(max_assets, by_different_user), + aggregations=cls._get_most_viewed_assets_aggs( + max_assets, by_different_user + ), ) return SearchLogRequest(dsl=dsl) @@ -190,7 +202,9 @@ def views_by_guid( :returns: A SearchLogRequest that can be used to perform the search. """ - query_filter = [Term(field="entityGuidsAll", value=guid, case_insensitive=False)] + query_filter = [ + Term(field="entityGuidsAll", value=guid, case_insensitive=False) + ] dsl = DSL( **cls._get_view_dsl_kwargs( size=size, @@ -210,8 +224,12 @@ class AssetViews(AtlanObject): """ guid: str = Field(description="GUID of the asset that was viewed.") - total_views: int = Field(description="Number of times the asset has been viewed (in total).") - distinct_users: int = Field(description="Number of distinct users that have viewed the asset.") + total_views: int = Field( + description="Number of times the asset has been viewed (in total)." + ) + distinct_users: int = Field( + description="Number of distinct users that have viewed the asset." + ) class UserViews(AtlanObject): @@ -233,8 +251,12 @@ class SearchLogEntry(AtlanObject): Instances of this class should be treated as immutable. """ - user_agent: str = Field(description="Details of the browser or other client used to make the request.") - host: str = Field(description="Hostname of the tenant against which the search was run.") + user_agent: str = Field( + description="Details of the browser or other client used to make the request." + ) + host: str = Field( + description="Hostname of the tenant against which the search was run." + ) ip_address: str = Field(description="IP address from which the search was run.") user_name: str = Field(description="Username of the user who ran the search.") entity_guids_all: List[str] = Field( @@ -271,12 +293,16 @@ class SearchLogEntry(AtlanObject): "Name(s) of the types of assets that were in the results of the search, that the user is permitted to see." ), ) - utm_tags: List[str] = Field(default_factory=list, description="Tag(s) that were sent in the search request.") + utm_tags: List[str] = Field( + default_factory=list, description="Tag(s) that were sent in the search request." + ) has_result: bool = Field( alias="hasResult", description="Whether the search had any results (true) or not (false).", ) - results_count: int = Field(alias="resultsCount", description="Number of results for the search.") + results_count: int = Field( + alias="resultsCount", description="Number of results for the search." + ) response_time: int = Field( alias="responseTime", description="Elapsed time to produce the results for the search, in milliseconds.", @@ -285,9 +311,15 @@ class SearchLogEntry(AtlanObject): alias="createdAt", description="Time (epoch-style) at which the search was logged, in milliseconds.", ) - timestamp: datetime = Field(description="Time (epoch-style) at which the search was run, in milliseconds.") - failed: bool = Field(description="Whether the search was successful (false) or not (true).") - request_dsl: dict = Field(alias="request.dsl", description="DSL of the full search request that was made.") + timestamp: datetime = Field( + description="Time (epoch-style) at which the search was run, in milliseconds." + ) + failed: bool = Field( + description="Whether the search was successful (false) or not (true)." + ) + request_dsl: dict = Field( + alias="request.dsl", description="DSL of the full search request that was made." + ) request_dsl_text: str = Field( alias="request.dslText", description="DSL of the full search request that was made, as a string.", @@ -388,7 +420,9 @@ def next_page(self, start=None, size=None) -> bool: :returns: True if there is a next page of results, otherwise False """ self._start = start or self._start + self._size - is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + is_bulk_search = ( + self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + ) if size: self._size = size @@ -398,7 +432,9 @@ def next_page(self, start=None, size=None) -> bool: # has already been processed in a previous page of results. # If it has, then exclude it from the current results; # otherwise, we may encounter duplicate search log records. - self._processed_log_entries.update(self._get_sl_unique_key(entity) for entity in self._log_entries) + self._processed_log_entries.update( + self._get_sl_unique_key(entity) for entity in self._log_entries + ) return self._get_next_page() if self._log_entries else False def _get_next_page(self): @@ -410,7 +446,9 @@ def _get_next_page(self): query = self._criteria.dsl.query self._criteria.dsl.from_ = self._start self._criteria.dsl.size = self._size - is_bulk_search = self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + is_bulk_search = ( + self._bulk or self._approximate_count > self._MASS_EXTRACT_THRESHOLD + ) if is_bulk_search: self._prepare_query_for_timestamp_paging(query) @@ -440,7 +478,9 @@ def _get_next_page_json(self, is_bulk_search: bool = False): self._filter_processed_entities() return raw_json except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err def _prepare_query_for_timestamp_paging(self, query: Query): """ @@ -454,7 +494,9 @@ def _prepare_query_for_timestamp_paging(self, query: Query): rewritten_filters.append(filter_) if self._first_record_creation_time != self._last_record_creation_time: - rewritten_filters.append(self._get_paging_timestamp_query(self._last_record_creation_time)) + rewritten_filters.append( + self._get_paging_timestamp_query(self._last_record_creation_time) + ) if isinstance(query, Bool): rewritten_query = Bool( filter=rewritten_filters, @@ -493,7 +535,11 @@ def _get_paging_timestamp_query(last_timestamp: int) -> Query: @staticmethod def _is_paging_timestamp_query(filter_: Query) -> bool: - return isinstance(filter_, Range) and filter_.field == "createdAt" and filter_.gte is not None + return ( + isinstance(filter_, Range) + and filter_.field == "createdAt" + and filter_.gte is not None + ) def _filter_processed_entities(self): """ @@ -502,7 +548,8 @@ def _filter_processed_entities(self): self._log_entries = [ entity for entity in self._log_entries - if entity is not None and self._get_sl_unique_key(entity) not in self._processed_log_entries + if entity is not None + and self._get_sl_unique_key(entity) not in self._processed_log_entries ] def _update_first_last_record_creation_times(self): @@ -527,7 +574,9 @@ def presorted_by_timestamp(sorts: Optional[List[SortItem]]) -> bool: :returns: True if sorting is already prioritized by creation time, False otherwise. """ if sorts and isinstance(sorts[0], SortItem): - return sorts[0].field == "createdAt" and sorts[0].order == SortOrder.ASCENDING + return ( + sorts[0].field == "createdAt" and sorts[0].order == SortOrder.ASCENDING + ) return False @staticmethod @@ -552,7 +601,10 @@ def sort_by_timestamp_first(sorts: List[SortItem]) -> List[SortItem]: for sort in sorts # Added a condition to disable "timestamp" sorting when bulk search for logs is enabled, # as sorting is already handled based on "createdAt" in this case. - if ((not sort.field) or (sort.field != Asset.CREATE_TIME.internal_field_name)) + if ( + (not sort.field) + or (sort.field != Asset.CREATE_TIME.internal_field_name) + ) and (sort not in BY_TIMESTAMP) ] return creation_asc_sort + rewritten_sorts diff --git a/pyatlan/model/sso.py b/pyatlan/model/sso.py index e405239fc..215add5e7 100644 --- a/pyatlan/model/sso.py +++ b/pyatlan/model/sso.py @@ -11,8 +11,12 @@ class SSOMapperConfig(AtlanObject): group_name: Optional[str] = Field(default=None, alias="group") attribute_name: Optional[str] = Field(default=None, alias="attribute.name") attribute_value: Optional[str] = Field(default=None, alias="attribute.value") - attribute_friendly_name: Optional[str] = Field(default=None, alias="attribute.friendly.name") - attribute_values_regex: Optional[str] = Field(default=None, alias="are.attribute.values.regex") + attribute_friendly_name: Optional[str] = Field( + default=None, alias="attribute.friendly.name" + ) + attribute_values_regex: Optional[str] = Field( + default=None, alias="are.attribute.values.regex" + ) class SSOMapper(AtlanObject): diff --git a/pyatlan/model/structs.py b/pyatlan/model/structs.py index a3e55cd1f..627d1ae69 100644 --- a/pyatlan/model/structs.py +++ b/pyatlan/model/structs.py @@ -46,8 +46,12 @@ class MCRuleSchedule(AtlanObject): """Description""" mc_rule_schedule_type: Optional[str] = Field(default=None, description="") - mc_rule_schedule_interval_in_minutes: Optional[int] = Field(default=None, description="") - mc_rule_schedule_start_time: Optional[datetime] = Field(default=None, description="") + mc_rule_schedule_interval_in_minutes: Optional[int] = Field( + default=None, description="" + ) + mc_rule_schedule_start_time: Optional[datetime] = Field( + default=None, description="" + ) mc_rule_schedule_crontab: Optional[str] = Field(default=None, description="") @@ -120,7 +124,9 @@ class SourceTagAttachment(AtlanObject): source_tag_qualified_name: Optional[str] = Field(default=None, description="") source_tag_guid: Optional[str] = Field(default=None, description="") source_tag_connector_name: Optional[str] = Field(default=None, description="") - source_tag_value: Optional[List[SourceTagAttachmentValue]] = Field(default=None, description="") + source_tag_value: Optional[List[SourceTagAttachmentValue]] = Field( + default=None, description="" + ) is_source_tag_synced: Optional[bool] = Field(default=None, description="") source_tag_sync_timestamp: Optional[datetime] = Field(default=None, description="") source_tag_sync_error: Optional[str] = Field(default=None, description="") @@ -152,7 +158,9 @@ def by_name( :raises NotFoundError: if the source-synced tag cannot be resolved """ tag = SourceTagCache.get_by_name(name) - tag_connector_name = AtlanConnectorType._get_connector_type_from_qualified_name(tag.qualified_name or "") + tag_connector_name = AtlanConnectorType._get_connector_type_from_qualified_name( + tag.qualified_name or "" + ) return cls.of( source_tag_name=tag.name, source_tag_qualified_name=tag.qualified_name, @@ -194,7 +202,9 @@ def by_qualified_name( :raises NotFoundError: if the source-synced tag cannot be resolved """ tag = SourceTagCache.get_by_qualified_name(source_tag_qualified_name) - tag_connector_name = AtlanConnectorType._get_connector_type_from_qualified_name(source_tag_qualified_name or "") + tag_connector_name = AtlanConnectorType._get_connector_type_from_qualified_name( + source_tag_qualified_name or "" + ) return cls.of( source_tag_name=tag.name, source_tag_qualified_name=source_tag_qualified_name, @@ -316,7 +326,9 @@ class AwsTag(AtlanObject): class DbtMetricFilter(AtlanObject): """Description""" - dbt_metric_filter_column_qualified_name: Optional[str] = Field(default=None, description="") + dbt_metric_filter_column_qualified_name: Optional[str] = Field( + default=None, description="" + ) dbt_metric_filter_field: Optional[str] = Field(default=None, description="") dbt_metric_filter_operator: Optional[str] = Field(default=None, description="") dbt_metric_filter_value: Optional[str] = Field(default=None, description="") @@ -357,7 +369,9 @@ class MCRuleComparison(AtlanObject): mc_rule_comparison_metric: Optional[str] = Field(default=None, description="") mc_rule_comparison_operator: Optional[str] = Field(default=None, description="") mc_rule_comparison_threshold: Optional[float] = Field(default=None, description="") - mc_rule_comparison_is_threshold_relative: Optional[bool] = Field(default=None, description="") + mc_rule_comparison_is_threshold_relative: Optional[bool] = Field( + default=None, description="" + ) class GoogleLabel(AtlanObject): @@ -377,7 +391,9 @@ class PopularityInsights(AtlanObject): record_total_user_count: Optional[int] = Field(default=None, description="") record_compute_cost: Optional[float] = Field(default=None, description="") record_max_compute_cost: Optional[float] = Field(default=None, description="") - record_compute_cost_unit: Optional[SourceCostUnitType] = Field(default=None, description="") + record_compute_cost_unit: Optional[SourceCostUnitType] = Field( + default=None, description="" + ) record_last_timestamp: Optional[datetime] = Field(default=None, description="") record_warehouse: Optional[str] = Field(default=None, description="") @@ -387,7 +403,9 @@ class SourceTagAttribute(AtlanObject): tag_attribute_key: Optional[str] = Field(default=None, description="") tag_attribute_value: Optional[str] = Field(default=None, description="") - tag_attribute_properties: Optional[Dict[str, str]] = Field(default=None, description="") + tag_attribute_properties: Optional[Dict[str, str]] = Field( + default=None, description="" + ) MCRuleSchedule.update_forward_refs() diff --git a/pyatlan/model/suggestions.py b/pyatlan/model/suggestions.py index 3dd716430..f3515aea7 100644 --- a/pyatlan/model/suggestions.py +++ b/pyatlan/model/suggestions.py @@ -20,12 +20,24 @@ class SuggestionResponse(AtlanObject): - system_descriptions: Optional[List[SuggestionResponse.SuggestedItem]] = Field(default_factory=list) - user_descriptions: Optional[List[SuggestionResponse.SuggestedItem]] = Field(default_factory=list) - owner_users: Optional[List[SuggestionResponse.SuggestedItem]] = Field(default_factory=list) - owner_groups: Optional[List[SuggestionResponse.SuggestedItem]] = Field(default_factory=list) - atlan_tags: Optional[List[SuggestionResponse.SuggestedItem]] = Field(default_factory=list) - assigned_terms: Optional[List[SuggestionResponse.SuggestedTerm]] = Field(default_factory=list) + system_descriptions: Optional[List[SuggestionResponse.SuggestedItem]] = Field( + default_factory=list + ) + user_descriptions: Optional[List[SuggestionResponse.SuggestedItem]] = Field( + default_factory=list + ) + owner_users: Optional[List[SuggestionResponse.SuggestedItem]] = Field( + default_factory=list + ) + owner_groups: Optional[List[SuggestionResponse.SuggestedItem]] = Field( + default_factory=list + ) + atlan_tags: Optional[List[SuggestionResponse.SuggestedItem]] = Field( + default_factory=list + ) + assigned_terms: Optional[List[SuggestionResponse.SuggestedTerm]] = Field( + default_factory=list + ) class SuggestedItem(AtlanObject): count: int @@ -48,7 +60,9 @@ class Suggestions(AtlanObject): AGG_ATLAN_TAGS: ClassVar[str] = "group_by_tags" AGG_TERMS: ClassVar[str] = "group_by_terms" - client: AtlanClient = Field(default_factory=lambda: AtlanClient.get_default_client()) + client: AtlanClient = Field( + default_factory=lambda: AtlanClient.get_default_client() + ) """Client through which to find suggestions.""" asset: Optional[Asset] = Field(default=None) """Asset for which to find suggestions.""" @@ -250,12 +264,18 @@ def get(self) -> SuggestionResponse: if include == Suggestions.TYPE.SYSTEM_DESCRIPTION: search = search.where_some(Asset.DESCRIPTION.has_any_value()).aggregate( Suggestions.AGG_DESCRIPTION, - Asset.DESCRIPTION.bucket_by(size=self.max_suggestions, include_source_value=True), + Asset.DESCRIPTION.bucket_by( + size=self.max_suggestions, include_source_value=True + ), ) elif include == Suggestions.TYPE.USER_DESCRIPTION: - search = search.where_some(Asset.USER_DESCRIPTION.has_any_value()).aggregate( + search = search.where_some( + Asset.USER_DESCRIPTION.has_any_value() + ).aggregate( Suggestions.AGG_USER_DESCRIPTION, - Asset.USER_DESCRIPTION.bucket_by(size=self.max_suggestions, include_source_value=True), + Asset.USER_DESCRIPTION.bucket_by( + size=self.max_suggestions, include_source_value=True + ), ) elif include == Suggestions.TYPE.INDIVIDUAL_OWNERS: search = search.where_some(Asset.OWNER_USERS.has_any_value()).aggregate( @@ -263,7 +283,9 @@ def get(self) -> SuggestionResponse: Asset.OWNER_USERS.bucket_by(self.max_suggestions), ) elif include == Suggestions.TYPE.GROUP_OWNERS: - search = search.where_some(Asset.OWNER_GROUPS.has_any_value()).aggregate( + search = search.where_some( + Asset.OWNER_GROUPS.has_any_value() + ).aggregate( Suggestions.AGG_OWNER_GROUPS, Asset.OWNER_GROUPS.bucket_by(self.max_suggestions), ) @@ -273,7 +295,9 @@ def get(self) -> SuggestionResponse: Asset.ATLAN_TAGS.bucket_by(self.max_suggestions), ) elif include == Suggestions.TYPE.TERMS: - search = search.where_some(Asset.ASSIGNED_TERMS.has_any_value()).aggregate( + search = search.where_some( + Asset.ASSIGNED_TERMS.has_any_value() + ).aggregate( Suggestions.AGG_TERMS, Asset.ASSIGNED_TERMS.bucket_by(self.max_suggestions), ) @@ -294,7 +318,9 @@ def _get_descriptions(self, result: Aggregations, field: AtlanField): count = bucket.doc_count value = bucket.get_source_value(field) if count and value: - results.append(SuggestionResponse.SuggestedItem(count=count, value=value)) + results.append( + SuggestionResponse.SuggestedItem(count=count, value=value) + ) return results def _get_terms(self, result: Aggregations): @@ -304,7 +330,11 @@ def _get_terms(self, result: Aggregations): count = bucket.doc_count value = bucket.key if count and value: - results.append(SuggestionResponse.SuggestedTerm(count=count, qualified_name=value)) + results.append( + SuggestionResponse.SuggestedTerm( + count=count, qualified_name=value + ) + ) return results def _get_tags(self, result: Aggregations): @@ -315,7 +345,9 @@ def _get_tags(self, result: Aggregations): value = bucket.key name = AtlanTagCache.get_name_for_id(value) if count and name: - results.append(SuggestionResponse.SuggestedItem(count=count, value=name)) + results.append( + SuggestionResponse.SuggestedItem(count=count, value=name) + ) return results def _get_others(self, result: Aggregations): @@ -325,7 +357,9 @@ def _get_others(self, result: Aggregations): count = bucket.doc_count value = bucket.key if count and value: - results.append(SuggestionResponse.SuggestedItem(count=count, value=value)) + results.append( + SuggestionResponse.SuggestedItem(count=count, value=value) + ) return results def _build_response(self, include, suggestion_response, aggregations): @@ -368,7 +402,9 @@ def _build_response(self, include, suggestion_response, aggregations): ) ) - def apply(self, allow_multiple: bool = False, batch: Optional[Batch] = None) -> Optional[AssetMutationResponse]: + def apply( + self, allow_multiple: bool = False, batch: Optional[Batch] = None + ) -> Optional[AssetMutationResponse]: """ Find the requested suggestions and apply the top suggestions as changes to the asset. @@ -413,7 +449,8 @@ def _apply(self, allow_multiple: bool): includes_tags = True if allow_multiple: asset.atlan_tags = [ - AtlanTag(type_name=AtlanTagName(tag.value), propagate=False) for tag in response.atlan_tags + AtlanTag(type_name=AtlanTagName(tag.value), propagate=False) + for tag in response.atlan_tags ] else: asset.atlan_tags = [ diff --git a/pyatlan/model/task.py b/pyatlan/model/task.py index fd9b3db1d..4c0ff7463 100644 --- a/pyatlan/model/task.py +++ b/pyatlan/model/task.py @@ -24,10 +24,14 @@ class AtlanTask(AtlanObject): CREATED_BY: ClassVar[KeywordField] = KeywordField("createdBy", "__task_createdBy") """User who created the task.""" - CREATED_TIME: ClassVar[NumericField] = NumericField("createdTime", "__task_timestamp") + CREATED_TIME: ClassVar[NumericField] = NumericField( + "createdTime", "__task_timestamp" + ) """Time (epoch) at which the task was created, in milliseconds.""" - UPDATED_TIME: ClassVar[NumericField] = NumericField("updatedTime", "__task_modificationTimestamp") + UPDATED_TIME: ClassVar[NumericField] = NumericField( + "updatedTime", "__task_modificationTimestamp" + ) """Time (epoch) at which the task was last updated, in milliseconds.""" START_TIME: ClassVar[NumericField] = NumericField("startTime", "__task_startTime") @@ -36,19 +40,27 @@ class AtlanTask(AtlanObject): END_TIME: ClassVar[NumericField] = NumericField("endTime", "__task_endTime") """Time (epoch) at which the task was ended, in milliseconds.""" - TIME_TAKEN_IN_SECONDS: ClassVar[NumericField] = NumericField("timeTakenInSeconds", "__task_timeTakenInSeconds") + TIME_TAKEN_IN_SECONDS: ClassVar[NumericField] = NumericField( + "timeTakenInSeconds", "__task_timeTakenInSeconds" + ) """Total time taken to complete the task, in seconds.""" - ATTEMPT_COUNT: ClassVar[NumericField] = NumericField("attemptCount", "__task_attemptCount") + ATTEMPT_COUNT: ClassVar[NumericField] = NumericField( + "attemptCount", "__task_attemptCount" + ) """Number of times the task has been attempted.""" STATUS: ClassVar[TextField] = TextField("status", "__task_status") """Status of the task.""" - CLASSIFICATION_ID: ClassVar[KeywordField] = KeywordField("classificationId", "__task_classificationId") + CLASSIFICATION_ID: ClassVar[KeywordField] = KeywordField( + "classificationId", "__task_classificationId" + ) """TBC""" - ENTITY_GUID: ClassVar[KeywordField] = KeywordField("entityGuid", "__task_entityGuid") + ENTITY_GUID: ClassVar[KeywordField] = KeywordField( + "entityGuid", "__task_entityGuid" + ) """Unique identifier of the asset the task originated from.""" type: Optional[AtlanTaskType] = Field(None, description="Type of the task.") @@ -61,14 +73,26 @@ class AtlanTask(AtlanObject): None, description="Time (epoch) at which the task was last updated, in milliseconds.", ) - start_time: Optional[int] = Field(None, description="Time (epoch) at which the task was started, in milliseconds.") - end_time: Optional[int] = Field(None, description="Time (epoch) at which the task was ended, in milliseconds.") - time_taken_in_seconds: Optional[int] = Field(None, description="Total time taken to complete the task, in seconds.") - parameters: Optional[Dict[str, Any]] = Field(None, description="Parameters used for running the task.") - attempt_count: Optional[int] = Field(None, description="Number of times the task has been attempted.") + start_time: Optional[int] = Field( + None, description="Time (epoch) at which the task was started, in milliseconds." + ) + end_time: Optional[int] = Field( + None, description="Time (epoch) at which the task was ended, in milliseconds." + ) + time_taken_in_seconds: Optional[int] = Field( + None, description="Total time taken to complete the task, in seconds." + ) + parameters: Optional[Dict[str, Any]] = Field( + None, description="Parameters used for running the task." + ) + attempt_count: Optional[int] = Field( + None, description="Number of times the task has been attempted." + ) status: Optional[AtlanTaskStatus] = Field(None, description="Status of the task.") classification_id: Optional[str] = Field(None, description="To Be Confirmed (TBC).") - entity_guid: Optional[str] = Field(None, description="Unique identifier of the asset the task originated from.") + entity_guid: Optional[str] = Field( + None, description="Unique identifier of the asset the task originated from." + ) class TaskSearchRequest(SearchRequest): @@ -156,7 +180,9 @@ def _get_next_page_json(self): self._tasks = parse_obj_as(List[AtlanTask], raw_json["tasks"]) return raw_json except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err def __iter__(self) -> Generator[AtlanTask, None, None]: """ diff --git a/pyatlan/model/typedef.py b/pyatlan/model/typedef.py index c452ec530..8764c7b61 100644 --- a/pyatlan/model/typedef.py +++ b/pyatlan/model/typedef.py @@ -204,8 +204,12 @@ class TypeDef(AtlanObject): default=None, description="Time (epoch) at which this object was created, in milliseconds.", ) - created_by: Optional[str] = Field(default=None, description="Username of the user who created the object.") - description: Optional[str] = Field(default=None, description="Description of the type definition.") + created_by: Optional[str] = Field( + default=None, description="Username of the user who created the object." + ) + description: Optional[str] = Field( + default=None, description="Description of the type definition." + ) guid: Optional[str] = Field( default=None, description="Unique identifier that represents the type definition.", @@ -220,14 +224,18 @@ class TypeDef(AtlanObject): default=None, description="Username of the user who last assets_updated the object.", ) - version: Optional[int] = Field(default=None, description="Version of this type definition.") + version: Optional[int] = Field( + default=None, description="Version of this type definition." + ) class EnumDef(TypeDef): class ElementDef(AtlanObject): value: str = Field(description="One unique value within the enumeration.") description: Optional[str] = Field(default=None, description="Unused.") - ordinal: Optional[int] = Field(default=None, description="Unique numeric identifier for the value.") + ordinal: Optional[int] = Field( + default=None, description="Unique numeric identifier for the value." + ) @staticmethod def of(ordinal: int, value: str) -> EnumDef.ElementDef: @@ -248,7 +256,10 @@ def list_from(values: List[str]) -> List[EnumDef.ElementDef]: [values], ) elements: List[EnumDef.ElementDef] = [] - elements.extend(EnumDef.ElementDef.of(ordinal=i, value=values[i]) for i in range(len(values))) + elements.extend( + EnumDef.ElementDef.of(ordinal=i, value=values[i]) + for i in range(len(values)) + ) return elements @staticmethod @@ -271,8 +282,12 @@ def extend_elements(current: List[str], new: List[str]) -> List[str]: return extended_list category: AtlanTypeCategory = AtlanTypeCategory.ENUM - element_defs: List[EnumDef.ElementDef] = Field(description="Valid values for the enumeration.") - options: Optional[Dict[str, Any]] = Field(default=None, description="Optional properties of the type definition.") + element_defs: List[EnumDef.ElementDef] = Field( + description="Valid values for the enumeration." + ) + options: Optional[Dict[str, Any]] = Field( + default=None, description="Optional properties of the type definition." + ) service_type: Optional[str] = Field(default=None, description="Internal use only.") @staticmethod @@ -347,7 +362,9 @@ class Options(AtlanObject): "are available and used.", default="v2", ) - description: Optional[str] = Field(default=None, description="Optional description of the attribute.") + description: Optional[str] = Field( + default=None, description="Optional description of the attribute." + ) applicable_entity_types: Optional[str] = Field( default=None, description="Set of entities on which this attribute can be applied. " @@ -408,11 +425,19 @@ class Options(AtlanObject): default=None, description="Whether the attribute has been deleted (true) or is still active (false).", ) - archived_at: Optional[int] = Field(default=None, description="When the attribute was deleted.") - archived_by: Optional[str] = Field(default=None, description="User who deleted the attribute.") + archived_at: Optional[int] = Field( + default=None, description="When the attribute was deleted." + ) + archived_by: Optional[str] = Field( + default=None, description="User who deleted the attribute." + ) is_soft_reference: Optional[str] = Field(default=None, description="TBC") - is_append_on_partial_update: Optional[str] = Field(default=None, description="TBC") - primitive_type: Optional[str] = Field(default=None, description="Type of the attribute.") + is_append_on_partial_update: Optional[str] = Field( + default=None, description="TBC" + ) + primitive_type: Optional[str] = Field( + default=None, description="Type of the attribute." + ) applicable_connections: Optional[str] = Field( default=None, description="Qualified names of connections to which to restrict the attribute. " @@ -466,7 +491,9 @@ def __setattr__(self, name, value): super().__setattr__(name, value) if self._attr_def and name == "multi_value_select": self._attr_def.cardinality = Cardinality.SET - if self._attr_def.type_name and "array<" not in str(self._attr_def.type_name): + if self._attr_def.type_name and "array<" not in str( + self._attr_def.type_name + ): self._attr_def.type_name = f"array<{self._attr_def.type_name}>" @staticmethod @@ -514,10 +541,18 @@ def create( "`LIST` indicates they are ordered and duplicates are allowed, while `SET` indicates " "they are unique and unordered.", ) - constraints: Optional[List[Dict[str, Any]]] = Field(default=None, description="Internal use only.") - enum_values: Optional[List[str]] = Field(default=None, description="list of values for an enumeration.") - description: Optional[str] = Field(default=None, description="Description of the attribute definition.") - default_value: Optional[str] = Field(default=None, description="Default value for this attribute (if any).") + constraints: Optional[List[Dict[str, Any]]] = Field( + default=None, description="Internal use only." + ) + enum_values: Optional[List[str]] = Field( + default=None, description="list of values for an enumeration." + ) + description: Optional[str] = Field( + default=None, description="Description of the attribute definition." + ) + default_value: Optional[str] = Field( + default=None, description="Default value for this attribute (if any)." + ) display_name: Optional[str] = Field( default=None, description="Name to use within all user interactions through the user interface. Note that this may not " @@ -533,7 +568,9 @@ def create( "by the user without impacting existing instances of the attribute.)", ) include_in_notification: Optional[bool] = Field(default=None, description="TBC") - index_type: Optional[IndexType] = Field(default=None, description="", example="DEFAULT") + index_type: Optional[IndexType] = Field( + default=None, description="", example="DEFAULT" + ) is_indexable: Optional[bool] = Field( default=None, description="When true, values for this attribute will be indexed for searching.", @@ -550,8 +587,12 @@ def create( default_factory=Options, description="Extensible options for the attribute." ) search_weight: Optional[float] = Field(default=None, description="TBC") - skip_scrubbing: Optional[bool] = Field(default=None, description="When true, scrubbing of data will be skipped.") - type_name: Optional[str] = Field(default=None, description="Type of this attribute.") + skip_scrubbing: Optional[bool] = Field( + default=None, description="When true, scrubbing of data will be skipped." + ) + type_name: Optional[str] = Field( + default=None, description="Type of this attribute." + ) values_min_count: Optional[float] = Field( default=None, description="Minimum number of values for this attribute. If greater than 0, this attribute becomes required.", @@ -601,7 +642,9 @@ def applicable_entity_types(self, entity_types: EntityTypes): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(entity_types, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_entity_types", EntityTypes) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "applicable_entity_types", EntityTypes + ) self.options.applicable_entity_types = json.dumps(list(entity_types)) @property @@ -620,7 +663,9 @@ def applicable_asset_types(self, asset_types: AssetTypes): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(asset_types, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_asset_types", AssetTypes) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "applicable_asset_types", AssetTypes + ) if not asset_types.issubset(_complete_type_list): raise ErrorCode.INVALID_PARAMETER_VALUE.exception_with_parameters( asset_types, "applicable_asset_types", _complete_type_list @@ -643,7 +688,9 @@ def applicable_glossary_types(self, glossary_types: GlossaryTypes): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(glossary_types, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_glossary_types", GlossaryTypes) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "applicable_glossary_types", GlossaryTypes + ) if not glossary_types.issubset(_all_glossary_types): raise ErrorCode.INVALID_PARAMETER_VALUE.exception_with_parameters( glossary_types, "applicable_glossary_types", _all_glossary_types @@ -666,7 +713,9 @@ def applicable_domain_types(self, domain_types: DomainTypes): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(domain_types, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_domain_types", DomainTypes) + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "applicable_domain_types", DomainTypes + ) if not domain_types.issubset(_all_domain_types): raise ErrorCode.INVALID_PARAMETER_VALUE.exception_with_parameters( domain_types, "applicable_domain_types", _all_domain_types @@ -716,7 +765,9 @@ def applicable_connections(self, connections: Set[str]): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(connections, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_connections", "Set[str]") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "applicable_connections", "Set[str]" + ) self.options.applicable_connections = json.dumps(list(connections)) @property @@ -735,7 +786,9 @@ def applicable_glossaries(self, glossaries: Set[str]): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(glossaries, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_glossaries", "Set[str]") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "applicable_glossaries", "Set[str]" + ) self.options.applicable_glossaries = json.dumps(list(glossaries)) @property @@ -754,7 +807,9 @@ def applicable_domains(self, domains: Set[str]): if self.options is None: raise ErrorCode.MISSING_OPTIONS.exception_with_parameters() if not isinstance(domains, set): - raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters("applicable_domains", "Set[str]") + raise ErrorCode.INVALID_PARAMETER_TYPE.exception_with_parameters( + "applicable_domains", "Set[str]" + ) self.options.applicable_domains = json.dumps(list(domains)) def __init__(self, **data): @@ -784,7 +839,9 @@ def create( # Explicitly set all defaults to ensure inclusion during pydantic serialization attr_def = AttributeDef( display_name=display_name, - options=AttributeDef.Options.create(attribute_type=attribute_type, options_name=options_name), + options=AttributeDef.Options.create( + attribute_type=attribute_type, options_name=options_name + ), is_new=True, cardinality=Cardinality.SINGLE, description="", @@ -822,11 +879,19 @@ def create( attr_def.enum_values = [] attr_def.applicable_asset_types = applicable_asset_types or _complete_type_list - attr_def.applicable_glossary_types = applicable_glossary_types or _all_glossary_types + attr_def.applicable_glossary_types = ( + applicable_glossary_types or _all_glossary_types + ) attr_def.applicable_domain_types = applicable_domain_types or _all_domain_types - attr_def.applicable_other_asset_types = applicable_other_asset_types or _all_other_types - attr_def.applicable_connections = applicable_connections or _get_all_qualified_names("Connection") - attr_def.applicable_glossaries = applicable_glossaries or _get_all_qualified_names("AtlasGlossary") + attr_def.applicable_other_asset_types = ( + applicable_other_asset_types or _all_other_types + ) + attr_def.applicable_connections = ( + applicable_connections or _get_all_qualified_names("Connection") + ) + attr_def.applicable_glossaries = ( + applicable_glossaries or _get_all_qualified_names("AtlasGlossary") + ) attr_def.applicable_domains = applicable_domains or _all_domains return attr_def @@ -845,7 +910,9 @@ def archive(self, by: str) -> AttributeDef: class RelationshipAttributeDef(AttributeDef): is_legacy_attribute: Optional[bool] = Field(default=None, description="Unused.") - relationship_type_name: Optional[str] = Field(default=None, description="Name of the relationship type.") + relationship_type_name: Optional[str] = Field( + default=None, description="Name of the relationship type." + ) class StructDef(TypeDef): @@ -854,19 +921,27 @@ class StructDef(TypeDef): default=None, description="list of attributes that should be available in the type_ definition.", ) - service_type: Optional[str] = Field(default=None, description="Internal use only.", example="atlan") + service_type: Optional[str] = Field( + default=None, description="Internal use only.", example="atlan" + ) class AtlanTagDef(TypeDef): - attribute_defs: Optional[List[AttributeDef]] = Field(default=None, description="Unused.") + attribute_defs: Optional[List[AttributeDef]] = Field( + default=None, description="Unused." + ) category: AtlanTypeCategory = AtlanTypeCategory.CLASSIFICATION - display_name: str = Field(default=None, description="Name used for display purposes (in user interfaces).") + display_name: str = Field( + default=None, description="Name used for display purposes (in user interfaces)." + ) entity_types: Optional[List[str]] = Field( default=None, description="A list of the entity types that this classification can be used against." " (This should be `Asset` to allow classification of any asset in Atlan.)", ) - options: Optional[Dict[str, Any]] = Field(default=None, description="Optional properties of the type_ definition.") + options: Optional[Dict[str, Any]] = Field( + default=None, description="Optional properties of the type_ definition." + ) sub_types: Optional[List[str]] = Field( default=None, description="list of the sub-types that extend from this type_ definition. Generally this is not specified " @@ -881,7 +956,9 @@ class AtlanTagDef(TypeDef): service_type: Optional[str] = Field( default=None, description="Name used for display purposes (in user interfaces)." ) - skip_display_name_uniqueness_check: Optional[bool] = Field(default=None, description="TBC") + skip_display_name_uniqueness_check: Optional[bool] = Field( + default=None, description="TBC" + ) @staticmethod def create( @@ -925,7 +1002,9 @@ def create( class EntityDef(TypeDef): - attribute_defs: Optional[List[Dict[str, Any]]] = Field(default_factory=list, description="Unused.", example=[]) + attribute_defs: Optional[List[Dict[str, Any]]] = Field( + default_factory=list, description="Unused.", example=[] + ) business_attribute_defs: Optional[Dict[str, List[Dict[str, Any]]]] = Field( default_factory=cast(Callable[[], Dict[str, List[Dict[str, Any]]]], dict), description="Unused.", @@ -935,7 +1014,9 @@ class EntityDef(TypeDef): relationship_attribute_defs: Optional[List[Dict[str, Any]]] = Field( default_factory=list, description="Unused.", example=[] ) - service_type: Optional[str] = Field(default=None, description="Internal use only.", example="atlan") + service_type: Optional[str] = Field( + default=None, description="Internal use only.", example="atlan" + ) sub_types: Optional[List[str]] = Field( default_factory=list, description="list of the sub-types that extend from this type_ definition. Generally this is not specified in " @@ -956,18 +1037,30 @@ def reserved_type(self) -> bool: class RelationshipDef(TypeDef): - attribute_defs: Optional[List[Dict[str, Any]]] = Field(default_factory=list, description="Unused.", example=[]) + attribute_defs: Optional[List[Dict[str, Any]]] = Field( + default_factory=list, description="Unused.", example=[] + ) category: AtlanTypeCategory = AtlanTypeCategory.RELATIONSHIP - end_def1: Optional[Dict[str, Any]] = Field(default_factory=dict, description="Unused.", example={}) - end_def2: Optional[Dict[str, Any]] = Field(default_factory=dict, description="Unused.", example={}) - propagate_tags: str = Field(default="ONE_TO_TWO", description="Unused", example="ONE_TO_TWO") - relationship_category: str = Field(default="AGGREGATION", description="Unused", example="AGGREGATION") + end_def1: Optional[Dict[str, Any]] = Field( + default_factory=dict, description="Unused.", example={} + ) + end_def2: Optional[Dict[str, Any]] = Field( + default_factory=dict, description="Unused.", example={} + ) + propagate_tags: str = Field( + default="ONE_TO_TWO", description="Unused", example="ONE_TO_TWO" + ) + relationship_category: str = Field( + default="AGGREGATION", description="Unused", example="AGGREGATION" + ) relationship_label: str = Field( default="__SalesforceOrganization.reports", description="Unused", example="__SalesforceOrganization.reports", ) - service_type: Optional[str] = Field(default=None, description="Internal use only.", example="atlan") + service_type: Optional[str] = Field( + default=None, description="Internal use only.", example="atlan" + ) class CustomMetadataDef(TypeDef): @@ -976,39 +1069,53 @@ class Options(AtlanObject): default=None, description="If the logoType is emoji, this should hold the emoji character.", ) - image_id: Optional[str] = Field(default=None, description="The id of the image used for the logo.") + image_id: Optional[str] = Field( + default=None, description="The id of the image used for the logo." + ) is_locked: Optional[bool] = Field( description="Indicates whether the custom metadata can be managed in the UI (false) or not (true)." ) - logo_type: Optional[str] = Field(default=None, description="Type of logo used for the custom metadata.") + logo_type: Optional[str] = Field( + default=None, description="Type of logo used for the custom metadata." + ) logo_url: Optional[str] = Field( default=None, description="If the logoType is image, this should hold a URL to the image.", ) - icon_color: Optional[AtlanTagColor] = Field(default=None, description="Color to use for the icon.") + icon_color: Optional[AtlanTagColor] = Field( + default=None, description="Color to use for the icon." + ) icon_name: Optional[AtlanIcon] = Field( default=None, description="Icon to use to represent the custom metadata." ) @staticmethod - def with_logo_as_emoji(emoji: str, locked: bool = False) -> CustomMetadataDef.Options: + def with_logo_as_emoji( + emoji: str, locked: bool = False + ) -> CustomMetadataDef.Options: from pyatlan.utils import validate_required_fields validate_required_fields( ["emoji"], [emoji], ) - return CustomMetadataDef.Options(emoji=emoji, logo_type="emoji", is_locked=locked) + return CustomMetadataDef.Options( + emoji=emoji, logo_type="emoji", is_locked=locked + ) @staticmethod - def with_logo_from_url(url: str, locked: bool = False) -> CustomMetadataDef.Options: + def with_logo_from_url( + url: str, locked: bool = False + ) -> CustomMetadataDef.Options: from pyatlan.utils import validate_required_fields validate_required_fields( ["url"], [url], ) - return CustomMetadataDef.Options(logo_url=url, logo_type="image", is_locked=locked) + return CustomMetadataDef.Options( + logo_url=url, logo_type="image", is_locked=locked + ) @staticmethod def with_logo_from_icon( @@ -1032,7 +1139,9 @@ def with_logo_from_icon( description="list of custom attributes defined within the custom metadata.", ) category: AtlanTypeCategory = AtlanTypeCategory.CUSTOM_METADATA - display_name: str = Field(default=None, description="Name used for display purposes (in user interfaces).") + display_name: str = Field( + default=None, description="Name used for display purposes (in user interfaces)." + ) options: Optional[CustomMetadataDef.Options] = Field( default=None, description="Optional properties of the type definition." ) @@ -1054,14 +1163,20 @@ def create(display_name: str) -> CustomMetadataDef: class TypeDefResponse(AtlanObject): - enum_defs: List[EnumDef] = Field(default_factory=list, description="list of enumeration type definitions.") - struct_defs: List[StructDef] = Field(default_factory=list, description="list of struct type definitions.") + enum_defs: List[EnumDef] = Field( + default_factory=list, description="list of enumeration type definitions." + ) + struct_defs: List[StructDef] = Field( + default_factory=list, description="list of struct type definitions." + ) atlan_tag_defs: List[AtlanTagDef] = Field( default_factory=list, description="list of classification type definitions.", alias="classificationDefs", ) - entity_defs: List[EntityDef] = Field(default_factory=list, description="list of entity type_ definitions.") + entity_defs: List[EntityDef] = Field( + default_factory=list, description="list of entity type_ definitions." + ) relationship_defs: List[RelationshipDef] = Field( default_factory=list, description="list of relationship type_ definitions." ) diff --git a/pyatlan/model/user.py b/pyatlan/model/user.py index 9c127b12b..81ed0db82 100644 --- a/pyatlan/model/user.py +++ b/pyatlan/model/user.py @@ -19,20 +19,34 @@ class Attributes(AtlanObject): default=None, description="Designation for the user, such as an honorific or title.", ) - skills: Optional[List[str]] = Field(default=None, description="Skills the user possesses.") - slack: Optional[List[str]] = Field(default=None, description="Unique Slack member identifier.") - jira: Optional[List[str]] = Field(default=None, description="Unique JIRA user identifier.") + skills: Optional[List[str]] = Field( + default=None, description="Skills the user possesses." + ) + slack: Optional[List[str]] = Field( + default=None, description="Unique Slack member identifier." + ) + jira: Optional[List[str]] = Field( + default=None, description="Unique JIRA user identifier." + ) invited_at: Optional[List[str]] = Field( default=None, description="Time at which the user was invited (as a formatted string).", ) - invited_by: Optional[List[str]] = Field(default=None, description="User who invited this user.") + invited_by: Optional[List[str]] = Field( + default=None, description="User who invited this user." + ) invited_by_name: Optional[List[str]] = Field(default=None, description="TBC") class Persona(AtlanObject): - id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the persona.") - name: Optional[str] = Field(default=None, description="Internal name of the persona.") - display_name: Optional[str] = Field(default=None, description="Human-readable name of the persona.") + id: Optional[str] = Field( + default=None, description="Unique identifier (GUID) of the persona." + ) + name: Optional[str] = Field( + default=None, description="Internal name of the persona." + ) + display_name: Optional[str] = Field( + default=None, description="Human-readable name of the persona." + ) class LoginEvent(AtlanObject): client_id: Optional[str] = Field( @@ -40,13 +54,17 @@ class LoginEvent(AtlanObject): description="Where the login occurred (usually `atlan-frontend`).", ) details: Optional[Any] = Field(default=None, description="TBC") - ip_address: Optional[str] = Field(default=None, description="IP address from which the user logged in.") + ip_address: Optional[str] = Field( + default=None, description="IP address from which the user logged in." + ) realm_id: Optional[str] = Field(default=None, description="TBC") session_id: Optional[str] = Field( default=None, description="Unique identifier (GUID) of the session for the login.", ) - time: Optional[int] = Field(description="Time (epoch) when the login occurred, in milliseconds.") + time: Optional[int] = Field( + description="Time (epoch) when the login occurred, in milliseconds." + ) type: Optional[str] = Field( default=None, description="Type of login event that occurred (usually `LOGIN`).", @@ -63,7 +81,9 @@ class AuthDetails(AtlanObject): user_id: Optional[str] = Field(default=None, description="TBC") class AdminEvent(AtlanObject): - operation_type: Optional[str] = Field(default=None, description="Type of admin operation that occurred.") + operation_type: Optional[str] = Field( + default=None, description="Type of admin operation that occurred." + ) realm_id: Optional[str] = Field(default=None, description="TBC") representation: Optional[str] = Field(default=None, description="TBC") resource_path: Optional[str] = Field(default=None, description="TBC") @@ -75,11 +95,19 @@ class AdminEvent(AtlanObject): default=None, description="Time (epoch) when the admin operation occurred, in milliseconds.", ) - auth_details: Optional[AtlanUser.AuthDetails] = Field(default=None, description="TBC") + auth_details: Optional[AtlanUser.AuthDetails] = Field( + default=None, description="TBC" + ) - username: Optional[str] = Field(default=None, description="Username of the user within Atlan.") - id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the user within Atlan.") - workspace_role: Optional[str] = Field(default=None, description="Name of the role of the user within Atlan.") + username: Optional[str] = Field( + default=None, description="Username of the user within Atlan." + ) + id: Optional[str] = Field( + default=None, description="Unique identifier (GUID) of the user within Atlan." + ) + workspace_role: Optional[str] = Field( + default=None, description="Name of the role of the user within Atlan." + ) email: Optional[str] = Field(default=None, description="Email address of the user.") email_verified: Optional[bool] = Field( default=None, @@ -89,9 +117,15 @@ class AdminEvent(AtlanObject): default=None, description="When true, the user is enabled. When false, the user has been deactivated.", ) - first_name: Optional[str] = Field(default=None, description="First name of the user.") - last_name: Optional[str] = Field(default=None, description="Last name (surname) of the user.") - attributes: Optional[AtlanUser.Attributes] = Field(default=None, description="Detailed attributes of the user.") + first_name: Optional[str] = Field( + default=None, description="First name of the user." + ) + last_name: Optional[str] = Field( + default=None, description="Last name (surname) of the user." + ) + attributes: Optional[AtlanUser.Attributes] = Field( + default=None, description="Detailed attributes of the user." + ) created_timestamp: Optional[int] = Field( default=None, description="Time (epoch) at which the user was created, in milliseconds.", @@ -100,14 +134,18 @@ class AdminEvent(AtlanObject): default=None, description="Time (epoch) at which the user last logged into Atlan.", ) - group_count: Optional[int] = Field(default=None, description="Number of groups to which the user belongs.") + group_count: Optional[int] = Field( + default=None, description="Number of groups to which the user belongs." + ) default_roles: Optional[List[str]] = Field(default=None, description="TBC") roles: Optional[List[str]] = Field(default=None, description="TBC") decentralized_roles: Optional[Any] = Field(default=None, description="TBC") personas: Optional[List[AtlanUser.Persona]] = Field( default=None, description="Personas the user is associated with." ) - purposes: Optional[List[Any]] = Field(default=None, description="Purposes the user is associated with.") + purposes: Optional[List[Any]] = Field( + default=None, description="Purposes the user is associated with." + ) admin_events: Optional[List[AtlanUser.AdminEvent]] = Field( default=None, description="List of administration-related events for this user." ) @@ -145,8 +183,12 @@ def create_for_modification( class UserMinimalResponse(AtlanObject): - username: Optional[str] = Field(default=None, description="Username of the user within Atlan.") - id: Optional[str] = Field(default=None, description="Unique identifier (GUID) of the user within Atlan.") + username: Optional[str] = Field( + default=None, description="Username of the user within Atlan." + ) + id: Optional[str] = Field( + default=None, description="Unique identifier (GUID) of the user within Atlan." + ) email: Optional[str] = Field(default=None, description="Email address of the user.") email_verified: Optional[bool] = Field( default=None, @@ -156,9 +198,15 @@ class UserMinimalResponse(AtlanObject): default=None, description="When true, the user is enabled. When false, the user has been deactivated.", ) - first_name: Optional[str] = Field(default=None, description="First name of the user.") - last_name: Optional[str] = Field(default=None, description="Last name (surname) of the user.") - attributes: Optional[AtlanUser.Attributes] = Field(default=None, description="Detailed attributes of the user.") + first_name: Optional[str] = Field( + default=None, description="First name of the user." + ) + last_name: Optional[str] = Field( + default=None, description="Last name (surname) of the user." + ) + attributes: Optional[AtlanUser.Attributes] = Field( + default=None, description="Detailed attributes of the user." + ) created_timestamp: Optional[int] = Field( default=None, description="Time (epoch) at which the use was created, in milliseconds.", @@ -175,7 +223,9 @@ class UserResponse(AtlanObject): _endpoint: API = PrivateAttr() _client: ApiCaller = PrivateAttr() _criteria: UserRequest = PrivateAttr() - total_record: Optional[int] = Field(default=None, description="Total number of users.") + total_record: Optional[int] = Field( + default=None, description="Total number of users." + ) filter_record: Optional[int] = Field( default=None, description="Number of users in the filtered response.", @@ -214,7 +264,9 @@ def _get_next_page(self): try: self.records = parse_obj_as(List[AtlanUser], raw_json.get("records")) except ValidationError as err: - raise ErrorCode.JSON_ERROR.exception_with_parameters(raw_json, 200, str(err)) from err + raise ErrorCode.JSON_ERROR.exception_with_parameters( + raw_json, 200, str(err) + ) from err return True def __iter__(self) -> Generator[AtlanUser, None, None]: # type: ignore[override] @@ -274,17 +326,25 @@ class CreateUserRequest(AtlanObject): class CreateUser(AtlanObject): email: str = Field(description="Email address of the user.") role_name: str = Field(description="Name of the workspace role for the user.") - role_id: str = Field(description="Unique identifier (GUID) of the workspace role for the user.") + role_id: str = Field( + description="Unique identifier (GUID) of the workspace role for the user." + ) - users: List[CreateUserRequest.CreateUser] = Field(description="List of users to create.") + users: List[CreateUserRequest.CreateUser] = Field( + description="List of users to create." + ) class AddToGroupsRequest(AtlanObject): - groups: Optional[List[str]] = Field(description="List of groups (their GUIDs) to add the user to.") + groups: Optional[List[str]] = Field( + description="List of groups (their GUIDs) to add the user to." + ) class ChangeRoleRequest(AtlanObject): - role_id: str = Field(description="Unique identifier (GUID) of the new workspace role for the user.") + role_id: str = Field( + description="Unique identifier (GUID) of the new workspace role for the user." + ) class UserProvider(Protocol): diff --git a/pyatlan/model/utils.py b/pyatlan/model/utils.py index 0a9a7bc04..302ebd8b1 100644 --- a/pyatlan/model/utils.py +++ b/pyatlan/model/utils.py @@ -46,7 +46,9 @@ def to_snake_case(value): elif value == "mappedClassificationName": return "mapped_atlan_tag_name" res = [value[0].lower()] - for c in value.replace("URL", "Url").replace("DBT", "Dbt").replace("GDPR", "Gdpr")[1:]: + for c in ( + value.replace("URL", "Url").replace("DBT", "Dbt").replace("GDPR", "Gdpr")[1:] + ): if c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": res.append("_") res.append(c.lower()) diff --git a/pyatlan/model/workflow.py b/pyatlan/model/workflow.py index 9b6641e0b..11c3de094 100644 --- a/pyatlan/model/workflow.py +++ b/pyatlan/model/workflow.py @@ -76,7 +76,9 @@ class Workflow(AtlanObject): class WorkflowSearchResultStatus(AtlanObject): - artifact_gc_Status: Optional[Dict[str, Any]] = Field(default=None, alias="artifactGCStatus") + artifact_gc_Status: Optional[Dict[str, Any]] = Field( + default=None, alias="artifactGCStatus" + ) artifact_repository_ref: Optional[Any] = Field(default=None) compressed_nodes: Optional[str] = Field(default=None) estimated_duration: Optional[int] = Field(default=None) @@ -211,4 +213,6 @@ class Config: def __init__(__pydantic_self__, **data: Any) -> None: super().__init__(**data) - __pydantic_self__.__fields_set__.update(["from_", "size", "track_total_hits", "sort"]) + __pydantic_self__.__fields_set__.update( + ["from_", "size", "track_total_hits", "sort"] + ) diff --git a/pyatlan/multipart_data_generator.py b/pyatlan/multipart_data_generator.py index 02528f280..3337fb3f5 100644 --- a/pyatlan/multipart_data_generator.py +++ b/pyatlan/multipart_data_generator.py @@ -41,7 +41,9 @@ def add_file(self, file, filename): # Write the file part with the correct 'name="file"' self._write(self.param_header()) self._write(self.line_break) - self._write(f'Content-Disposition: form-data; name="file"; filename="{filename}"') + self._write( + f'Content-Disposition: form-data; name="file"; filename="{filename}"' + ) self._write(self.line_break) # Get content type from dictionary, default to 'application/octet-stream' @@ -71,7 +73,9 @@ def _write(self, value): elif isinstance(value, str): array = bytearray(value, encoding="utf-8") else: - raise TypeError("unexpected type: {value_type}".format(value_type=type(value))) + raise TypeError( + "unexpected type: {value_type}".format(value_type=type(value)) + ) self.data.write(array) diff --git a/pyatlan/pkg/create_package_files.py b/pyatlan/pkg/create_package_files.py index b192b04d6..0463c787c 100644 --- a/pyatlan/pkg/create_package_files.py +++ b/pyatlan/pkg/create_package_files.py @@ -168,6 +168,8 @@ def main(package_name: str): print("Please specify the python package name for the package") exit(1) if not re.fullmatch(r"\w+", sys.argv[1], re.ASCII): - print("The package name can only consist of alphanumeric characters and the underscore") + print( + "The package name can only consist of alphanumeric characters and the underscore" + ) main(sys.argv[1]) diff --git a/pyatlan/pkg/models.py b/pyatlan/pkg/models.py index 0c0c9fb61..ca8e7091a 100644 --- a/pyatlan/pkg/models.py +++ b/pyatlan/pkg/models.py @@ -79,7 +79,9 @@ class PackageDefinition(BaseModel): def __init__(self, **data): super().__init__(**data) source = self.connector_type.value if self.connector_type else "atlan" - source_category = self.connector_type.category.value if self.connector_type else "utility" + source_category = ( + self.connector_type.category.value if self.connector_type else "utility" + ) self._package_definition = _PackageDefinition( name=self.package_id, version=VERSION, @@ -113,7 +115,9 @@ def __init__(self, **data): }, annotations={ "orchestration.atlan.com/name": self.package_name, - "orchestration.atlan.com/allowSchedule": str(self.allow_schedule).lower(), + "orchestration.atlan.com/allowSchedule": str( + self.allow_schedule + ).lower(), "orchestration.atlan.com/dependentPackage": "", "orchestration.atlan.com/emoji": "🚀", "orchestration.atlan.com/categories": ",".join(self.keywords), diff --git a/pyatlan/pkg/ui.py b/pyatlan/pkg/ui.py index b5e607664..e143728dd 100644 --- a/pyatlan/pkg/ui.py +++ b/pyatlan/pkg/ui.py @@ -101,7 +101,9 @@ class UIRule: properties: Dict[str, Dict[str, str]] = field(default_factory=dict) @validate_arguments() - def __init__(self, when_inputs: Dict[StrictStr, StrictStr], required: List[StrictStr]): + def __init__( + self, when_inputs: Dict[StrictStr, StrictStr], required: List[StrictStr] + ): """ Configure basic UI rules that when the specified inputs have specified values, certain other fields become required. diff --git a/pyatlan/pkg/utils.py b/pyatlan/pkg/utils.py index 86325a47b..711f85285 100644 --- a/pyatlan/pkg/utils.py +++ b/pyatlan/pkg/utils.py @@ -53,7 +53,10 @@ def _is_valid_type(self, value: Any) -> bool: if isinstance(value, Sequence): return all(self._is_valid_type(v) for v in value) elif isinstance(value, Mapping): - return all(self._is_valid_type(k) & self._is_valid_type(v) for k, v in value.items()) + return all( + self._is_valid_type(k) & self._is_valid_type(v) + for k, v in value.items() + ) return False OTEL_IMPORTS_AVAILABLE = True @@ -82,7 +85,9 @@ def get_client(impersonate_user_id: str) -> AtlanClient: client = AtlanClient(base_url=base_url, api_key="") api_key = client.impersonate.user(user_id=user_id) else: - LOGGER.info("No API token or impersonation user, attempting short-lived escalation.") + LOGGER.info( + "No API token or impersonation user, attempting short-lived escalation." + ) client = AtlanClient(base_url=base_url, api_key="") api_key = client.impersonate.escalate() @@ -113,12 +118,18 @@ def set_package_headers(client: AtlanClient) -> AtlanClient: :returns: updated AtlanClient instance. """ - if (agent := os.environ.get("X_ATLAN_AGENT")) and (agent_id := os.environ.get("X_ATLAN_AGENT_ID")): + if (agent := os.environ.get("X_ATLAN_AGENT")) and ( + agent_id := os.environ.get("X_ATLAN_AGENT_ID") + ): headers: Dict[str, str] = { "x-atlan-agent": agent, "x-atlan-agent-id": agent_id, - "x-atlan-agent-package-name": os.environ.get("X_ATLAN_AGENT_PACKAGE_NAME", ""), - "x-atlan-agent-workflow-id": os.environ.get("X_ATLAN_AGENT_WORKFLOW_ID", ""), + "x-atlan-agent-package-name": os.environ.get( + "X_ATLAN_AGENT_PACKAGE_NAME", "" + ), + "x-atlan-agent-workflow-id": os.environ.get( + "X_ATLAN_AGENT_WORKFLOW_ID", "" + ), } client.update_headers(headers) return client @@ -183,7 +194,9 @@ def has_handler(logger: logging.Logger, handler_class) -> bool: return False -def add_otel_handler(logger: logging.Logger, level: Union[int, str], resource: dict) -> Optional[logging.Handler]: +def add_otel_handler( + logger: logging.Logger, level: Union[int, str], resource: dict +) -> Optional[logging.Handler]: """ Adds an OpenTelemetry logging handler to the provided logger if the necessary OpenTelemetry imports are available and the handler is not already present. @@ -210,12 +223,18 @@ def add_otel_handler(logger: logging.Logger, level: Union[int, str], resource: d if workflow_node_name := os.getenv("OTEL_WF_NODE_NAME", ""): resource["k8s.workflow.node.name"] = workflow_node_name logger_provider = LoggerProvider(Resource.create(resource)) - otel_log_exporter = OTLPLogExporter(endpoint=os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT"), insecure=True) - logger_provider.add_log_record_processor(CustomBatchLogRecordProcessor(otel_log_exporter)) + otel_log_exporter = OTLPLogExporter( + endpoint=os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT"), insecure=True + ) + logger_provider.add_log_record_processor( + CustomBatchLogRecordProcessor(otel_log_exporter) + ) otel_handler = LoggingHandler(level=level, logger_provider=logger_provider) otel_handler.setLevel(level) - formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") + formatter = logging.Formatter( + "%(asctime)s - %(name)s - %(levelname)s - %(message)s" + ) otel_handler.setFormatter(formatter) logger.addHandler(otel_handler) logger.info("OpenTelemetry handler with formatter added to the logger.") diff --git a/pyatlan/pkg/widgets.py b/pyatlan/pkg/widgets.py index 0b400e363..feb39e6c2 100644 --- a/pyatlan/pkg/widgets.py +++ b/pyatlan/pkg/widgets.py @@ -135,7 +135,9 @@ def __init__( :param help: informational text to place in a hover-over to describe the use of the input :param grid: sizing of the input on the UI (8 is full-width, 4 is half-width) """ - widget = APITokenSelectorWidget(label=label, hidden=hidden, help=help, grid=grid) + widget = APITokenSelectorWidget( + label=label, hidden=hidden, help=help, grid=grid + ) super().__init__(type_="string", required=required, ui=widget) @@ -195,7 +197,9 @@ def __init__( @dataclasses.dataclass class ConnectionCreatorWidget(AbstractWidget): - def __init__(self, label: str, hidden: bool = False, help: str = "", placeholder: str = ""): + def __init__( + self, label: str, hidden: bool = False, help: str = "", placeholder: str = "" + ): super().__init__( widget="connection", label=label, @@ -232,7 +236,9 @@ def __init__( :param help: informational text to place in a hover-over to describe the use of the input :param placeholder: example text to place within the widget to exemplify its use """ - widget = ConnectionCreatorWidget(label=label, hidden=hidden, help=help, placeholder=placeholder) + widget = ConnectionCreatorWidget( + label=label, hidden=hidden, help=help, placeholder=placeholder + ) super().__init__(type_="string", required=required, ui=widget) @@ -419,7 +425,9 @@ def __init__( start: int = 1, grid: int = 4, ): - super().__init__(widget="date", label=label, hidden=hidden, help=help, grid=grid) + super().__init__( + widget="date", label=label, hidden=hidden, help=help, grid=grid + ) self.start = start self.max = max self.min = min diff --git a/pyatlan/samples/custom_metadata/deploy_branded_cm.py b/pyatlan/samples/custom_metadata/deploy_branded_cm.py index 94e92d499..f59f7ed79 100644 --- a/pyatlan/samples/custom_metadata/deploy_branded_cm.py +++ b/pyatlan/samples/custom_metadata/deploy_branded_cm.py @@ -41,7 +41,9 @@ def create_custom_metadata_structure(): """ try: CustomMetadataCache.get_id_for_name(CUSTOM_METADATA_NAME) - logger.info(f"{CUSTOM_METADATA_NAME} custom metadata structure has already been created.") + logger.info( + f"{CUSTOM_METADATA_NAME} custom metadata structure has already been created." + ) except NotFoundError: cm_def = CustomMetadataDef.create(display_name=CUSTOM_METADATA_NAME) cm_def.attribute_defs = [ diff --git a/pyatlan/samples/custom_metadata/update_cm_on_assets.py b/pyatlan/samples/custom_metadata/update_cm_on_assets.py index 5872c673e..82f6f0f04 100644 --- a/pyatlan/samples/custom_metadata/update_cm_on_assets.py +++ b/pyatlan/samples/custom_metadata/update_cm_on_assets.py @@ -33,10 +33,16 @@ def find_asset( :returns: the asset, if found """ - connections = client.asset.find_connections_by_name(name=connection_name, connector_type=connector_type) - qualified_names = [f"{connection.qualified_name}/{asset_name}" for connection in connections] + connections = client.asset.find_connections_by_name( + name=connection_name, connector_type=connector_type + ) + qualified_names = [ + f"{connection.qualified_name}/{asset_name}" for connection in connections + ] search_request = ( - FluentSearch(_includes_on_results=attributes).where(Asset.QUALIFIED_NAME.within(qualified_names)) + FluentSearch(_includes_on_results=attributes).where( + Asset.QUALIFIED_NAME.within(qualified_names) + ) ).to_request() if results := client.asset.search(search_request): return results.current_page()[0] @@ -78,7 +84,9 @@ def main(): connector_type=AtlanConnectorType.SNOWFLAKE, connection_name="development", asset_name="RAW/WIDEWORLDIMPORTERS_PURCHASING/SUPPLIERS", - attributes=CustomMetadataCache.get_attributes_for_search_results(CUSTOM_METADATA_NAME), + attributes=CustomMetadataCache.get_attributes_for_search_results( + CUSTOM_METADATA_NAME + ), ): logger.info("Found asset: %s", asset) updated = update_custom_metadata( @@ -91,10 +99,14 @@ def main(): # Note that the updated asset will NOT show the custom metadata, if you want # to see the custom metadata you need to re-retrieve the asset itself assert updated # noqa: S101 - result = client.asset.get_by_guid(guid=updated.guid, asset_type=type(updated), ignore_relationships=True) + result = client.asset.get_by_guid( + guid=updated.guid, asset_type=type(updated), ignore_relationships=True + ) logger.info("Asset's custom metadata was updated: %s", result) else: - logger.warning("Unable to find asset: (development)/RAW/WIDEWORLDIMPORTERS_PURCHASING/SUPPLIERS") + logger.warning( + "Unable to find asset: (development)/RAW/WIDEWORLDIMPORTERS_PURCHASING/SUPPLIERS" + ) if __name__ == "__main__": diff --git a/pyatlan/samples/events/lambda_enforcer.py b/pyatlan/samples/events/lambda_enforcer.py index 1d6511266..87e094580 100644 --- a/pyatlan/samples/events/lambda_enforcer.py +++ b/pyatlan/samples/events/lambda_enforcer.py @@ -25,7 +25,9 @@ "outputFromProcesses", "certificateStatus", ] -ENFORCEMENT_MESSAGE = "To be verified, an asset must have a description, at least one owner, and lineage." +ENFORCEMENT_MESSAGE = ( + "To be verified, an asset must have a description, at least one owner, and lineage." +) logger = logging.getLogger(__name__) client = AtlanClient() @@ -56,7 +58,11 @@ def calculate_changes(self, asset: Asset) -> List[Asset]: """ if asset.certificate_status == CertificateStatus.VERIFIED: - if not has_description(asset) or not has_owner(asset) or not has_lineage(asset): + if ( + not has_description(asset) + or not has_owner(asset) + or not has_lineage(asset) + ): trimmed = asset.trim_to_required() trimmed.certificate_status = CertificateStatus.DRAFT trimmed.certificate_status_message = ENFORCEMENT_MESSAGE diff --git a/pyatlan/samples/events/lambda_scorer.py b/pyatlan/samples/events/lambda_scorer.py index 9420ef662..7fde131df 100644 --- a/pyatlan/samples/events/lambda_scorer.py +++ b/pyatlan/samples/events/lambda_scorer.py @@ -106,7 +106,9 @@ def _create_cm_if_not_exists() -> Optional[str]: try: return CustomMetadataCache.get_id_for_name(CM_DAAP) except NotFoundError: - logger.error("Unable to look up DaaP custom metadata, even though itshould already exist.") + logger.error( + "Unable to look up DaaP custom metadata, even though itshould already exist." + ) except AtlanError: logger.error("Unable to create DaaP custom metadata structure.") except AtlanError: @@ -141,7 +143,9 @@ def get_current_state(self, from_event: Asset) -> Optional[Asset]: """ search_attrs = SCORED_ATTRS - custom_metadata_attrs = CustomMetadataCache.get_attributes_for_search_results(CM_DAAP) + custom_metadata_attrs = CustomMetadataCache.get_attributes_for_search_results( + CM_DAAP + ) if custom_metadata_attrs is not None: search_attrs.extend(custom_metadata_attrs) @@ -172,7 +176,9 @@ def has_changes(self, original: Asset, modified: Asset) -> bool: score_original = cm_original.get(CM_ATTR_DAAP_SCORE) if cm_modified := modified.get_custom_metadata(CM_DAAP): score_modified = cm_modified.get(CM_ATTR_DAAP_SCORE) - logger.info("Existing score = %s, new score = %s", score_original, score_modified) + logger.info( + "Existing score = %s, new score = %s", score_original, score_modified + ) return score_original != score_modified def calculate_changes(self, asset: Asset) -> List[Asset]: @@ -202,7 +208,9 @@ def calculate_changes(self, asset: Asset) -> List[Asset]: s_readme = 0 readme = asset.readme if readme and readme.guid: - readme = client.asset.get_by_guid(readme.guid, asset_type=Readme, ignore_relationships=False) + readme = client.asset.get_by_guid( + readme.guid, asset_type=Readme, ignore_relationships=False + ) if description := readme.description: if len(description) > 1000: s_readme = 20 @@ -210,7 +218,14 @@ def calculate_changes(self, asset: Asset) -> List[Asset]: s_readme = 10 elif len(description) > 100: s_readme = 5 - score = s_description + s_related_term + s_links + s_related_asset + s_certificate + s_readme + score = ( + s_description + + s_related_term + + s_links + + s_related_asset + + s_certificate + + s_readme + ) elif not asset.type_name.startswith("AtlasGlossary"): # We will not score glossaries or categories s_description = 15 if has_description(asset) else 0 diff --git a/pyatlan/samples/search/and_star_assets.py b/pyatlan/samples/search/and_star_assets.py index 0f82f6a8a..6bec5f245 100644 --- a/pyatlan/samples/search/and_star_assets.py +++ b/pyatlan/samples/search/and_star_assets.py @@ -46,9 +46,15 @@ def list_users_in_group(name: str) -> List[str]: """ usernames: List[str] = [] if groups := client.group.get_by_name(alias=name): - if groups[0].id is not None and (response := client.group.get_members(guid=groups[0].id)): + if groups[0].id is not None and ( + response := client.group.get_members(guid=groups[0].id) + ): if response.records and len(response.records) > 0: - usernames.extend(str(user.username) for user in response.records if user.username is not None) + usernames.extend( + str(user.username) + for user in response.records + if user.username is not None + ) return usernames @@ -68,12 +74,16 @@ def star_asset(asset: Asset, usernames: List[str]) -> None: if user not in starred_by: starred_by.add(user) starred_count += 1 - starred_details_list.append(StarredDetails(asset_starred_by=user, asset_starred_at=datetime.now())) + starred_details_list.append( + StarredDetails(asset_starred_by=user, asset_starred_at=datetime.now()) + ) to_update = asset.trim_to_required() to_update.starred_details_list = starred_details_list to_update.starred_count = starred_count to_update.starred_by = starred_by - logger.info("Updating '%s' (%s) with total stars: %s", asset.name, asset.guid, starred_count) + logger.info( + "Updating '%s' (%s) with total stars: %s", asset.name, asset.guid, starred_count + ) client.asset.save(to_update) diff --git a/pyatlan/samples/search/and_traverse_lineage.py b/pyatlan/samples/search/and_traverse_lineage.py index c189f02ef..9297f640a 100644 --- a/pyatlan/samples/search/and_traverse_lineage.py +++ b/pyatlan/samples/search/and_traverse_lineage.py @@ -27,7 +27,10 @@ def find_all(asset_type: type) -> IndexSearchResults: :returns: results of the search """ search_request = ( - FluentSearch().where(FluentSearch.asset_type(asset_type)).where(FluentSearch.active_assets()).page_size(100) + FluentSearch() + .where(FluentSearch.asset_type(asset_type)) + .where(FluentSearch.active_assets()) + .page_size(100) ).to_request() return client.asset.search(search_request) @@ -63,7 +66,9 @@ def upstream_certified_sources(guid: str) -> List[Asset]: ) # type: ignore[call-arg] response = client.asset.get_lineage_list(request) verified_assets: List[Asset] = [ - asset for asset in response if asset.type_name in {"Table", "View", "MaterialisedView"} + asset + for asset in response + if asset.type_name in {"Table", "View", "MaterialisedView"} ] return verified_assets diff --git a/pyatlan/test_utils/__init__.py b/pyatlan/test_utils/__init__.py index d8351772b..f040d858d 100644 --- a/pyatlan/test_utils/__init__.py +++ b/pyatlan/test_utils/__init__.py @@ -55,7 +55,11 @@ def delete_token(client: AtlanClient, token: Optional[ApiToken] = None): if not token: tokens = client.token.get().records assert tokens # noqa: S101 - delete_tokens = [token for token in tokens if token.display_name and "psdk_Requests" in token.display_name] + delete_tokens = [ + token + for token in tokens + if token.display_name and "psdk_Requests" in token.display_name + ] for token in delete_tokens: assert token and token.guid # noqa: S101 client.token.purge(token.guid) @@ -69,7 +73,11 @@ def save_with_purge(client: AtlanClient): def _save(asset: Asset) -> AssetMutationResponse: _response = client.asset.save(asset) - if _response and _response.mutated_entities and _response.mutated_entities.CREATE: + if ( + _response + and _response.mutated_entities + and _response.mutated_entities.CREATE + ): guids.append(_response.mutated_entities.CREATE[0].guid) return _response @@ -77,7 +85,11 @@ def _save(asset: Asset) -> AssetMutationResponse: for guid in reversed(guids): response = client.asset.purge_by_guid(guid) - if not response or not response.mutated_entities or not response.mutated_entities.DELETE: + if ( + not response + or not response.mutated_entities + or not response.mutated_entities.DELETE + ): LOGGER.error(f"Failed to remove asset with GUID {guid}.") @@ -91,12 +103,18 @@ def delete_asset(client: AtlanClient, asset_type: Type[A], guid: str) -> None: LOGGER.error(f"Failed to remove {asset_type} with GUID {guid}.") -def create_connection(client: AtlanClient, name: str, connector_type: AtlanConnectorType) -> Connection: +def create_connection( + client: AtlanClient, name: str, connector_type: AtlanConnectorType +) -> Connection: admin_role_guid = str(RoleCache.get_id_for_name("$admin")) - to_create = Connection.create(name=name, connector_type=connector_type, admin_roles=[admin_role_guid]) + to_create = Connection.create( + name=name, connector_type=connector_type, admin_roles=[admin_role_guid] + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=Connection)[0] - return client.asset.get_by_guid(result.guid, asset_type=Connection, ignore_relationships=False) + return client.asset.get_by_guid( + result.guid, asset_type=Connection, ignore_relationships=False + ) def create_group(client: AtlanClient, name: str) -> CreateGroupResponse: @@ -117,7 +135,9 @@ def create_category( glossary: AtlasGlossary, parent: Optional[AtlasGlossaryCategory] = None, ) -> AtlasGlossaryCategory: - c = AtlasGlossaryCategory.create(name=name, anchor=glossary, parent_category=parent or None) + c = AtlasGlossaryCategory.create( + name=name, anchor=glossary, parent_category=parent or None + ) return client.asset.save(c).assets_created(AtlasGlossaryCategory)[0] @@ -137,19 +157,25 @@ def create_term( def create_database(client: AtlanClient, database_name: str, connection: Connection): - to_create = Database.create(name=database_name, connection_qualified_name=connection.qualified_name) + to_create = Database.create( + name=database_name, connection_qualified_name=connection.qualified_name + ) result = client.asset.save(to_create) return result.assets_created(asset_type=Database)[0] def create_schema(client: AtlanClient, schema_name: str, database: Database): - to_create = Schema.create(name=schema_name, connection_qualified_name=database.qualified_name) + to_create = Schema.create( + name=schema_name, connection_qualified_name=database.qualified_name + ) result = client.asset.save(to_create) return result.assets_created(asset_type=Schema)[0] def create_table(client: AtlanClient, table_name: str, schema: Schema): - to_create = Table.create(name=table_name, schema_qualified_name=schema.qualified_name) + to_create = Table.create( + name=table_name, schema_qualified_name=schema.qualified_name + ) result = client.asset.save(to_create) return result.assets_created(asset_type=Table)[0] @@ -161,12 +187,16 @@ def create_view(client: AtlanClient, view_name: str, schema: Schema): def create_mview(client: AtlanClient, mview_name: str, schema: Schema): - to_create = MaterialisedView.create(name=mview_name, schema_qualified_name=schema.qualified_name) + to_create = MaterialisedView.create( + name=mview_name, schema_qualified_name=schema.qualified_name + ) result = client.asset.save(to_create) return result.assets_created(asset_type=MaterialisedView)[0] -def create_column(client: AtlanClient, column_name: str, parent_type: type, parent: Asset, order: int): +def create_column( + client: AtlanClient, column_name: str, parent_type: type, parent: Asset, order: int +): to_create = Column.create( name=column_name, parent_type=parent_type, @@ -189,13 +219,17 @@ def create_custom_metadata( cm_def = CustomMetadataDef.create(display_name=name) cm_def.attribute_defs = attribute_defs if icon and color: - cm_def.options = CustomMetadataDef.Options.with_logo_from_icon(icon, color, locked) + cm_def.options = CustomMetadataDef.Options.with_logo_from_icon( + icon, color, locked + ) elif logo and logo.startswith("http"): cm_def.options = CustomMetadataDef.Options.with_logo_from_url(logo, locked) elif logo: cm_def.options = CustomMetadataDef.Options.with_logo_as_emoji(logo, locked) else: - raise ValueError("Invalid configuration for the visual to use for the custom metadata.") + raise ValueError( + "Invalid configuration for the visual to use for the custom metadata." + ) r = client.typedef.create(cm_def) return r.custom_metadata_defs[0] diff --git a/pyatlan/utils.py b/pyatlan/utils.py index f08cf9c57..fe55d6b37 100644 --- a/pyatlan/utils.py +++ b/pyatlan/utils.py @@ -58,7 +58,9 @@ def get_parent_qualified_name(qualified_name: str) -> str: return "/".join(qn[:-1]) -def list_attributes_to_params(attributes_list: list, query_params: Optional[dict] = None) -> dict: +def list_attributes_to_params( + attributes_list: list, query_params: Optional[dict] = None +) -> dict: if query_params is None: query_params = {} @@ -70,7 +72,9 @@ def list_attributes_to_params(attributes_list: list, query_params: Optional[dict return query_params -def attributes_to_params(attributes: List[tuple[str, object]], query_params: Optional[dict] = None) -> dict: +def attributes_to_params( + attributes: List[tuple[str, object]], query_params: Optional[dict] = None +) -> dict: if query_params is None: query_params = {} @@ -108,15 +112,27 @@ def type_coerce(obj, obj_type): def type_coerce_list(obj, obj_type): - return [type_coerce(entry, obj_type) for entry in obj] if isinstance(obj, list) else None + return ( + [type_coerce(entry, obj_type) for entry in obj] + if isinstance(obj, list) + else None + ) def type_coerce_dict(obj, obj_type): - return {k: type_coerce(v, obj_type) for k, v in obj.items()} if isinstance(obj, dict) else None + return ( + {k: type_coerce(v, obj_type) for k, v in obj.items()} + if isinstance(obj, dict) + else None + ) def type_coerce_dict_list(obj, obj_type): - return {k: type_coerce_list(v, obj_type) for k, v in obj.items()} if isinstance(obj, dict) else None + return ( + {k: type_coerce_list(v, obj_type) for k, v in obj.items()} + if isinstance(obj, dict) + else None + ) def validate_required_fields(field_names: List[str], values: List[Any]): @@ -229,8 +245,12 @@ def unflatten_custom_metadata( return retval -def unflatten_custom_metadata_for_entity(entity: Dict[str, Any], attributes: Optional[List[str]]): - if custom_metadata := unflatten_custom_metadata(attributes=attributes, asset_attributes=entity.get("attributes")): +def unflatten_custom_metadata_for_entity( + entity: Dict[str, Any], attributes: Optional[List[str]] +): + if custom_metadata := unflatten_custom_metadata( + attributes=attributes, asset_attributes=entity.get("attributes") + ): entity["businessAttributes"] = custom_metadata @@ -266,7 +286,9 @@ def _get_embedded_type(attribute_type: str): def get_base_type(attribute_type: str): base_type = attribute_type if "<" in attribute_type: - if attribute_type.startswith("array<") and attribute_type.startswith("array 1 else type_names[0] + type_name = ( + ", ".join(type_names[:-1]) + f" or {type_names[-1]}" + if len(type_names) > 1 + else type_names[0] + ) else: type_name = _type.__name__ if _type is not None else "None" @@ -324,7 +350,11 @@ def filter(self, record: logging.LogRecord) -> bool: record.args["access_token"] = "***REDACTED***" # noqa: S105 elif record.args and hasattr(record.args, "__iter__"): for arg in record.args: - if isinstance(arg, dict) and "headers" in arg and "authorization" in arg["headers"]: + if ( + isinstance(arg, dict) + and "headers" in arg + and "authorization" in arg["headers"] + ): arg["headers"]["authorization"] = "***REDACTED***" return True @@ -346,7 +376,9 @@ def format(self, record: logging.LogRecord) -> str: "asctime": self.formatTime(record, self.datefmt), "name": record.name, "levelname": record.levelname, - "message": (record.msg if isinstance(record.msg, dict) else record.getMessage()), + "message": ( + record.msg if isinstance(record.msg, dict) else record.getMessage() + ), } return json.dumps(log_record, ensure_ascii=False) @@ -407,7 +439,9 @@ def __init__(self, logger: logging.Logger, contextvar: ContextVar): :param contextvar: the ContextVar from which to obtain the value to be used for 'requestid' """ - super().__init__(logger, ContextVarWrapper(contextvar=contextvar, key_name=REQUESTID)) + super().__init__( + logger, ContextVarWrapper(contextvar=contextvar, key_name=REQUESTID) + ) def process(self, msg, kwargs): return f"[{self.extra['requestid']}] {msg}", kwargs @@ -416,7 +450,11 @@ def process(self, msg, kwargs): def validate_single_required_field(field_names: List[str], values: List[Any]): indexes = [idx for idx, value in enumerate(values) if value is not None] if not indexes: - raise ValueError(f"One of the following parameters are required: {', '.join(field_names)}") + raise ValueError( + f"One of the following parameters are required: {', '.join(field_names)}" + ) if len(indexes) > 1: names = [field_names[idx] for idx in indexes] - raise ValueError(f"Only one of the following parameters are allowed: {', '.join(names)}") + raise ValueError( + f"Only one of the following parameters are allowed: {', '.join(names)}" + ) diff --git a/setup.py b/setup.py index 286edfc44..8b1397616 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,9 @@ def read(file_name): """Read a text file and return the content as a string.""" - with io.open(os.path.join(os.path.dirname(__file__), file_name), encoding="utf-8") as f: + with io.open( + os.path.join(os.path.dirname(__file__), file_name), encoding="utf-8" + ) as f: return f.read() diff --git a/tests/integration/adls_asset_test.py b/tests/integration/adls_asset_test.py index c62920319..1644946f1 100644 --- a/tests/integration/adls_asset_test.py +++ b/tests/integration/adls_asset_test.py @@ -33,15 +33,21 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def adls_account(client: AtlanClient, connection: Connection) -> Generator[ADLSAccount, None, None]: +def adls_account( + client: AtlanClient, connection: Connection +) -> Generator[ADLSAccount, None, None]: assert connection.qualified_name - to_create = ADLSAccount.create(name=ADLS_ACCOUNT_NAME, connection_qualified_name=connection.qualified_name) + to_create = ADLSAccount.create( + name=ADLS_ACCOUNT_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=ADLSAccount)[0] yield result @@ -62,9 +68,13 @@ def test_adls_account( @pytest.fixture(scope="module") -def adls_container(client: AtlanClient, adls_account: ADLSAccount) -> Generator[ADLSContainer, None, None]: +def adls_container( + client: AtlanClient, adls_account: ADLSAccount +) -> Generator[ADLSContainer, None, None]: assert adls_account.qualified_name - to_create = ADLSContainer.create(name=CONTAINER_NAME, adls_account_qualified_name=adls_account.qualified_name) + to_create = ADLSContainer.create( + name=CONTAINER_NAME, adls_account_qualified_name=adls_account.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=ADLSContainer)[0] yield result @@ -110,14 +120,19 @@ def test_overload_adls_container( assert adls_container_overload assert adls_container_overload.guid assert adls_container_overload.qualified_name - assert adls_container_overload.adls_account_qualified_name == adls_account.qualified_name + assert ( + adls_container_overload.adls_account_qualified_name + == adls_account.qualified_name + ) assert adls_container_overload.adls_account_name == adls_account.name assert adls_container_overload.name == CONTAINER_NAME_OVERLOAD assert adls_container_overload.connector_name == AtlanConnectorType.ADLS.value @pytest.fixture(scope="module") -def adls_object(client: AtlanClient, adls_container: ADLSContainer) -> Generator[ADLSObject, None, None]: +def adls_object( + client: AtlanClient, adls_container: ADLSContainer +) -> Generator[ADLSObject, None, None]: assert adls_container.qualified_name to_create = ADLSObject.create( name=OBJECT_NAME, @@ -162,13 +177,17 @@ def test_overload_adls_object( assert adls_object_overload assert adls_object_overload.guid assert adls_object_overload.qualified_name - assert adls_object_overload.adls_container_qualified_name == adls_container_overload.qualified_name + assert ( + adls_object_overload.adls_container_qualified_name + == adls_container_overload.qualified_name + ) assert adls_object_overload.adls_container_name == adls_container_overload.name assert adls_object_overload.name == OBJECT_NAME_OVERLOAD assert adls_object_overload.connector_name == AtlanConnectorType.ADLS.value assert adls_container_overload.qualified_name - assert adls_object_overload.adls_account_qualified_name == get_parent_qualified_name( - adls_container_overload.qualified_name + assert ( + adls_object_overload.adls_account_qualified_name + == get_parent_qualified_name(adls_container_overload.qualified_name) ) assert adls_object_overload.adls_account_name == adls_account.name @@ -187,7 +206,9 @@ def test_adls_object( assert adls_object.name == OBJECT_NAME assert adls_object.connector_name == AtlanConnectorType.ADLS.value assert adls_container.qualified_name - assert adls_object.adls_account_qualified_name == get_parent_qualified_name(adls_container.qualified_name) + assert adls_object.adls_account_qualified_name == get_parent_qualified_name( + adls_container.qualified_name + ) assert adls_object.adls_account_name == adls_account.name @@ -233,7 +254,9 @@ def test_retrieve_adls_object( adls_container: ADLSContainer, adls_object: ADLSObject, ): - b = client.asset.get_by_guid(adls_object.guid, asset_type=ADLSObject, ignore_relationships=False) + b = client.asset.get_by_guid( + adls_object.guid, asset_type=ADLSObject, ignore_relationships=False + ) assert b assert not b.is_incomplete assert b.guid == adls_object.guid @@ -303,7 +326,9 @@ def test_read_deleted_adls_object( adls_container: ADLSContainer, adls_object: ADLSObject, ): - deleted = client.asset.get_by_guid(adls_object.guid, asset_type=ADLSObject, ignore_relationships=False) + deleted = client.asset.get_by_guid( + adls_object.guid, asset_type=ADLSObject, ignore_relationships=False + ) assert deleted assert deleted.guid == adls_object.guid assert deleted.qualified_name == adls_object.qualified_name @@ -318,7 +343,9 @@ def test_restore_object( adls_object: ADLSObject, ): assert adls_object.qualified_name - assert client.asset.restore(asset_type=ADLSObject, qualified_name=adls_object.qualified_name) + assert client.asset.restore( + asset_type=ADLSObject, qualified_name=adls_object.qualified_name + ) assert adls_object.qualified_name restored = client.asset.get_by_qualified_name( asset_type=ADLSObject, diff --git a/tests/integration/admin_test.py b/tests/integration/admin_test.py index c93f106b8..8f83e6eed 100644 --- a/tests/integration/admin_test.py +++ b/tests/integration/admin_test.py @@ -260,7 +260,11 @@ def test_final_user_state( assert fixed_user assert fixed_user.id response = client.user.get_groups(fixed_user.id) - assert response.records is None or len(response.records) == 0 or len(response.records) == _default_group_count + assert ( + response.records is None + or len(response.records) == 0 + or len(response.records) == _default_group_count + ) @pytest.mark.order(after="test_final_user_state") diff --git a/tests/integration/airflow_asset_test.py b/tests/integration/airflow_asset_test.py index 35f82c397..7dae854cf 100644 --- a/tests/integration/airflow_asset_test.py +++ b/tests/integration/airflow_asset_test.py @@ -31,15 +31,21 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.AIRFLOW) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.AIRFLOW + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def airflow_dag(client: AtlanClient, connection: Connection) -> Generator[AirflowDag, None, None]: +def airflow_dag( + client: AtlanClient, connection: Connection +) -> Generator[AirflowDag, None, None]: assert connection.qualified_name - to_create = AirflowDag.creator(name=AIRFLOW_DAG_NAME, connection_qualified_name=connection.qualified_name) + to_create = AirflowDag.creator( + name=AIRFLOW_DAG_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=AirflowDag)[0] yield result @@ -60,9 +66,13 @@ def test_airflow_dag( @pytest.fixture(scope="module") -def airflow_task(client: AtlanClient, airflow_dag: AirflowDag) -> Generator[AirflowTask, None, None]: +def airflow_task( + client: AtlanClient, airflow_dag: AirflowDag +) -> Generator[AirflowTask, None, None]: assert airflow_dag.qualified_name - to_create = AirflowTask.creator(name=AIRFLOW_TASK_NAME, airflow_dag_qualified_name=airflow_dag.qualified_name) + to_create = AirflowTask.creator( + name=AIRFLOW_TASK_NAME, airflow_dag_qualified_name=airflow_dag.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=AirflowTask)[0] yield result @@ -109,7 +119,9 @@ def test_overload_airflow_task( assert airflow_task_overload.qualified_name assert airflow_task_overload.name == AIRFLOW_TASK_NAME_OVERLOAD assert airflow_task_overload.connector_name == AtlanConnectorType.AIRFLOW - assert airflow_task_overload.airflow_dag_qualified_name == airflow_dag.qualified_name + assert ( + airflow_task_overload.airflow_dag_qualified_name == airflow_dag.qualified_name + ) def _update_cert_and_annoucement(client, asset, asset_type): @@ -153,7 +165,9 @@ def test_update_airflow_assets( def _retrieve_airflow_assets(client, asset, asset_type): - retrieved = client.asset.get_by_guid(asset.guid, asset_type=asset_type, ignore_relationships=False) + retrieved = client.asset.get_by_guid( + asset.guid, asset_type=asset_type, ignore_relationships=False + ) assert retrieved assert not retrieved.is_incomplete assert retrieved.guid == asset.guid @@ -198,7 +212,9 @@ def test_read_deleted_airflow_task( client: AtlanClient, airflow_task: AirflowTask, ): - deleted = client.asset.get_by_guid(airflow_task.guid, asset_type=AirflowTask, ignore_relationships=False) + deleted = client.asset.get_by_guid( + airflow_task.guid, asset_type=AirflowTask, ignore_relationships=False + ) assert deleted assert deleted.status == EntityStatus.DELETED assert deleted.guid == airflow_task.guid @@ -211,7 +227,9 @@ def test_restore_airflow_task( airflow_task: AirflowTask, ): assert airflow_task.qualified_name - assert client.asset.restore(asset_type=AirflowTask, qualified_name=airflow_task.qualified_name) + assert client.asset.restore( + asset_type=AirflowTask, qualified_name=airflow_task.qualified_name + ) assert airflow_task.qualified_name restored = client.asset.get_by_qualified_name( asset_type=AirflowTask, diff --git a/tests/integration/anaplan_asset_test.py b/tests/integration/anaplan_asset_test.py index 0cd357ba4..ff4689626 100644 --- a/tests/integration/anaplan_asset_test.py +++ b/tests/integration/anaplan_asset_test.py @@ -56,13 +56,17 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def anaplan_workspace(client: AtlanClient, connection: Connection) -> Generator[AnaplanWorkspace, None, None]: +def anaplan_workspace( + client: AtlanClient, connection: Connection +) -> Generator[AnaplanWorkspace, None, None]: assert connection.qualified_name to_create = AnaplanWorkspace.creator( name=ANAPLAN_WORKSPACE_NAME, connection_qualified_name=connection.qualified_name @@ -73,7 +77,9 @@ def anaplan_workspace(client: AtlanClient, connection: Connection) -> Generator[ delete_asset(client, guid=result.guid, asset_type=AnaplanWorkspace) -def test_anaplan_workspace(client: AtlanClient, connection: Connection, anaplan_workspace: AnaplanWorkspace): +def test_anaplan_workspace( + client: AtlanClient, connection: Connection, anaplan_workspace: AnaplanWorkspace +): assert anaplan_workspace assert anaplan_workspace.guid assert anaplan_workspace.qualified_name @@ -106,21 +112,29 @@ def test_anaplan_system_dimension( assert anaplan_system_dimension.guid assert anaplan_system_dimension.qualified_name assert anaplan_system_dimension.name == ANAPLAN_SYSTEM_DIMENSION_NAME - assert anaplan_system_dimension.connection_qualified_name == connection.qualified_name + assert ( + anaplan_system_dimension.connection_qualified_name == connection.qualified_name + ) assert anaplan_system_dimension.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_app(client: AtlanClient, connection: Connection) -> Generator[AnaplanApp, None, None]: +def anaplan_app( + client: AtlanClient, connection: Connection +) -> Generator[AnaplanApp, None, None]: assert connection.qualified_name - to_create = AnaplanApp.creator(name=ANAPLAN_APP_NAME, connection_qualified_name=connection.qualified_name) + to_create = AnaplanApp.creator( + name=ANAPLAN_APP_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanApp)[0] yield result delete_asset(client, guid=result.guid, asset_type=AnaplanApp) -def test_anaplan_app(client: AtlanClient, connection: Connection, anaplan_app: AnaplanApp): +def test_anaplan_app( + client: AtlanClient, connection: Connection, anaplan_app: AnaplanApp +): assert anaplan_app assert anaplan_app.guid assert anaplan_app.qualified_name @@ -130,21 +144,29 @@ def test_anaplan_app(client: AtlanClient, connection: Connection, anaplan_app: A @pytest.fixture(scope="module") -def anaplan_page(client: AtlanClient, anaplan_app: AnaplanApp) -> Generator[AnaplanPage, None, None]: +def anaplan_page( + client: AtlanClient, anaplan_app: AnaplanApp +) -> Generator[AnaplanPage, None, None]: assert anaplan_app.qualified_name - to_create = AnaplanPage.creator(name=ANAPLAN_PAGE_NAME, app_qualified_name=anaplan_app.qualified_name) + to_create = AnaplanPage.creator( + name=ANAPLAN_PAGE_NAME, app_qualified_name=anaplan_app.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanPage)[0] yield result delete_asset(client, guid=result.guid, asset_type=AnaplanPage) -def test_anaplan_page(client: AtlanClient, anaplan_app: AnaplanApp, anaplan_page: AnaplanPage): +def test_anaplan_page( + client: AtlanClient, anaplan_app: AnaplanApp, anaplan_page: AnaplanPage +): assert anaplan_page assert anaplan_page.guid assert anaplan_page.qualified_name assert anaplan_page.name == ANAPLAN_PAGE_NAME - assert anaplan_page.connection_qualified_name == anaplan_app.connection_qualified_name + assert ( + anaplan_page.connection_qualified_name == anaplan_app.connection_qualified_name + ) assert anaplan_page.connector_name == AtlanConnectorType.ANAPLAN.value @@ -165,17 +187,24 @@ def anaplan_page_overload( delete_asset(client, guid=result.guid, asset_type=AnaplanPage) -def test_overload_anaplan_page(client: AtlanClient, anaplan_app: AnaplanApp, anaplan_page_overload: AnaplanPage): +def test_overload_anaplan_page( + client: AtlanClient, anaplan_app: AnaplanApp, anaplan_page_overload: AnaplanPage +): assert anaplan_page_overload assert anaplan_page_overload.guid assert anaplan_page_overload.qualified_name assert anaplan_page_overload.name == ANAPLAN_PAGE_NAME_OVERLOAD - assert anaplan_page_overload.connection_qualified_name == anaplan_app.connection_qualified_name + assert ( + anaplan_page_overload.connection_qualified_name + == anaplan_app.connection_qualified_name + ) assert anaplan_page_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_model(client: AtlanClient, anaplan_workspace: AnaplanWorkspace) -> Generator[AnaplanModel, None, None]: +def anaplan_model( + client: AtlanClient, anaplan_workspace: AnaplanWorkspace +) -> Generator[AnaplanModel, None, None]: assert anaplan_workspace.qualified_name to_create = AnaplanModel.creator( name=ANAPLAN_MODEL_NAME, @@ -196,7 +225,10 @@ def test_anaplan_model( assert anaplan_model.guid assert anaplan_model.qualified_name assert anaplan_model.name == ANAPLAN_MODEL_NAME - assert anaplan_model.connection_qualified_name == anaplan_workspace.connection_qualified_name + assert ( + anaplan_model.connection_qualified_name + == anaplan_workspace.connection_qualified_name + ) assert anaplan_model.connector_name == AtlanConnectorType.ANAPLAN.value @@ -226,26 +258,38 @@ def test_overload_anaplan_model( assert anaplan_model_overload.guid assert anaplan_model_overload.qualified_name assert anaplan_model_overload.name == ANAPLAN_MODEL_NAME_OVERLOAD - assert anaplan_model_overload.connection_qualified_name == anaplan_workspace.connection_qualified_name + assert ( + anaplan_model_overload.connection_qualified_name + == anaplan_workspace.connection_qualified_name + ) assert anaplan_model_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_module(client: AtlanClient, anaplan_model: AnaplanModel) -> Generator[AnaplanModule, None, None]: +def anaplan_module( + client: AtlanClient, anaplan_model: AnaplanModel +) -> Generator[AnaplanModule, None, None]: assert anaplan_model.qualified_name - to_create = AnaplanModule.creator(name=ANAPLAN_MODULE_NAME, model_qualified_name=anaplan_model.qualified_name) + to_create = AnaplanModule.creator( + name=ANAPLAN_MODULE_NAME, model_qualified_name=anaplan_model.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanModule)[0] yield result delete_asset(client, guid=result.guid, asset_type=AnaplanModule) -def test_anaplan_module(client: AtlanClient, anaplan_model: AnaplanModel, anaplan_module: AnaplanModule): +def test_anaplan_module( + client: AtlanClient, anaplan_model: AnaplanModel, anaplan_module: AnaplanModule +): assert anaplan_module assert anaplan_module.guid assert anaplan_module.qualified_name assert anaplan_module.name == ANAPLAN_MODULE_NAME - assert anaplan_module.connection_qualified_name == anaplan_model.connection_qualified_name + assert ( + anaplan_module.connection_qualified_name + == anaplan_model.connection_qualified_name + ) assert anaplan_module.connector_name == AtlanConnectorType.ANAPLAN.value @@ -275,26 +319,38 @@ def test_overload_anaplan_module( assert anaplan_module_overload.guid assert anaplan_module_overload.qualified_name assert anaplan_module_overload.name == ANAPLAN_MODULE_NAME_OVERLOAD - assert anaplan_module_overload.connection_qualified_name == anaplan_model.connection_qualified_name + assert ( + anaplan_module_overload.connection_qualified_name + == anaplan_model.connection_qualified_name + ) assert anaplan_module_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_list(client: AtlanClient, anaplan_model: AnaplanModel) -> Generator[AnaplanList, None, None]: +def anaplan_list( + client: AtlanClient, anaplan_model: AnaplanModel +) -> Generator[AnaplanList, None, None]: assert anaplan_model.qualified_name - to_create = AnaplanList.creator(name=ANAPLAN_LIST_NAME, model_qualified_name=anaplan_model.qualified_name) + to_create = AnaplanList.creator( + name=ANAPLAN_LIST_NAME, model_qualified_name=anaplan_model.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanList)[0] yield result delete_asset(client, guid=result.guid, asset_type=AnaplanList) -def test_anaplan_list(client: AtlanClient, anaplan_model: AnaplanModel, anaplan_list: AnaplanList): +def test_anaplan_list( + client: AtlanClient, anaplan_model: AnaplanModel, anaplan_list: AnaplanList +): assert anaplan_list assert anaplan_list.guid assert anaplan_list.qualified_name assert anaplan_list.name == ANAPLAN_LIST_NAME - assert anaplan_list.connection_qualified_name == anaplan_model.connection_qualified_name + assert ( + anaplan_list.connection_qualified_name + == anaplan_model.connection_qualified_name + ) assert anaplan_list.connector_name == AtlanConnectorType.ANAPLAN.value @@ -315,19 +371,28 @@ def anaplan_list_overload( delete_asset(client, guid=result.guid, asset_type=AnaplanList) -def test_overload_anaplan_list(client: AtlanClient, anaplan_model: AnaplanModel, anaplan_list_overload: AnaplanList): +def test_overload_anaplan_list( + client: AtlanClient, anaplan_model: AnaplanModel, anaplan_list_overload: AnaplanList +): assert anaplan_list_overload assert anaplan_list_overload.guid assert anaplan_list_overload.qualified_name assert anaplan_list_overload.name == ANAPLAN_LIST_NAME_OVERLOAD - assert anaplan_list_overload.connection_qualified_name == anaplan_model.connection_qualified_name + assert ( + anaplan_list_overload.connection_qualified_name + == anaplan_model.connection_qualified_name + ) assert anaplan_list_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_dimension(client: AtlanClient, anaplan_model: AnaplanModel) -> Generator[AnaplanDimension, None, None]: +def anaplan_dimension( + client: AtlanClient, anaplan_model: AnaplanModel +) -> Generator[AnaplanDimension, None, None]: assert anaplan_model.qualified_name - to_create = AnaplanDimension.creator(name=ANAPLAN_DIMENSION_NAME, model_qualified_name=anaplan_model.qualified_name) + to_create = AnaplanDimension.creator( + name=ANAPLAN_DIMENSION_NAME, model_qualified_name=anaplan_model.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanDimension)[0] yield result @@ -343,7 +408,10 @@ def test_anaplan_dimension( assert anaplan_dimension.guid assert anaplan_dimension.qualified_name assert anaplan_dimension.name == ANAPLAN_DIMENSION_NAME - assert anaplan_dimension.connection_qualified_name == anaplan_model.connection_qualified_name + assert ( + anaplan_dimension.connection_qualified_name + == anaplan_model.connection_qualified_name + ) assert anaplan_dimension.connector_name == AtlanConnectorType.ANAPLAN.value @@ -373,14 +441,21 @@ def test_overload_anaplan_dimension( assert anaplan_dimension_overload.guid assert anaplan_dimension_overload.qualified_name assert anaplan_dimension_overload.name == ANAPLAN_DIMENSION_NAME_OVERLOAD - assert anaplan_dimension_overload.connection_qualified_name == anaplan_model.connection_qualified_name + assert ( + anaplan_dimension_overload.connection_qualified_name + == anaplan_model.connection_qualified_name + ) assert anaplan_dimension_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_lineitem(client: AtlanClient, anaplan_module: AnaplanModule) -> Generator[AnaplanLineItem, None, None]: +def anaplan_lineitem( + client: AtlanClient, anaplan_module: AnaplanModule +) -> Generator[AnaplanLineItem, None, None]: assert anaplan_module.qualified_name - to_create = AnaplanLineItem.creator(name=ANAPLAN_LINEITEM_NAME, module_qualified_name=anaplan_module.qualified_name) + to_create = AnaplanLineItem.creator( + name=ANAPLAN_LINEITEM_NAME, module_qualified_name=anaplan_module.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanLineItem)[0] yield result @@ -396,7 +471,10 @@ def test_anaplan_lineitem( assert anaplan_lineitem.guid assert anaplan_lineitem.qualified_name assert anaplan_lineitem.name == ANAPLAN_LINEITEM_NAME - assert anaplan_lineitem.connection_qualified_name == anaplan_module.connection_qualified_name + assert ( + anaplan_lineitem.connection_qualified_name + == anaplan_module.connection_qualified_name + ) assert anaplan_lineitem.connector_name == AtlanConnectorType.ANAPLAN.value @@ -426,26 +504,38 @@ def test_overload_anaplan_lineitem( assert anaplan_lineitem_overload.guid assert anaplan_lineitem_overload.qualified_name assert anaplan_lineitem_overload.name == ANAPLAN_LINEITEM_NAME_OVERLOAD - assert anaplan_lineitem_overload.connection_qualified_name == anaplan_module.connection_qualified_name + assert ( + anaplan_lineitem_overload.connection_qualified_name + == anaplan_module.connection_qualified_name + ) assert anaplan_lineitem_overload.connector_name == AtlanConnectorType.ANAPLAN.value @pytest.fixture(scope="module") -def anaplan_view(client: AtlanClient, anaplan_module: AnaplanModule) -> Generator[AnaplanView, None, None]: +def anaplan_view( + client: AtlanClient, anaplan_module: AnaplanModule +) -> Generator[AnaplanView, None, None]: assert anaplan_module.qualified_name - to_create = AnaplanView.creator(name=ANAPLAN_VIEW_NAME, module_qualified_name=anaplan_module.qualified_name) + to_create = AnaplanView.creator( + name=ANAPLAN_VIEW_NAME, module_qualified_name=anaplan_module.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=AnaplanView)[0] yield result delete_asset(client, guid=result.guid, asset_type=AnaplanView) -def test_anaplan_view(client: AtlanClient, anaplan_module: AnaplanModule, anaplan_view: AnaplanView): +def test_anaplan_view( + client: AtlanClient, anaplan_module: AnaplanModule, anaplan_view: AnaplanView +): assert anaplan_view assert anaplan_view.guid assert anaplan_view.qualified_name assert anaplan_view.name == ANAPLAN_VIEW_NAME - assert anaplan_view.connection_qualified_name == anaplan_module.connection_qualified_name + assert ( + anaplan_view.connection_qualified_name + == anaplan_module.connection_qualified_name + ) assert anaplan_view.connector_name == AtlanConnectorType.ANAPLAN.value @@ -475,7 +565,10 @@ def test_overload_anaplan_view( assert anaplan_view_overload.guid assert anaplan_view_overload.qualified_name assert anaplan_view_overload.name == ANAPLAN_VIEW_NAME_OVERLOAD - assert anaplan_view_overload.connection_qualified_name == anaplan_module.connection_qualified_name + assert ( + anaplan_view_overload.connection_qualified_name + == anaplan_module.connection_qualified_name + ) assert anaplan_view_overload.connector_name == AtlanConnectorType.ANAPLAN.value @@ -608,9 +701,13 @@ def test_restore_anaplan_view( anaplan_view: AnaplanView, ): assert anaplan_view.qualified_name - assert client.asset.restore(asset_type=AnaplanView, qualified_name=anaplan_view.qualified_name) + assert client.asset.restore( + asset_type=AnaplanView, qualified_name=anaplan_view.qualified_name + ) assert anaplan_view.qualified_name - restored = client.asset.get_by_qualified_name(asset_type=AnaplanView, qualified_name=anaplan_view.qualified_name) + restored = client.asset.get_by_qualified_name( + asset_type=AnaplanView, qualified_name=anaplan_view.qualified_name + ) assert restored assert restored.guid == anaplan_view.guid assert restored.qualified_name == anaplan_view.qualified_name diff --git a/tests/integration/api_asset_test.py b/tests/integration/api_asset_test.py index cd449d4a6..b5471c5f4 100644 --- a/tests/integration/api_asset_test.py +++ b/tests/integration/api_asset_test.py @@ -60,15 +60,21 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def api_spec(client: AtlanClient, connection: Connection) -> Generator[APISpec, None, None]: +def api_spec( + client: AtlanClient, connection: Connection +) -> Generator[APISpec, None, None]: assert connection.qualified_name - to_create = APISpec.create(name=API_SPEC_NAME, connection_qualified_name=connection.qualified_name) + to_create = APISpec.create( + name=API_SPEC_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=APISpec)[0] yield result @@ -109,7 +115,9 @@ def test_api_path(client: AtlanClient, api_spec: APISpec, api_path: APIPath): @pytest.fixture(scope="module") -def api_path_overload(client: AtlanClient, api_spec: APISpec) -> Generator[APIPath, None, None]: +def api_path_overload( + client: AtlanClient, api_spec: APISpec +) -> Generator[APIPath, None, None]: assert api_spec.qualified_name to_create = APIPath.creator( path_raw_uri=API_PATH_RAW_URI_OVERLOAD, @@ -121,19 +129,26 @@ def api_path_overload(client: AtlanClient, api_spec: APISpec) -> Generator[APIPa delete_asset(client, guid=result.guid, asset_type=APIPath) -def test_overload_api_path(client: AtlanClient, api_spec: APISpec, api_path_overload: APIPath): +def test_overload_api_path( + client: AtlanClient, api_spec: APISpec, api_path_overload: APIPath +): assert api_path_overload assert api_path_overload.guid assert api_path_overload.qualified_name assert api_path_overload.api_spec_qualified_name assert api_path_overload.api_path_raw_u_r_i == API_PATH_RAW_URI_OVERLOAD assert api_path_overload.name == API_PATH_NAME_OVERLOAD - assert api_path_overload.connection_qualified_name == api_spec.connection_qualified_name + assert ( + api_path_overload.connection_qualified_name + == api_spec.connection_qualified_name + ) assert api_path_overload.connector_name == AtlanConnectorType.API.value # here -def test_update_api_path(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): +def test_update_api_path( + client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath +): assert api_path.qualified_name assert api_path.name updated = client.asset.update_certificate( @@ -164,8 +179,12 @@ def test_update_api_path(client: AtlanClient, connection: Connection, api_spec: @pytest.mark.order(after="test_update_api_path") -def test_retrieve_api_path(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): - b = client.asset.get_by_guid(api_path.guid, asset_type=APIPath, ignore_relationships=False) +def test_retrieve_api_path( + client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath +): + b = client.asset.get_by_guid( + api_path.guid, asset_type=APIPath, ignore_relationships=False + ) assert b assert not b.is_incomplete assert b.guid == api_path.guid @@ -179,7 +198,9 @@ def test_retrieve_api_path(client: AtlanClient, connection: Connection, api_spec @pytest.mark.order(after="test_retrieve_api_path") -def test_update_api_path_again(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): +def test_update_api_path_again( + client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath +): assert api_path.qualified_name assert api_path.name updated = client.asset.remove_certificate( @@ -206,7 +227,9 @@ def test_update_api_path_again(client: AtlanClient, connection: Connection, api_ @pytest.mark.order(after="test_update_api_path_again") -def test_delete_api_path(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): +def test_delete_api_path( + client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath +): response = client.asset.delete_by_guid(api_path.guid) assert response assert not response.assets_created(asset_type=APIPath) @@ -221,8 +244,12 @@ def test_delete_api_path(client: AtlanClient, connection: Connection, api_spec: @pytest.mark.order(after="test_delete_api_path") -def test_read_deleted_api_path(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): - deleted = client.asset.get_by_guid(api_path.guid, asset_type=APIPath, ignore_relationships=False) +def test_read_deleted_api_path( + client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath +): + deleted = client.asset.get_by_guid( + api_path.guid, asset_type=APIPath, ignore_relationships=False + ) assert deleted assert deleted.guid == api_path.guid assert deleted.qualified_name == api_path.qualified_name @@ -230,9 +257,13 @@ def test_read_deleted_api_path(client: AtlanClient, connection: Connection, api_ @pytest.mark.order(after="test_read_deleted_api_path") -def test_restore_path(client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath): +def test_restore_path( + client: AtlanClient, connection: Connection, api_spec: APISpec, api_path: APIPath +): assert api_path.qualified_name - assert client.asset.restore(asset_type=APIPath, qualified_name=api_path.qualified_name) + assert client.asset.restore( + asset_type=APIPath, qualified_name=api_path.qualified_name + ) assert api_path.qualified_name restored = client.asset.get_by_qualified_name( asset_type=APIPath, @@ -246,9 +277,13 @@ def test_restore_path(client: AtlanClient, connection: Connection, api_spec: API @pytest.fixture(scope="module") -def api_object(client: AtlanClient, connection: Connection) -> Generator[APIObject, None, None]: +def api_object( + client: AtlanClient, connection: Connection +) -> Generator[APIObject, None, None]: assert connection.qualified_name - to_create = APIObject.creator(name=API_OBJECT_NAME, connection_qualified_name=connection.qualified_name) + to_create = APIObject.creator( + name=API_OBJECT_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=APIObject)[0] yield result @@ -265,7 +300,9 @@ def test_api_object(client: AtlanClient, connection: Connection, api_object: API @pytest.fixture(scope="module") -def api_object_overload(client: AtlanClient, connection: Connection) -> Generator[APIObject, None, None]: +def api_object_overload( + client: AtlanClient, connection: Connection +) -> Generator[APIObject, None, None]: assert connection.qualified_name to_create = APIObject.creator( name=API_OBJECT_OVERLOAD_NAME, @@ -278,17 +315,24 @@ def api_object_overload(client: AtlanClient, connection: Connection) -> Generato delete_asset(client, guid=result.guid, asset_type=APIObject) -def test_api_object_overload(client: AtlanClient, connection: Connection, api_object_overload: APIObject): +def test_api_object_overload( + client: AtlanClient, connection: Connection, api_object_overload: APIObject +): assert api_object_overload assert api_object_overload.guid - assert api_object_overload.qualified_name == f"{connection.qualified_name}/{API_OBJECT_OVERLOAD_NAME}" + assert ( + api_object_overload.qualified_name + == f"{connection.qualified_name}/{API_OBJECT_OVERLOAD_NAME}" + ) assert api_object_overload.name == API_OBJECT_OVERLOAD_NAME assert api_object_overload.connection_qualified_name == connection.qualified_name assert api_object_overload.api_field_count == API_OBJECT_FIELD_COUNT assert api_object_overload.connector_name == AtlanConnectorType.API.value -def test_update_api_object(client: AtlanClient, connection: Connection, api_object_overload: APIObject): +def test_update_api_object( + client: AtlanClient, connection: Connection, api_object_overload: APIObject +): assert api_object_overload.qualified_name assert api_object_overload.name updated = client.asset.update_certificate( @@ -319,8 +363,12 @@ def test_update_api_object(client: AtlanClient, connection: Connection, api_obje @pytest.mark.order(after="test_update_api_object") -def test_retrieve_api_object(client: AtlanClient, connection: Connection, api_object_overload: APIObject): - b = client.asset.get_by_guid(api_object_overload.guid, asset_type=APIObject, ignore_relationships=False) +def test_retrieve_api_object( + client: AtlanClient, connection: Connection, api_object_overload: APIObject +): + b = client.asset.get_by_guid( + api_object_overload.guid, asset_type=APIObject, ignore_relationships=False + ) assert b assert not b.is_incomplete assert b.guid == api_object_overload.guid @@ -333,7 +381,9 @@ def test_retrieve_api_object(client: AtlanClient, connection: Connection, api_ob @pytest.mark.order(after="test_retrieve_api_object") -def test_delete_api_object(client: AtlanClient, connection: Connection, api_object_overload: APIObject): +def test_delete_api_object( + client: AtlanClient, connection: Connection, api_object_overload: APIObject +): response = client.asset.delete_by_guid(api_object_overload.guid) assert response assert not response.assets_created(asset_type=APIObject) @@ -348,8 +398,12 @@ def test_delete_api_object(client: AtlanClient, connection: Connection, api_obje @pytest.mark.order(after="test_delete_api_object") -def test_read_deleted_api_object(client: AtlanClient, connection: Connection, api_object_overload: APIObject): - deleted = client.asset.get_by_guid(api_object_overload.guid, asset_type=APIObject, ignore_relationships=False) +def test_read_deleted_api_object( + client: AtlanClient, connection: Connection, api_object_overload: APIObject +): + deleted = client.asset.get_by_guid( + api_object_overload.guid, asset_type=APIObject, ignore_relationships=False + ) assert deleted assert deleted.guid == api_object_overload.guid assert deleted.qualified_name == api_object_overload.qualified_name @@ -357,9 +411,13 @@ def test_read_deleted_api_object(client: AtlanClient, connection: Connection, ap @pytest.mark.order(after="test_read_deleted_api_object") -def test_restore_object(client: AtlanClient, connection: Connection, api_object_overload: APIObject): +def test_restore_object( + client: AtlanClient, connection: Connection, api_object_overload: APIObject +): assert api_object_overload.qualified_name - assert client.asset.restore(asset_type=APIObject, qualified_name=api_object_overload.qualified_name) + assert client.asset.restore( + asset_type=APIObject, qualified_name=api_object_overload.qualified_name + ) assert api_object_overload.qualified_name restored = client.asset.get_by_qualified_name( asset_type=APIObject, @@ -373,9 +431,13 @@ def test_restore_object(client: AtlanClient, connection: Connection, api_object_ @pytest.fixture(scope="module") -def api_query(client: AtlanClient, connection: Connection) -> Generator[APIQuery, None, None]: +def api_query( + client: AtlanClient, connection: Connection +) -> Generator[APIQuery, None, None]: assert connection.qualified_name - to_create = APIQuery.creator(name=API_QUERY_NAME, connection_qualified_name=connection.qualified_name) + to_create = APIQuery.creator( + name=API_QUERY_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=APIQuery)[0] yield result @@ -392,7 +454,9 @@ def test_api_query(client: AtlanClient, connection: Connection, api_query: APIQu @pytest.fixture(scope="module") -def api_query_overload_1(client: AtlanClient, connection: Connection) -> Generator[APIQuery, None, None]: +def api_query_overload_1( + client: AtlanClient, connection: Connection +) -> Generator[APIQuery, None, None]: assert connection.qualified_name to_create = APIQuery.creator( name=API_QUERY_OVERLOAD_1_NAME, @@ -405,10 +469,15 @@ def api_query_overload_1(client: AtlanClient, connection: Connection) -> Generat delete_asset(client, guid=result.guid, asset_type=APIQuery) -def test_api_query_overload_1(client: AtlanClient, connection: Connection, api_query_overload_1: APIQuery): +def test_api_query_overload_1( + client: AtlanClient, connection: Connection, api_query_overload_1: APIQuery +): assert api_query_overload_1 assert api_query_overload_1.guid - assert api_query_overload_1.qualified_name == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_1_NAME}" + assert ( + api_query_overload_1.qualified_name + == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_1_NAME}" + ) assert api_query_overload_1.name == API_QUERY_OVERLOAD_1_NAME assert api_query_overload_1.connection_qualified_name == connection.qualified_name assert api_query_overload_1.api_input_field_count == API_QUERY_INPUT_FIELD_COUNT @@ -416,7 +485,9 @@ def test_api_query_overload_1(client: AtlanClient, connection: Connection, api_q @pytest.fixture(scope="module") -def api_query_overload_2(client: AtlanClient, connection: Connection) -> Generator[APIQuery, None, None]: +def api_query_overload_2( + client: AtlanClient, connection: Connection +) -> Generator[APIQuery, None, None]: assert connection.qualified_name to_create = APIQuery.creator( name=API_QUERY_OVERLOAD_2_NAME, @@ -431,15 +502,23 @@ def api_query_overload_2(client: AtlanClient, connection: Connection) -> Generat delete_asset(client, guid=result.guid, asset_type=APIQuery) -def test_api_query_overload_2(client: AtlanClient, connection: Connection, api_query_overload_2: APIQuery): +def test_api_query_overload_2( + client: AtlanClient, connection: Connection, api_query_overload_2: APIQuery +): assert api_query_overload_2 assert api_query_overload_2.guid - assert api_query_overload_2.qualified_name == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_2_NAME}" + assert ( + api_query_overload_2.qualified_name + == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_2_NAME}" + ) assert api_query_overload_2.name == API_QUERY_OVERLOAD_2_NAME assert api_query_overload_2.connection_qualified_name == connection.qualified_name assert api_query_overload_2.api_input_field_count == API_QUERY_INPUT_FIELD_COUNT assert api_query_overload_2.api_query_output_type == API_QUERY_OUTPUT_TYPE - assert api_query_overload_2.api_query_output_type_secondary == API_QUERY_OUTPUT_TYPE_SECONDARY + assert ( + api_query_overload_2.api_query_output_type_secondary + == API_QUERY_OUTPUT_TYPE_SECONDARY + ) assert api_query_overload_2.connector_name == AtlanConnectorType.API.value @@ -472,18 +551,26 @@ def test_api_query_overload_3( ): assert api_query_overload_3 assert api_query_overload_3.guid - assert api_query_overload_3.qualified_name == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_3_NAME}" + assert ( + api_query_overload_3.qualified_name + == f"{connection.qualified_name}/{API_QUERY_OVERLOAD_3_NAME}" + ) assert api_query_overload_3.name == API_QUERY_OVERLOAD_3_NAME assert api_query_overload_3.connection_qualified_name == connection.qualified_name assert api_query_overload_3.api_input_field_count == API_QUERY_INPUT_FIELD_COUNT assert api_query_overload_3.api_query_output_type == API_QUERY_OUTPUT_TYPE - assert api_query_overload_3.api_query_output_type_secondary == API_QUERY_OUTPUT_TYPE_SECONDARY + assert ( + api_query_overload_3.api_query_output_type_secondary + == API_QUERY_OUTPUT_TYPE_SECONDARY + ) assert api_query_overload_3.api_is_object_reference == API_QUERY_IS_OBJECT_REFERENCE assert api_query_overload_3.api_object_qualified_name == api_object.qualified_name assert api_query_overload_3.connector_name == AtlanConnectorType.API.value -def test_update_api_query(client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery): +def test_update_api_query( + client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery +): assert api_query_overload_3.qualified_name assert api_query_overload_3.name updated = client.asset.update_certificate( @@ -514,8 +601,12 @@ def test_update_api_query(client: AtlanClient, connection: Connection, api_query @pytest.mark.order(after="test_update_api_query") -def test_retrieve_api_query(client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery): - b = client.asset.get_by_guid(api_query_overload_3.guid, asset_type=APIQuery, ignore_relationships=False) +def test_retrieve_api_query( + client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery +): + b = client.asset.get_by_guid( + api_query_overload_3.guid, asset_type=APIQuery, ignore_relationships=False + ) assert b assert not b.is_incomplete assert b.guid == api_query_overload_3.guid @@ -528,7 +619,9 @@ def test_retrieve_api_query(client: AtlanClient, connection: Connection, api_que @pytest.mark.order(after="test_retrieve_api_query") -def test_delete_api_query(client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery): +def test_delete_api_query( + client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery +): response = client.asset.delete_by_guid(api_query_overload_3.guid) assert response assert not response.assets_created(asset_type=APIQuery) @@ -543,8 +636,12 @@ def test_delete_api_query(client: AtlanClient, connection: Connection, api_query @pytest.mark.order(after="test_delete_api_query") -def test_read_deleted_api_query(client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery): - deleted = client.asset.get_by_guid(api_query_overload_3.guid, asset_type=APIQuery, ignore_relationships=False) +def test_read_deleted_api_query( + client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery +): + deleted = client.asset.get_by_guid( + api_query_overload_3.guid, asset_type=APIQuery, ignore_relationships=False + ) assert deleted assert deleted.guid == api_query_overload_3.guid assert deleted.qualified_name == api_query_overload_3.qualified_name @@ -552,9 +649,13 @@ def test_read_deleted_api_query(client: AtlanClient, connection: Connection, api @pytest.mark.order(after="test_read_deleted_api_query") -def test_restore_query(client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery): +def test_restore_query( + client: AtlanClient, connection: Connection, api_query_overload_3: APIQuery +): assert api_query_overload_3.qualified_name - assert client.asset.restore(asset_type=APIQuery, qualified_name=api_query_overload_3.qualified_name) + assert client.asset.restore( + asset_type=APIQuery, qualified_name=api_query_overload_3.qualified_name + ) assert api_query_overload_3.qualified_name restored = client.asset.get_by_qualified_name( asset_type=APIQuery, @@ -591,9 +692,14 @@ def test_api_field_parent_object( ): assert api_field_parent_object assert api_field_parent_object.guid - assert api_field_parent_object.qualified_name == f"{api_object.qualified_name}/{API_FIELD_NAME}" + assert ( + api_field_parent_object.qualified_name + == f"{api_object.qualified_name}/{API_FIELD_NAME}" + ) assert api_field_parent_object.name == API_FIELD_NAME - assert api_field_parent_object.connection_qualified_name == connection.qualified_name + assert ( + api_field_parent_object.connection_qualified_name == connection.qualified_name + ) assert api_field_parent_object.connector_name == AtlanConnectorType.API.value @@ -623,11 +729,18 @@ def test_api_field_parent_object_overload_1( assert api_field_parent_object_overload_1 assert api_field_parent_object_overload_1.guid assert ( - api_field_parent_object_overload_1.qualified_name == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_1_NAME}" + api_field_parent_object_overload_1.qualified_name + == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_1_NAME}" ) assert api_field_parent_object_overload_1.name == API_FIELD_OVERLOAD_1_NAME - assert api_field_parent_object_overload_1.connection_qualified_name == connection.qualified_name - assert api_field_parent_object_overload_1.connector_name == AtlanConnectorType.API.value + assert ( + api_field_parent_object_overload_1.connection_qualified_name + == connection.qualified_name + ) + assert ( + api_field_parent_object_overload_1.connector_name + == AtlanConnectorType.API.value + ) @pytest.fixture(scope="module") @@ -656,12 +769,22 @@ def test_api_field_parent_object_overload_2( assert api_field_parent_object_overload_2 assert api_field_parent_object_overload_2.guid assert ( - api_field_parent_object_overload_2.qualified_name == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_2_NAME}" + api_field_parent_object_overload_2.qualified_name + == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_2_NAME}" ) assert api_field_parent_object_overload_2.name == API_FIELD_OVERLOAD_2_NAME - assert api_field_parent_object_overload_2.connection_qualified_name == connection.qualified_name - assert api_field_parent_object_overload_2.api_query_param_type == APIQueryParamTypeEnum.INPUT.value - assert api_field_parent_object_overload_2.connector_name == AtlanConnectorType.API.value + assert ( + api_field_parent_object_overload_2.connection_qualified_name + == connection.qualified_name + ) + assert ( + api_field_parent_object_overload_2.api_query_param_type + == APIQueryParamTypeEnum.INPUT.value + ) + assert ( + api_field_parent_object_overload_2.connector_name + == AtlanConnectorType.API.value + ) @pytest.fixture(scope="module") @@ -692,14 +815,27 @@ def test_api_field_parent_object_overload_3( assert api_field_parent_object_overload_3 assert api_field_parent_object_overload_3.guid assert ( - api_field_parent_object_overload_3.qualified_name == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_3_NAME}" + api_field_parent_object_overload_3.qualified_name + == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_3_NAME}" ) assert api_field_parent_object_overload_3.name == API_FIELD_OVERLOAD_3_NAME - assert api_field_parent_object_overload_3.connection_qualified_name == connection.qualified_name + assert ( + api_field_parent_object_overload_3.connection_qualified_name + == connection.qualified_name + ) assert api_field_parent_object_overload_3.api_field_type == API_FIELD_TYPE - assert api_field_parent_object_overload_3.api_field_type_secondary == API_FIELD_TYPE_SECONDARY - assert api_field_parent_object_overload_3.api_query_param_type == APIQueryParamTypeEnum.INPUT.value - assert api_field_parent_object_overload_3.connector_name == AtlanConnectorType.API.value + assert ( + api_field_parent_object_overload_3.api_field_type_secondary + == API_FIELD_TYPE_SECONDARY + ) + assert ( + api_field_parent_object_overload_3.api_query_param_type + == APIQueryParamTypeEnum.INPUT.value + ) + assert ( + api_field_parent_object_overload_3.connector_name + == AtlanConnectorType.API.value + ) @pytest.fixture(scope="module") @@ -733,19 +869,35 @@ def test_api_field_parent_object_overload_4( assert api_field_parent_object_overload_4 assert api_field_parent_object_overload_4.guid assert ( - api_field_parent_object_overload_4.qualified_name == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_4_NAME}" + api_field_parent_object_overload_4.qualified_name + == f"{api_object.qualified_name}/{API_FIELD_OVERLOAD_4_NAME}" ) assert api_field_parent_object_overload_4.name == API_FIELD_OVERLOAD_4_NAME - assert api_field_parent_object_overload_4.connection_qualified_name == connection.qualified_name + assert ( + api_field_parent_object_overload_4.connection_qualified_name + == connection.qualified_name + ) assert api_field_parent_object_overload_4.api_field_type == API_FIELD_TYPE - assert api_field_parent_object_overload_4.api_field_type_secondary == API_FIELD_TYPE_SECONDARY - assert api_field_parent_object_overload_4.api_is_object_reference == API_FIELD_IS_OBJECT_REFERENCE + assert ( + api_field_parent_object_overload_4.api_field_type_secondary + == API_FIELD_TYPE_SECONDARY + ) + assert ( + api_field_parent_object_overload_4.api_is_object_reference + == API_FIELD_IS_OBJECT_REFERENCE + ) assert ( api_field_parent_object_overload_4.api_object_qualified_name == f"{connection.qualified_name}/{API_FIELD_REFERENCE_OBJECT_NAME}" ) - assert api_field_parent_object_overload_4.api_query_param_type == APIQueryParamTypeEnum.INPUT.value - assert api_field_parent_object_overload_4.connector_name == AtlanConnectorType.API.value + assert ( + api_field_parent_object_overload_4.api_query_param_type + == APIQueryParamTypeEnum.INPUT.value + ) + assert ( + api_field_parent_object_overload_4.connector_name + == AtlanConnectorType.API.value + ) @pytest.fixture(scope="module") @@ -778,18 +930,35 @@ def test_api_field_parent_query_overload( ): assert api_field_parent_query_overload assert api_field_parent_query_overload.guid - assert api_field_parent_query_overload.qualified_name == f"{api_query.qualified_name}/{API_FIELD_PARENT_QUERY_NAME}" + assert ( + api_field_parent_query_overload.qualified_name + == f"{api_query.qualified_name}/{API_FIELD_PARENT_QUERY_NAME}" + ) assert api_field_parent_query_overload.name == API_FIELD_PARENT_QUERY_NAME - assert api_field_parent_query_overload.connection_qualified_name == connection.qualified_name + assert ( + api_field_parent_query_overload.connection_qualified_name + == connection.qualified_name + ) assert api_field_parent_query_overload.api_field_type == API_FIELD_TYPE - assert api_field_parent_query_overload.api_field_type_secondary == API_FIELD_TYPE_SECONDARY - assert api_field_parent_query_overload.api_is_object_reference == API_FIELD_IS_OBJECT_REFERENCE + assert ( + api_field_parent_query_overload.api_field_type_secondary + == API_FIELD_TYPE_SECONDARY + ) + assert ( + api_field_parent_query_overload.api_is_object_reference + == API_FIELD_IS_OBJECT_REFERENCE + ) assert ( api_field_parent_query_overload.api_object_qualified_name == f"{connection.qualified_name}/{API_FIELD_REFERENCE_OBJECT_NAME}" ) - assert api_field_parent_query_overload.api_query_param_type == APIQueryParamTypeEnum.INPUT.value - assert api_field_parent_query_overload.connector_name == AtlanConnectorType.API.value + assert ( + api_field_parent_query_overload.api_query_param_type + == APIQueryParamTypeEnum.INPUT.value + ) + assert ( + api_field_parent_query_overload.connector_name == AtlanConnectorType.API.value + ) def test_update_api_field( @@ -843,7 +1012,10 @@ def test_retrieve_api_field( assert b.qualified_name == api_field_parent_query_overload.qualified_name assert b.name == api_field_parent_query_overload.name assert b.connector_name == api_field_parent_query_overload.connector_name - assert b.connection_qualified_name == api_field_parent_query_overload.connection_qualified_name + assert ( + b.connection_qualified_name + == api_field_parent_query_overload.connection_qualified_name + ) assert b.certificate_status == CERTIFICATE_STATUS assert b.certificate_status_message == CERTIFICATE_MESSAGE diff --git a/tests/integration/app_asset_test.py b/tests/integration/app_asset_test.py index b16446ec5..1e722c6f4 100644 --- a/tests/integration/app_asset_test.py +++ b/tests/integration/app_asset_test.py @@ -29,13 +29,17 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def application(client: AtlanClient, connection: Connection) -> Generator[Application, None, None]: +def application( + client: AtlanClient, connection: Connection +) -> Generator[Application, None, None]: assert connection.qualified_name to_create = Application.create( name=APPLICATION_NAME, @@ -101,7 +105,9 @@ def test_retrieve_application( connection: Connection, application: Application, ): - b = client.asset.get_by_guid(application.guid, asset_type=Application, ignore_relationships=False) + b = client.asset.get_by_guid( + application.guid, asset_type=Application, ignore_relationships=False + ) assert b assert not b.is_incomplete assert b.guid == application.guid @@ -169,7 +175,9 @@ def test_read_deleted_application( connection: Connection, application: Application, ): - deleted = client.asset.get_by_guid(application.guid, asset_type=Application, ignore_relationships=False) + deleted = client.asset.get_by_guid( + application.guid, asset_type=Application, ignore_relationships=False + ) assert deleted assert deleted.guid == application.guid assert deleted.qualified_name == application.qualified_name @@ -200,7 +208,9 @@ def test_restore_application( @pytest.fixture(scope="module") -def application_field(client: AtlanClient, application: ApplicationField) -> Generator[ApplicationField, None, None]: +def application_field( + client: AtlanClient, application: ApplicationField +) -> Generator[ApplicationField, None, None]: assert application.qualified_name to_create = ApplicationField.creator( name=APPLICATION_FIELD_NAME, @@ -212,14 +222,22 @@ def application_field(client: AtlanClient, application: ApplicationField) -> Gen delete_asset(client, guid=result.guid, asset_type=ApplicationField) -def test_application_field(client: AtlanClient, application: Application, application_field: ApplicationField): +def test_application_field( + client: AtlanClient, application: Application, application_field: ApplicationField +): assert application_field assert application_field.guid assert application_field.qualified_name assert application_field.name == APPLICATION_FIELD_NAME - assert application_field.connection_qualified_name == application.connection_qualified_name + assert ( + application_field.connection_qualified_name + == application.connection_qualified_name + ) assert application_field.connector_name == AtlanConnectorType.APP.value - assert application_field.application_parent_qualified_name == application.qualified_name + assert ( + application_field.application_parent_qualified_name + == application.qualified_name + ) @pytest.fixture(scope="module") @@ -249,6 +267,12 @@ def test_overload_application_field( assert application_field_overload.guid assert application_field_overload.qualified_name assert application_field_overload.name == APPLICATION_FIELD_OVERLOAD_NAME - assert application_field_overload.connection_qualified_name == connection.qualified_name + assert ( + application_field_overload.connection_qualified_name + == connection.qualified_name + ) assert application_field_overload.connector_name == AtlanConnectorType.APP.value - assert application_field_overload.application_parent_qualified_name == application.qualified_name + assert ( + application_field_overload.application_parent_qualified_name + == application.qualified_name + ) diff --git a/tests/integration/azure_event_hub_asset_test.py b/tests/integration/azure_event_hub_asset_test.py index 37ae80797..152d62181 100644 --- a/tests/integration/azure_event_hub_asset_test.py +++ b/tests/integration/azure_event_hub_asset_test.py @@ -41,9 +41,13 @@ def connection(client: AtlanClient) -> Generator[Connection, None, None]: @pytest.fixture(scope="module") -def event_hub(client: AtlanClient, connection: Connection) -> Generator[AzureEventHub, None, None]: +def event_hub( + client: AtlanClient, connection: Connection +) -> Generator[AzureEventHub, None, None]: assert connection.qualified_name - to_create = AzureEventHub.creator(name=EVENT_HUB_NAME, connection_qualified_name=connection.qualified_name) + to_create = AzureEventHub.creator( + name=EVENT_HUB_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=AzureEventHub)[0] yield result @@ -64,7 +68,9 @@ def test_event_hub( @pytest.fixture(scope="module") -def consumer_group(client: AtlanClient, event_hub: AzureEventHub) -> Generator[AzureEventHubConsumerGroup, None, None]: +def consumer_group( + client: AtlanClient, event_hub: AzureEventHub +) -> Generator[AzureEventHubConsumerGroup, None, None]: assert event_hub.qualified_name to_create = AzureEventHubConsumerGroup.creator( name=EVENT_HUB_CONSUMER_GROUP_NAME, @@ -134,7 +140,9 @@ def test_update_event_hub_assets( def _retrieve_event_hub_assets(client, asset, asset_type): - retrieved = client.asset.get_by_guid(asset.guid, asset_type=asset_type, ignore_relationships=False) + retrieved = client.asset.get_by_guid( + asset.guid, asset_type=asset_type, ignore_relationships=False + ) assert retrieved assert not retrieved.is_incomplete assert retrieved.guid == asset.guid diff --git a/tests/integration/connection_test.py b/tests/integration/connection_test.py index 61f7b5721..ea79e1e5e 100644 --- a/tests/integration/connection_test.py +++ b/tests/integration/connection_test.py @@ -11,23 +11,33 @@ MODULE_NAME = TestId.make_unique("CONN") -def create_connection(client: AtlanClient, name: str, connector_type: AtlanConnectorType) -> Connection: +def create_connection( + client: AtlanClient, name: str, connector_type: AtlanConnectorType +) -> Connection: admin_role_guid = str(RoleCache.get_id_for_name("$admin")) - to_create = Connection.create(name=name, connector_type=connector_type, admin_roles=[admin_role_guid]) + to_create = Connection.create( + name=name, connector_type=connector_type, admin_roles=[admin_role_guid] + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=Connection)[0] - return client.asset.get_by_guid(result.guid, asset_type=Connection, ignore_relationships=False) + return client.asset.get_by_guid( + result.guid, asset_type=Connection, ignore_relationships=False + ) def test_invalid_connection(client: AtlanClient): - with pytest.raises(ValueError, match="One of admin_user, admin_groups or admin_roles is required"): + with pytest.raises( + ValueError, match="One of admin_user, admin_groups or admin_roles is required" + ): Connection.create(name=MODULE_NAME, connector_type=AtlanConnectorType.POSTGRES) def test_invalid_connection_admin_role( client: AtlanClient, ): - with pytest.raises(ValueError, match="Provided role ID abc123 was not found in Atlan."): + with pytest.raises( + ValueError, match="Provided role ID abc123 was not found in Atlan." + ): Connection.create( name=MODULE_NAME, connector_type=AtlanConnectorType.SAPHANA, @@ -38,7 +48,9 @@ def test_invalid_connection_admin_role( def test_invalid_connection_admin_group( client: AtlanClient, ): - with pytest.raises(ValueError, match="Provided group name abc123 was not found in Atlan."): + with pytest.raises( + ValueError, match="Provided group name abc123 was not found in Atlan." + ): Connection.create( name=MODULE_NAME, connector_type=AtlanConnectorType.SAPHANA, @@ -49,7 +61,9 @@ def test_invalid_connection_admin_group( def test_invalid_connection_admin_user( client: AtlanClient, ): - with pytest.raises(ValueError, match="Provided username abc123 was not found in Atlan."): + with pytest.raises( + ValueError, match="Provided username abc123 was not found in Atlan." + ): Connection.create( name=MODULE_NAME, connector_type=AtlanConnectorType.SAPHANA, diff --git a/tests/integration/custom_asset_test.py b/tests/integration/custom_asset_test.py index 3bfe9502d..2d47e3bab 100644 --- a/tests/integration/custom_asset_test.py +++ b/tests/integration/custom_asset_test.py @@ -28,22 +28,30 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def custom_entity(client: AtlanClient, connection: Connection) -> Generator[CustomEntity, None, None]: +def custom_entity( + client: AtlanClient, connection: Connection +) -> Generator[CustomEntity, None, None]: assert connection.qualified_name - to_create = CustomEntity.creator(name=CUSTOM_ENTITY_NAME, connection_qualified_name=connection.qualified_name) + to_create = CustomEntity.creator( + name=CUSTOM_ENTITY_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=CustomEntity)[0] yield result delete_asset(client, guid=result.guid, asset_type=CustomEntity) -def test_custom_entity(client: AtlanClient, connection: Connection, custom_entity: CustomEntity): +def test_custom_entity( + client: AtlanClient, connection: Connection, custom_entity: CustomEntity +): assert custom_entity assert custom_entity.guid assert custom_entity.qualified_name @@ -78,9 +86,13 @@ def test_restore_custom_entity( custom_entity: CustomEntity, ): assert custom_entity.qualified_name - assert client.asset.restore(asset_type=CustomEntity, qualified_name=custom_entity.qualified_name) + assert client.asset.restore( + asset_type=CustomEntity, qualified_name=custom_entity.qualified_name + ) assert custom_entity.qualified_name - restored = client.asset.get_by_qualified_name(asset_type=CustomEntity, qualified_name=custom_entity.qualified_name) + restored = client.asset.get_by_qualified_name( + asset_type=CustomEntity, qualified_name=custom_entity.qualified_name + ) assert restored assert restored.guid == custom_entity.guid assert restored.qualified_name == custom_entity.qualified_name @@ -126,7 +138,9 @@ def test_update_custom_assets( def _retrieve_custom_assets(client, asset, asset_type): - retrieved = client.asset.get_by_guid(asset.guid, asset_type=asset_type, ignore_relationships=False) + retrieved = client.asset.get_by_guid( + asset.guid, asset_type=asset_type, ignore_relationships=False + ) assert retrieved assert not retrieved.is_incomplete assert retrieved.guid == asset.guid diff --git a/tests/integration/custom_metadata_test.py b/tests/integration/custom_metadata_test.py index f6add5ab4..ce9322f07 100644 --- a/tests/integration/custom_metadata_test.py +++ b/tests/integration/custom_metadata_test.py @@ -92,13 +92,17 @@ def create_custom_metadata( cm_def = CustomMetadataDef.create(display_name=name) cm_def.attribute_defs = attribute_defs if icon and color: - cm_def.options = CustomMetadataDef.Options.with_logo_from_icon(icon, color, locked) + cm_def.options = CustomMetadataDef.Options.with_logo_from_icon( + icon, color, locked + ) elif logo and logo.startswith("http"): cm_def.options = CustomMetadataDef.Options.with_logo_from_url(logo, locked) elif logo: cm_def.options = CustomMetadataDef.Options.with_logo_as_emoji(logo, locked) else: - raise ValueError("Invalid configuration for the visual to use for the custom metadata.") + raise ValueError( + "Invalid configuration for the visual to use for the custom metadata." + ) r = client.typedef.create(cm_def) return r.custom_metadata_defs[0] @@ -109,14 +113,20 @@ def create_enum(client: AtlanClient, name: str, values: List[str]) -> EnumDef: return r.enum_defs[0] -def update_enum(client: AtlanClient, name: str, values: List[str], replace_existing: bool = False) -> EnumDef: - enum_def = EnumDef.update(name=name, values=values, replace_existing=replace_existing) +def update_enum( + client: AtlanClient, name: str, values: List[str], replace_existing: bool = False +) -> EnumDef: + enum_def = EnumDef.update( + name=name, values=values, replace_existing=replace_existing + ) r = client.typedef.update(enum_def) return r.enum_defs[0] @pytest.fixture(scope="module") -def limit_attribute_applicability_kwargs(glossary: AtlasGlossary, connection: Connection): +def limit_attribute_applicability_kwargs( + glossary: AtlasGlossary, connection: Connection +): return dict( applicable_asset_types={"Link"}, applicable_other_asset_types={"File"}, @@ -127,7 +137,9 @@ def limit_attribute_applicability_kwargs(glossary: AtlasGlossary, connection: Co @pytest.fixture(scope="module") -def cm_ipr(client: AtlanClient, limit_attribute_applicability_kwargs) -> Generator[CustomMetadataDef, None, None]: +def cm_ipr( + client: AtlanClient, limit_attribute_applicability_kwargs +) -> Generator[CustomMetadataDef, None, None]: attribute_defs = [ AttributeDef.create( display_name=CM_ATTR_IPR_LICENSE, @@ -151,7 +163,9 @@ def cm_ipr(client: AtlanClient, limit_attribute_applicability_kwargs) -> Generat attribute_type=AtlanCustomAttributePrimitiveType.URL, ), ] - cm = create_custom_metadata(client, name=CM_IPR, attribute_defs=attribute_defs, logo="⚖️", locked=True) + cm = create_custom_metadata( + client, name=CM_IPR, attribute_defs=attribute_defs, logo="⚖️", locked=True + ) yield cm wait_for_successful_custometadatadef_purge(CM_IPR, client=client) @@ -175,8 +189,12 @@ def test_cm_ipr(cm_ipr: CustomMetadataDef, limit_attribute_applicability_kwargs) assert not one_with_limited.options.multi_value_select options = one_with_limited.options for attribute in limit_attribute_applicability_kwargs.keys(): - assert getattr(one_with_limited, attribute) == limit_attribute_applicability_kwargs.get(attribute) - assert getattr(options, attribute) == json.dumps(list(limit_attribute_applicability_kwargs.get(attribute))) + assert getattr( + one_with_limited, attribute + ) == limit_attribute_applicability_kwargs.get(attribute) + assert getattr(options, attribute) == json.dumps( + list(limit_attribute_applicability_kwargs.get(attribute)) + ) one = attributes[1] assert one.display_name == CM_ATTR_IPR_VERSION assert one.name != CM_ATTR_IPR_VERSION @@ -338,7 +356,9 @@ def cm_enum_update( def cm_enum_update_with_replace( client: AtlanClient, ) -> Generator[EnumDef, None, None]: - enum_def = update_enum(client, name=DQ_ENUM, values=DQ_TYPE_LIST, replace_existing=True) + enum_def = update_enum( + client, name=DQ_ENUM, values=DQ_TYPE_LIST, replace_existing=True + ) yield enum_def @@ -603,7 +623,9 @@ def test_search_by_any_accountable( term: AtlasGlossaryTerm, ): attributes = ["name", "anchor"] - cm_attributes = CustomMetadataCache.get_attributes_for_search_results(set_name=CM_RACI) + cm_attributes = CustomMetadataCache.get_attributes_for_search_results( + set_name=CM_RACI + ) assert cm_attributes attributes.extend(cm_attributes) request = ( @@ -629,7 +651,9 @@ def test_search_by_any_accountable( anchor = t.attributes.anchor assert anchor assert anchor.name == glossary.name - _validate_raci_attributes_replacement(client, t.get_custom_metadata(name=CM_RACI)) + _validate_raci_attributes_replacement( + client, t.get_custom_metadata(name=CM_RACI) + ) @pytest.mark.order(after="test_replace_term_cm_ipr") @@ -666,7 +690,9 @@ def test_search_by_specific_accountable( assert anchor.name == glossary.name -@pytest.mark.order(after=["test_search_by_any_accountable", "test_search_by_specific_accountable"]) +@pytest.mark.order( + after=["test_search_by_any_accountable", "test_search_by_specific_accountable"] +) def test_remove_term_cm_raci( client: AtlanClient, cm_raci: CustomMetadataDef, @@ -720,7 +746,9 @@ def test_remove_attribute(client: AtlanClient, cm_raci: CustomMetadataDef): attributes = updated.attribute_defs archived = _validate_raci_structure(attributes, 5) assert archived - assert archived.display_name == f"{CM_ATTR_RACI_EXTRA}-archived-{str(_removal_epoch)}" + assert ( + archived.display_name == f"{CM_ATTR_RACI_EXTRA}-archived-{str(_removal_epoch)}" + ) assert archived.name != CM_ATTR_RACI_EXTRA assert archived.type_name == AtlanCustomAttributePrimitiveType.STRING.value assert not archived.options.multi_value_select @@ -738,7 +766,9 @@ def test_retrieve_structures(client: AtlanClient, cm_raci: CustomMetadataDef): assert CM_QUALITY in custom_attributes.keys() extra = _validate_raci_structure(custom_attributes.get(CM_RACI), 4) assert not extra - custom_attributes = CustomMetadataCache.get_all_custom_attributes(include_deleted=True) + custom_attributes = CustomMetadataCache.get_all_custom_attributes( + include_deleted=True + ) assert custom_attributes assert CM_RACI in custom_attributes.keys() assert CM_IPR in custom_attributes.keys() @@ -786,7 +816,9 @@ def test_recreate_attribute(client: AtlanClient, cm_raci: CustomMetadataDef): @pytest.mark.order(after="test_recreate_attribute") -def test_retrieve_structure_without_archived(client: AtlanClient, cm_raci: CustomMetadataDef): +def test_retrieve_structure_without_archived( + client: AtlanClient, cm_raci: CustomMetadataDef +): custom_attributes = CustomMetadataCache.get_all_custom_attributes() assert custom_attributes assert len(custom_attributes) >= 3 @@ -803,8 +835,12 @@ def test_retrieve_structure_without_archived(client: AtlanClient, cm_raci: Custo @pytest.mark.order(after="test_recreate_attribute") -def test_retrieve_structure_with_archived(client: AtlanClient, cm_raci: CustomMetadataDef): - custom_attributes = CustomMetadataCache.get_all_custom_attributes(include_deleted=True) +def test_retrieve_structure_with_archived( + client: AtlanClient, cm_raci: CustomMetadataDef +): + custom_attributes = CustomMetadataCache.get_all_custom_attributes( + include_deleted=True + ) assert custom_attributes assert len(custom_attributes) >= 3 assert CM_RACI in custom_attributes.keys() @@ -974,7 +1010,9 @@ def _validate_dq_empty(dq_attrs: CustomMetadataDict): assert dq_attrs[CM_ATTR_QUALITY_TYPE] is None -def _validate_raci_structure(attributes: Optional[List[AttributeDef]], total_expected: int): +def _validate_raci_structure( + attributes: Optional[List[AttributeDef]], total_expected: int +): global _removal_epoch assert attributes assert len(attributes) == total_expected @@ -1020,7 +1058,9 @@ def _validate_raci_structure(attributes: Optional[List[AttributeDef]], total_exp if total_expected > 5: # If we're expecting more than 5, then the penultimate must be an archived CM_ATTR_EXTRA one = attributes[4] - assert one.display_name == f"{CM_ATTR_RACI_EXTRA}-archived-{str(_removal_epoch)}" + assert ( + one.display_name == f"{CM_ATTR_RACI_EXTRA}-archived-{str(_removal_epoch)}" + ) assert one.name != CM_ATTR_RACI_EXTRA assert one.type_name == AtlanCustomAttributePrimitiveType.STRING.value assert one.options diff --git a/tests/integration/custom_package_test.py b/tests/integration/custom_package_test.py index 87593bb92..6dc1ac386 100644 --- a/tests/integration/custom_package_test.py +++ b/tests/integration/custom_package_test.py @@ -86,7 +86,9 @@ def test_generate_config(custom_package: CustomPackage, tmpdir): config_name = "owner_propagator_cfg.py" assert dir / config_name - spec = importlib.util.spec_from_file_location("owner_propagator_cfg", dir / config_name) + spec = importlib.util.spec_from_file_location( + "owner_propagator_cfg", dir / config_name + ) assert spec is not None module = importlib.util.module_from_spec(spec) assert module is not None diff --git a/tests/integration/data_mesh_test.py b/tests/integration/data_mesh_test.py index 85fa7ff06..33de2e708 100644 --- a/tests/integration/data_mesh_test.py +++ b/tests/integration/data_mesh_test.py @@ -30,7 +30,9 @@ from tests.integration.custom_metadata_test import create_custom_metadata from tests.integration.utils import wait_for_successful_custometadatadef_purge -DATA_PRODUCT_ASSETS_PLAYBOOK_FILTER = '{"condition":"AND","isGroupLocked":false,"rules":[]}' +DATA_PRODUCT_ASSETS_PLAYBOOK_FILTER = ( + '{"condition":"AND","isGroupLocked":false,"rules":[]}' +) MODULE_NAME = TestId.make_unique("DM") @@ -38,10 +40,14 @@ DATA_DOMAIN_QUALIFIED_NAME = f"default/domain/{DATA_DOMAIN_NAME}/super" DATA_DOMAIN_QN_REGEX = r"default/domain/[a-zA-Z0-9-]+/super" DATA_SUB_DOMAIN_NAME = f"{MODULE_NAME}-data-sub-domain" -DATA_SUB_DOMAIN_QUALIFIED_NAME = f"{DATA_DOMAIN_QUALIFIED_NAME}/domain/{DATA_SUB_DOMAIN_NAME}" +DATA_SUB_DOMAIN_QUALIFIED_NAME = ( + f"{DATA_DOMAIN_QUALIFIED_NAME}/domain/{DATA_SUB_DOMAIN_NAME}" +) DATA_SUB_DOMAIN_QN_REGEX = r"default/domain/[a-zA-Z0-9-]+/super/domain/[a-zA-Z0-9-]+" DATA_PRODUCT_NAME = f"{MODULE_NAME}-data-product" -DATA_PRODUCT_QUALIFIED_NAME = f"{DATA_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" +DATA_PRODUCT_QUALIFIED_NAME = ( + f"{DATA_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" +) DATA_PRODUCT_QN_REGEX = r"default/domain/[a-zA-Z0-9-]+/super/product/[a-zA-Z0-9-]+" DD_CM = f"{MODULE_NAME}_CM" DD_ATTR = f"{MODULE_NAME}_ATTRIBUTE" @@ -132,7 +138,9 @@ def test_update_domain(client: AtlanClient, domain: DataDomain): @pytest.mark.order(after="test_update_domain") def test_retrieve_domain(client: AtlanClient, domain: DataDomain): - test_domain = client.asset.get_by_guid(domain.guid, asset_type=DataDomain, ignore_relationships=False) + test_domain = client.asset.get_by_guid( + domain.guid, asset_type=DataDomain, ignore_relationships=False + ) assert test_domain assert test_domain.guid == domain.guid assert test_domain.qualified_name == domain.qualified_name @@ -143,7 +151,9 @@ def test_retrieve_domain(client: AtlanClient, domain: DataDomain): @pytest.mark.order(after="test_retrieve_domain") def test_find_domain_by_name(client: AtlanClient, domain: DataDomain): - response = client.asset.find_domain_by_name(name=domain.name, attributes=["certificateStatus"]) + response = client.asset.find_domain_by_name( + name=domain.name, attributes=["certificateStatus"] + ) assert response assert response.guid == domain.guid @@ -182,7 +192,9 @@ def test_update_sub_domain(client: AtlanClient, sub_domain: DataDomain): @pytest.mark.order(after="test_update_sub_domain") def test_retrieve_sub_domain(client: AtlanClient, sub_domain: DataDomain): - test_sub_domain = client.asset.get_by_guid(sub_domain.guid, asset_type=DataDomain, ignore_relationships=False) + test_sub_domain = client.asset.get_by_guid( + sub_domain.guid, asset_type=DataDomain, ignore_relationships=False + ) assert test_sub_domain assert test_sub_domain.guid == sub_domain.guid assert test_sub_domain.qualified_name == sub_domain.qualified_name @@ -193,7 +205,9 @@ def test_retrieve_sub_domain(client: AtlanClient, sub_domain: DataDomain): @pytest.mark.order(after="test_retrieve_sub_domain") def test_find_sub_domain_by_name(client: AtlanClient, sub_domain: DataDomain): - response = client.asset.find_domain_by_name(name=sub_domain.name, attributes=["certificateStatus"]) + response = client.asset.find_domain_by_name( + name=sub_domain.name, attributes=["certificateStatus"] + ) assert response assert response.guid == sub_domain.guid @@ -201,7 +215,9 @@ def test_find_sub_domain_by_name(client: AtlanClient, sub_domain: DataDomain): @pytest.fixture(scope="module") -def data_domain_cm(client: AtlanClient, domain: DataDomain) -> Generator[CustomMetadataDef, None, None]: +def data_domain_cm( + client: AtlanClient, domain: DataDomain +) -> Generator[CustomMetadataDef, None, None]: assert domain.qualified_name attribute_defs = [ AttributeDef.create( @@ -211,7 +227,9 @@ def data_domain_cm(client: AtlanClient, domain: DataDomain) -> Generator[CustomM applicable_domains={domain.qualified_name}, ) ] - dd_cm = create_custom_metadata(client, name=DD_CM, attribute_defs=attribute_defs, logo="📦", locked=True) + dd_cm = create_custom_metadata( + client, name=DD_CM, attribute_defs=attribute_defs, logo="📦", locked=True + ) yield dd_cm wait_for_successful_custometadatadef_purge(DD_CM, client=client) @@ -259,7 +277,10 @@ def test_product(client: AtlanClient, product: DataProduct): assert product.parent_domain_qualified_name assert product.super_domain_qualified_name assert product.name == DATA_PRODUCT_NAME - assert product.data_product_assets_playbook_filter == DATA_PRODUCT_ASSETS_PLAYBOOK_FILTER + assert ( + product.data_product_assets_playbook_filter + == DATA_PRODUCT_ASSETS_PLAYBOOK_FILTER + ) assert re.search(DATA_PRODUCT_QN_REGEX, product.qualified_name) assert re.search(DATA_DOMAIN_QN_REGEX, product.parent_domain_qualified_name) assert re.search(DATA_DOMAIN_QN_REGEX, product.super_domain_qualified_name) @@ -315,14 +336,20 @@ def updated_contract( delete_asset(client, guid=result.guid, asset_type=DataContract) -def test_contract(client: AtlanClient, table: Table, product: DataProduct, contract: DataContract): +def test_contract( + client: AtlanClient, table: Table, product: DataProduct, contract: DataContract +): assert product and product.guid - product = client.asset.get_by_guid(guid=product.guid, asset_type=DataProduct, ignore_relationships=False) + product = client.asset.get_by_guid( + guid=product.guid, asset_type=DataProduct, ignore_relationships=False + ) assert product and product.output_ports and len(product.output_ports) table_asset = product.output_ports[0] assert table and table.guid assert table.guid == table_asset.guid - table = client.asset.get_by_guid(guid=table_asset.guid, asset_type=Table, ignore_relationships=False) + table = client.asset.get_by_guid( + guid=table_asset.guid, asset_type=Table, ignore_relationships=False + ) assert table.has_contract assert table.data_contract_latest table_data_contract = table.data_contract_latest @@ -334,9 +361,13 @@ def test_contract(client: AtlanClient, table: Table, product: DataProduct, contr assert contract.data_contract_asset_guid == table.guid -def test_update_contract(client: AtlanClient, table: Table, updated_contract: DataContract): +def test_update_contract( + client: AtlanClient, table: Table, updated_contract: DataContract +): assert table and table.guid - table = client.asset.get_by_guid(guid=table.guid, asset_type=Table, ignore_relationships=False) + table = client.asset.get_by_guid( + guid=table.guid, asset_type=Table, ignore_relationships=False + ) assert table.has_contract assert table.data_contract_latest table_data_contract = table.data_contract_latest @@ -349,7 +380,9 @@ def test_update_contract(client: AtlanClient, table: Table, updated_contract: Da assert "(UPDATED)" in updated_contract.data_contract_json -def test_update_product(client: AtlanClient, product: DataProduct, glossary: AtlasGlossary): +def test_update_product( + client: AtlanClient, product: DataProduct, glossary: AtlasGlossary +): assert product.qualified_name assert product.name updated = client.asset.update_certificate( @@ -382,7 +415,11 @@ def test_update_product(client: AtlanClient, product: DataProduct, glossary: Atl # Test the product.updater() method with assets assert glossary.qualified_name - assets = FluentSearch().where(Asset.QUALIFIED_NAME.eq(glossary.qualified_name)).to_request() + assets = ( + FluentSearch() + .where(Asset.QUALIFIED_NAME.eq(glossary.qualified_name)) + .to_request() + ) to_update = DataProduct.updater( name=DATA_PRODUCT_NAME, qualified_name=product.qualified_name, @@ -391,18 +428,24 @@ def test_update_product(client: AtlanClient, product: DataProduct, glossary: Atl response = client.asset.save(to_update) assert (products := response.assets_updated(asset_type=DataProduct)) assert len(products) == 1 - assert products[0].data_product_assets_d_s_l == DataProductsAssetsDSL.get_asset_selection(assets) + assert products[ + 0 + ].data_product_assets_d_s_l == DataProductsAssetsDSL.get_asset_selection(assets) # Test the product.updater() method without assets # (ensure asset selection remains unchanged) - product = DataProduct.updater(name=DATA_PRODUCT_NAME, qualified_name=product.qualified_name) + product = DataProduct.updater( + name=DATA_PRODUCT_NAME, qualified_name=product.qualified_name + ) response = client.asset.save(product) assert response.assets_updated(asset_type=DataProduct) == [] @pytest.mark.order(after="test_update_product") def test_retrieve_product(client: AtlanClient, product: DataProduct): - test_product = client.asset.get_by_guid(product.guid, asset_type=DataProduct, ignore_relationships=False) + test_product = client.asset.get_by_guid( + product.guid, asset_type=DataProduct, ignore_relationships=False + ) assert test_product assert test_product.guid == product.guid assert test_product.qualified_name == product.qualified_name @@ -412,8 +455,12 @@ def test_retrieve_product(client: AtlanClient, product: DataProduct): @pytest.mark.order(after="test_update_contract") -def test_retrieve_contract(client: AtlanClient, table: Table, updated_contract: DataContract): - test_contract = client.asset.get_by_guid(updated_contract.guid, asset_type=DataContract, ignore_relationships=False) +def test_retrieve_contract( + client: AtlanClient, table: Table, updated_contract: DataContract +): + test_contract = client.asset.get_by_guid( + updated_contract.guid, asset_type=DataContract, ignore_relationships=False + ) assert test_contract assert test_contract.name == updated_contract.name assert table.name and updated_contract.name and table.name in updated_contract.name @@ -427,7 +474,9 @@ def test_retrieve_contract(client: AtlanClient, table: Table, updated_contract: @pytest.mark.order(after="test_retrieve_product") def test_find_product_by_name(client: AtlanClient, product: DataProduct): - response = client.asset.find_product_by_name(name=product.name, attributes=["daapStatus"]) + response = client.asset.find_product_by_name( + name=product.name, attributes=["daapStatus"] + ) assert response assert response.guid == product.guid diff --git a/tests/integration/data_studio_asset_test.py b/tests/integration/data_studio_asset_test.py index 2a637b2b4..9e01a267d 100644 --- a/tests/integration/data_studio_asset_test.py +++ b/tests/integration/data_studio_asset_test.py @@ -29,13 +29,17 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def data_studio_asset_report(client: AtlanClient, connection: Connection) -> Generator[DataStudioAsset, None, None]: +def data_studio_asset_report( + client: AtlanClient, connection: Connection +) -> Generator[DataStudioAsset, None, None]: assert connection.qualified_name to_create = DataStudioAsset.create( name=REPORT_NAME, @@ -56,10 +60,17 @@ def test_data_studio_asset_report( assert data_studio_asset_report assert data_studio_asset_report.guid assert data_studio_asset_report.qualified_name - assert data_studio_asset_report.connection_qualified_name == connection.qualified_name + assert ( + data_studio_asset_report.connection_qualified_name == connection.qualified_name + ) assert data_studio_asset_report.name == REPORT_NAME - assert data_studio_asset_report.connector_name == AtlanConnectorType.DATASTUDIO.value - assert data_studio_asset_report.data_studio_asset_type == GoogleDatastudioAssetType.REPORT + assert ( + data_studio_asset_report.connector_name == AtlanConnectorType.DATASTUDIO.value + ) + assert ( + data_studio_asset_report.data_studio_asset_type + == GoogleDatastudioAssetType.REPORT + ) def test_update_data_studio_asset_report( @@ -120,10 +131,19 @@ def test_data_studio_asset_data_source( assert data_studio_asset_data_source assert data_studio_asset_data_source.guid assert data_studio_asset_data_source.qualified_name - assert data_studio_asset_data_source.connection_qualified_name == connection.qualified_name + assert ( + data_studio_asset_data_source.connection_qualified_name + == connection.qualified_name + ) assert data_studio_asset_data_source.name == SOURCE_NAME - assert data_studio_asset_data_source.connector_name == AtlanConnectorType.DATASTUDIO.value - assert data_studio_asset_data_source.data_studio_asset_type == GoogleDatastudioAssetType.DATA_SOURCE + assert ( + data_studio_asset_data_source.connector_name + == AtlanConnectorType.DATASTUDIO.value + ) + assert ( + data_studio_asset_data_source.data_studio_asset_type + == GoogleDatastudioAssetType.DATA_SOURCE + ) def test_update_data_studio_asset_data_source( diff --git a/tests/integration/dataverse_asset_test.py b/tests/integration/dataverse_asset_test.py index a6a1504f5..a2a1be61b 100644 --- a/tests/integration/dataverse_asset_test.py +++ b/tests/integration/dataverse_asset_test.py @@ -31,22 +31,30 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def dataverse_entity(client: AtlanClient, connection: Connection) -> Generator[DataverseEntity, None, None]: +def dataverse_entity( + client: AtlanClient, connection: Connection +) -> Generator[DataverseEntity, None, None]: assert connection.qualified_name - to_create = DataverseEntity.creator(name=DATAVERSE_ENTITY_NAME, connection_qualified_name=connection.qualified_name) + to_create = DataverseEntity.creator( + name=DATAVERSE_ENTITY_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=DataverseEntity)[0] yield result delete_asset(client, guid=result.guid, asset_type=DataverseEntity) -def test_dataverse_entity(client: AtlanClient, connection: Connection, dataverse_entity: DataverseEntity): +def test_dataverse_entity( + client: AtlanClient, connection: Connection, dataverse_entity: DataverseEntity +): assert dataverse_entity assert dataverse_entity.guid assert dataverse_entity.qualified_name @@ -79,7 +87,10 @@ def test_dataverse_attribute( assert dataverse_attribute.guid assert dataverse_attribute.qualified_name assert dataverse_attribute.name == DATAVERSE_ATTRIBUTE_NAME - assert dataverse_attribute.connection_qualified_name == dataverse_entity.connection_qualified_name + assert ( + dataverse_attribute.connection_qualified_name + == dataverse_entity.connection_qualified_name + ) assert dataverse_attribute.connector_name == AtlanConnectorType.DATAVERSE.value @@ -109,8 +120,14 @@ def test_overload_dataverse_attribute( assert dataverse_attribute_overload.guid assert dataverse_attribute_overload.qualified_name assert dataverse_attribute_overload.name == DATAVERSE_ATTRIBUTE_NAME_OVERLOAD - assert dataverse_attribute_overload.connection_qualified_name == dataverse_entity.connection_qualified_name - assert dataverse_attribute_overload.connector_name == AtlanConnectorType.DATAVERSE.value + assert ( + dataverse_attribute_overload.connection_qualified_name + == dataverse_entity.connection_qualified_name + ) + assert ( + dataverse_attribute_overload.connector_name + == AtlanConnectorType.DATAVERSE.value + ) def _update_cert_and_annoucement(client, asset, asset_type): @@ -154,7 +171,9 @@ def test_update_dataverse_assets( def _retrieve_dataverse_assets(client, asset, asset_type): - retrieved = client.asset.get_by_guid(asset.guid, asset_type=asset_type, ignore_relationships=False) + retrieved = client.asset.get_by_guid( + asset.guid, asset_type=asset_type, ignore_relationships=False + ) assert retrieved assert not retrieved.is_incomplete assert retrieved.guid == asset.guid @@ -216,7 +235,9 @@ def test_restore_dataverse_attribute( dataverse_attribute: DataverseAttribute, ): assert dataverse_attribute.qualified_name - assert client.asset.restore(asset_type=DataverseAttribute, qualified_name=dataverse_attribute.qualified_name) + assert client.asset.restore( + asset_type=DataverseAttribute, qualified_name=dataverse_attribute.qualified_name + ) assert dataverse_attribute.qualified_name restored = client.asset.get_by_qualified_name( asset_type=DataverseAttribute, diff --git a/tests/integration/file_test.py b/tests/integration/file_test.py index 78a39c77a..637cca66b 100644 --- a/tests/integration/file_test.py +++ b/tests/integration/file_test.py @@ -29,7 +29,9 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result # TODO: proper connection delete workflow delete_asset(client, guid=result.guid, asset_type=Connection) @@ -63,7 +65,9 @@ def test_file( assert file.file_type == FileType.PDF assert file.file_path == "https://www.example.com" assert connection.qualified_name - assert file.connector_name == AtlanConnectorType.get_connector_name(connection.qualified_name) + assert file.connector_name == AtlanConnectorType.get_connector_name( + connection.qualified_name + ) @pytest.mark.order(after="test_file") diff --git a/tests/integration/gcs_asset_test.py b/tests/integration/gcs_asset_test.py index 49f42206f..d248820f9 100644 --- a/tests/integration/gcs_asset_test.py +++ b/tests/integration/gcs_asset_test.py @@ -29,15 +29,21 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def gcs_bucket(client: AtlanClient, connection: Connection) -> Generator[GCSBucket, None, None]: +def gcs_bucket( + client: AtlanClient, connection: Connection +) -> Generator[GCSBucket, None, None]: assert connection.qualified_name - to_create = GCSBucket.create(name=GCS_BUCKET_NAME, connection_qualified_name=connection.qualified_name) + to_create = GCSBucket.create( + name=GCS_BUCKET_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=GCSBucket)[0] yield result @@ -54,9 +60,13 @@ def test_gcs_bucket(client: AtlanClient, connection: Connection, gcs_bucket: GCS @pytest.fixture(scope="module") -def gcs_object(client: AtlanClient, connection: Connection, gcs_bucket: GCSBucket) -> Generator[GCSObject, None, None]: +def gcs_object( + client: AtlanClient, connection: Connection, gcs_bucket: GCSBucket +) -> Generator[GCSObject, None, None]: assert gcs_bucket.qualified_name - to_create = GCSObject.create(name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=gcs_bucket.qualified_name) + to_create = GCSObject.create( + name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=gcs_bucket.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=GCSObject)[0] yield result @@ -150,7 +160,9 @@ def test_retrieve_gcs_object( gcs_bucket: GCSBucket, gcs_object: GCSObject, ): - b = client.asset.get_by_guid(gcs_object.guid, asset_type=GCSObject, ignore_relationships=False) + b = client.asset.get_by_guid( + gcs_object.guid, asset_type=GCSObject, ignore_relationships=False + ) assert b assert not b.is_incomplete assert b.guid == gcs_object.guid @@ -221,7 +233,9 @@ def test_read_deleted_gcs_object( gcs_bucket: GCSBucket, gcs_object: GCSObject, ): - deleted = client.asset.get_by_guid(gcs_object.guid, asset_type=GCSObject, ignore_relationships=False) + deleted = client.asset.get_by_guid( + gcs_object.guid, asset_type=GCSObject, ignore_relationships=False + ) assert deleted assert deleted.guid == gcs_object.guid assert deleted.qualified_name == gcs_object.qualified_name @@ -236,7 +250,9 @@ def test_restore_object( gcs_object: GCSObject, ): assert gcs_object.qualified_name - assert client.asset.restore(asset_type=GCSObject, qualified_name=gcs_object.qualified_name) + assert client.asset.restore( + asset_type=GCSObject, qualified_name=gcs_object.qualified_name + ) assert gcs_object.qualified_name restored = client.asset.get_by_qualified_name( asset_type=GCSObject, diff --git a/tests/integration/glossary_test.py b/tests/integration/glossary_test.py index a22e9eb2d..5a7932f9e 100644 --- a/tests/integration/glossary_test.py +++ b/tests/integration/glossary_test.py @@ -40,7 +40,9 @@ def create_category( glossary: AtlasGlossary, parent: Optional[AtlasGlossaryCategory] = None, ) -> AtlasGlossaryCategory: - c = AtlasGlossaryCategory.create(name=name, anchor=glossary, parent_category=parent or None) + c = AtlasGlossaryCategory.create( + name=name, anchor=glossary, parent_category=parent or None + ) return client.asset.save(c).assets_created(AtlasGlossaryCategory)[0] @@ -78,7 +80,9 @@ def test_glossary( @pytest.fixture(scope="module") -def category(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryCategory, None, None]: +def category( + client: AtlanClient, glossary: AtlasGlossary +) -> Generator[AtlasGlossaryCategory, None, None]: c = create_category(client, MODULE_NAME, glossary) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -94,7 +98,9 @@ def hierarchy_glossary( @pytest.fixture(scope="module") -def top1_category(client: AtlanClient, hierarchy_glossary) -> Generator[AtlasGlossaryCategory, None, None]: +def top1_category( + client: AtlanClient, hierarchy_glossary +) -> Generator[AtlasGlossaryCategory, None, None]: c = create_category(client, TestId.make_unique("top1"), hierarchy_glossary) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -106,7 +112,9 @@ def mid1a_category( hierarchy_glossary: AtlasGlossary, top1_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category(client, TestId.make_unique("mid1a"), hierarchy_glossary, parent=top1_category) + c = create_category( + client, TestId.make_unique("mid1a"), hierarchy_glossary, parent=top1_category + ) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -122,7 +130,9 @@ def mid1a_term( client, name=f"mid1a_{TERM_NAME1}", glossary_guid=hierarchy_glossary.guid, - categories=[AtlasGlossaryCategory.ref_by_qualified_name(mid1a_category.qualified_name)], + categories=[ + AtlasGlossaryCategory.ref_by_qualified_name(mid1a_category.qualified_name) + ], ) yield t delete_asset(client, guid=t.guid, asset_type=AtlasGlossaryTerm) @@ -134,7 +144,9 @@ def leaf1aa_category( hierarchy_glossary: AtlasGlossary, mid1a_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category(client, TestId.make_unique("leaf1aa"), hierarchy_glossary, parent=mid1a_category) + c = create_category( + client, TestId.make_unique("leaf1aa"), hierarchy_glossary, parent=mid1a_category + ) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -145,7 +157,9 @@ def leaf1ab_category( hierarchy_glossary: AtlasGlossary, mid1a_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category(client, TestId.make_unique("leaf1ab"), hierarchy_glossary, parent=mid1a_category) + c = create_category( + client, TestId.make_unique("leaf1ab"), hierarchy_glossary, parent=mid1a_category + ) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -156,7 +170,9 @@ def mid1b_category( hierarchy_glossary: AtlasGlossary, top1_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category(client, TestId.make_unique("mid1b"), hierarchy_glossary, parent=top1_category) + c = create_category( + client, TestId.make_unique("mid1b"), hierarchy_glossary, parent=top1_category + ) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -167,7 +183,9 @@ def leaf1ba_category( hierarchy_glossary: AtlasGlossary, mid1b_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category(client, TestId.make_unique("leaf1ba"), hierarchy_glossary, parent=mid1b_category) + c = create_category( + client, TestId.make_unique("leaf1ba"), hierarchy_glossary, parent=mid1b_category + ) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -187,7 +205,9 @@ def mid2a_category( hierarchy_glossary: AtlasGlossary, top2_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category(client, TestId.make_unique("mid2a"), hierarchy_glossary, parent=top2_category) + c = create_category( + client, TestId.make_unique("mid2a"), hierarchy_glossary, parent=top2_category + ) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -198,7 +218,9 @@ def leaf2aa_category( hierarchy_glossary: AtlasGlossary, mid2a_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category(client, TestId.make_unique("leaf2aa"), hierarchy_glossary, parent=mid2a_category) + c = create_category( + client, TestId.make_unique("leaf2aa"), hierarchy_glossary, parent=mid2a_category + ) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -209,7 +231,9 @@ def leaf2ab_category( hierarchy_glossary: AtlasGlossary, mid2a_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category(client, TestId.make_unique("leaf2ab"), hierarchy_glossary, parent=mid2a_category) + c = create_category( + client, TestId.make_unique("leaf2ab"), hierarchy_glossary, parent=mid2a_category + ) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -220,7 +244,9 @@ def mid2b_category( hierarchy_glossary: AtlasGlossary, top2_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category(client, TestId.make_unique("mid2b"), hierarchy_glossary, parent=top2_category) + c = create_category( + client, TestId.make_unique("mid2b"), hierarchy_glossary, parent=top2_category + ) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) @@ -231,16 +257,22 @@ def leaf2ba_category( hierarchy_glossary: AtlasGlossary, mid2b_category: AtlasGlossaryCategory, ) -> Generator[AtlasGlossaryCategory, None, None]: - c = create_category(client, TestId.make_unique("leaf2ba"), hierarchy_glossary, parent=mid2b_category) + c = create_category( + client, TestId.make_unique("leaf2ba"), hierarchy_glossary, parent=mid2b_category + ) yield c delete_asset(client, guid=c.guid, asset_type=AtlasGlossaryCategory) -def test_category(client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary): +def test_category( + client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary +): assert category.guid assert category.name == MODULE_NAME assert category.qualified_name - c = client.asset.get_by_guid(category.guid, AtlasGlossaryCategory, ignore_relationships=False) + c = client.asset.get_by_guid( + category.guid, AtlasGlossaryCategory, ignore_relationships=False + ) assert c assert c.guid == category.guid assert c.anchor @@ -248,7 +280,9 @@ def test_category(client: AtlanClient, category: AtlasGlossaryCategory, glossary @pytest.fixture(scope="module") -def term1(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryTerm, None, None]: +def term1( + client: AtlanClient, glossary: AtlasGlossary +) -> Generator[AtlasGlossaryTerm, None, None]: t = create_term(client, name=TERM_NAME1, glossary_guid=glossary.guid) yield t delete_asset(client, guid=t.guid, asset_type=AtlasGlossaryTerm) @@ -263,7 +297,11 @@ def test_term_failure( match="ATLAN-PYTHON-404-000 Server responded with a not found " "error ATLAS-404-00-009: Instance AtlasGlossaryTerm with unique attribute *", ): - client.asset.update_merging_cm(AtlasGlossaryTerm.create(name=f"{TERM_NAME1} X", glossary_guid=glossary.guid)) + client.asset.update_merging_cm( + AtlasGlossaryTerm.create( + name=f"{TERM_NAME1} X", glossary_guid=glossary.guid + ) + ) def test_term1( @@ -275,7 +313,9 @@ def test_term1( assert term1.name == TERM_NAME1 assert term1.qualified_name assert term1.qualified_name != TERM_NAME1 - t = client.asset.get_by_guid(term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + t = client.asset.get_by_guid( + term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) assert t assert t.guid == term1.guid assert t.attributes.anchor @@ -283,7 +323,9 @@ def test_term1( @pytest.fixture(scope="module") -def term2(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryTerm, None, None]: +def term2( + client: AtlanClient, glossary: AtlasGlossary +) -> Generator[AtlasGlossaryTerm, None, None]: t = create_term(client, name=TERM_NAME2, glossary_guid=glossary.guid) yield t delete_asset(client, guid=t.guid, asset_type=AtlasGlossaryTerm) @@ -298,7 +340,9 @@ def test_term2( assert term2.name == TERM_NAME2 assert term2.qualified_name assert term2.qualified_name != TERM_NAME2 - t = client.asset.get_by_guid(term2.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + t = client.asset.get_by_guid( + term2.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) assert t assert t.guid == term2.guid assert t.attributes.anchor @@ -306,7 +350,9 @@ def test_term2( @pytest.fixture(scope="module") -def term3(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryTerm, None, None]: +def term3( + client: AtlanClient, glossary: AtlasGlossary +) -> Generator[AtlasGlossaryTerm, None, None]: t = create_term(client, name=TERM_NAME3, glossary_guid=glossary.guid) yield t delete_asset(client, guid=t.guid, asset_type=AtlasGlossaryTerm) @@ -321,7 +367,9 @@ def test_term3( assert term3.name == TERM_NAME3 assert term3.qualified_name assert term3.qualified_name != TERM_NAME3 - t = client.asset.get_by_guid(term3.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + t = client.asset.get_by_guid( + term3.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) assert t assert t.guid == term3.guid assert t.attributes.anchor @@ -329,7 +377,9 @@ def test_term3( @pytest.fixture(scope="module") -def term4(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryTerm, None, None]: +def term4( + client: AtlanClient, glossary: AtlasGlossary +) -> Generator[AtlasGlossaryTerm, None, None]: t = create_term(client, name=TERM_NAME4, glossary_guid=glossary.guid) yield t delete_asset(client, guid=t.guid, asset_type=AtlasGlossaryTerm) @@ -344,7 +394,9 @@ def test_term4( assert term4.name == TERM_NAME4 assert term4.qualified_name assert term4.qualified_name != TERM_NAME4 - t = client.asset.get_by_guid(term4.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + t = client.asset.get_by_guid( + term4.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) assert t assert t.guid == term4.guid assert t.attributes.anchor @@ -359,7 +411,9 @@ def test_read_glossary( term3: AtlasGlossaryTerm, term4: AtlasGlossaryTerm, ): - g = client.asset.get_by_guid(glossary.guid, asset_type=AtlasGlossary, ignore_relationships=False) + g = client.asset.get_by_guid( + glossary.guid, asset_type=AtlasGlossary, ignore_relationships=False + ) assert g assert isinstance(g, AtlasGlossary) assert g.guid == glossary.guid @@ -498,7 +552,9 @@ def test_term_trim_to_required( client: AtlanClient, term1: AtlasGlossaryTerm, ): - term1 = client.asset.get_by_guid(guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + term1 = client.asset.get_by_guid( + guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) term1 = term1.trim_to_required() response = client.asset.save(term1) assert response.mutated_entities is None @@ -508,7 +564,9 @@ def test_find_glossary_by_name(client: AtlanClient, glossary: AtlasGlossary): assert glossary.guid == client.asset.find_glossary_by_name(name=glossary.name).guid -def test_find_category_fast_by_name(client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary): +def test_find_category_fast_by_name( + client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary +): @retry( wait=wait_fixed(2), retry=retry_if_exception_type(NotFoundError), @@ -525,8 +583,15 @@ def check_it(): check_it() -def test_find_category_by_name(client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary): - assert category.guid == client.asset.find_category_by_name(name=category.name, glossary_name=glossary.name)[0].guid +def test_find_category_by_name( + client: AtlanClient, category: AtlasGlossaryCategory, glossary: AtlasGlossary +): + assert ( + category.guid + == client.asset.find_category_by_name( + name=category.name, glossary_name=glossary.name + )[0].guid + ) def test_find_category_by_name_qn_guid_correctly_populated( @@ -575,7 +640,9 @@ def test_category_delete_by_guid_raises_error_invalid_request_error( client.asset.delete_by_guid(guid=category.guid) -def test_find_term_fast_by_name(client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary): +def test_find_term_fast_by_name( + client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary +): @retry( wait=wait_fixed(2), retry=retry_if_exception_type(NotFoundError), @@ -592,8 +659,15 @@ def check_it(): check_it() -def test_find_term_by_name(client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary): - assert term1.guid == client.asset.find_term_by_name(name=term1.name, glossary_name=glossary.name).guid +def test_find_term_by_name( + client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary +): + assert ( + term1.guid + == client.asset.find_term_by_name( + name=term1.name, glossary_name=glossary.name + ).guid + ) @pytest.mark.parametrize( @@ -741,7 +815,9 @@ def test_create_relationship( response = client.asset.save(term) assert response - result = client.asset.get_by_guid(guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + result = client.asset.get_by_guid( + guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) assert result assert result.see_also assert len(result.see_also) == 2 @@ -776,7 +852,9 @@ def test_remove_relationship( response = client.asset.save(term) assert response - result = client.asset.get_by_guid(guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + result = client.asset.get_by_guid( + guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) assert result assert result.see_also active_relationships = [] @@ -811,7 +889,9 @@ def test_append_relationship( response = client.asset.save(term) assert response - result = client.asset.get_by_guid(guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + result = client.asset.get_by_guid( + guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) assert result assert result.see_also active_relationships = [] @@ -847,7 +927,9 @@ def test_append_relationship_again( response = client.asset.save(term) assert response - result = client.asset.get_by_guid(guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + result = client.asset.get_by_guid( + guid=term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) assert result assert result.see_also active_relationships = [] diff --git a/tests/integration/insights_test.py b/tests/integration/insights_test.py index 6e64edff6..1fffc8b3e 100644 --- a/tests/integration/insights_test.py +++ b/tests/integration/insights_test.py @@ -35,13 +35,21 @@ def collection(client: AtlanClient) -> Generator[Collection, None, None]: @pytest.fixture(scope="module") -def folder(client: AtlanClient, collection: Collection) -> Generator[Folder, None, None]: +def folder( + client: AtlanClient, collection: Collection +) -> Generator[Folder, None, None]: assert collection and collection.qualified_name - folder = Folder.creator(name=FOLDER_NAME, collection_qualified_name=collection.qualified_name) + folder = Folder.creator( + name=FOLDER_NAME, collection_qualified_name=collection.qualified_name + ) response = client.asset.save(folder) result = response.assets_created(asset_type=Folder)[0] updated = response.assets_updated(asset_type=Collection)[0] - assert updated and updated.guid == collection.guid and updated.qualified_name == collection.qualified_name + assert ( + updated + and updated.guid == collection.guid + and updated.qualified_name == collection.qualified_name + ) yield result delete_asset(client, guid=result.guid, asset_type=Folder) @@ -49,18 +57,26 @@ def folder(client: AtlanClient, collection: Collection) -> Generator[Folder, Non @pytest.fixture(scope="module") def sub_folder(client: AtlanClient, folder: Folder) -> Generator[Folder, None, None]: assert folder and folder.qualified_name - sub = Folder.creator(name=SUB_FOLDER_NAME, parent_folder_qualified_name=folder.qualified_name) + sub = Folder.creator( + name=SUB_FOLDER_NAME, parent_folder_qualified_name=folder.qualified_name + ) response = client.asset.save(sub) result = response.assets_created(asset_type=Folder)[0] updated = response.assets_updated(asset_type=Folder)[0] - assert updated and updated.guid == folder.guid and updated.qualified_name == folder.qualified_name + assert ( + updated + and updated.guid == folder.guid + and updated.qualified_name == folder.qualified_name + ) yield result delete_asset(client, guid=result.guid, asset_type=Folder) @pytest.fixture(scope="module") def query(client: AtlanClient, folder: Folder) -> Generator[Query, None, None]: - connection = client.find_connections_by_name(name=CONNECTION_NAME, connector_type=AtlanConnectorType.SNOWFLAKE) + connection = client.find_connections_by_name( + name=CONNECTION_NAME, connector_type=AtlanConnectorType.SNOWFLAKE + ) assert connection and len(connection) == 1 and connection[0].qualified_name results = ( FluentSearch() @@ -74,12 +90,20 @@ def query(client: AtlanClient, folder: Folder) -> Generator[Query, None, None]: schema = results.current_page()[0] assert schema and schema.qualified_name assert folder and folder.qualified_name - to_create = Query.creator(name=QUERY_NAME, parent_folder_qualified_name=folder.qualified_name) - to_create.with_raw_query(schema_qualified_name=schema.qualified_name, query=RAW_QUERY) + to_create = Query.creator( + name=QUERY_NAME, parent_folder_qualified_name=folder.qualified_name + ) + to_create.with_raw_query( + schema_qualified_name=schema.qualified_name, query=RAW_QUERY + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=Query)[0] updated = response.assets_updated(asset_type=Folder)[0] - assert updated and updated.guid == folder.guid and updated.qualified_name == folder.qualified_name + assert ( + updated + and updated.guid == folder.guid + and updated.qualified_name == folder.qualified_name + ) yield result delete_asset(client, guid=result.guid, asset_type=Folder) @@ -106,7 +130,9 @@ def test_create_sub_folder(sub_folder: Folder, folder: Folder, collection: Colle assert sub_folder.parent_qualified_name == folder.qualified_name -def test_create_query(client: AtlanClient, query: Query, folder: Folder, collection: Collection): +def test_create_query( + client: AtlanClient, query: Query, folder: Folder, collection: Collection +): assert query assert query.name == QUERY_NAME assert query.guid and query.qualified_name diff --git a/tests/integration/kafka_asset_test.py b/tests/integration/kafka_asset_test.py index bd13f3984..ca3a0b87d 100644 --- a/tests/integration/kafka_asset_test.py +++ b/tests/integration/kafka_asset_test.py @@ -31,15 +31,21 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.KAFKA) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.KAFKA + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def kafka_topic(client: AtlanClient, connection: Connection) -> Generator[KafkaTopic, None, None]: +def kafka_topic( + client: AtlanClient, connection: Connection +) -> Generator[KafkaTopic, None, None]: assert connection.qualified_name - to_create = KafkaTopic.creator(name=KAKFA_TOPIC_NAME, connection_qualified_name=connection.qualified_name) + to_create = KafkaTopic.creator( + name=KAKFA_TOPIC_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=KafkaTopic)[0] yield result @@ -60,7 +66,9 @@ def test_kafka_topic( @pytest.fixture(scope="module") -def consumer_group(client: AtlanClient, kafka_topic: KafkaTopic) -> Generator[KafkaConsumerGroup, None, None]: +def consumer_group( + client: AtlanClient, kafka_topic: KafkaTopic +) -> Generator[KafkaConsumerGroup, None, None]: assert kafka_topic.qualified_name to_create = KafkaConsumerGroup.creator( name=KAKFA_CONSUMER_GROUP_NAME, @@ -130,7 +138,9 @@ def test_update_kafka_assets( def _retrieve_kafka_assets(client, asset, asset_type): - retrieved = client.asset.get_by_guid(asset.guid, asset_type=asset_type, ignore_relationships=False) + retrieved = client.asset.get_by_guid( + asset.guid, asset_type=asset_type, ignore_relationships=False + ) assert retrieved assert not retrieved.is_incomplete assert retrieved.guid == asset.guid @@ -175,7 +185,9 @@ def test_read_deleted_kafka_consumer_group( client: AtlanClient, consumer_group: KafkaConsumerGroup, ): - deleted = client.asset.get_by_guid(consumer_group.guid, asset_type=KafkaConsumerGroup, ignore_relationships=False) + deleted = client.asset.get_by_guid( + consumer_group.guid, asset_type=KafkaConsumerGroup, ignore_relationships=False + ) assert deleted assert deleted.status == EntityStatus.DELETED assert deleted.guid == consumer_group.guid @@ -188,7 +200,9 @@ def test_restore_kafka_consumer_group( consumer_group: KafkaConsumerGroup, ): assert consumer_group.qualified_name - assert client.asset.restore(asset_type=KafkaConsumerGroup, qualified_name=consumer_group.qualified_name) + assert client.asset.restore( + asset_type=KafkaConsumerGroup, qualified_name=consumer_group.qualified_name + ) assert consumer_group.qualified_name restored = client.asset.get_by_qualified_name( asset_type=KafkaConsumerGroup, diff --git a/tests/integration/lineage_test.py b/tests/integration/lineage_test.py index e31cbc8f9..91ec86281 100644 --- a/tests/integration/lineage_test.py +++ b/tests/integration/lineage_test.py @@ -50,21 +50,29 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result # TODO: proper connection delete workflow delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def database(client: AtlanClient, connection: Connection) -> Generator[Database, None, None]: - db = create_database(client=client, connection=connection, database_name=DATABASE_NAME) +def database( + client: AtlanClient, connection: Connection +) -> Generator[Database, None, None]: + db = create_database( + client=client, connection=connection, database_name=DATABASE_NAME + ) yield db delete_asset(client, guid=db.guid, asset_type=Database) def create_database(client: AtlanClient, connection, database_name: str): - to_create = Database.create(name=database_name, connection_qualified_name=connection.qualified_name) + to_create = Database.create( + name=database_name, connection_qualified_name=connection.qualified_name + ) to_create.certificate_status = CERTIFICATE_STATUS to_create.certificate_status_message = CERTIFICATE_MESSAGE result = client.asset.save(to_create) @@ -78,7 +86,9 @@ def schema( database: Database, ) -> Generator[Schema, None, None]: assert database.qualified_name - to_create = Schema.create(name=SCHEMA_NAME, database_qualified_name=database.qualified_name) + to_create = Schema.create( + name=SCHEMA_NAME, database_qualified_name=database.qualified_name + ) result = client.asset.save(to_create) sch = result.assets_created(asset_type=Schema)[0] yield sch @@ -93,7 +103,9 @@ def table( schema: Schema, ) -> Generator[Table, None, None]: assert schema.qualified_name - to_create = Table.create(name=TABLE_NAME, schema_qualified_name=schema.qualified_name) + to_create = Table.create( + name=TABLE_NAME, schema_qualified_name=schema.qualified_name + ) result = client.asset.save(to_create) tbl = result.assets_created(asset_type=Table)[0] yield tbl @@ -108,7 +120,9 @@ def mview( schema: Schema, ) -> Generator[MaterialisedView, None, None]: assert schema.qualified_name - to_create = MaterialisedView.create(name=MVIEW_NAME, schema_qualified_name=schema.qualified_name) + to_create = MaterialisedView.create( + name=MVIEW_NAME, schema_qualified_name=schema.qualified_name + ) result = client.asset.save(to_create) mv = result.assets_created(asset_type=MaterialisedView)[0] yield mv @@ -428,7 +442,9 @@ def test_fetch_lineage_start_list( lineage_start: Process, lineage_end: Process, ): - lineage = FluentLineage(starting_guid=table.guid, includes_on_results=Asset.NAME, size=1).request + lineage = FluentLineage( + starting_guid=table.guid, includes_on_results=Asset.NAME, size=1 + ).request response = client.asset.get_lineage_list(lineage) assert response results = [] @@ -445,7 +461,9 @@ def test_fetch_lineage_start_list( assert isinstance(results[3], View) assert results[3].depth == 2 assert results[3].guid == view.guid - lineage = FluentLineage(starting_guid=table.guid, direction=LineageDirection.UPSTREAM).request + lineage = FluentLineage( + starting_guid=table.guid, direction=LineageDirection.UPSTREAM + ).request response = client.asset.get_lineage_list(lineage) assert response assert not response.has_more @@ -526,7 +544,9 @@ def test_fetch_lineage_middle_list( lineage_start: Process, lineage_end: Process, ): - lineage = FluentLineage(starting_guid=mview.guid, includes_on_results=Asset.NAME, size=5).request + lineage = FluentLineage( + starting_guid=mview.guid, includes_on_results=Asset.NAME, size=5 + ).request response = client.asset.get_lineage_list(lineage) assert response results = [] @@ -536,7 +556,9 @@ def test_fetch_lineage_middle_list( assert isinstance(results[0], Process) assert isinstance(results[1], View) assert results[1].guid == view.guid - lineage = FluentLineage(starting_guid=mview.guid, direction=LineageDirection.UPSTREAM, size=5).request + lineage = FluentLineage( + starting_guid=mview.guid, direction=LineageDirection.UPSTREAM, size=5 + ).request response = client.asset.get_lineage_list(lineage) assert response results = [] @@ -559,11 +581,15 @@ def test_fetch_lineage_end_list( lineage_start: Process, lineage_end: Process, ): - lineage = FluentLineage(starting_guid=view.guid, includes_on_results=Asset.NAME, size=10).request + lineage = FluentLineage( + starting_guid=view.guid, includes_on_results=Asset.NAME, size=10 + ).request response = client.asset.get_lineage_list(lineage) assert response assert not response.has_more - lineage = FluentLineage(starting_guid=view.guid, direction=LineageDirection.UPSTREAM).request + lineage = FluentLineage( + starting_guid=view.guid, direction=LineageDirection.UPSTREAM + ).request response = client.asset.get_lineage_list(lineage) assert response results = [] @@ -670,16 +696,22 @@ def test_restore_lineage( ): assert lineage_start.qualified_name assert lineage_start.name - to_restore = Process.create_for_modification(lineage_start.qualified_name, lineage_start.name) + to_restore = Process.create_for_modification( + lineage_start.qualified_name, lineage_start.name + ) to_restore.status = EntityStatus.ACTIVE client.asset.save(to_restore) - restored = client.asset.get_by_guid(lineage_start.guid, asset_type=Process, ignore_relationships=False) + restored = client.asset.get_by_guid( + lineage_start.guid, asset_type=Process, ignore_relationships=False + ) assert restored count = 0 # TODO: replace with exponential back-off and jitter while restored.status == EntityStatus.DELETED: time.sleep(2) - restored = client.asset.get_by_guid(lineage_start.guid, asset_type=Process, ignore_relationships=False) + restored = client.asset.get_by_guid( + lineage_start.guid, asset_type=Process, ignore_relationships=False + ) count += 1 assert restored.guid == lineage_start.guid assert restored.qualified_name == lineage_start.qualified_name diff --git a/tests/integration/persona_test.py b/tests/integration/persona_test.py index 2684763d3..9e51a8b96 100644 --- a/tests/integration/persona_test.py +++ b/tests/integration/persona_test.py @@ -26,7 +26,9 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result # TODO: proper connection delete workflow delete_asset(client, guid=result.guid, asset_type=Connection) @@ -77,7 +79,9 @@ def test_update_persona( ): assert persona.qualified_name assert persona.name - to_update = Persona.create_for_modification(persona.qualified_name, persona.name, True) + to_update = Persona.create_for_modification( + persona.qualified_name, persona.name, True + ) to_update.description = "Now with a description!" to_update.deny_asset_tabs = { AssetSidebarTab.LINEAGE.value, @@ -185,7 +189,9 @@ def test_retrieve_persona( for policy in policies: # Need to retrieve the full policy if we want to see any info about it # (what comes back on the Persona itself are just policy references) - full = client.asset.get_by_guid(guid=policy.guid, asset_type=AuthPolicy, ignore_relationships=False) + full = client.asset.get_by_guid( + guid=policy.guid, asset_type=AuthPolicy, ignore_relationships=False + ) assert full sub_cat = full.policy_sub_category assert sub_cat diff --git a/tests/integration/preset_asset_test.py b/tests/integration/preset_asset_test.py index 5b662b72a..cf66f00df 100644 --- a/tests/integration/preset_asset_test.py +++ b/tests/integration/preset_asset_test.py @@ -39,15 +39,21 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def preset_workspace(client: AtlanClient, connection: Connection) -> Generator[PresetWorkspace, None, None]: +def preset_workspace( + client: AtlanClient, connection: Connection +) -> Generator[PresetWorkspace, None, None]: assert connection.qualified_name - to_create = PresetWorkspace.create(name=PRESET_WORKSPACE_NAME, connection_qualified_name=connection.qualified_name) + to_create = PresetWorkspace.create( + name=PRESET_WORKSPACE_NAME, connection_qualified_name=connection.qualified_name + ) response = client.asset.save(to_create) result = response.assets_created(asset_type=PresetWorkspace)[0] yield result @@ -120,13 +126,17 @@ def test_overload_preset_dashboard( assert preset_dashboard_overload assert preset_dashboard_overload.guid assert preset_dashboard_overload.qualified_name - assert preset_dashboard_overload.connection_qualified_name == connection.qualified_name + assert ( + preset_dashboard_overload.connection_qualified_name == connection.qualified_name + ) assert preset_dashboard_overload.name == PRESET_DASHBOARD_NAME_OVERLOAD assert preset_dashboard_overload.connector_name == AtlanConnectorType.PRESET.value @pytest.fixture(scope="module") -def preset_chart(client: AtlanClient, preset_dashboard: PresetDashboard) -> Generator[PresetChart, None, None]: +def preset_chart( + client: AtlanClient, preset_dashboard: PresetDashboard +) -> Generator[PresetChart, None, None]: assert preset_dashboard.qualified_name to_create = PresetChart.create( name=PRESET_CHART_NAME, @@ -146,7 +156,9 @@ def test_preset_chart( assert preset_chart assert preset_chart.guid assert preset_chart.qualified_name - assert preset_chart.preset_dashboard_qualified_name == preset_dashboard.qualified_name + assert ( + preset_chart.preset_dashboard_qualified_name == preset_dashboard.qualified_name + ) assert preset_chart.name == PRESET_CHART_NAME assert preset_chart.connector_name == AtlanConnectorType.PRESET.value @@ -178,7 +190,10 @@ def test_overload_preset_chart( assert preset_chart_overload assert preset_chart_overload.guid assert preset_chart_overload.qualified_name - assert preset_chart_overload.preset_dashboard_qualified_name == preset_dashboard_overload.qualified_name + assert ( + preset_chart_overload.preset_dashboard_qualified_name + == preset_dashboard_overload.qualified_name + ) assert preset_chart_overload.name == PRESET_CHART_NAME_OVERLOAD assert preset_chart_overload.connector_name == AtlanConnectorType.PRESET.value @@ -238,7 +253,9 @@ def test_overload_preset_dataset( assert preset_dataset_overload assert preset_dataset_overload.guid assert preset_dataset_overload.qualified_name - assert preset_dataset_overload.connection_qualified_name == connection.qualified_name + assert ( + preset_dataset_overload.connection_qualified_name == connection.qualified_name + ) assert preset_dataset_overload.name == PRESET_DATASET_NAME_OVERLOAD assert preset_dataset_overload.connector_name == AtlanConnectorType.PRESET.value @@ -314,7 +331,9 @@ def test_retrieve_preset_dashboard( client: AtlanClient, preset_dashboard: PresetDashboard, ): - b = client.asset.get_by_guid(preset_dashboard.guid, asset_type=PresetDashboard, ignore_relationships=False) + b = client.asset.get_by_guid( + preset_dashboard.guid, asset_type=PresetDashboard, ignore_relationships=False + ) assert b assert not b.is_incomplete assert b.guid == preset_dashboard.guid @@ -356,7 +375,9 @@ def test_update_preset_dashboard_again( @pytest.mark.order(after="test_update_preset_dashboard_again") -def test_delete_preset_dashboard(client: AtlanClient, preset_dashboard: PresetDashboard): +def test_delete_preset_dashboard( + client: AtlanClient, preset_dashboard: PresetDashboard +): response = client.asset.delete_by_guid(preset_dashboard.guid) assert response assert not response.assets_created(asset_type=PresetDashboard) @@ -376,7 +397,9 @@ def test_restore_dashboard( preset_dashboard: PresetDashboard, ): assert preset_dashboard.qualified_name - assert client.asset.restore(asset_type=PresetDashboard, qualified_name=preset_dashboard.qualified_name) + assert client.asset.restore( + asset_type=PresetDashboard, qualified_name=preset_dashboard.qualified_name + ) assert preset_dashboard.qualified_name restored = client.asset.get_by_qualified_name( asset_type=PresetDashboard, diff --git a/tests/integration/purpose_test.py b/tests/integration/purpose_test.py index 84712f92b..b12155bac 100644 --- a/tests/integration/purpose_test.py +++ b/tests/integration/purpose_test.py @@ -38,7 +38,9 @@ @pytest.fixture(scope="module") def snowflake_conn(client: AtlanClient): - return client.asset.find_connections_by_name("development", AtlanConnectorType.SNOWFLAKE)[0] + return client.asset.find_connections_by_name( + "development", AtlanConnectorType.SNOWFLAKE + )[0] @pytest.fixture(scope="module") @@ -131,7 +133,9 @@ def test_purpose(client: AtlanClient, purpose: Purpose, atlan_tag_name: AtlanTag assert purpose.name == MODULE_NAME assert purpose.display_name == MODULE_NAME assert purpose.qualified_name != MODULE_NAME - purpose = client.asset.get_by_guid(guid=purpose.guid, asset_type=Purpose, ignore_relationships=False) + purpose = client.asset.get_by_guid( + guid=purpose.guid, asset_type=Purpose, ignore_relationships=False + ) assert purpose.purpose_atlan_tags assert [atlan_tag_name] == purpose.purpose_atlan_tags @@ -143,7 +147,9 @@ def test_update_purpose( ): assert purpose.qualified_name assert purpose.name - to_update = Purpose.create_for_modification(purpose.qualified_name, purpose.name, True) + to_update = Purpose.create_for_modification( + purpose.qualified_name, purpose.name, True + ) to_update.description = "Now with a description!" to_update.deny_asset_tabs = { AssetSidebarTab.LINEAGE.value, @@ -169,7 +175,9 @@ def test_find_purpose_by_name( ): result = None with contextlib.suppress(NotFoundError): - result = client.asset.find_purposes_by_name(MODULE_NAME, attributes=["purposeClassifications"]) + result = client.asset.find_purposes_by_name( + MODULE_NAME, attributes=["purposeClassifications"] + ) count = 0 # TODO: replace with exponential back-off and jitter while not result and count < 10: @@ -240,7 +248,9 @@ def test_retrieve_purpose( for policy in policies: # Need to retrieve the full policy if we want to see any info about it # (what comes back on the Persona itself are just policy references) - full = client.asset.get_by_guid(guid=policy.guid, asset_type=AuthPolicy, ignore_relationships=False) + full = client.asset.get_by_guid( + guid=policy.guid, asset_type=AuthPolicy, ignore_relationships=False + ) assert full sub_cat = full.policy_sub_category assert sub_cat @@ -279,7 +289,10 @@ def test_token_permissions(client: AtlanClient, token): assert result.attributes assert result.attributes.persona_qualified_name assert len(result.attributes.persona_qualified_name) == 1 - assert next(iter(result.attributes.persona_qualified_name)).persona_qualified_name == persona.qualified_name + assert ( + next(iter(result.attributes.persona_qualified_name)).persona_qualified_name + == persona.qualified_name + ) @pytest.mark.skip(reason="Test failing with HekaException") diff --git a/tests/integration/quick_sight_asset_test.py b/tests/integration/quick_sight_asset_test.py index 430300f65..6a04dfe55 100644 --- a/tests/integration/quick_sight_asset_test.py +++ b/tests/integration/quick_sight_asset_test.py @@ -46,13 +46,17 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def quick_sight_folder(client: AtlanClient, connection: Connection) -> Generator[QuickSightFolder, None, None]: +def quick_sight_folder( + client: AtlanClient, connection: Connection +) -> Generator[QuickSightFolder, None, None]: assert connection.qualified_name to_create = QuickSightFolder.creator( name=QUICKSIGHT_FOLDER_NAME, @@ -183,7 +187,9 @@ def quick_sight_dashboard_visual( delete_asset(client, guid=result.guid, asset_type=QuickSightDashboardVisual) -def test_sight_folder(client: AtlanClient, connection: Connection, quick_sight_folder: QuickSightFolder): +def test_sight_folder( + client: AtlanClient, connection: Connection, quick_sight_folder: QuickSightFolder +): assert quick_sight_folder assert quick_sight_folder.guid assert quick_sight_folder.qualified_name @@ -209,7 +215,9 @@ def test_sight_folder(client: AtlanClient, connection: Connection, quick_sight_f assert asset.qualified_name == quick_sight_folder.qualified_name -def test_sight_dataset(client: AtlanClient, connection: Connection, quick_sight_dataset: QuickSightDataset): +def test_sight_dataset( + client: AtlanClient, connection: Connection, quick_sight_dataset: QuickSightDataset +): assert quick_sight_dataset assert quick_sight_dataset.guid assert quick_sight_dataset.qualified_name @@ -217,7 +225,10 @@ def test_sight_dataset(client: AtlanClient, connection: Connection, quick_sight_ assert quick_sight_dataset.quick_sight_id == QUICKSIGHT_DATASET_ID assert quick_sight_dataset.connection_qualified_name == connection.qualified_name assert quick_sight_dataset.connector_name == AtlanConnectorType.QUICKSIGHT.value - assert quick_sight_dataset.quick_sight_dataset_import_mode == QuickSightDatasetImportMode.SPICE + assert ( + quick_sight_dataset.quick_sight_dataset_import_mode + == QuickSightDatasetImportMode.SPICE + ) to_update = quick_sight_dataset.updater( name=quick_sight_dataset.name, qualified_name=quick_sight_dataset.qualified_name @@ -308,10 +319,20 @@ def test_sight_dataset_field( assert quick_sight_dataset_field.qualified_name assert quick_sight_dataset_field.name == QUICKSIGHT_DATASET_FIELD_NAME assert quick_sight_dataset_field.quick_sight_id == QUICKSIGHT_DATASET_FIELD_ID - assert quick_sight_dataset_field.connection_qualified_name == connection.qualified_name - assert quick_sight_dataset_field.connector_name == AtlanConnectorType.QUICKSIGHT.value - assert quick_sight_dataset_field.quick_sight_dataset_qualified_name == quick_sight_dataset.qualified_name - assert quick_sight_dataset_field.quick_sight_dataset_field_type == QuickSightDatasetFieldType.STRING + assert ( + quick_sight_dataset_field.connection_qualified_name == connection.qualified_name + ) + assert ( + quick_sight_dataset_field.connector_name == AtlanConnectorType.QUICKSIGHT.value + ) + assert ( + quick_sight_dataset_field.quick_sight_dataset_qualified_name + == quick_sight_dataset.qualified_name + ) + assert ( + quick_sight_dataset_field.quick_sight_dataset_field_type + == QuickSightDatasetFieldType.STRING + ) to_update = quick_sight_dataset_field.updater( name=quick_sight_dataset_field.name, @@ -342,9 +363,18 @@ def test_sight_analysis_visual( assert quick_sight_analysis_visual.qualified_name assert quick_sight_analysis_visual.name == QUICKSIGHT_ANALYSIS_VISUAL_NAME assert quick_sight_analysis_visual.quick_sight_id == QUICKSIGHT_ANALYSIS_VISUAL_ID - assert quick_sight_analysis_visual.connection_qualified_name == connection.qualified_name - assert quick_sight_analysis_visual.connector_name == AtlanConnectorType.QUICKSIGHT.value - assert quick_sight_analysis_visual.quick_sight_analysis_qualified_name == quick_sight_analysis.qualified_name + assert ( + quick_sight_analysis_visual.connection_qualified_name + == connection.qualified_name + ) + assert ( + quick_sight_analysis_visual.connector_name + == AtlanConnectorType.QUICKSIGHT.value + ) + assert ( + quick_sight_analysis_visual.quick_sight_analysis_qualified_name + == quick_sight_analysis.qualified_name + ) assert quick_sight_analysis_visual.quick_sight_sheet_id == QUICKSIGHT_SHEET_ID assert quick_sight_analysis_visual.quick_sight_sheet_name == QUICKSIGHT_SHEET_NAME @@ -377,9 +407,18 @@ def test_sight_dashboard_visual( assert quick_sight_dashboard_visual.qualified_name assert quick_sight_dashboard_visual.name == QUICKSIGHT_DASHBOARD_VISUAL_NAME assert quick_sight_dashboard_visual.quick_sight_id == QUICKSIGHT_DASHBOARD_VISUAL_ID - assert quick_sight_dashboard_visual.connection_qualified_name == connection.qualified_name - assert quick_sight_dashboard_visual.connector_name == AtlanConnectorType.QUICKSIGHT.value - assert quick_sight_dashboard_visual.quick_sight_dashboard_qualified_name == quick_sight_dashboard.qualified_name + assert ( + quick_sight_dashboard_visual.connection_qualified_name + == connection.qualified_name + ) + assert ( + quick_sight_dashboard_visual.connector_name + == AtlanConnectorType.QUICKSIGHT.value + ) + assert ( + quick_sight_dashboard_visual.quick_sight_dashboard_qualified_name + == quick_sight_dashboard.qualified_name + ) assert quick_sight_dashboard_visual.quick_sight_sheet_id == QUICKSIGHT_SHEET_ID assert quick_sight_dashboard_visual.quick_sight_sheet_name == QUICKSIGHT_SHEET_NAME diff --git a/tests/integration/requests_test.py b/tests/integration/requests_test.py index 3f93473ce..16d62fe53 100644 --- a/tests/integration/requests_test.py +++ b/tests/integration/requests_test.py @@ -23,7 +23,11 @@ def delete_token(client: AtlanClient, token: Optional[ApiToken] = None): if not token: tokens = client.token.get().records assert tokens - delete_tokens = [token for token in tokens if token.display_name and "psdk_Requests" in token.display_name] + delete_tokens = [ + token + for token in tokens + if token.display_name and "psdk_Requests" in token.display_name + ] for token in delete_tokens: assert token and token.guid client.token.purge(token.guid) diff --git a/tests/integration/s3_asset_test.py b/tests/integration/s3_asset_test.py index 55d37396b..662433723 100644 --- a/tests/integration/s3_asset_test.py +++ b/tests/integration/s3_asset_test.py @@ -34,14 +34,18 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result # TODO: proper connection delete workflow delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def bucket(client: AtlanClient, connection: Connection) -> Generator[S3Bucket, None, None]: +def bucket( + client: AtlanClient, connection: Connection +) -> Generator[S3Bucket, None, None]: assert connection.qualified_name to_create = S3Bucket.create( name=BUCKET_NAME, @@ -55,7 +59,9 @@ def bucket(client: AtlanClient, connection: Connection) -> Generator[S3Bucket, N @pytest.fixture(scope="module") -def bucket_with_name(client: AtlanClient, connection: Connection) -> Generator[S3Bucket, None, None]: +def bucket_with_name( + client: AtlanClient, connection: Connection +) -> Generator[S3Bucket, None, None]: assert connection.qualified_name to_create = S3Bucket.create( name=BUCKET_NAME, @@ -173,7 +179,9 @@ def _assert_update_bucket(client, bucket, with_name=False): def _assert_retrieve_bucket(client, bucket, s3object, with_name=False): - b = client.asset.get_by_guid(bucket.guid, asset_type=S3Bucket, ignore_relationships=False) + b = client.asset.get_by_guid( + bucket.guid, asset_type=S3Bucket, ignore_relationships=False + ) assert b assert not b.is_incomplete assert b.guid == bucket.guid @@ -236,7 +244,9 @@ def _assert_delete_object(client, s3object): def _assert_read_delete_object(client, s3object): - deleted = client.asset.get_by_guid(s3object.guid, asset_type=S3Object, ignore_relationships=False) + deleted = client.asset.get_by_guid( + s3object.guid, asset_type=S3Object, ignore_relationships=False + ) assert deleted assert deleted.guid == s3object.guid assert deleted.qualified_name == s3object.qualified_name @@ -245,7 +255,9 @@ def _assert_read_delete_object(client, s3object): def _assert_restore_object(client, s3object): assert s3object.qualified_name - assert client.asset.restore(asset_type=S3Object, qualified_name=s3object.qualified_name) + assert client.asset.restore( + asset_type=S3Object, qualified_name=s3object.qualified_name + ) assert s3object.qualified_name restored = client.asset.get_by_qualified_name( asset_type=S3Object, @@ -327,7 +339,9 @@ def test_retrieve_bucket_with_name( bucket_with_name: S3Bucket, s3object_with_name: S3Object, ): - _assert_retrieve_bucket(client, bucket_with_name, s3object_with_name, with_name=True) + _assert_retrieve_bucket( + client, bucket_with_name, s3object_with_name, with_name=True + ) @pytest.mark.order(after="test_retrieve_bucket") diff --git a/tests/integration/suggestions_test.py b/tests/integration/suggestions_test.py index 7a07fff91..3be485ee7 100644 --- a/tests/integration/suggestions_test.py +++ b/tests/integration/suggestions_test.py @@ -57,7 +57,9 @@ def wait_for_consistency(): @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @@ -68,7 +70,9 @@ def database( connection: Connection, upsert: Callable[[Asset], AssetMutationResponse], ): - to_create = Database.creator(name=DATABASE_NAME, connection_qualified_name=connection.qualified_name) + to_create = Database.creator( + name=DATABASE_NAME, connection_qualified_name=connection.qualified_name + ) result = upsert(to_create) assert result database = result.assets_created(asset_type=Database)[0] @@ -441,7 +445,9 @@ def owner_group( def test_connection(client: AtlanClient, connection: Connection): - results = client.asset.find_connections_by_name(name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE) + results = client.asset.find_connections_by_name( + name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE + ) assert results and len(results) == 1 assert results[0].guid == connection.guid assert results[0].qualified_name == connection.qualified_name @@ -602,7 +608,9 @@ def test_update_table1( response = client.asset.save(to_update, replace_atlan_tags=True) assert response and response.mutated_entities - assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 # table + 2x terms + assert ( + response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 + ) # table + 2x terms expected_types = {asset.type_name for asset in response.mutated_entities.UPDATE} assert expected_types == {Table.__name__, AtlasGlossaryTerm.__name__} assert (tables := response.assets_updated(asset_type=Table)) @@ -646,7 +654,9 @@ def test_update_table3( response = client.asset.save(to_update, replace_atlan_tags=True) assert response and response.mutated_entities - assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 # table + 2x terms + assert ( + response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 + ) # table + 2x terms expected_types = {asset.type_name for asset in response.mutated_entities.UPDATE} assert expected_types == {Table.__name__, AtlasGlossaryTerm.__name__} assert (tables := response.assets_updated(asset_type=Table)) @@ -688,7 +698,9 @@ def test_update_table1_column1( response = client.asset.save(to_update, replace_atlan_tags=True) assert response and response.mutated_entities - assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 # column + 2x terms + assert ( + response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 3 + ) # column + 2x terms expected_types = {asset.type_name for asset in response.mutated_entities.UPDATE} assert expected_types == {Column.__name__, AtlasGlossaryTerm.__name__} assert (columns := response.assets_updated(asset_type=Column)) @@ -725,7 +737,9 @@ def test_update_view1_column1( response = client.asset.save(to_update, replace_atlan_tags=True) assert response and response.mutated_entities - assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 2 # column + term + assert ( + response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 2 + ) # column + term expected_types = {asset.type_name for asset in response.mutated_entities.UPDATE} assert expected_types == {Column.__name__, AtlasGlossaryTerm.__name__} assert (columns := response.assets_updated(asset_type=Column)) @@ -762,9 +776,13 @@ def test_suggestions_default( assert response.atlan_tags[1].value == ATLAN_TAG_NAME1 assert response.assigned_terms and len(response.assigned_terms) == 2 assert response.assigned_terms[0].count == 2 - assert response.assigned_terms[0].value == AtlasGlossaryTerm.ref_by_qualified_name(term2.qualified_name) + assert response.assigned_terms[0].value == AtlasGlossaryTerm.ref_by_qualified_name( + term2.qualified_name + ) assert response.assigned_terms[1].count == 1 - assert response.assigned_terms[1].value == AtlasGlossaryTerm.ref_by_qualified_name(term1.qualified_name) + assert response.assigned_terms[1].value == AtlasGlossaryTerm.ref_by_qualified_name( + term1.qualified_name + ) def test_suggestions_accross_types( @@ -777,7 +795,12 @@ def test_suggestions_accross_types( assert term1 and term1.qualified_name assert term2 and term2.qualified_name assert owner_group and owner_group.name - response = Suggestions(includes=Suggestions.TYPE.all()).finder(view1).with_other_type("Table").get() + response = ( + Suggestions(includes=Suggestions.TYPE.all()) + .finder(view1) + .with_other_type("Table") + .get() + ) assert response assert response.owner_groups and len(response.owner_groups) == 1 @@ -849,7 +872,9 @@ def test_apply_t2c1( ) assert response and response.mutated_entities - assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 2 # column + term + assert ( + response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 2 + ) # column + term one = response.mutated_entities.UPDATE[0] assert one and one.owner_groups == {owner_group.name} # System description should be untouched (still empty) @@ -874,7 +899,9 @@ def test_apply_v2c1( ) assert response and response.mutated_entities - assert response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 1 + assert ( + response.mutated_entities.UPDATE and len(response.mutated_entities.UPDATE) == 1 + ) one = response.mutated_entities.UPDATE[0] assert one and one.owner_groups == set() # System description should be untouched (still empty) diff --git a/tests/integration/superset_asset_test.py b/tests/integration/superset_asset_test.py index 4ba04db63..987d32fde 100644 --- a/tests/integration/superset_asset_test.py +++ b/tests/integration/superset_asset_test.py @@ -36,13 +36,17 @@ @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=MODULE_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @pytest.fixture(scope="module") -def superset_dashboard(client: AtlanClient, connection: Connection) -> Generator[SupersetDashboard, None, None]: +def superset_dashboard( + client: AtlanClient, connection: Connection +) -> Generator[SupersetDashboard, None, None]: assert connection.qualified_name to_create = SupersetDashboard.create( name=SUPERSET_DASHBOARD_NAME, @@ -68,7 +72,9 @@ def test_superset_dashboard( @pytest.fixture(scope="module") -def superset_chart(client: AtlanClient, superset_dashboard: SupersetDashboard) -> Generator[SupersetChart, None, None]: +def superset_chart( + client: AtlanClient, superset_dashboard: SupersetDashboard +) -> Generator[SupersetChart, None, None]: assert superset_dashboard.qualified_name to_create = SupersetChart.create( name=SUPERSET_CHART_NAME, @@ -88,7 +94,10 @@ def test_superset_chart( assert superset_chart assert superset_chart.guid assert superset_chart.qualified_name - assert superset_chart.superset_dashboard_qualified_name == superset_dashboard.qualified_name + assert ( + superset_chart.superset_dashboard_qualified_name + == superset_dashboard.qualified_name + ) assert superset_chart.name == SUPERSET_CHART_NAME assert superset_chart.connector_name == AtlanConnectorType.SUPERSET.value @@ -120,7 +129,10 @@ def test_overload_superset_chart( assert superset_chart_overload assert superset_chart_overload.guid assert superset_chart_overload.qualified_name - assert superset_chart_overload.superset_dashboard_qualified_name == superset_dashboard.qualified_name + assert ( + superset_chart_overload.superset_dashboard_qualified_name + == superset_dashboard.qualified_name + ) assert superset_chart_overload.name == SUPERSET_CHART_NAME_OVERLOAD assert superset_chart_overload.connector_name == AtlanConnectorType.SUPERSET.value @@ -180,7 +192,9 @@ def test_overload_superset_dataset( assert superset_dataset_overload assert superset_dataset_overload.guid assert superset_dataset_overload.qualified_name - assert superset_dataset_overload.connection_qualified_name == connection.qualified_name + assert ( + superset_dataset_overload.connection_qualified_name == connection.qualified_name + ) assert superset_dataset_overload.name == SUPERSET_DATASET_NAME_OVERLOAD assert superset_dataset_overload.connector_name == AtlanConnectorType.SUPERSET.value @@ -302,7 +316,9 @@ def test_update_superset_dashboard_again( @pytest.mark.order(after="test_update_superset_dashboard_again") -def test_delete_superset_dashboard(client: AtlanClient, superset_dashboard: SupersetDashboard): +def test_delete_superset_dashboard( + client: AtlanClient, superset_dashboard: SupersetDashboard +): response = client.asset.delete_by_guid(superset_dashboard.guid) assert response assert not response.assets_created(asset_type=SupersetDashboard) @@ -322,7 +338,9 @@ def test_restore_dashboard( superset_dashboard: SupersetDashboard, ): assert superset_dashboard.qualified_name - assert client.asset.restore(asset_type=SupersetDashboard, qualified_name=superset_dashboard.qualified_name) + assert client.asset.restore( + asset_type=SupersetDashboard, qualified_name=superset_dashboard.qualified_name + ) assert superset_dashboard.qualified_name restored = client.asset.get_by_qualified_name( asset_type=SupersetDashboard, diff --git a/tests/integration/test_asset_batch.py b/tests/integration/test_asset_batch.py index fdb580749..e444652d0 100644 --- a/tests/integration/test_asset_batch.py +++ b/tests/integration/test_asset_batch.py @@ -46,7 +46,9 @@ def wait_for_consistency(): @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - result = create_connection(client=client, name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE) + result = create_connection( + client=client, name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE + ) yield result delete_asset(client, guid=result.guid, asset_type=Connection) @@ -56,7 +58,9 @@ def database( connection: Connection, upsert: Callable[[Asset], AssetMutationResponse], ): - to_create = Database.creator(name=DATABASE_NAME, connection_qualified_name=connection.qualified_name) + to_create = Database.creator( + name=DATABASE_NAME, connection_qualified_name=connection.qualified_name + ) result = upsert(to_create) assert result database = result.assets_created(asset_type=Database)[0] @@ -82,7 +86,9 @@ def schema( @pytest.fixture(scope="module") -def batch_table_create(client: AtlanClient, schema: Schema) -> Generator[Batch, None, None]: +def batch_table_create( + client: AtlanClient, schema: Schema +) -> Generator[Batch, None, None]: assert schema and schema.qualified_name batch = Batch( client=client, @@ -126,12 +132,18 @@ def batch_table_create(client: AtlanClient, schema: Schema) -> Generator[Batch, ) assert created and created.guid response = client.asset.purge_by_guid(created.guid) - if not response or not response.mutated_entities or not response.mutated_entities.DELETE: + if ( + not response + or not response.mutated_entities + or not response.mutated_entities.DELETE + ): LOGGER.error(f"Failed to remove asset with GUID {asset.guid}.") @pytest.fixture(scope="module") -def batch_table_update(client: AtlanClient, schema: Schema) -> Generator[Batch, None, None]: +def batch_table_update( + client: AtlanClient, schema: Schema +) -> Generator[Batch, None, None]: assert schema and schema.qualified_name batch = Batch( client=client, @@ -159,7 +171,10 @@ def test_batch_create(batch_table_create: Batch, schema: Schema): # Verify that 5 assets (3 tables, 1 view, 1 materialized view) were created assert batch.created and len(batch.created) == 5 and batch.num_created == 5 - assert all(asset.type_name in {Table.__name__, View.__name__, MaterialisedView.__name__} for asset in batch.created) + assert all( + asset.type_name in {Table.__name__, View.__name__, MaterialisedView.__name__} + for asset in batch.created + ) # Ensure the schema was updated assert batch.updated and len(batch.updated) == 1 and batch.num_updated == 1 @@ -167,7 +182,9 @@ def test_batch_create(batch_table_create: Batch, schema: Schema): @pytest.mark.order(after="test_batch_create") -def test_batch_update(wait_for_consistency, client: AtlanClient, batch_table_create: Batch): +def test_batch_update( + wait_for_consistency, client: AtlanClient, batch_table_create: Batch +): # Table with view qn / mview qn # 1. table_view_agnostic and update only -- update -- table? -> view? -> mview # 2. not table_view_agnostic and update only -- skip -- table? -> view? -> mview? - not found @@ -321,7 +338,11 @@ def test_batch_update(wait_for_consistency, client: AtlanClient, batch_table_cre assert results and results.count == 1 assert results.current_page() and len(results.current_page()) == 1 created_table = results.current_page()[0] - assert created_table and created_table.guid and created_table.qualified_name == view.qualified_name + assert ( + created_table + and created_table.guid + and created_table.qualified_name == view.qualified_name + ) # Verify the new table was created and has the updated user description assert created_table.user_description == SUB_TEST3_DESCRIPTION @@ -346,7 +367,9 @@ def test_batch_update(wait_for_consistency, client: AtlanClient, batch_table_cre ) SUB_TEST4_DESCRIPTION = f"[sub-test4] {DESCRIPTION}" - table = Table.updater(qualified_name=table1.qualified_name.lower(), name=table1.name) + table = Table.updater( + qualified_name=table1.qualified_name.lower(), name=table1.name + ) table.user_description = SUB_TEST4_DESCRIPTION batch4.add(table) batch4.flush() @@ -370,7 +393,11 @@ def test_batch_update(wait_for_consistency, client: AtlanClient, batch_table_cre assert results and results.count == 1 assert results.current_page() and len(results.current_page()) == 1 updated_table = results.current_page()[0] - assert updated_table and updated_table.guid and updated_table.qualified_name == table1.qualified_name + assert ( + updated_table + and updated_table.guid + and updated_table.qualified_name == table1.qualified_name + ) assert updated_table.user_description == SUB_TEST4_DESCRIPTION # [sub-test-5]: Table with table qn (case_insensitive=False, update_only=True) @@ -408,7 +435,11 @@ def test_batch_update(wait_for_consistency, client: AtlanClient, batch_table_cre assert results and results.count == 1 assert results.current_page() and len(results.current_page()) == 1 updated_table = results.current_page()[0] - assert updated_table and updated_table.guid and updated_table.qualified_name == table1.qualified_name + assert ( + updated_table + and updated_table.guid + and updated_table.qualified_name == table1.qualified_name + ) assert updated_table.user_description == SUB_TEST5_DESCRIPTION # [sub-test-6]: (same operation as sub-test-5) @@ -447,7 +478,9 @@ def test_batch_update(wait_for_consistency, client: AtlanClient, batch_table_cre ) SUB_TEST7_DESCRIPTION = f"[sub-test7] {DESCRIPTION}" - table = Table.updater(qualified_name=table1.qualified_name.lower(), name=table1.name) + table = Table.updater( + qualified_name=table1.qualified_name.lower(), name=table1.name + ) table.user_description = SUB_TEST7_DESCRIPTION batch7.add(table) batch7.flush() @@ -473,7 +506,11 @@ def test_batch_update(wait_for_consistency, client: AtlanClient, batch_table_cre assert results.current_page() and len(results.current_page()) == 1 created_table = results.current_page()[0] - assert created_table and created_table.guid and created_table.qualified_name == table.qualified_name + assert ( + created_table + and created_table.guid + and created_table.qualified_name == table.qualified_name + ) assert created_table.is_partial assert created_table.user_description == SUB_TEST7_DESCRIPTION diff --git a/tests/integration/test_client.py b/tests/integration/test_client.py index 6b9c45f19..a3fe09498 100644 --- a/tests/integration/test_client.py +++ b/tests/integration/test_client.py @@ -45,7 +45,9 @@ CLASSIFICATION_NAME = "Issue" SL_SORT_BY_TIMESTAMP = SortItem(field="timestamp", order=SortOrder.ASCENDING) SL_SORT_BY_GUID = SortItem(field="entityGuidsAll", order=SortOrder.ASCENDING) -SL_SORT_BY_QUALIFIED_NAME = SortItem(field="entityQFNamesAll", order=SortOrder.ASCENDING) +SL_SORT_BY_QUALIFIED_NAME = SortItem( + field="entityQFNamesAll", order=SortOrder.ASCENDING +) AUDIT_SORT_BY_GUID = SortItem(field="entityId", order=SortOrder.ASCENDING) AUDIT_SORT_BY_LATEST = SortItem("created", order=SortOrder.DESCENDING) MODULE_NAME = TestId.make_unique("Client") @@ -89,7 +91,9 @@ def glossary( @pytest.fixture(scope="module") -def term(client: AtlanClient, glossary: AtlasGlossary) -> Generator[AtlasGlossaryTerm, None, None]: +def term( + client: AtlanClient, glossary: AtlasGlossary +) -> Generator[AtlasGlossaryTerm, None, None]: t = AtlasGlossaryTerm.creator( name=StrictStr(MODULE_NAME), glossary_guid=StrictStr(glossary.guid), @@ -125,7 +129,9 @@ def announcement(): @pytest.fixture() -def database(client: AtlanClient, connection: Connection) -> Generator[Database, None, None]: +def database( + client: AtlanClient, connection: Connection +) -> Generator[Database, None, None]: """Get a database with function scope""" database_name = TestId.make_unique("my_db") db = create_database(client, connection, database_name) @@ -146,7 +152,9 @@ def create_glossary(client: AtlanClient, name: str) -> AtlasGlossary: @pytest.fixture(scope="module") def audit_glossary(client: AtlanClient) -> Generator[AtlasGlossary, None, None]: - created_glossary = create_glossary(client, TestId.make_unique("test-audit-glossary")) + created_glossary = create_glossary( + client, TestId.make_unique("test-audit-glossary") + ) yield created_glossary delete_asset(client, guid=created_glossary.guid, asset_type=AtlasGlossary) @@ -168,7 +176,9 @@ def _test_update_certificate( ): assert test_asset.qualified_name assert test_asset.name - test_asset = client.asset.get_by_guid(guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False) + test_asset = client.asset.get_by_guid( + guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False + ) assert test_asset.qualified_name assert test_asset.name assert test_asset.certificate_status is None @@ -182,7 +192,9 @@ def _test_update_certificate( message=message, glossary_guid=glossary_guid if glossary_guid else None, ) - test_asset = client.asset.get_by_guid(guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False) + test_asset = client.asset.get_by_guid( + guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False + ) assert test_asset.certificate_status == CertificateStatus.DRAFT assert test_asset.certificate_status_message == message @@ -201,7 +213,9 @@ def _test_remove_certificate( name=test_asset.name, glossary_guid=glossary_guid if glossary_guid else None, ) - test_asset = client.asset.get_by_guid(guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False) + test_asset = client.asset.get_by_guid( + guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False + ) assert test_asset.certificate_status is None assert test_asset.certificate_status_message is None @@ -222,7 +236,9 @@ def _test_update_announcement( announcement=test_announcement, glossary_guid=glossary_guid if glossary_guid else None, ) - test_asset = client.asset.get_by_guid(guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False) + test_asset = client.asset.get_by_guid( + guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False + ) assert test_asset.get_announcment() == test_announcement @@ -240,7 +256,9 @@ def _test_remove_announcement( name=test_asset.name, glossary_guid=glossary_guid if glossary_guid else None, ) - test_asset = client.asset.get_by_guid(guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False) + test_asset = client.asset.get_by_guid( + guid=test_asset.guid, asset_type=test_asset_type, ignore_relationships=False + ) assert test_asset.get_announcment() is None @@ -250,8 +268,14 @@ def test_append_terms_with_guid( database: Database, ): time.sleep(5) - assert (database := client.asset.append_terms(guid=database.guid, asset_type=Database, terms=[term1])) - database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) + assert ( + database := client.asset.append_terms( + guid=database.guid, asset_type=Database, terms=[term1] + ) + ) + database = client.asset.get_by_guid( + guid=database.guid, asset_type=Database, ignore_relationships=False + ) assert database.assigned_terms assert len(database.assigned_terms) == 1 assert database.assigned_terms[0].guid == term1.guid @@ -268,7 +292,9 @@ def test_append_terms_with_qualified_name( qualified_name=database.qualified_name, asset_type=Database, terms=[term1] ) ) - database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) + database = client.asset.get_by_guid( + guid=database.guid, asset_type=Database, ignore_relationships=False + ) assert database.assigned_terms assert len(database.assigned_terms) == 1 assert database.assigned_terms[0].guid == term1.guid @@ -287,7 +313,9 @@ def test_append_terms_using_ref_by_guid_for_term( terms=[AtlasGlossaryTerm.ref_by_guid(guid=term1.guid)], ) ) - database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) + database = client.asset.get_by_guid( + guid=database.guid, asset_type=Database, ignore_relationships=False + ) assert database.assigned_terms assert len(database.assigned_terms) == 1 assert database.assigned_terms[0].guid == term1.guid @@ -308,9 +336,15 @@ def test_replace_a_term( ) ) - assert (database := client.asset.replace_terms(guid=database.guid, asset_type=Database, terms=[term2])) + assert ( + database := client.asset.replace_terms( + guid=database.guid, asset_type=Database, terms=[term2] + ) + ) - database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) + database = client.asset.get_by_guid( + guid=database.guid, asset_type=Database, ignore_relationships=False + ) assert database.assigned_terms assert len(database.assigned_terms) == 1 assert database.assigned_terms[0].guid == term2.guid @@ -330,9 +364,15 @@ def test_replace_all_term( ) ) - assert (database := client.asset.replace_terms(guid=database.guid, asset_type=Database, terms=[])) + assert ( + database := client.asset.replace_terms( + guid=database.guid, asset_type=Database, terms=[] + ) + ) - database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) + database = client.asset.get_by_guid( + guid=database.guid, asset_type=Database, ignore_relationships=False + ) assert database.assigned_terms == [] assert len(database.assigned_terms) == 0 @@ -363,7 +403,9 @@ def test_remove_term( ) ) - database = client.asset.get_by_guid(guid=database.guid, asset_type=Database, ignore_relationships=False) + database = client.asset.get_by_guid( + guid=database.guid, asset_type=Database, ignore_relationships=False + ) assert database.assigned_terms assert len(database.assigned_terms) == 1 assert database.assigned_terms[0].guid == term2.guid @@ -380,16 +422,22 @@ def test_find_connections_by_name(client: AtlanClient): def test_get_asset_by_guid_good_guid(client: AtlanClient, glossary: AtlasGlossary): - glossary = client.asset.get_by_guid(glossary.guid, AtlasGlossary, ignore_relationships=False) + glossary = client.asset.get_by_guid( + glossary.guid, AtlasGlossary, ignore_relationships=False + ) assert isinstance(glossary, AtlasGlossary) -def test_get_asset_by_guid_without_asset_type(client: AtlanClient, glossary: AtlasGlossary): +def test_get_asset_by_guid_without_asset_type( + client: AtlanClient, glossary: AtlasGlossary +): glossary = client.asset.get_by_guid(glossary.guid, ignore_relationships=False) assert isinstance(glossary, AtlasGlossary) -def test_get_minimal_asset_without_asset_type(client: AtlanClient, glossary: AtlasGlossary): +def test_get_minimal_asset_without_asset_type( + client: AtlanClient, glossary: AtlasGlossary +): glossary = client.asset.retrieve_minimal(glossary.guid) assert isinstance(glossary, AtlasGlossary) @@ -420,7 +468,9 @@ def test_get_by_guid_with_fs(client: AtlanClient, term: AtlasGlossaryTerm): assert result.anchor is None # Should call `GET_ENTITY_BY_GUID` API with `ignore_relationships=False` - result = client.asset.get_by_guid(guid=term.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + result = client.asset.get_by_guid( + guid=term.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) assert isinstance(result, AtlasGlossaryTerm) assert result.guid == term.guid assert hasattr(result, "attributes") @@ -477,7 +527,9 @@ def test_get_by_qualified_name_with_fs(client: AtlanClient, term: AtlasGlossaryT time.sleep(5) # Default - should call `GET_ENTITY_BY_GUID` API assert term and term.qualified_name - result = client.asset.get_by_qualified_name(qualified_name=term.qualified_name, asset_type=AtlasGlossaryTerm) + result = client.asset.get_by_qualified_name( + qualified_name=term.qualified_name, asset_type=AtlasGlossaryTerm + ) assert isinstance(result, AtlasGlossaryTerm) assert result.guid == term.guid assert hasattr(result, "attributes") @@ -565,7 +617,9 @@ def test_upsert_when_no_changes(client: AtlanClient, glossary: AtlasGlossary): def test_get_by_qualified_name(client: AtlanClient, glossary: AtlasGlossary): qualified_name = glossary.qualified_name or "" - glossary = client.asset.get_by_qualified_name(qualified_name=qualified_name, asset_type=AtlasGlossary) + glossary = client.asset.get_by_qualified_name( + qualified_name=qualified_name, asset_type=AtlasGlossary + ) assert glossary.attributes.qualified_name == qualified_name @@ -577,13 +631,19 @@ def test_get_by_qualified_name_when_superclass_specified_raises_not_found_error( NotFoundError, match="ATLAN-PYTHON-404-014 The Asset asset could not be found by name: ", ): - client.asset.get_by_qualified_name(qualified_name=qualified_name, asset_type=Asset) + client.asset.get_by_qualified_name( + qualified_name=qualified_name, asset_type=Asset + ) def test_add_classification(client: AtlanClient, term1: AtlasGlossaryTerm): assert term1.qualified_name - client.asset.add_atlan_tags(AtlasGlossaryTerm, term1.qualified_name, [CLASSIFICATION_NAME]) - glossary_term = client.asset.get_by_guid(term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + client.asset.add_atlan_tags( + AtlasGlossaryTerm, term1.qualified_name, [CLASSIFICATION_NAME] + ) + glossary_term = client.asset.get_by_guid( + term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) assert glossary_term.atlan_tags assert len(glossary_term.atlan_tags) == 1 classification = glossary_term.atlan_tags[0] @@ -594,7 +654,9 @@ def test_add_classification(client: AtlanClient, term1: AtlasGlossaryTerm): def test_include_atlan_tag_names(client: AtlanClient, term1: AtlasGlossaryTerm): assert term1 and term1.qualified_name query = Term.with_type_name(term1.type_name) + Term.with_name(term1.name) - request = IndexSearchRequest(dsl=DSL(query=query), exclude_atlan_tags=True, include_atlan_tag_names=False) + request = IndexSearchRequest( + dsl=DSL(query=query), exclude_atlan_tags=True, include_atlan_tag_names=False + ) response = client.asset.search(criteria=request) # Ensure classification names are not present @@ -603,7 +665,9 @@ def test_include_atlan_tag_names(client: AtlanClient, term1: AtlasGlossaryTerm): assert response.current_page()[0].guid == term1.guid assert response.current_page()[0].classification_names is None - request = IndexSearchRequest(dsl=DSL(query=query), exclude_atlan_tags=True, include_atlan_tag_names=True) + request = IndexSearchRequest( + dsl=DSL(query=query), exclude_atlan_tags=True, include_atlan_tag_names=True + ) response = client.asset.search(criteria=request) # Ensure classification names are present @@ -617,8 +681,12 @@ def test_include_atlan_tag_names(client: AtlanClient, term1: AtlasGlossaryTerm): @pytest.mark.order(after="test_add_classification") def test_remove_classification(client: AtlanClient, term1: AtlasGlossaryTerm): assert term1.qualified_name - client.asset.remove_atlan_tag(AtlasGlossaryTerm, term1.qualified_name, CLASSIFICATION_NAME) - glossary_term = client.asset.get_by_guid(term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False) + client.asset.remove_atlan_tag( + AtlasGlossaryTerm, term1.qualified_name, CLASSIFICATION_NAME + ) + glossary_term = client.asset.get_by_guid( + term1.guid, asset_type=AtlasGlossaryTerm, ignore_relationships=False + ) assert not glossary_term.atlan_tags @@ -626,7 +694,9 @@ def test_glossary_update_certificate(client: AtlanClient, glossary: AtlasGlossar _test_update_certificate(client, glossary, AtlasGlossary) -def test_glossary_term_update_certificate(client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary): +def test_glossary_term_update_certificate( + client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary +): _test_update_certificate(client, term1, AtlasGlossaryTerm, glossary.guid) @@ -642,7 +712,9 @@ def test_glossary_remove_certificate(client: AtlanClient, glossary: AtlasGlossar @pytest.mark.order(after="test_glossary_term_update_certificate") -def test_glossary_term_remove_certificate(client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary): +def test_glossary_term_remove_certificate( + client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary +): _test_remove_certificate(client, term1, AtlasGlossaryTerm, glossary.guid) @@ -653,7 +725,9 @@ def test_glossary_category_remove_certificate( _test_remove_certificate(client, category, AtlasGlossaryCategory, glossary.guid) -def test_glossary_update_announcement(client: AtlanClient, glossary: AtlasGlossary, announcement: Announcement): +def test_glossary_update_announcement( + client: AtlanClient, glossary: AtlasGlossary, announcement: Announcement +): _test_update_announcement(client, glossary, AtlasGlossary, announcement) @@ -684,7 +758,9 @@ def test_glossary_term_update_announcement( glossary: AtlasGlossary, announcement: Announcement, ): - _test_update_announcement(client, term1, AtlasGlossaryTerm, announcement, glossary.guid) + _test_update_announcement( + client, term1, AtlasGlossaryTerm, announcement, glossary.guid + ) def test_glossary_category_update_announcement( @@ -693,7 +769,9 @@ def test_glossary_category_update_announcement( glossary: AtlasGlossary, announcement: Announcement, ): - _test_update_announcement(client, category, AtlasGlossaryCategory, announcement, glossary.guid) + _test_update_announcement( + client, category, AtlasGlossaryCategory, announcement, glossary.guid + ) @pytest.mark.order(after="test_glossary_update_announcement") @@ -702,7 +780,9 @@ def test_glossary_remove_announcement(client: AtlanClient, glossary: AtlasGlossa @pytest.mark.order(after="test_glossary_term_update_announcement") -def test_glossary_term_remove_announcement(client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary): +def test_glossary_term_remove_announcement( + client: AtlanClient, term1: AtlasGlossaryTerm, glossary: AtlasGlossary +): _test_remove_announcement(client, term1, AtlasGlossaryTerm, glossary.guid) @@ -721,7 +801,9 @@ def test_audit_find_by_user( size = 10 assert current_user.username - results = client.audit.search(AuditSearchRequest.by_user(current_user.username, size=size, sort=[])) + results = client.audit.search( + AuditSearchRequest.by_user(current_user.username, size=size, sort=[]) + ) assert results.total_count > 0 assert size == len(results.current_page()) audit_entity = results.current_page()[0] @@ -749,10 +831,14 @@ def generate_audit_entries(client: AtlanClient, audit_glossary: AtlasGlossary): request = AuditSearchRequest.by_guid(guid=audit_glossary.guid, size=log_count) response = client.audit.search(request) - assert response.total_count >= log_count, f"Expected at least {log_count} logs, but got {response.total_count}." + assert response.total_count >= log_count, ( + f"Expected at least {log_count} logs, but got {response.total_count}." + ) -def _assert_audit_search_results(results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, bulk=False): +def _assert_audit_search_results( + results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, bulk=False +): assert results.total_count > size assert len(results.current_page()) == size counter = 0 @@ -785,7 +871,9 @@ def test_audit_search_pagination( results = client.audit.search(criteria=request, bulk=False) TOTAL_AUDIT_ENTRIES = results.total_count expected_sorts = [SortItem(field="entityId", order=SortOrder.ASCENDING)] - _assert_audit_search_results(results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, False) + _assert_audit_search_results( + results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, False + ) # Test audit search by guid with `bulk` option using timestamp-based pagination dsl = DSL( @@ -799,7 +887,9 @@ def test_audit_search_pagination( SortItem("created", order=SortOrder.ASCENDING), SortItem(field="entityId", order=SortOrder.ASCENDING), ] - _assert_audit_search_results(results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, True) + _assert_audit_search_results( + results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, True + ) assert mock_logger.call_count == 1 assert "Audit bulk search option is enabled." in mock_logger.call_args_list[0][0][0] mock_logger.reset_mock() @@ -818,9 +908,14 @@ def test_audit_search_pagination( SortItem("created", order=SortOrder.ASCENDING), SortItem(field="entityId", order=SortOrder.ASCENDING), ] - _assert_audit_search_results(results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, True) + _assert_audit_search_results( + results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, True + ) assert mock_logger.call_count < TOTAL_AUDIT_ENTRIES - assert "Audit bulk search option is enabled." in mock_logger.call_args_list[0][0][0] + assert ( + "Audit bulk search option is enabled." + in mock_logger.call_args_list[0][0][0] + ) mock_logger.reset_mock() # When the number of results exceeds the predefined threshold and bulk is `False` and no pre-defined sort. @@ -838,9 +933,14 @@ def test_audit_search_pagination( SortItem("created", order=SortOrder.ASCENDING), SortItem(field="entityId", order=SortOrder.ASCENDING), ] - _assert_audit_search_results(results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, False) + _assert_audit_search_results( + results, expected_sorts, size, TOTAL_AUDIT_ENTRIES, False + ) assert mock_logger.call_count < TOTAL_AUDIT_ENTRIES - assert "Result size (%s) exceeds threshold (%s)." in mock_logger.call_args_list[0][0][0] + assert ( + "Result size (%s) exceeds threshold (%s)." + in mock_logger.call_args_list[0][0][0] + ) mock_logger.reset_mock() @@ -940,9 +1040,13 @@ def test_audit_search_default_sorting(client: AtlanClient, audit_info: AuditInfo assert sort_options[1].field == AUDIT_SORT_BY_LATEST.field -def _view_test_glossary_by_search(client: AtlanClient, sl_glossary: AtlasGlossary) -> None: +def _view_test_glossary_by_search( + client: AtlanClient, sl_glossary: AtlasGlossary +) -> None: time.sleep(2) - index = (FluentSearch().where(Asset.GUID.eq(sl_glossary.guid, case_insensitive=True))).to_request() + index = ( + FluentSearch().where(Asset.GUID.eq(sl_glossary.guid, case_insensitive=True)) + ).to_request() index.request_metadata = IndexSearchRequest.Metadata( utm_tags=[ UTMTags.ACTION_ASSET_VIEWED, @@ -977,7 +1081,9 @@ def test_search_log_most_recent_viewers( # Test exclude users assert current_user.username - request = SearchLogRequest.most_recent_viewers(guid=sl_glossary.guid, exclude_users=[current_user.username]) + request = SearchLogRequest.most_recent_viewers( + guid=sl_glossary.guid, exclude_users=[current_user.username] + ) response = client.search_log.search(request) if not isinstance(response, SearchLogViewResults): pytest.fail(f"Failed to retrieve most recent viewers of : {sl_glossary.name}") @@ -1021,7 +1127,9 @@ def _assert_most_viewed_assets( prev_count = response.count assert prev_count assert current_user.username - request = SearchLogRequest.most_viewed_assets(max_assets=10, exclude_users=[current_user.username]) + request = SearchLogRequest.most_viewed_assets( + max_assets=10, exclude_users=[current_user.username] + ) response = client.search_log.search(request) if not isinstance(response, SearchLogViewResults): pytest.fail("Failed to retrieve most viewed assets") @@ -1031,7 +1139,9 @@ def _assert_most_viewed_assets( @pytest.mark.order(after="test_search_log_most_viewed_assets") -def test_search_log_views_by_guid(client: AtlanClient, current_user: UserMinimalResponse, sl_glossary: AtlasGlossary): +def test_search_log_views_by_guid( + client: AtlanClient, current_user: UserMinimalResponse, sl_glossary: AtlasGlossary +): request = SearchLogRequest.views_by_guid(guid=sl_glossary.guid, size=10) response = client.search_log.search(request) if not isinstance(response, SearchLogResults): @@ -1062,7 +1172,9 @@ def test_search_log_views_by_guid(client: AtlanClient, current_user: UserMinimal # Test exclude users assert current_user.username - request = SearchLogRequest.views_by_guid(guid=sl_glossary.guid, size=10, exclude_users=[current_user.username]) + request = SearchLogRequest.views_by_guid( + guid=sl_glossary.guid, size=10, exclude_users=[current_user.username] + ) response = client.search_log.search(request) if not isinstance(response, SearchLogResults): pytest.fail("Failed to retrieve asset detailed log entries") @@ -1080,10 +1192,14 @@ def generate_search_logs(client: AtlanClient, sl_glossary: AtlasGlossary): request = SearchLogRequest.views_by_guid(guid=sl_glossary.guid, size=20) response = client.search_log.search(request) - assert response.count >= log_count, f"Expected at least {log_count} logs, but got {response.count}." + assert response.count >= log_count, ( + f"Expected at least {log_count} logs, but got {response.count}." + ) -def _assert_search_log_results(results, expected_sorts, size, TOTAL_LOG_ENTRIES, bulk=False): +def _assert_search_log_results( + results, expected_sorts, size, TOTAL_LOG_ENTRIES, bulk=False +): assert results.count > size assert len(results.current_page()) == size counter = 0 @@ -1097,7 +1213,9 @@ def _assert_search_log_results(results, expected_sorts, size, TOTAL_LOG_ENTRIES, @patch.object(SEARCH_LOG_LOGGER, "debug") -def test_search_log_pagination(mock_logger, generate_search_logs, sl_glossary: AtlasGlossary, client: AtlanClient): +def test_search_log_pagination( + mock_logger, generate_search_logs, sl_glossary: AtlasGlossary, client: AtlanClient +): size = 2 # Test search logs by GUID with default offset-based pagination search_log_request = SearchLogRequest.views_by_guid( @@ -1128,7 +1246,10 @@ def test_search_log_pagination(mock_logger, generate_search_logs, sl_glossary: A ] _assert_search_log_results(results, expected_sorts, size, TOTAL_LOG_ENTRIES, True) assert mock_logger.call_count == 1 - assert "Search log bulk search option is enabled." in mock_logger.call_args_list[0][0][0] + assert ( + "Search log bulk search option is enabled." + in mock_logger.call_args_list[0][0][0] + ) mock_logger.reset_mock() # When the number of results exceeds the predefined threshold and bulk=True @@ -1143,9 +1264,14 @@ def test_search_log_pagination(mock_logger, generate_search_logs, sl_glossary: A SortItem(field="createdAt", order=SortOrder.ASCENDING), SortItem(field="entityGuidsAll", order=SortOrder.ASCENDING), ] - _assert_search_log_results(results, expected_sorts, size, TOTAL_LOG_ENTRIES, True) + _assert_search_log_results( + results, expected_sorts, size, TOTAL_LOG_ENTRIES, True + ) assert mock_logger.call_count < TOTAL_LOG_ENTRIES - assert "Search log bulk search option is enabled." in mock_logger.call_args_list[0][0][0] + assert ( + "Search log bulk search option is enabled." + in mock_logger.call_args_list[0][0][0] + ) mock_logger.reset_mock() # When results exceed threshold and bulk=False, SDK auto-switches to bulk search @@ -1162,7 +1288,10 @@ def test_search_log_pagination(mock_logger, generate_search_logs, sl_glossary: A ] _assert_search_log_results(results, expected_sorts, size, TOTAL_LOG_ENTRIES) assert mock_logger.call_count < TOTAL_LOG_ENTRIES - assert "Result size (%s) exceeds threshold (%s)." in mock_logger.call_args_list[0][0][0] + assert ( + "Result size (%s) exceeds threshold (%s)." + in mock_logger.call_args_list[0][0][0] + ) mock_logger.reset_mock() @@ -1226,21 +1355,33 @@ def test_search_log_default_sorting(client: AtlanClient, sl_glossary: AtlasGloss assert sort_options[2].field == SL_SORT_BY_TIMESTAMP.field -def test_client_401_token_refresh(client: AtlanClient, expired_token: ApiToken, argo_fake_token: ApiToken, monkeypatch): +def test_client_401_token_refresh( + client: AtlanClient, expired_token: ApiToken, argo_fake_token: ApiToken, monkeypatch +): # Use a smaller retry count to speed up test execution DEFAULT_RETRY.total = 1 # Retrieve required client information before updating the client with invalid API tokens assert argo_fake_token and argo_fake_token.guid - argo_client_secret = client.impersonate.get_client_secret(client_guid=argo_fake_token.guid) + argo_client_secret = client.impersonate.get_client_secret( + client_guid=argo_fake_token.guid + ) # Retrieve the user ID associated with the expired token's username # Since user credentials for API tokens cannot be retrieved directly, use the existing username - expired_token_user_id = client.impersonate.get_user_id(username=expired_token.username) + expired_token_user_id = client.impersonate.get_user_id( + username=expired_token.username + ) # Initialize the client with an expired/invalid token (results in 401 Unauthorized errors) - assert expired_token and expired_token.attributes and expired_token.attributes.access_token - client = AtlanClient(api_key=expired_token.attributes.access_token, retry=DEFAULT_RETRY) + assert ( + expired_token + and expired_token.attributes + and expired_token.attributes.access_token + ) + client = AtlanClient( + api_key=expired_token.attributes.access_token, retry=DEFAULT_RETRY + ) expired_api_token = expired_token.attributes.access_token # Case 1: No user_id (default) @@ -1250,9 +1391,9 @@ def test_client_401_token_refresh(client: AtlanClient, expired_token: ApiToken, AuthenticationError, match="Server responded with an authentication error 401", ): - FluentSearch().where(CompoundQuery.active_assets()).where(CompoundQuery.asset_type(AtlasGlossary)).page_size( - 100 - ).execute(client=client) + FluentSearch().where(CompoundQuery.active_assets()).where( + CompoundQuery.asset_type(AtlasGlossary) + ).page_size(100).execute(client=client) # Case 2: Invalid user_id # Test that providing an invalid user ID results in the same authentication error @@ -1261,9 +1402,9 @@ def test_client_401_token_refresh(client: AtlanClient, expired_token: ApiToken, AuthenticationError, match="Server responded with an authentication error 401", ): - FluentSearch().where(CompoundQuery.active_assets()).where(CompoundQuery.asset_type(AtlasGlossary)).page_size( - 100 - ).execute(client=client) + FluentSearch().where(CompoundQuery.active_assets()).where( + CompoundQuery.asset_type(AtlasGlossary) + ).page_size(100).execute(client=client) # Case 3: Valid user_id associated with the expired token # This should trigger a retry, refresh the token diff --git a/tests/integration/test_file_client.py b/tests/integration/test_file_client.py index f5d9751f6..90b3b023f 100644 --- a/tests/integration/test_file_client.py +++ b/tests/integration/test_file_client.py @@ -49,18 +49,26 @@ def s3_get_presigned_url(client: AtlanClient) -> str: ) -def test_file_client_presigned_url_upload(client: AtlanClient, s3_put_presigned_url: str): +def test_file_client_presigned_url_upload( + client: AtlanClient, s3_put_presigned_url: str +): assert s3_put_presigned_url assert os.path.exists(UPLOAD_FILE_PATH) - client.files.upload_file(presigned_url=s3_put_presigned_url, file_path=UPLOAD_FILE_PATH) + client.files.upload_file( + presigned_url=s3_put_presigned_url, file_path=UPLOAD_FILE_PATH + ) -def test_file_client_presigned_url_download(client: AtlanClient, s3_get_presigned_url: str): +def test_file_client_presigned_url_download( + client: AtlanClient, s3_get_presigned_url: str +): assert s3_get_presigned_url assert not os.path.exists(DOWNLOAD_FILE_PATH) - client.files.download_file(presigned_url=s3_get_presigned_url, file_path=DOWNLOAD_FILE_PATH) + client.files.download_file( + presigned_url=s3_get_presigned_url, file_path=DOWNLOAD_FILE_PATH + ) assert os.path.exists(DOWNLOAD_FILE_PATH) assert imghdr.what(DOWNLOAD_FILE_PATH) == "png" os.remove(DOWNLOAD_FILE_PATH) diff --git a/tests/integration/test_index_search.py b/tests/integration/test_index_search.py index f1fa06683..4f17b35dd 100644 --- a/tests/integration/test_index_search.py +++ b/tests/integration/test_index_search.py @@ -96,7 +96,9 @@ @pytest.fixture(scope="module") def snowflake_conn(client: AtlanClient): - return client.asset.find_connections_by_name("development", AtlanConnectorType.SNOWFLAKE)[0] + return client.asset.find_connections_by_name( + "development", AtlanConnectorType.SNOWFLAKE + )[0] @pytest.fixture(scope="module") @@ -179,7 +181,11 @@ def test_search_source_synced_assets(client: AtlanClient): FluentSearch() .select() .where(CompoundQuery.asset_type(Table)) - .where(CompoundQuery.tagged_with_value(EXISTING_SOURCE_SYNCED_TAG, "Highly Restricted")) + .where( + CompoundQuery.tagged_with_value( + EXISTING_SOURCE_SYNCED_TAG, "Highly Restricted" + ) + ) .execute(client=client) ) if isinstance(table, Table) @@ -190,11 +196,15 @@ def test_search_source_synced_assets(client: AtlanClient): def test_source_tag_assign_with_value(client: AtlanClient, table: Table): # Make sure no tags are assigned initially assert table.guid - table = client.asset.get_by_guid(guid=table.guid, asset_type=Table, ignore_relationships=False) + table = client.asset.get_by_guid( + guid=table.guid, asset_type=Table, ignore_relationships=False + ) assert not table.atlan_tags assert table.name and table.qualified_name - source_tag_name = SourceTagName("snowflake/development@@ANALYTICS/WIDE_WORLD_IMPORTERS/CONFIDENTIAL") + source_tag_name = SourceTagName( + "snowflake/development@@ANALYTICS/WIDE_WORLD_IMPORTERS/CONFIDENTIAL" + ) to_update = table.updater(table.qualified_name, table.name) to_update.atlan_tags = [ AtlanTag.of(atlan_tag_name=AtlanTagName(EXISTING_TAG)), @@ -202,14 +212,21 @@ def test_source_tag_assign_with_value(client: AtlanClient, table: Table): atlan_tag_name=AtlanTagName(EXISTING_SOURCE_SYNCED_TAG), source_tag_attachment=SourceTagAttachment.by_name( name=source_tag_name, - source_tag_values=[SourceTagAttachmentValue(tag_attachment_value="Not Restricted")], + source_tag_values=[ + SourceTagAttachmentValue(tag_attachment_value="Not Restricted") + ], ), ), ] response = client.asset.save(to_update, replace_atlan_tags=True) assert (tables := response.assets_updated(asset_type=Table)) and len(tables) == 1 - assert tables and len(tables) == 1 and tables[0].atlan_tags and len(tables[0].atlan_tags) == 2 + assert ( + tables + and len(tables) == 1 + and tables[0].atlan_tags + and len(tables[0].atlan_tags) == 2 + ) for tag in tables[0].atlan_tags: assert str(tag.type_name) in (EXISTING_TAG, EXISTING_SOURCE_SYNCED_TAG) @@ -223,19 +240,30 @@ def test_source_tag_assign_with_value(client: AtlanClient, table: Table): .select() .where(CompoundQuery.asset_type(Table)) .where(Table.QUALIFIED_NAME.eq(table.qualified_name)) - .where(CompoundQuery.tagged_with_value(EXISTING_SOURCE_SYNCED_TAG, "Not Restricted")) + .where( + CompoundQuery.tagged_with_value( + EXISTING_SOURCE_SYNCED_TAG, "Not Restricted" + ) + ) .execute(client=client) ) if isinstance(table, Table) ] - assert tables and len(tables) == 1 and tables[0].atlan_tags and len(tables[0].atlan_tags) == 2 + assert ( + tables + and len(tables) == 1 + and tables[0].atlan_tags + and len(tables[0].atlan_tags) == 2 + ) for tag in tables[0].atlan_tags: assert str(tag.type_name) in (EXISTING_TAG, EXISTING_SOURCE_SYNCED_TAG) _assert_source_tag(tables, EXISTING_SOURCE_SYNCED_TAG, "Not Restricted") -def test_search_source_specific_custom_attributes(client: AtlanClient, snowflake_column_qn: str): +def test_search_source_specific_custom_attributes( + client: AtlanClient, snowflake_column_qn: str +): # Test with get_by_qualified_name() asset = client.asset.get_by_qualified_name( asset_type=Column, @@ -303,7 +331,9 @@ def test_search_pagination(mock_logger, client: AtlanClient): Asset.NAME.wildcard("jsdk_*"), Asset.NAME.wildcard("gsdk_*"), ] - query = CompoundQuery(where_nots=exclude_sdk_terms, where_somes=[CompoundQuery.active_assets()]).to_query() + query = CompoundQuery( + where_nots=exclude_sdk_terms, where_somes=[CompoundQuery.active_assets()] + ).to_query() # Test search() with DSL: using default offset-based pagination # when results are less than the predefined threshold (i.e: 100,000 assets) @@ -398,7 +428,10 @@ def test_search_pagination(mock_logger, client: AtlanClient): ] _assert_search_results(results, expected_sorts, size, TOTAL_ASSETS) assert mock_logger.call_count < TOTAL_ASSETS - assert "Result size (%s) exceeds threshold (%s)." in mock_logger.call_args_list[0][0][0] + assert ( + "Result size (%s) exceeds threshold (%s)." + in mock_logger.call_args_list[0][0][0] + ) mock_logger.reset_mock() @@ -488,7 +521,12 @@ def test_exists_query_factory(client: AtlanClient, with_name): @pytest.mark.parametrize( "text_query_value, method, clazz", - [(method, method, query) for query in [Match] for method in sorted(dir(query)) if method.startswith("with_")], + [ + (method, method, query) + for query in [Match] + for method in sorted(dir(query)) + if method.startswith("with_") + ], indirect=["text_query_value"], ) def test_text_queries_factory(client: AtlanClient, text_query_value, method, clazz): @@ -546,7 +584,9 @@ def test_bucket_aggregation(client: AtlanClient): def test_nested_bucket_aggregation(client: AtlanClient): - nested_aggs_level_2 = Asset.TYPE_NAME.bucket_by(nested={"asset_guid": Asset.GUID.bucket_by()}) + nested_aggs_level_2 = Asset.TYPE_NAME.bucket_by( + nested={"asset_guid": Asset.GUID.bucket_by()} + ) nested_aggs = Asset.TYPE_NAME.bucket_by(nested={"asset_name": nested_aggs_level_2}) request = ( FluentSearch.select() @@ -589,7 +629,11 @@ def test_aggregation_source_value(client: AtlanClient): .aggregate( "asset_type", Asset.TYPE_NAME.bucket_by( - nested={"asset_description": Asset.DESCRIPTION.bucket_by(include_source_value=True)}, + nested={ + "asset_description": Asset.DESCRIPTION.bucket_by( + include_source_value=True + ) + }, ), ) .sort(Asset.CREATE_TIME.order()) @@ -618,15 +662,22 @@ def test_aggregation_source_value(client: AtlanClient): assert bucket.doc_count assert bucket.nested_results if SearchableField.EMBEDDED_SOURCE_VALUE in bucket.nested_results: - nested_results = bucket.nested_results[SearchableField.EMBEDDED_SOURCE_VALUE] + nested_results = bucket.nested_results[ + SearchableField.EMBEDDED_SOURCE_VALUE + ] assert ( - nested_results and nested_results.hits and nested_results.hits.hits and nested_results.hits.hits[0] + nested_results + and nested_results.hits + and nested_results.hits.hits + and nested_results.hits.hits[0] ) assert bucket.get_source_value(Asset.DESCRIPTION) source_value_found = True if not source_value_found: - pytest.fail("Failed to retrieve the source value for asset description in the aggregation") + pytest.fail( + "Failed to retrieve the source value for asset description in the aggregation" + ) def test_metric_aggregation(client: AtlanClient): @@ -664,7 +715,9 @@ def test_index_search_with_no_aggregation_results(client: AtlanClient): def test_default_sorting(client: AtlanClient): # Empty sorting - request = (FluentSearch().where(Asset.QUALIFIED_NAME.eq("test-qn", case_insensitive=True))).to_request() + request = ( + FluentSearch().where(Asset.QUALIFIED_NAME.eq("test-qn", case_insensitive=True)) + ).to_request() response = client.asset.search(criteria=request) sort_options = response._criteria.dsl.sort # type: ignore assert response @@ -723,7 +776,9 @@ def test_read_timeout(client: AtlanClient): def test_connect_timeout(client: AtlanClient): request = (FluentSearch().select()).to_request() - with client_connection(connect_timeout=0.0001, retry=Retry(total=0)) as timed_client: + with client_connection( + connect_timeout=0.0001, retry=Retry(total=0) + ) as timed_client: with pytest.raises( requests.exceptions.ConnectionError, match=".(timed out\. \(connect timeout=0\.0001\))|(Failed to establish a new connection.)", # noqa W605 diff --git a/tests/integration/test_open_lineage.py b/tests/integration/test_open_lineage.py index 20750bcb6..31cb86720 100644 --- a/tests/integration/test_open_lineage.py +++ b/tests/integration/test_open_lineage.py @@ -19,9 +19,13 @@ def connection(client: AtlanClient): admin_role_guid = RoleCache.get_id_for_name("$admin") assert admin_role_guid - response = client.open_lineage.create_connection(name=MODULE_NAME, admin_roles=[admin_role_guid]) + response = client.open_lineage.create_connection( + name=MODULE_NAME, admin_roles=[admin_role_guid] + ) result = response.assets_created(asset_type=Connection)[0] - yield client.asset.get_by_guid(result.guid, asset_type=Connection, ignore_relationships=False) + yield client.asset.get_by_guid( + result.guid, asset_type=Connection, ignore_relationships=False + ) delete_asset(client, asset_type=Connection, guid=result.guid) @@ -31,7 +35,9 @@ def test_open_lineage_integration(connection: Connection, client: AtlanClient): namespace = "snowflake://abc123.snowflakecomputing.com" producer = "https://your.orchestrator/unique/id/123" - job = OpenLineageJob.creator(connection_name=MODULE_NAME, job_name="dag_123", producer=producer) + job = OpenLineageJob.creator( + connection_name=MODULE_NAME, job_name="dag_123", producer=producer + ) run = OpenLineageRun.creator(job=job) id = job.create_input(namespace=namespace, asset_name="OPS.DEFAULT.RUN_STATS") od = job.create_output(namespace=namespace, asset_name="OPS.DEFAULT.FULL_STATS") @@ -61,7 +67,9 @@ def test_open_lineage_integration(connection: Connection, client: AtlanClient): ] start.emit() - complete = OpenLineageEvent.creator(run=run, event_type=OpenLineageEventType.COMPLETE) + complete = OpenLineageEvent.creator( + run=run, event_type=OpenLineageEventType.COMPLETE + ) complete.emit() assert job @@ -100,14 +108,21 @@ def test_open_lineage_integration(connection: Connection, client: AtlanClient): assert outputs assert process - input_qns = {input.get("uniqueAttributes", {}).get("qualifiedName") for input in inputs} + input_qns = { + input.get("uniqueAttributes", {}).get("qualifiedName") for input in inputs + } assert f"{connection.qualified_name}/OPS/DEFAULT/RUN_STATS" in input_qns assert f"{connection.qualified_name}/SOME/OTHER/TBL" in input_qns assert f"{connection.qualified_name}/AN/OTHER/TBL" in input_qns - outputs_qns = {output.get("uniqueAttributes", {}).get("qualifiedName") for output in outputs} + outputs_qns = { + output.get("uniqueAttributes", {}).get("qualifiedName") for output in outputs + } assert f"{connection.qualified_name}/OPS/DEFAULT/FULL_STATS" in outputs_qns assert f"{connection.qualified_name}/AN/OTHER/VIEW" in outputs_qns - assert process.get("uniqueAttributes", {}).get("qualifiedName") == f"{connection.qualified_name}/dag_123/process" + assert ( + process.get("uniqueAttributes", {}).get("qualifiedName") + == f"{connection.qualified_name}/dag_123/process" + ) delete_asset(client, asset_type=Process, guid=process.get("guid")) delete_asset(client, asset_type=SparkJob, guid=job_asset.detail.guid) diff --git a/tests/integration/test_sql_assets.py b/tests/integration/test_sql_assets.py index cf561bc43..5daff19fd 100644 --- a/tests/integration/test_sql_assets.py +++ b/tests/integration/test_sql_assets.py @@ -35,7 +35,11 @@ def upsert(client: AtlanClient): def _upsert(asset: Asset) -> AssetMutationResponse: _response = client.asset.save(asset) - if _response and _response.mutated_entities and _response.mutated_entities.CREATE: + if ( + _response + and _response.mutated_entities + and _response.mutated_entities.CREATE + ): guids.append(_response.mutated_entities.CREATE[0].guid) return _response @@ -43,7 +47,11 @@ def _upsert(asset: Asset) -> AssetMutationResponse: for guid in reversed(guids): response = client.asset.purge_by_guid(guid) - if not response or not response.mutated_entities or not response.mutated_entities.DELETE: + if ( + not response + or not response.mutated_entities + or not response.mutated_entities.DELETE + ): LOGGER.error(f"Failed to remove asset with GUID {guid}.") @@ -90,7 +98,9 @@ def test_create( TestConnection.connection = c @pytest.mark.order(after="test_create") - def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_create_for_modification( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestConnection.connection assert TestConnection.connection.name connection = TestConnection.connection @@ -104,7 +114,9 @@ def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[As verify_asset_updated(response, Connection) @pytest.mark.order(after="test_create") - def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_trim_to_required( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestConnection.connection connection = TestConnection.connection.trim_to_required() response = upsert(connection) @@ -142,7 +154,9 @@ def test_create( TestDatabase.database = database @pytest.mark.order(after="test_create") - def test_create_for_modification(self, client, upsert: Callable[[Asset], AssetMutationResponse]): + def test_create_for_modification( + self, client, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestDatabase.database assert TestDatabase.database.qualified_name assert TestDatabase.database.name @@ -156,7 +170,9 @@ def test_create_for_modification(self, client, upsert: Callable[[Asset], AssetMu verify_asset_updated(response, Database) @pytest.mark.order(after="test_create") - def test_trim_to_required(self, client, upsert: Callable[[Asset], AssetMutationResponse]): + def test_trim_to_required( + self, client, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestDatabase.database database = TestDatabase.database.trim_to_required() response = upsert(database) @@ -182,10 +198,14 @@ def test_create( response = upsert(schema) assert (schemas := response.assets_created(asset_type=Schema)) assert len(schemas) == 1 - schema = client.asset.get_by_guid(schemas[0].guid, Schema, ignore_relationships=False) + schema = client.asset.get_by_guid( + schemas[0].guid, Schema, ignore_relationships=False + ) assert (databases := response.assets_updated(asset_type=Database)) assert len(databases) == 1 - database = client.asset.get_by_guid(databases[0].guid, Database, ignore_relationships=False) + database = client.asset.get_by_guid( + databases[0].guid, Database, ignore_relationships=False + ) assert database.attributes.schemas schemas = database.attributes.schemas assert len(schemas) == 1 @@ -213,10 +233,14 @@ def test_overload_creator( response = upsert(schema) assert (schemas := response.assets_created(asset_type=Schema)) assert len(schemas) == 1 - overload_schema = client.asset.get_by_guid(schemas[0].guid, Schema, ignore_relationships=False) + overload_schema = client.asset.get_by_guid( + schemas[0].guid, Schema, ignore_relationships=False + ) assert (databases := response.assets_updated(asset_type=Database)) assert len(databases) == 1 - database = client.asset.get_by_guid(databases[0].guid, Database, ignore_relationships=False) + database = client.asset.get_by_guid( + databases[0].guid, Database, ignore_relationships=False + ) assert database.attributes.schemas schemas = database.attributes.schemas assert len(schemas) == 2 @@ -227,19 +251,25 @@ def test_overload_creator( assert overload_schema.guid and overload_schema.guid in schema_guids @pytest.mark.order(after="test_create") - def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_create_for_modification( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestSchema.schema schema = TestSchema.schema assert schema.qualified_name assert schema.name description = f"{schema.description} more stuff" - schema = Schema.create_for_modification(qualified_name=schema.qualified_name, name=schema.name) + schema = Schema.create_for_modification( + qualified_name=schema.qualified_name, name=schema.name + ) schema.description = description response = upsert(schema) verify_asset_updated(response, Schema) @pytest.mark.order(after="test_create") - def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_trim_to_required( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestSchema.schema schema = TestSchema.schema.trim_to_required() response = upsert(schema) @@ -279,10 +309,14 @@ def test_create( response = upsert(table) assert (tables := response.assets_created(asset_type=Table)) assert len(tables) == 1 - table = client.asset.get_by_guid(guid=tables[0].guid, asset_type=Table, ignore_relationships=False) + table = client.asset.get_by_guid( + guid=tables[0].guid, asset_type=Table, ignore_relationships=False + ) assert (schemas := response.assets_updated(asset_type=Schema)) assert len(schemas) == 1 - schema = client.asset.get_by_guid(guid=schemas[0].guid, asset_type=Schema, ignore_relationships=False) + schema = client.asset.get_by_guid( + guid=schemas[0].guid, asset_type=Schema, ignore_relationships=False + ) assert schema.attributes.tables tables = schema.attributes.tables assert len(tables) == 1 @@ -315,10 +349,14 @@ def test_overload_creator( response = upsert(table) assert (tables := response.assets_created(asset_type=Table)) assert len(tables) == 1 - overload_table = client.asset.get_by_guid(guid=tables[0].guid, asset_type=Table, ignore_relationships=False) + overload_table = client.asset.get_by_guid( + guid=tables[0].guid, asset_type=Table, ignore_relationships=False + ) assert (schemas := response.assets_updated(asset_type=Schema)) assert len(schemas) == 1 - schema = client.asset.get_by_guid(guid=schemas[0].guid, asset_type=Schema, ignore_relationships=False) + schema = client.asset.get_by_guid( + guid=schemas[0].guid, asset_type=Schema, ignore_relationships=False + ) assert schema.attributes.tables tables = schema.attributes.tables assert len(tables) == 2 @@ -329,19 +367,25 @@ def test_overload_creator( assert overload_table.guid and overload_table.guid in table_guids @pytest.mark.order(after="test_create") - def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_create_for_modification( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestTable.table table = TestTable.table assert table.qualified_name assert table.name description = f"{table.description} more stuff" - table = Table.create_for_modification(qualified_name=table.qualified_name, name=table.name) + table = Table.create_for_modification( + qualified_name=table.qualified_name, name=table.name + ) table.description = description response = upsert(table) verify_asset_updated(response, Table) @pytest.mark.order(after="test_create") - def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_trim_to_required( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestTable.table table = TestTable.table.trim_to_required() response = upsert(table) @@ -369,7 +413,9 @@ def test_source_read_recent_user_record_list_readable( popularity_insight: PopularityInsights, ): assert TestTable.table - asset = client.asset.get_by_guid(guid=TestTable.table.guid, asset_type=Table, ignore_relationships=False) + asset = client.asset.get_by_guid( + guid=TestTable.table.guid, asset_type=Table, ignore_relationships=False + ) assert asset.source_read_recent_user_record_list asset_popularity = asset.source_read_recent_user_record_list[0] self.verify_popularity(asset_popularity, popularity_insight) @@ -398,12 +444,28 @@ def test_source_read_recent_user_record_list_readable_with_fluent_search( def verify_popularity(self, asset_popularity, popularity_insight): assert popularity_insight.record_user == asset_popularity.record_user - assert popularity_insight.record_query_count == asset_popularity.record_query_count - assert popularity_insight.record_compute_cost == asset_popularity.record_compute_cost - assert popularity_insight.record_query_count == asset_popularity.record_query_count - assert popularity_insight.record_total_user_count == asset_popularity.record_total_user_count - assert popularity_insight.record_compute_cost_unit == asset_popularity.record_compute_cost_unit - assert popularity_insight.record_query_duration == asset_popularity.record_query_duration + assert ( + popularity_insight.record_query_count == asset_popularity.record_query_count + ) + assert ( + popularity_insight.record_compute_cost + == asset_popularity.record_compute_cost + ) + assert ( + popularity_insight.record_query_count == asset_popularity.record_query_count + ) + assert ( + popularity_insight.record_total_user_count + == asset_popularity.record_total_user_count + ) + assert ( + popularity_insight.record_compute_cost_unit + == asset_popularity.record_compute_cost_unit + ) + assert ( + popularity_insight.record_query_duration + == asset_popularity.record_query_duration + ) assert popularity_insight.record_warehouse == asset_popularity.record_warehouse @@ -463,19 +525,25 @@ def test_overload_creator( assert response.guid_assignments @pytest.mark.order(after="test_create") - def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_create_for_modification( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestView.view view = TestView.view assert view.qualified_name assert view.name description = f"{view.description} more stuff" - view = View.create_for_modification(qualified_name=view.qualified_name, name=view.name) + view = View.create_for_modification( + qualified_name=view.qualified_name, name=view.name + ) view.description = description response = upsert(view) verify_asset_updated(response, View) @pytest.mark.order(after="test_create") - def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_trim_to_required( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestView.view view = TestView.view.trim_to_required() response = upsert(view) @@ -546,7 +614,9 @@ def test_overload_creator( assert response.guid_assignments @pytest.mark.order(after="test_creator") - def test_updater(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_updater( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestProcedure.procedure procedure = TestProcedure.procedure assert procedure.qualified_name @@ -563,7 +633,9 @@ def test_updater(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutat verify_asset_updated(response, Procedure) @pytest.mark.order(after="test_creator") - def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_trim_to_required( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestProcedure.procedure procedure = TestProcedure.procedure.trim_to_required() response = upsert(procedure) @@ -631,7 +703,9 @@ def test_overload_creator( assert response.guid_assignments @pytest.mark.order(after="test_creator") - def test_updater(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_updater( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestTablePartition.table_partition table_partition = TestTablePartition.table_partition assert table_partition.qualified_name @@ -646,7 +720,9 @@ def test_updater(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutat verify_asset_updated(response, TablePartition) @pytest.mark.order(after="test_creator") - def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_trim_to_required( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestTablePartition.table_partition table_partition = TestTablePartition.table_partition.trim_to_required() response = upsert(table_partition) @@ -674,8 +750,12 @@ def test_create( response = client.asset.save(column) assert (columns := response.assets_created(asset_type=Column)) assert len(columns) == 1 - column = client.asset.get_by_guid(asset_type=Column, guid=columns[0].guid, ignore_relationships=False) - table = client.asset.get_by_guid(asset_type=Table, guid=TestTable.table.guid, ignore_relationships=False) + column = client.asset.get_by_guid( + asset_type=Column, guid=columns[0].guid, ignore_relationships=False + ) + table = client.asset.get_by_guid( + asset_type=Table, guid=TestTable.table.guid, ignore_relationships=False + ) assert table.attributes.columns columns = table.attributes.columns assert len(columns) == 1 @@ -746,8 +826,12 @@ def test_overload_creator( assert (columns := response.assets_created(asset_type=Column)) assert len(columns) == 1 - overload_column = client.asset.get_by_guid(asset_type=Column, guid=columns[0].guid, ignore_relationships=False) - table = client.asset.get_by_guid(asset_type=Table, guid=TestTable.table.guid, ignore_relationships=False) + overload_column = client.asset.get_by_guid( + asset_type=Column, guid=columns[0].guid, ignore_relationships=False + ) + table = client.asset.get_by_guid( + asset_type=Table, guid=TestTable.table.guid, ignore_relationships=False + ) assert table.attributes.columns columns = table.attributes.columns @@ -759,24 +843,36 @@ def test_overload_creator( assert overload_column.guid and overload_column.guid in column_guids assert overload_column.attributes assert overload_column.attributes.schema_name == TestSchema.schema.name - assert overload_column.attributes.schema_qualified_name == TestSchema.schema.qualified_name + assert ( + overload_column.attributes.schema_qualified_name + == TestSchema.schema.qualified_name + ) assert overload_column.attributes.database_name == TestDatabase.database.name - assert overload_column.attributes.database_qualified_name == TestDatabase.database.qualified_name + assert ( + overload_column.attributes.database_qualified_name + == TestDatabase.database.qualified_name + ) @pytest.mark.order(after="test_create") - def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_create_for_modification( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestColumn.column column = TestColumn.column assert column.qualified_name assert column.name description = f"{column.description} more stuff" - column = Column.create_for_modification(qualified_name=column.qualified_name, name=column.name) + column = Column.create_for_modification( + qualified_name=column.qualified_name, name=column.name + ) column.description = description response = upsert(column) verify_asset_updated(response, Column) @pytest.mark.order(after="test_create") - def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_trim_to_required( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestColumn.column column = TestColumn.column.trim_to_required() response = upsert(column) @@ -800,24 +896,32 @@ def test_create( assert len(reaadmes) == 1 assert (columns := response.assets_updated(asset_type=Column)) assert len(columns) == 1 - readme = client.asset.get_by_guid(guid=reaadmes[0].guid, asset_type=Readme, ignore_relationships=False) + readme = client.asset.get_by_guid( + guid=reaadmes[0].guid, asset_type=Readme, ignore_relationships=False + ) assert readme.description == self.CONTENT TestReadme.readme = readme @pytest.mark.order(after="test_create") - def test_create_for_modification(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_create_for_modification( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestReadme.readme readme = TestReadme.readme assert readme.qualified_name assert readme.name description = f"{readme.description} more stuff" - readme = Readme.create_for_modification(qualified_name=readme.qualified_name, name=readme.name) + readme = Readme.create_for_modification( + qualified_name=readme.qualified_name, name=readme.name + ) readme.description = description response = upsert(readme) verify_asset_updated(response, Readme) @pytest.mark.order(after="test_create") - def test_trim_to_required(self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse]): + def test_trim_to_required( + self, client: AtlanClient, upsert: Callable[[Asset], AssetMutationResponse] + ): assert TestReadme.readme readme = TestReadme.readme readme = readme.trim_to_required() diff --git a/tests/integration/test_sso_client.py b/tests/integration/test_sso_client.py index ef3f75be4..d4078bf37 100644 --- a/tests/integration/test_sso_client.py +++ b/tests/integration/test_sso_client.py @@ -26,7 +26,9 @@ def delete_group(client: AtlanClient, guid: str) -> None: def delete_sso_mapping(client: AtlanClient, group_map_id: str) -> None: - response = client.sso.delete_group_mapping(sso_alias=AtlanSSO.JUMPCLOUD, group_map_id=group_map_id) + response = client.sso.delete_group_mapping( + sso_alias=AtlanSSO.JUMPCLOUD, group_map_id=group_map_id + ) assert response is None @@ -45,7 +47,9 @@ def group(client: AtlanClient) -> Generator[AtlanGroup, None, None]: @pytest.fixture(scope="module") -def sso_mapping(client: AtlanClient, group: AtlanGroup) -> Generator[SSOMapper, None, None]: +def sso_mapping( + client: AtlanClient, group: AtlanGroup +) -> Generator[SSOMapper, None, None]: assert group assert group.id response = client.sso.create_group_mapping( @@ -68,7 +72,9 @@ def sso_mapping(client: AtlanClient, group: AtlanGroup) -> Generator[SSOMapper, delete_sso_mapping(client, azure_group_mapping.id) -def _assert_sso_group_mapping(group: AtlanGroup, sso_mapping: SSOMapper, is_updated: bool = False): +def _assert_sso_group_mapping( + group: AtlanGroup, sso_mapping: SSOMapper, is_updated: bool = False +): assert sso_mapping assert sso_mapping.id assert sso_mapping.identity_provider_alias == AtlanSSO.JUMPCLOUD @@ -119,7 +125,9 @@ def test_sso_create_group_mapping_again_raises_invalid_request_error( ) in str(err.value) -@pytest.mark.order(after="test_sso_create_group_mapping_again_raises_invalid_request_error") +@pytest.mark.order( + after="test_sso_create_group_mapping_again_raises_invalid_request_error" +) def test_sso_retrieve_group_mapping( client: AtlanClient, group: AtlanGroup, @@ -130,7 +138,9 @@ def test_sso_retrieve_group_mapping( assert sso_mapping.id time.sleep(5) - retrieved_sso_mapping = client.sso.get_group_mapping(sso_alias=AtlanSSO.JUMPCLOUD, group_map_id=sso_mapping.id) + retrieved_sso_mapping = client.sso.get_group_mapping( + sso_alias=AtlanSSO.JUMPCLOUD, group_map_id=sso_mapping.id + ) _assert_sso_group_mapping(group, retrieved_sso_mapping) @@ -149,7 +159,10 @@ def test_sso_retrieve_all_group_mappings( assert len(retrieved_mappings) >= 1 mapping_found = False for mapping in retrieved_mappings: - if group.id in str(mapping.name) and mapping.identity_provider_mapper == SSOClient.IDP_GROUP_MAPPER: + if ( + group.id in str(mapping.name) + and mapping.identity_provider_mapper == SSOClient.IDP_GROUP_MAPPER + ): mapping_found = True _assert_sso_group_mapping(group, mapping) break diff --git a/tests/integration/test_task_client.py b/tests/integration/test_task_client.py index ea8452803..8e81b1ba2 100644 --- a/tests/integration/test_task_client.py +++ b/tests/integration/test_task_client.py @@ -23,7 +23,9 @@ @pytest.fixture(scope="module") def snowflake_conn(client: AtlanClient): - return client.asset.find_connections_by_name("production", AtlanConnectorType.SNOWFLAKE)[0] + return client.asset.find_connections_by_name( + "production", AtlanConnectorType.SNOWFLAKE + )[0] @pytest.fixture(scope="module") @@ -32,7 +34,9 @@ def snowflake_column_qn(snowflake_conn): @pytest.fixture() -def snowflake_column(client: AtlanClient, snowflake_column_qn) -> Generator[Column, None, None]: +def snowflake_column( + client: AtlanClient, snowflake_column_qn +) -> Generator[Column, None, None]: client.asset.add_atlan_tags( asset_type=Column, qualified_name=snowflake_column_qn, @@ -75,7 +79,9 @@ def atlan_tag_def(make_atlan_tag) -> AtlanTagDef: return make_atlan_tag(TAG_NAME) -def test_task_search(client: AtlanClient, atlan_tag_def, task_search_request, snowflake_column): +def test_task_search( + client: AtlanClient, atlan_tag_def, task_search_request, snowflake_column +): assert snowflake_column assert snowflake_column.atlan_tags diff --git a/tests/integration/test_workflow_client.py b/tests/integration/test_workflow_client.py index f5823a99c..5b291aaa0 100644 --- a/tests/integration/test_workflow_client.py +++ b/tests/integration/test_workflow_client.py @@ -65,7 +65,9 @@ def delete_credentials(client: AtlanClient, guid: str): @pytest.fixture(scope="module") def connection(client: AtlanClient) -> Generator[Connection, None, None]: - connection = create_connection(client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.SNOWFLAKE) + connection = create_connection( + client=client, name=MODULE_NAME, connector_type=AtlanConnectorType.SNOWFLAKE + ) yield connection delete_asset(client, guid=connection.guid, asset_type=Connection) @@ -75,7 +77,9 @@ def delete_workflow(client: AtlanClient, workflow_name: str) -> None: @pytest.fixture(scope="module") -def workflow(client: AtlanClient, connection: Connection) -> Generator[WorkflowResponse, None, None]: +def workflow( + client: AtlanClient, connection: Connection +) -> Generator[WorkflowResponse, None, None]: assert connection and connection.qualified_name miner = ( SnowflakeMiner(connection_qualified_name=connection.qualified_name) @@ -93,7 +97,9 @@ def workflow(client: AtlanClient, connection: Connection) -> Generator[WorkflowR .custom_config(config={"test": True, "feature": 1234}) .to_workflow() ) - schedule = WorkflowSchedule(cron_schedule=WORKFLOW_SCHEDULE_SCHEDULE, timezone=WORKFLOW_SCHEDULE_TIMEZONE) + schedule = WorkflowSchedule( + cron_schedule=WORKFLOW_SCHEDULE_SCHEDULE, timezone=WORKFLOW_SCHEDULE_TIMEZONE + ) workflow = client.workflow.run(miner, workflow_schedule=schedule) assert workflow # Adding some delay to make sure @@ -105,7 +111,9 @@ def workflow(client: AtlanClient, connection: Connection) -> Generator[WorkflowR def test_workflow_find_by_methods(client: AtlanClient): - results = client.workflow.find_by_type(prefix=WorkflowPackage.SNOWFLAKE, max_results=10) + results = client.workflow.find_by_type( + prefix=WorkflowPackage.SNOWFLAKE, max_results=10 + ) assert results assert len(results) >= 1 @@ -122,7 +130,9 @@ def test_workflow_find_by_methods(client: AtlanClient): def test_workflow_get_runs_and_stop(client: AtlanClient, workflow: WorkflowResponse): # Retrieve the lastest workflow run assert workflow and workflow.metadata and workflow.metadata.name - runs = client.workflow.get_runs(workflow_name=workflow.metadata.name, workflow_phase=AtlanWorkflowPhase.RUNNING) + runs = client.workflow.get_runs( + workflow_name=workflow.metadata.name, workflow_phase=AtlanWorkflowPhase.RUNNING + ) assert runs assert len(runs) == 1 run = runs[0] @@ -132,10 +142,14 @@ def test_workflow_get_runs_and_stop(client: AtlanClient, workflow: WorkflowRespo # Stop the running workflow run_response = client.workflow.stop(workflow_run_id=run.id) assert run_response - assert run_response.status and run_response.status.phase == AtlanWorkflowPhase.RUNNING + assert ( + run_response.status and run_response.status.phase == AtlanWorkflowPhase.RUNNING + ) assert ( run_response.status.stored_workflow_template_spec - and run_response.status.stored_workflow_template_spec.get(WORKFLOW_TEMPLATE_REF).get("name") + and run_response.status.stored_workflow_template_spec.get( + WORKFLOW_TEMPLATE_REF + ).get("name") == workflow.metadata.name ) @@ -153,22 +167,30 @@ def test_workflow_get_runs_and_stop(client: AtlanClient, workflow: WorkflowRespo ) -def test_workflow_get_all_scheduled_runs(client: AtlanClient, workflow: WorkflowResponse): +def test_workflow_get_all_scheduled_runs( + client: AtlanClient, workflow: WorkflowResponse +): runs = client.workflow.get_all_scheduled_runs() assert workflow and workflow.metadata and workflow.metadata.name scheduled_workflow_name = f"{workflow.metadata.name}-cron" assert runs and len(runs) >= 1 - found = any(run.metadata and run.metadata.name == scheduled_workflow_name for run in runs) + found = any( + run.metadata and run.metadata.name == scheduled_workflow_name for run in runs + ) if not found: - pytest.fail(f"Unable to find scheduled run for workflow: {workflow.metadata.name}") + pytest.fail( + f"Unable to find scheduled run for workflow: {workflow.metadata.name}" + ) def _assert_scheduled_run(client: AtlanClient, workflow: WorkflowResponse): assert workflow and workflow.metadata and workflow.metadata.name - scheduled_workflow = client.workflow.get_scheduled_run(workflow_name=workflow.metadata.name) + scheduled_workflow = client.workflow.get_scheduled_run( + workflow_name=workflow.metadata.name + ) scheduled_workflow_name = f"{workflow.metadata.name}-cron" assert ( scheduled_workflow @@ -186,8 +208,18 @@ def _assert_add_schedule(workflow, scheduled_workflow, schedule, timezone): assert scheduled_workflow.metadata assert scheduled_workflow.metadata.name == workflow.metadata.name assert scheduled_workflow.metadata.annotations - assert scheduled_workflow.metadata.annotations.get(WorkflowClient._WORKFLOW_RUN_SCHEDULE) == schedule - assert scheduled_workflow.metadata.annotations.get(WorkflowClient._WORKFLOW_RUN_TIMEZONE) == timezone + assert ( + scheduled_workflow.metadata.annotations.get( + WorkflowClient._WORKFLOW_RUN_SCHEDULE + ) + == schedule + ) + assert ( + scheduled_workflow.metadata.annotations.get( + WorkflowClient._WORKFLOW_RUN_TIMEZONE + ) + == timezone + ) def _assert_remove_schedule(response, workflow): @@ -206,7 +238,9 @@ def test_workflow_add_remove_schedule(client: AtlanClient, workflow: WorkflowRes # NOTE: This method will overwrite existing workflow run schedule # Try to update schedule again, with `Workflow` object - scheduled_workflow = client.workflow.add_schedule(workflow=workflow, workflow_schedule=schedule) + scheduled_workflow = client.workflow.add_schedule( + workflow=workflow, workflow_schedule=schedule + ) _assert_add_schedule( workflow, @@ -221,8 +255,14 @@ def test_workflow_add_remove_schedule(client: AtlanClient, workflow: WorkflowRes _assert_remove_schedule(response, workflow) # Try to update schedule again, with `WorkflowSearchResult` object - existing_workflow = client.workflow.find_by_type(prefix=WorkflowPackage.SNOWFLAKE_MINER)[0] - assert existing_workflow and existing_workflow.source and existing_workflow.source.metadata + existing_workflow = client.workflow.find_by_type( + prefix=WorkflowPackage.SNOWFLAKE_MINER + )[0] + assert ( + existing_workflow + and existing_workflow.source + and existing_workflow.source.metadata + ) assert workflow and workflow.metadata assert existing_workflow.source.metadata.name == workflow.metadata.name @@ -230,7 +270,9 @@ def test_workflow_add_remove_schedule(client: AtlanClient, workflow: WorkflowRes cron_schedule=WORKFLOW_SCHEDULE_UPDATED_2, timezone=WORKFLOW_SCHEDULE_TIMEZONE_UPDATED_2, ) - scheduled_workflow = client.workflow.add_schedule(workflow=existing_workflow, workflow_schedule=schedule) + scheduled_workflow = client.workflow.add_schedule( + workflow=existing_workflow, workflow_schedule=schedule + ) _assert_add_schedule( workflow, @@ -287,17 +329,23 @@ def test_get_all_credentials(client: AtlanClient): credentials = client.credentials.get_all() assert credentials, "Expected credentials but found None" assert credentials.records is not None, "Expected records but found None" - assert len(credentials.records or []) > 0, "Expected at least one record but found none" + assert len(credentials.records or []) > 0, ( + "Expected at least one record but found none" + ) def test_get_all_credentials_with_filter_limit_offset(client: AtlanClient): filter_criteria = {"connectorType": "jdbc"} limit = 1 offset = 1 - credentials = client.credentials.get_all(filter=filter_criteria, limit=limit, offset=offset) + credentials = client.credentials.get_all( + filter=filter_criteria, limit=limit, offset=offset + ) assert len(credentials.records or []) <= limit, "Exceeded limit in results" for cred in credentials.records or []: - assert cred.connector_type == "jdbc", f"Expected 'jdbc', got {cred.connector_type}" + assert cred.connector_type == "jdbc", ( + f"Expected 'jdbc', got {cred.connector_type}" + ) def test_get_all_credentials_with_multiple_filters(client: AtlanClient): @@ -306,10 +354,14 @@ def test_get_all_credentials_with_multiple_filters(client: AtlanClient): credentials = client.credentials.get_all(filter=filter_criteria) assert credentials, "Expected credentials but found None" assert credentials.records is not None, "Expected records but found None" - assert len(credentials.records or []) > 0, "Expected at least one record but found none" + assert len(credentials.records or []) > 0, ( + "Expected at least one record but found none" + ) for record in credentials.records or []: - assert record.connector_type == "jdbc", f"Expected 'jdbc', got {record.connector_type}" + assert record.connector_type == "jdbc", ( + f"Expected 'jdbc', got {record.connector_type}" + ) assert record.is_active, f"Expected active record, but got inactive: {record}" diff --git a/tests/unit/model/a_d_l_s_account_test.py b/tests/unit/model/a_d_l_s_account_test.py index 325046178..4833dd2ce 100644 --- a/tests/unit/model/a_d_l_s_account_test.py +++ b/tests/unit/model/a_d_l_s_account_test.py @@ -16,13 +16,19 @@ (ADLS_ACCOUNT_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - ADLSAccount.create(name=name, connection_qualified_name=connection_qualified_name) + ADLSAccount.create( + name=name, connection_qualified_name=connection_qualified_name + ) def test_create(): - sut = ADLSAccount.create(name=ADLS_ACCOUNT_NAME, connection_qualified_name=ADLS_CONNECTION_QUALIFIED_NAME) + sut = ADLSAccount.create( + name=ADLS_ACCOUNT_NAME, connection_qualified_name=ADLS_CONNECTION_QUALIFIED_NAME + ) assert sut.name == ADLS_ACCOUNT_NAME assert sut.connection_qualified_name == ADLS_CONNECTION_QUALIFIED_NAME @@ -45,7 +51,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = ADLSAccount.create_for_modification(qualified_name=ADLS_QUALIFIED_NAME, name=ADLS_ACCOUNT_NAME) + sut = ADLSAccount.create_for_modification( + qualified_name=ADLS_QUALIFIED_NAME, name=ADLS_ACCOUNT_NAME + ) assert sut.qualified_name == ADLS_QUALIFIED_NAME assert sut.name == ADLS_ACCOUNT_NAME diff --git a/tests/unit/model/a_d_l_s_container_test.py b/tests/unit/model/a_d_l_s_container_test.py index 72c55c7a4..58883773f 100644 --- a/tests/unit/model/a_d_l_s_container_test.py +++ b/tests/unit/model/a_d_l_s_container_test.py @@ -18,9 +18,13 @@ (ADLS_CONTAINER_NAME, None, "adls_account_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, adls_account_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, adls_account_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - ADLSContainer.create(name=name, adls_account_qualified_name=adls_account_qualified_name) + ADLSContainer.create( + name=name, adls_account_qualified_name=adls_account_qualified_name + ) # Test case for creating an ADLSContainer @@ -66,7 +70,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = ADLSContainer.create_for_modification(qualified_name=ADLS_CONTAINER_QUALIFIED_NAME, name=ADLS_CONTAINER_NAME) + sut = ADLSContainer.create_for_modification( + qualified_name=ADLS_CONTAINER_QUALIFIED_NAME, name=ADLS_CONTAINER_NAME + ) assert sut.name == ADLS_CONTAINER_NAME assert sut.qualified_name == ADLS_CONTAINER_QUALIFIED_NAME diff --git a/tests/unit/model/a_d_l_s_object_test.py b/tests/unit/model/a_d_l_s_object_test.py index 545c6bc0f..9b6b09198 100644 --- a/tests/unit/model/a_d_l_s_object_test.py +++ b/tests/unit/model/a_d_l_s_object_test.py @@ -43,14 +43,18 @@ def test_create(): assert sut.qualified_name == f"{ADLS_CONTAINER_QUALIFIED_NAME}/{ADLS_OBJECT_NAME}" assert sut.connection_qualified_name == ADLS_CONNECTION_QUALIFIED_NAME assert sut.connector_name == ADLS_CONNECTOR_TYPE - assert sut.adls_account_qualified_name == get_parent_qualified_name(ADLS_CONTAINER_QUALIFIED_NAME) + assert sut.adls_account_qualified_name == get_parent_qualified_name( + ADLS_CONTAINER_QUALIFIED_NAME + ) def test_overload_creator(): sut = ADLSObject.creator( name=ADLS_OBJECT_NAME, adls_container_qualified_name=ADLS_CONTAINER_QUALIFIED_NAME, - adls_account_qualified_name=get_parent_qualified_name(ADLS_CONTAINER_QUALIFIED_NAME), + adls_account_qualified_name=get_parent_qualified_name( + ADLS_CONTAINER_QUALIFIED_NAME + ), connection_qualified_name=ADLS_CONNECTION_QUALIFIED_NAME, ) @@ -59,7 +63,9 @@ def test_overload_creator(): assert sut.qualified_name == f"{ADLS_CONTAINER_QUALIFIED_NAME}/{ADLS_OBJECT_NAME}" assert sut.connection_qualified_name == ADLS_CONNECTION_QUALIFIED_NAME assert sut.connector_name == ADLS_CONNECTOR_TYPE - assert sut.adls_account_qualified_name == get_parent_qualified_name(ADLS_CONTAINER_QUALIFIED_NAME) + assert sut.adls_account_qualified_name == get_parent_qualified_name( + ADLS_CONTAINER_QUALIFIED_NAME + ) # Test cases for creating ADLSObject for modification @@ -78,7 +84,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = ADLSObject.create_for_modification(qualified_name=ADLS_OBJECT_QUALIFIED_NAME, name=ADLS_OBJECT_NAME) + sut = ADLSObject.create_for_modification( + qualified_name=ADLS_OBJECT_QUALIFIED_NAME, name=ADLS_OBJECT_NAME + ) assert sut.name == ADLS_OBJECT_NAME assert sut.qualified_name == ADLS_OBJECT_QUALIFIED_NAME diff --git a/tests/unit/model/a_p_i_field_test.py b/tests/unit/model/a_p_i_field_test.py index 350765040..d1c4097e3 100644 --- a/tests/unit/model/a_p_i_field_test.py +++ b/tests/unit/model/a_p_i_field_test.py @@ -53,7 +53,10 @@ def test_create_parent_object(): assert sut.name == API_FIELD_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" + assert ( + sut.qualified_name + == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" + ) assert sut.connector_name == API_CONNECTOR_TYPE assert sut.api_object.qualified_name == API_FIELD_PARENT_OBJECT_QUALIFIED_NAME @@ -67,7 +70,10 @@ def test_create_parent_query(): assert sut.name == API_FIELD_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{API_FIELD_PARENT_QUERY_QUALIFIED_NAME}/{API_FIELD_NAME}" + assert ( + sut.qualified_name + == f"{API_FIELD_PARENT_QUERY_QUALIFIED_NAME}/{API_FIELD_NAME}" + ) assert sut.connector_name == API_CONNECTOR_TYPE assert sut.api_query.qualified_name == API_FIELD_PARENT_QUERY_QUALIFIED_NAME @@ -87,7 +93,10 @@ def test_overload_creator_parent_object(): assert sut.name == API_FIELD_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" + assert ( + sut.qualified_name + == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" + ) assert sut.connector_name == API_CONNECTOR_TYPE assert sut.api_field_type == "api-object-ref" assert sut.api_field_type_secondary == "Object" @@ -111,7 +120,10 @@ def test_overload_creator_parent_query(): assert sut.name == API_FIELD_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{API_FIELD_PARENT_QUERY_QUALIFIED_NAME}/{API_FIELD_NAME}" + assert ( + sut.qualified_name + == f"{API_FIELD_PARENT_QUERY_QUALIFIED_NAME}/{API_FIELD_NAME}" + ) assert sut.connector_name == API_CONNECTOR_TYPE assert sut.api_field_type == "api-object-ref" assert sut.api_field_type_secondary == "Object" @@ -144,7 +156,10 @@ def test_create_for_modification(): name=API_FIELD_NAME, ) - assert sut.qualified_name == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" + assert ( + sut.qualified_name + == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" + ) assert sut.name == API_FIELD_NAME @@ -155,4 +170,7 @@ def test_trim_to_required(): ).trim_to_required() assert sut.name == API_FIELD_NAME - assert sut.qualified_name == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" + assert ( + sut.qualified_name + == f"{API_FIELD_PARENT_OBJECT_QUALIFIED_NAME}/{API_FIELD_NAME}" + ) diff --git a/tests/unit/model/a_p_i_object_test.py b/tests/unit/model/a_p_i_object_test.py index 27e0c0d7b..18db31943 100644 --- a/tests/unit/model/a_p_i_object_test.py +++ b/tests/unit/model/a_p_i_object_test.py @@ -16,13 +16,19 @@ (API_OBJECT_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - APIObject.creator(name=name, connection_qualified_name=connection_qualified_name) + APIObject.creator( + name=name, connection_qualified_name=connection_qualified_name + ) def test_create(): - sut = APIObject.creator(name=API_OBJECT_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME) + sut = APIObject.creator( + name=API_OBJECT_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME + ) assert sut.name == API_OBJECT_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME @@ -59,14 +65,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = APIObject.updater(qualified_name=API_OBJECT_QUALIFIED_NAME, name=API_OBJECT_NAME) + sut = APIObject.updater( + qualified_name=API_OBJECT_QUALIFIED_NAME, name=API_OBJECT_NAME + ) assert sut.qualified_name == API_OBJECT_QUALIFIED_NAME assert sut.name == API_OBJECT_NAME def test_trim_to_required(): - sut = APIObject.updater(name=API_OBJECT_NAME, qualified_name=API_OBJECT_QUALIFIED_NAME).trim_to_required() + sut = APIObject.updater( + name=API_OBJECT_NAME, qualified_name=API_OBJECT_QUALIFIED_NAME + ).trim_to_required() assert sut.name == API_OBJECT_NAME assert sut.qualified_name == API_OBJECT_QUALIFIED_NAME diff --git a/tests/unit/model/a_p_i_path_test.py b/tests/unit/model/a_p_i_path_test.py index 2ef21f9a9..20d0b6023 100644 --- a/tests/unit/model/a_p_i_path_test.py +++ b/tests/unit/model/a_p_i_path_test.py @@ -74,14 +74,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = APIPath.create_for_modification(qualified_name=API_PATH_QUALIFIED_NAME, name=API_PATH_NAME) + sut = APIPath.create_for_modification( + qualified_name=API_PATH_QUALIFIED_NAME, name=API_PATH_NAME + ) assert sut.qualified_name == API_PATH_QUALIFIED_NAME assert sut.name == API_PATH_NAME def test_trim_to_required(): - sut = APIPath.create_for_modification(name=API_PATH_NAME, qualified_name=API_PATH_QUALIFIED_NAME).trim_to_required() + sut = APIPath.create_for_modification( + name=API_PATH_NAME, qualified_name=API_PATH_QUALIFIED_NAME + ).trim_to_required() assert sut.name == API_PATH_NAME assert sut.qualified_name == API_PATH_QUALIFIED_NAME diff --git a/tests/unit/model/a_p_i_query_test.py b/tests/unit/model/a_p_i_query_test.py index 1338bcf63..4c59c39a7 100644 --- a/tests/unit/model/a_p_i_query_test.py +++ b/tests/unit/model/a_p_i_query_test.py @@ -17,13 +17,17 @@ (API_QUERY_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): APIQuery.creator(name=name, connection_qualified_name=connection_qualified_name) def test_create(): - sut = APIQuery.creator(name=API_QUERY_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME) + sut = APIQuery.creator( + name=API_QUERY_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME + ) assert sut.name == API_QUERY_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME @@ -75,7 +79,9 @@ def test_create_for_modification(): def test_trim_to_required(): - sut = APIQuery.updater(name=API_QUERY_NAME, qualified_name=API_QUERY_QUALIFIED_NAME).trim_to_required() + sut = APIQuery.updater( + name=API_QUERY_NAME, qualified_name=API_QUERY_QUALIFIED_NAME + ).trim_to_required() assert sut.name == API_QUERY_NAME assert sut.qualified_name == API_QUERY_QUALIFIED_NAME diff --git a/tests/unit/model/a_p_i_spec_test.py b/tests/unit/model/a_p_i_spec_test.py index cc31da8d1..25c0c736a 100644 --- a/tests/unit/model/a_p_i_spec_test.py +++ b/tests/unit/model/a_p_i_spec_test.py @@ -16,13 +16,17 @@ (API_SPEC_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): APISpec.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): - sut = APISpec.create(name=API_SPEC_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME) + sut = APISpec.create( + name=API_SPEC_NAME, connection_qualified_name=API_CONNECTION_QUALIFIED_NAME + ) assert sut.name == API_SPEC_NAME assert sut.connection_qualified_name == API_CONNECTION_QUALIFIED_NAME @@ -45,14 +49,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = APISpec.create_for_modification(qualified_name=API_QUALIFIED_NAME, name=API_SPEC_NAME) + sut = APISpec.create_for_modification( + qualified_name=API_QUALIFIED_NAME, name=API_SPEC_NAME + ) assert sut.qualified_name == API_QUALIFIED_NAME assert sut.name == API_SPEC_NAME def test_trim_to_required(): - sut = APISpec.create_for_modification(name=API_SPEC_NAME, qualified_name=API_QUALIFIED_NAME).trim_to_required() + sut = APISpec.create_for_modification( + name=API_SPEC_NAME, qualified_name=API_QUALIFIED_NAME + ).trim_to_required() assert sut.name == API_SPEC_NAME assert sut.qualified_name == API_QUALIFIED_NAME diff --git a/tests/unit/model/airflow_dag_test.py b/tests/unit/model/airflow_dag_test.py index 87be3fe3e..42cb5436c 100644 --- a/tests/unit/model/airflow_dag_test.py +++ b/tests/unit/model/airflow_dag_test.py @@ -16,9 +16,13 @@ (AIRFLOW_DAG_NAME, None, "connection_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_creator_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - AirflowDag.creator(name=name, connection_qualified_name=connection_qualified_name) + AirflowDag.creator( + name=name, connection_qualified_name=connection_qualified_name + ) def test_creator(): @@ -40,13 +44,17 @@ def test_creator(): (AIRFLOW_DAG_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): +def test_updater_with_invalid_parameter_raises_value_error( + qualified_name: str, name: str, message: str +): with pytest.raises(ValueError, match=message): AirflowDag.updater(qualified_name=qualified_name, name=name) def test_updater(): - dag = AirflowDag.updater(name=AIRFLOW_DAG_NAME, qualified_name=AIRFLOW_DAG_QUALIFIED_NAME) + dag = AirflowDag.updater( + name=AIRFLOW_DAG_NAME, qualified_name=AIRFLOW_DAG_QUALIFIED_NAME + ) assert dag.name == AIRFLOW_DAG_NAME assert dag.qualified_name == AIRFLOW_DAG_QUALIFIED_NAME diff --git a/tests/unit/model/airflow_task_test.py b/tests/unit/model/airflow_task_test.py index e4c0a3b12..cee95f793 100644 --- a/tests/unit/model/airflow_task_test.py +++ b/tests/unit/model/airflow_task_test.py @@ -17,9 +17,13 @@ (AIRFLOW_TASK_NAME, None, "airflow_dag_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error(name: str, airflow_dag_qualified_name: str, message: str): +def test_creator_with_missing_parameters_raise_value_error( + name: str, airflow_dag_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - AirflowTask.creator(name=name, airflow_dag_qualified_name=airflow_dag_qualified_name) + AirflowTask.creator( + name=name, airflow_dag_qualified_name=airflow_dag_qualified_name + ) def test_creator(): @@ -56,20 +60,26 @@ def test_overload_creator(): (AIRFLOW_TASK_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): +def test_updater_with_invalid_parameter_raises_value_error( + qualified_name: str, name: str, message: str +): with pytest.raises(ValueError, match=message): AirflowTask.updater(qualified_name=qualified_name, name=name) def test_updater(): - task = AirflowTask.updater(name=AIRFLOW_TASK_NAME, qualified_name=AIRFLOW_TASK_QUALIFIED_NAME) + task = AirflowTask.updater( + name=AIRFLOW_TASK_NAME, qualified_name=AIRFLOW_TASK_QUALIFIED_NAME + ) assert task.name == AIRFLOW_TASK_NAME assert task.qualified_name == AIRFLOW_TASK_QUALIFIED_NAME def test_trim_to_required(): - task = AirflowTask.updater(name=AIRFLOW_TASK_NAME, qualified_name=AIRFLOW_TASK_QUALIFIED_NAME).trim_to_required() + task = AirflowTask.updater( + name=AIRFLOW_TASK_NAME, qualified_name=AIRFLOW_TASK_QUALIFIED_NAME + ).trim_to_required() assert task.name == AIRFLOW_TASK_NAME assert task.qualified_name == AIRFLOW_TASK_QUALIFIED_NAME diff --git a/tests/unit/model/anaplan_app_test.py b/tests/unit/model/anaplan_app_test.py index 4abfc3061..cfbd541a2 100644 --- a/tests/unit/model/anaplan_app_test.py +++ b/tests/unit/model/anaplan_app_test.py @@ -16,9 +16,13 @@ (ANAPLAN_APP_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - AnaplanApp.create(name=name, connection_qualified_name=connection_qualified_name) + AnaplanApp.create( + name=name, connection_qualified_name=connection_qualified_name + ) def test_create(): @@ -48,7 +52,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanApp.create_for_modification(qualified_name=ANAPLAN_APP_QUALIFIED_NAME, name=ANAPLAN_APP_NAME) + sut = AnaplanApp.create_for_modification( + qualified_name=ANAPLAN_APP_QUALIFIED_NAME, name=ANAPLAN_APP_NAME + ) assert sut.qualified_name == ANAPLAN_APP_QUALIFIED_NAME assert sut.name == ANAPLAN_APP_NAME diff --git a/tests/unit/model/anaplan_dimension_test.py b/tests/unit/model/anaplan_dimension_test.py index 8c93e1245..241577afd 100644 --- a/tests/unit/model/anaplan_dimension_test.py +++ b/tests/unit/model/anaplan_dimension_test.py @@ -17,7 +17,9 @@ (ANAPLAN_DIMENSION_NAME, None, "model_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, model_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, model_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): AnaplanDimension.creator(name=name, model_qualified_name=model_qualified_name) @@ -45,7 +47,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - AnaplanDimension.create_for_modification(qualified_name=qualified_name, name=name) + AnaplanDimension.create_for_modification( + qualified_name=qualified_name, name=name + ) def test_create_for_modification(): diff --git a/tests/unit/model/anaplan_line_item_test.py b/tests/unit/model/anaplan_line_item_test.py index b8c96907d..06694a6b4 100644 --- a/tests/unit/model/anaplan_line_item_test.py +++ b/tests/unit/model/anaplan_line_item_test.py @@ -17,7 +17,9 @@ (ANAPLAN_LINE_ITEM_NAME, None, "module_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, module_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, module_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): AnaplanLineItem.creator(name=name, module_qualified_name=module_qualified_name) @@ -45,7 +47,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - AnaplanLineItem.create_for_modification(qualified_name=qualified_name, name=name) + AnaplanLineItem.create_for_modification( + qualified_name=qualified_name, name=name + ) def test_create_for_modification(): diff --git a/tests/unit/model/anaplan_list_test.py b/tests/unit/model/anaplan_list_test.py index b53e9fbd6..c43e50d52 100644 --- a/tests/unit/model/anaplan_list_test.py +++ b/tests/unit/model/anaplan_list_test.py @@ -17,7 +17,9 @@ (ANAPLAN_LIST_NAME, None, "model_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, model_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, model_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): AnaplanList.creator(name=name, model_qualified_name=model_qualified_name) @@ -49,7 +51,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanList.create_for_modification(qualified_name=ANAPLAN_LIST_QUALIFIED_NAME, name=ANAPLAN_LIST_NAME) + sut = AnaplanList.create_for_modification( + qualified_name=ANAPLAN_LIST_QUALIFIED_NAME, name=ANAPLAN_LIST_NAME + ) assert sut.qualified_name == ANAPLAN_LIST_QUALIFIED_NAME assert sut.name == ANAPLAN_LIST_NAME diff --git a/tests/unit/model/anaplan_model_test.py b/tests/unit/model/anaplan_model_test.py index 8974277af..e12197e8b 100644 --- a/tests/unit/model/anaplan_model_test.py +++ b/tests/unit/model/anaplan_model_test.py @@ -17,9 +17,13 @@ (ANAPLAN_MODEL_NAME, None, "workspace_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, workspace_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, workspace_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - AnaplanModel.creator(name=name, workspace_qualified_name=workspace_qualified_name) + AnaplanModel.creator( + name=name, workspace_qualified_name=workspace_qualified_name + ) def test_create(): @@ -49,7 +53,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanModel.create_for_modification(qualified_name=ANAPLAN_MODEL_QUALIFIED_NAME, name=ANAPLAN_MODEL_NAME) + sut = AnaplanModel.create_for_modification( + qualified_name=ANAPLAN_MODEL_QUALIFIED_NAME, name=ANAPLAN_MODEL_NAME + ) assert sut.qualified_name == ANAPLAN_MODEL_QUALIFIED_NAME assert sut.name == ANAPLAN_MODEL_NAME diff --git a/tests/unit/model/anaplan_module_test.py b/tests/unit/model/anaplan_module_test.py index 8f1e06fbe..628083648 100644 --- a/tests/unit/model/anaplan_module_test.py +++ b/tests/unit/model/anaplan_module_test.py @@ -17,7 +17,9 @@ (ANAPLAN_MODULE_NAME, None, "model_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, model_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, model_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): AnaplanModule.creator(name=name, model_qualified_name=model_qualified_name) @@ -49,7 +51,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanModule.create_for_modification(qualified_name=ANAPLAN_MODULE_QUALIFIED_NAME, name=ANAPLAN_MODULE_NAME) + sut = AnaplanModule.create_for_modification( + qualified_name=ANAPLAN_MODULE_QUALIFIED_NAME, name=ANAPLAN_MODULE_NAME + ) assert sut.qualified_name == ANAPLAN_MODULE_QUALIFIED_NAME assert sut.name == ANAPLAN_MODULE_NAME diff --git a/tests/unit/model/anaplan_page_test.py b/tests/unit/model/anaplan_page_test.py index 5fc61631d..1bbf766cd 100644 --- a/tests/unit/model/anaplan_page_test.py +++ b/tests/unit/model/anaplan_page_test.py @@ -17,7 +17,9 @@ (ANAPLAN_PAGE_NAME, None, "app_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, app_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, app_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): AnaplanPage.creator(name=name, app_qualified_name=app_qualified_name) @@ -49,7 +51,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanPage.create_for_modification(qualified_name=ANAPLAN_PAGE_QUALIFIED_NAME, name=ANAPLAN_PAGE_NAME) + sut = AnaplanPage.create_for_modification( + qualified_name=ANAPLAN_PAGE_QUALIFIED_NAME, name=ANAPLAN_PAGE_NAME + ) assert sut.qualified_name == ANAPLAN_PAGE_QUALIFIED_NAME assert sut.name == ANAPLAN_PAGE_NAME diff --git a/tests/unit/model/anaplan_system_dimension_test.py b/tests/unit/model/anaplan_system_dimension_test.py index c2cc87df7..631c834b9 100644 --- a/tests/unit/model/anaplan_system_dimension_test.py +++ b/tests/unit/model/anaplan_system_dimension_test.py @@ -16,9 +16,13 @@ (ANAPLAN_SYSTEM_DIMENSION_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - AnaplanSystemDimension.create(name=name, connection_qualified_name=connection_qualified_name) + AnaplanSystemDimension.create( + name=name, connection_qualified_name=connection_qualified_name + ) def test_create(): @@ -44,7 +48,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - AnaplanSystemDimension.create_for_modification(qualified_name=qualified_name, name=name) + AnaplanSystemDimension.create_for_modification( + qualified_name=qualified_name, name=name + ) def test_create_for_modification(): diff --git a/tests/unit/model/anaplan_view_test.py b/tests/unit/model/anaplan_view_test.py index 416fccdc1..3250a5a08 100644 --- a/tests/unit/model/anaplan_view_test.py +++ b/tests/unit/model/anaplan_view_test.py @@ -17,7 +17,9 @@ (ANAPLAN_VIEW_NAME, None, "module_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, module_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, module_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): AnaplanView.creator(name=name, module_qualified_name=module_qualified_name) @@ -49,7 +51,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AnaplanView.create_for_modification(qualified_name=ANAPLAN_VIEW_QUALIFIED_NAME, name=ANAPLAN_VIEW_NAME) + sut = AnaplanView.create_for_modification( + qualified_name=ANAPLAN_VIEW_QUALIFIED_NAME, name=ANAPLAN_VIEW_NAME + ) assert sut.qualified_name == ANAPLAN_VIEW_QUALIFIED_NAME assert sut.name == ANAPLAN_VIEW_NAME diff --git a/tests/unit/model/anaplan_workspace_test.py b/tests/unit/model/anaplan_workspace_test.py index fab35f939..9d32de21f 100644 --- a/tests/unit/model/anaplan_workspace_test.py +++ b/tests/unit/model/anaplan_workspace_test.py @@ -16,9 +16,13 @@ (ANAPLAN_WORKSPACE_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - AnaplanWorkspace.create(name=name, connection_qualified_name=connection_qualified_name) + AnaplanWorkspace.create( + name=name, connection_qualified_name=connection_qualified_name + ) def test_create(): @@ -44,7 +48,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - AnaplanWorkspace.create_for_modification(qualified_name=qualified_name, name=name) + AnaplanWorkspace.create_for_modification( + qualified_name=qualified_name, name=name + ) def test_create_for_modification(): diff --git a/tests/unit/model/application_field_test.py b/tests/unit/model/application_field_test.py index 6cbf16cd4..e285b9b6f 100644 --- a/tests/unit/model/application_field_test.py +++ b/tests/unit/model/application_field_test.py @@ -17,9 +17,13 @@ (APPLICATION_FIELD_NAME, None, "application_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error(name: str, application_qualified_name: str, message: str): +def test_creator_with_missing_parameters_raise_value_error( + name: str, application_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - ApplicationField.creator(name=name, application_qualified_name=application_qualified_name) + ApplicationField.creator( + name=name, application_qualified_name=application_qualified_name + ) def test_creator(): @@ -41,7 +45,9 @@ def test_creator(): (APPLICATION_FIELD_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): +def test_updater_with_invalid_parameter_raises_value_error( + qualified_name: str, name: str, message: str +): with pytest.raises(ValueError, match=message): ApplicationField.updater(qualified_name=qualified_name, name=name) diff --git a/tests/unit/model/application_test.py b/tests/unit/model/application_test.py index ba8e3e1e8..fe1ffcdde 100644 --- a/tests/unit/model/application_test.py +++ b/tests/unit/model/application_test.py @@ -16,9 +16,13 @@ (APPLICATION_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - Application.creator(name=name, connection_qualified_name=connection_qualified_name) + Application.creator( + name=name, connection_qualified_name=connection_qualified_name + ) def test_create(): diff --git a/tests/unit/model/azure_event_consumer_group_test.py b/tests/unit/model/azure_event_consumer_group_test.py index 527f4c801..a65a0fe4d 100644 --- a/tests/unit/model/azure_event_consumer_group_test.py +++ b/tests/unit/model/azure_event_consumer_group_test.py @@ -17,9 +17,13 @@ (EVENT_HUB_QUALIFIED_NAMES, None, "event_hub_qualified_names is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error(name: str, event_hub_qualified_names: str, message: str): +def test_creator_with_missing_parameters_raise_value_error( + name: str, event_hub_qualified_names: str, message: str +): with pytest.raises(ValueError, match=message): - AzureEventHubConsumerGroup.creator(name=name, event_hub_qualified_names=event_hub_qualified_names) + AzureEventHubConsumerGroup.creator( + name=name, event_hub_qualified_names=event_hub_qualified_names + ) def test_creator(): @@ -42,7 +46,9 @@ def test_creator(): (EVENT_HUB_CONSUMER_GROUP_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): +def test_updater_with_invalid_parameter_raises_value_error( + qualified_name: str, name: str, message: str +): with pytest.raises(ValueError, match=message): AzureEventHubConsumerGroup.updater(qualified_name=qualified_name, name=name) diff --git a/tests/unit/model/azure_event_hub_test.py b/tests/unit/model/azure_event_hub_test.py index 98d8b070f..5a34aa436 100644 --- a/tests/unit/model/azure_event_hub_test.py +++ b/tests/unit/model/azure_event_hub_test.py @@ -16,9 +16,13 @@ (EVENT_HUB_NAME, None, "connection_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_creator_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - AzureEventHub.creator(name=name, connection_qualified_name=connection_qualified_name) + AzureEventHub.creator( + name=name, connection_qualified_name=connection_qualified_name + ) def test_creator(): @@ -40,13 +44,17 @@ def test_creator(): (EVENT_HUB_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): +def test_updater_with_invalid_parameter_raises_value_error( + qualified_name: str, name: str, message: str +): with pytest.raises(ValueError, match=message): AzureEventHub.updater(qualified_name=qualified_name, name=name) def test_updater(): - event_hub = AzureEventHub.updater(name=EVENT_HUB_NAME, qualified_name=EVENT_HUB_QUALIFIED_NAME) + event_hub = AzureEventHub.updater( + name=EVENT_HUB_NAME, qualified_name=EVENT_HUB_QUALIFIED_NAME + ) assert event_hub.name == EVENT_HUB_NAME assert event_hub.qualified_name == EVENT_HUB_QUALIFIED_NAME diff --git a/tests/unit/model/badge_test.py b/tests/unit/model/badge_test.py index eb8ba2551..7c0ece1d8 100644 --- a/tests/unit/model/badge_test.py +++ b/tests/unit/model/badge_test.py @@ -78,14 +78,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Badge.create_for_modification(qualified_name=BADGE_QUALIFIED_NAME, name=BADGE_NAME) + sut = Badge.create_for_modification( + qualified_name=BADGE_QUALIFIED_NAME, name=BADGE_NAME + ) assert sut.qualified_name == BADGE_QUALIFIED_NAME assert sut.name == BADGE_NAME def test_trim_to_required(): - sut = Badge.create_for_modification(qualified_name=BADGE_QUALIFIED_NAME, name=BADGE_NAME).trim_to_required() + sut = Badge.create_for_modification( + qualified_name=BADGE_QUALIFIED_NAME, name=BADGE_NAME + ).trim_to_required() assert sut.qualified_name == BADGE_QUALIFIED_NAME assert sut.name == BADGE_NAME diff --git a/tests/unit/model/column_process_test.py b/tests/unit/model/column_process_test.py index 805cd897e..25dbb8a74 100644 --- a/tests/unit/model/column_process_test.py +++ b/tests/unit/model/column_process_test.py @@ -140,6 +140,8 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_trim_to_required(): - test_cp = ColumnProcess.create_for_modification(qualified_name=CP_QUALIFIED_NAME, name=CP_NAME).trim_to_required() + test_cp = ColumnProcess.create_for_modification( + qualified_name=CP_QUALIFIED_NAME, name=CP_NAME + ).trim_to_required() assert test_cp.name == CP_NAME assert test_cp.qualified_name == CP_QUALIFIED_NAME diff --git a/tests/unit/model/column_test.py b/tests/unit/model/column_test.py index 2e7c9acde..4f2d0d8cf 100644 --- a/tests/unit/model/column_test.py +++ b/tests/unit/model/column_test.py @@ -211,14 +211,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Column.create_for_modification(qualified_name=TABLE_COLUMN_QUALIFIED_NAME, name=COLUMN_NAME) + sut = Column.create_for_modification( + qualified_name=TABLE_COLUMN_QUALIFIED_NAME, name=COLUMN_NAME + ) assert sut.qualified_name == TABLE_COLUMN_QUALIFIED_NAME assert sut.name == COLUMN_NAME def test_trim_to_required(): - sut = Table.create_for_modification(qualified_name=TABLE_COLUMN_QUALIFIED_NAME, name=COLUMN_NAME).trim_to_required() + sut = Table.create_for_modification( + qualified_name=TABLE_COLUMN_QUALIFIED_NAME, name=COLUMN_NAME + ).trim_to_required() assert sut.qualified_name == TABLE_COLUMN_QUALIFIED_NAME assert sut.name == COLUMN_NAME diff --git a/tests/unit/model/connection_test.py b/tests/unit/model/connection_test.py index 6b2a3a7f8..f7f83b480 100644 --- a/tests/unit/model/connection_test.py +++ b/tests/unit/model/connection_test.py @@ -148,7 +148,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Connection.create_for_modification(qualified_name=CONNECTION_QUALIFIED_NAME, name=CONNECTION_NAME) + sut = Connection.create_for_modification( + qualified_name=CONNECTION_QUALIFIED_NAME, name=CONNECTION_NAME + ) assert sut.qualified_name == CONNECTION_QUALIFIED_NAME assert sut.name == CONNECTION_NAME @@ -232,7 +234,9 @@ def test_admin_roles_when_set_to_good_name(mock_role_cache): mock_role_cache.validate_idstrs.assert_called_once -def test_validation_of_admin_not_done_when_constructed_from_json(mock_user_cache, mock_group_cache, mock_role_cache): +def test_validation_of_admin_not_done_when_constructed_from_json( + mock_user_cache, mock_group_cache, mock_role_cache +): data = { "typeName": "Connection", "attributes": { diff --git a/tests/unit/model/constants.py b/tests/unit/model/constants.py index 847e1e186..598cdcb1d 100644 --- a/tests/unit/model/constants.py +++ b/tests/unit/model/constants.py @@ -37,7 +37,9 @@ ADLS_CONNECTOR_TYPE = "adls" ADLS_CONTAINER_NAME = "mycontainer" ADLS_OBJECT_NAME = "myobject.csv" -ADLS_ACCOUNT_QUALIFIED_NAME = f"{ADLS_QUALIFIED_NAME}" # "default/adls/123456789/myaccount" +ADLS_ACCOUNT_QUALIFIED_NAME = ( + f"{ADLS_QUALIFIED_NAME}" # "default/adls/123456789/myaccount" +) # "default/adls/123456789/myaccount/mycontainer" ADLS_CONTAINER_QUALIFIED_NAME = f"{ADLS_QUALIFIED_NAME}/{ADLS_CONTAINER_NAME}" # "default/adls/123456789/myaccount/mycontainer/myobject.csv" @@ -45,23 +47,33 @@ ANAPLAN_CONNECTION_QUALIFIED_NAME = "default/anaplan/123456789" ANAPLAN_CONNECTOR_TYPE = "anaplan" ANAPLAN_WORKSPACE_NAME = "anaplan-workspace" -ANAPLAN_WORKSPACE_QUALIFIED_NAME = f"{ANAPLAN_CONNECTION_QUALIFIED_NAME}/{ANAPLAN_WORKSPACE_NAME}" +ANAPLAN_WORKSPACE_QUALIFIED_NAME = ( + f"{ANAPLAN_CONNECTION_QUALIFIED_NAME}/{ANAPLAN_WORKSPACE_NAME}" +) ANAPLAN_APP_NAME = "anaplan-app" ANAPLAN_APP_QUALIFIED_NAME = f"{ANAPLAN_CONNECTION_QUALIFIED_NAME}/{ANAPLAN_APP_NAME}" ANAPLAN_PAGE_NAME = "anaplan-page" ANAPLAN_PAGE_QUALIFIED_NAME = f"{ANAPLAN_APP_QUALIFIED_NAME}/{ANAPLAN_PAGE_NAME}" ANAPLAN_MODEL_NAME = "anaplan-model" -ANAPLAN_MODEL_QUALIFIED_NAME = f"{ANAPLAN_WORKSPACE_QUALIFIED_NAME}/{ANAPLAN_MODEL_NAME}" +ANAPLAN_MODEL_QUALIFIED_NAME = ( + f"{ANAPLAN_WORKSPACE_QUALIFIED_NAME}/{ANAPLAN_MODEL_NAME}" +) ANAPLAN_MODULE_NAME = "anaplan-module" ANAPLAN_MODULE_QUALIFIED_NAME = f"{ANAPLAN_MODEL_QUALIFIED_NAME}/{ANAPLAN_MODULE_NAME}" ANAPLAN_LIST_NAME = "anaplan-list" ANAPLAN_LIST_QUALIFIED_NAME = f"{ANAPLAN_MODEL_QUALIFIED_NAME}/{ANAPLAN_LIST_NAME}" ANAPLAN_SYSTEM_DIMENSION_NAME = "anaplan-system-dimension" -ANAPLAN_SYSTEM_DIMENSION_QUALIFIED_NAME = f"{ANAPLAN_CONNECTION_QUALIFIED_NAME}/{ANAPLAN_SYSTEM_DIMENSION_NAME}" +ANAPLAN_SYSTEM_DIMENSION_QUALIFIED_NAME = ( + f"{ANAPLAN_CONNECTION_QUALIFIED_NAME}/{ANAPLAN_SYSTEM_DIMENSION_NAME}" +) ANAPLAN_DIMENSION_NAME = "anaplan-list" -ANAPLAN_DIMENSION_QUALIFIED_NAME = f"{ANAPLAN_MODEL_QUALIFIED_NAME}/{ANAPLAN_DIMENSION_NAME}" +ANAPLAN_DIMENSION_QUALIFIED_NAME = ( + f"{ANAPLAN_MODEL_QUALIFIED_NAME}/{ANAPLAN_DIMENSION_NAME}" +) ANAPLAN_LINE_ITEM_NAME = "anaplan-lineitem" -ANAPLAN_LINE_ITEM_QUALIFIED_NAME = f"{ANAPLAN_MODULE_QUALIFIED_NAME}/{ANAPLAN_LINE_ITEM_NAME}" +ANAPLAN_LINE_ITEM_QUALIFIED_NAME = ( + f"{ANAPLAN_MODULE_QUALIFIED_NAME}/{ANAPLAN_LINE_ITEM_NAME}" +) ANAPLAN_VIEW_NAME = "anaplan-view" ANAPLAN_VIEW_QUALIFIED_NAME = f"{ANAPLAN_MODULE_QUALIFIED_NAME}/{ANAPLAN_VIEW_NAME}" API_SPEC_NAME = "api-spec" @@ -75,12 +87,18 @@ API_CONNECTOR_TYPE = "api" API_PATH_RAW_URI = "/api/path" API_SPEC_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_SPEC_NAME}" -API_PATH_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_SPEC_NAME}{API_PATH_RAW_URI}" +API_PATH_QUALIFIED_NAME = ( + f"{API_CONNECTION_QUALIFIED_NAME}/{API_SPEC_NAME}{API_PATH_RAW_URI}" +) API_OBJECT_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_OBJECT_NAME}" API_QUERY_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_QUERY_NAME}" API_QUERY_REFERENCE_OBJECT_QN = f"{API_CONNECTION_QUALIFIED_NAME}/{API_OBJECT_REF_NAME}" -API_FIELD_PARENT_OBJECT_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_OBJECT_NAME}" -API_FIELD_PARENT_QUERY_QUALIFIED_NAME = f"{API_CONNECTION_QUALIFIED_NAME}/{API_QUERY_NAME}" +API_FIELD_PARENT_OBJECT_QUALIFIED_NAME = ( + f"{API_CONNECTION_QUALIFIED_NAME}/{API_OBJECT_NAME}" +) +API_FIELD_PARENT_QUERY_QUALIFIED_NAME = ( + f"{API_CONNECTION_QUALIFIED_NAME}/{API_QUERY_NAME}" +) API_FIELD_REFERENCE_OBJECT_QN = f"{API_CONNECTION_QUALIFIED_NAME}/{API_OBJECT_REF_NAME}" APPLICATION_NAME = "application" APP_CONNECTOR_TYPE = "app" @@ -103,23 +121,33 @@ CONNECTOR_NAME = "datastudio" PRESET_WORKSPACE_NAME = "ps-workspace" PRESET_CONNECTION_QUALIFIED_NAME = "default/preset/123456789" -PRESET_WORKSPACE_QUALIFIED_NAME = f"{PRESET_CONNECTION_QUALIFIED_NAME}/{PRESET_WORKSPACE_NAME}" +PRESET_WORKSPACE_QUALIFIED_NAME = ( + f"{PRESET_CONNECTION_QUALIFIED_NAME}/{PRESET_WORKSPACE_NAME}" +) PRESET_CONNECTOR_TYPE = "preset" PRESET_DASHBOARD_NAME = "ps-collection" PRESET_DASHBOARD_QUALIFIED_NAME = f"{PRESET_CONNECTION_QUALIFIED_NAME}/{PRESET_WORKSPACE_NAME}/{PRESET_DASHBOARD_NAME}" PRESET_CHART_NAME = "ps-chart" PRESET_CHART_QUALIFIED_NAME = f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_CHART_NAME}" PRESET_DATASET_NAME = "ps-dataset" -PRESET_DATASET_QUALIFIED_NAME = f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" +PRESET_DATASET_QUALIFIED_NAME = ( + f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" +) PERSONA_NAME = "my-persona" PURPOSE_NAME = "my-purpose" DATA_DOMAIN_NAME = "data-domain" DATA_DOMAIN_QUALIFIED_NAME = f"default/domain/{DATA_DOMAIN_NAME}/super" DATA_SUB_DOMAIN_NAME = "data-sub-domain" -DATA_SUB_DOMAIN_QUALIFIED_NAME = f"{DATA_DOMAIN_QUALIFIED_NAME}/domain/{DATA_SUB_DOMAIN_NAME}" +DATA_SUB_DOMAIN_QUALIFIED_NAME = ( + f"{DATA_DOMAIN_QUALIFIED_NAME}/domain/{DATA_SUB_DOMAIN_NAME}" +) DATA_PRODUCT_NAME = "data-product" -DATA_PRODUCT_QUALIFIED_NAME = f"{DATA_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" -DATA_PRODUCT_UNDER_SUB_DOMAIN_QUALIFIED_NAME = f"{DATA_SUB_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" +DATA_PRODUCT_QUALIFIED_NAME = ( + f"{DATA_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" +) +DATA_PRODUCT_UNDER_SUB_DOMAIN_QUALIFIED_NAME = ( + f"{DATA_SUB_DOMAIN_QUALIFIED_NAME}/product/{DATA_PRODUCT_NAME}" +) ASSET_QUALIFIED_NAME = "default/snowflake/1234567890/db/schema/test-table" DATA_CONTRACT_NAME_DEFAULT = "Data contract for test-table" DATA_CONTRACT_QUALIFIED_NAME = f"{ASSET_QUALIFIED_NAME}/contract" @@ -163,7 +191,9 @@ CP_NAME = "column-process" CP_PROCESS_ID = "cp-process-id" CP_CONNECTION_QUALIFIED_NAME = "default/vertica/123456789" -CP_QUALIFIED_NAME_HASH = f"{CP_CONNECTION_QUALIFIED_NAME}/ecb5f77380c04710c979acfb8d3bba2f" +CP_QUALIFIED_NAME_HASH = ( + f"{CP_CONNECTION_QUALIFIED_NAME}/ecb5f77380c04710c979acfb8d3bba2f" +) CP_QUALIFIED_NAME = f"{CP_CONNECTION_QUALIFIED_NAME}/{CP_PROCESS_ID}" AIRFLOW_DAG_NAME = "test-airflow-dag" AIRFLOW_CONNECTION_QUALIFIED_NAME = "default/airflow/123456789" @@ -173,44 +203,60 @@ KAFKA_TOPIC_NAME = "test-kafka-topic" KAFKA_TOPIC_NAME_2 = f"{KAFKA_TOPIC_NAME}-2" KAFKA_CONNECTION_QUALIFIED_NAME = "default/kafka/123456789" -KAFKA_TOPIC_QUALIFIED_NAME = f"{KAFKA_CONNECTION_QUALIFIED_NAME}/topic/{KAFKA_TOPIC_NAME}" +KAFKA_TOPIC_QUALIFIED_NAME = ( + f"{KAFKA_CONNECTION_QUALIFIED_NAME}/topic/{KAFKA_TOPIC_NAME}" +) KAFKA_TOPIC_QUALIFIED_NAMES = [ KAFKA_TOPIC_QUALIFIED_NAME, f"{KAFKA_CONNECTION_QUALIFIED_NAME}/topic/{KAFKA_TOPIC_NAME_2}", ] KAFKA_CONSUMER_GROUP_NAME = "test-kafka-cg" -KAFKA_CONSUMER_GROUP_QUALIFIED_NAME = f"{KAFKA_CONNECTION_QUALIFIED_NAME}/consumer-group/{KAFKA_CONSUMER_GROUP_NAME}" +KAFKA_CONSUMER_GROUP_QUALIFIED_NAME = ( + f"{KAFKA_CONNECTION_QUALIFIED_NAME}/consumer-group/{KAFKA_CONSUMER_GROUP_NAME}" +) EVENT_HUB_NAME = "test-event-hub" EVENT_HUB_NAME_2 = f"{EVENT_HUB_NAME}-2" EVENT_HUB_CONNECTION_QUALIFIED_NAME = "default/azure-event-hub/123456789" -EVENT_HUB_QUALIFIED_NAME = f"{EVENT_HUB_CONNECTION_QUALIFIED_NAME}/topic/{EVENT_HUB_NAME}" +EVENT_HUB_QUALIFIED_NAME = ( + f"{EVENT_HUB_CONNECTION_QUALIFIED_NAME}/topic/{EVENT_HUB_NAME}" +) EVENT_HUB_QUALIFIED_NAMES = [ EVENT_HUB_QUALIFIED_NAME, f"{EVENT_HUB_CONNECTION_QUALIFIED_NAME}/topic/{EVENT_HUB_NAME_2}", ] EVENT_HUB_CONSUMER_GROUP_NAME = "test-event-cg" -EVENT_HUB_CONSUMER_GROUP_QUALIFIED_NAME = ( - f"{EVENT_HUB_CONNECTION_QUALIFIED_NAME}/consumer-group/{EVENT_HUB_NAME}/{EVENT_HUB_CONSUMER_GROUP_NAME}" -) +EVENT_HUB_CONSUMER_GROUP_QUALIFIED_NAME = f"{EVENT_HUB_CONNECTION_QUALIFIED_NAME}/consumer-group/{EVENT_HUB_NAME}/{EVENT_HUB_CONSUMER_GROUP_NAME}" SUPERSET_CONNECTION_QUALIFIED_NAME = "default/superset/123456789" SUPERSET_CONNECTOR_TYPE = "superset" SUPERSET_DASHBOARD_NAME = "ss-dashboard" -SUPERSET_DASHBOARD_QUALIFIED_NAME = f"{SUPERSET_CONNECTION_QUALIFIED_NAME}/{SUPERSET_DASHBOARD_NAME}" +SUPERSET_DASHBOARD_QUALIFIED_NAME = ( + f"{SUPERSET_CONNECTION_QUALIFIED_NAME}/{SUPERSET_DASHBOARD_NAME}" +) SUPERSET_CHART_NAME = "ss-chart" -SUPERSET_CHART_QUALIFIED_NAME = f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" +SUPERSET_CHART_QUALIFIED_NAME = ( + f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" +) SUPERSET_DATASET_NAME = "ss-dataset" -SUPERSET_DATASET_QUALIFIED_NAME = f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" +SUPERSET_DATASET_QUALIFIED_NAME = ( + f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" +) CUSTOM_CONNECTION_QUALIFIED_NAME = "default/custom/123456789" CUSTOM_CONNECTOR_TYPE = "custom" CUSTOM_ENTITY_NAME = "test-custom-entity" -CUSTOM_ENTITY_QUALIFIED_NAME = f"{CUSTOM_CONNECTION_QUALIFIED_NAME}/{CUSTOM_ENTITY_NAME}" +CUSTOM_ENTITY_QUALIFIED_NAME = ( + f"{CUSTOM_CONNECTION_QUALIFIED_NAME}/{CUSTOM_ENTITY_NAME}" +) PROCEDURE_NAME = "test-procedure" DATAVERSE_CONNECTION_QUALIFIED_NAME = "default/dataverse/123456789" DATAVERSE_CONNECTOR_TYPE = "dataverse" DATAVERSE_ENTITY_NAME = "dv-entity" -DATAVERSE_ENTITY_QUALIFIED_NAME = f"{DATAVERSE_CONNECTION_QUALIFIED_NAME}/{DATAVERSE_ENTITY_NAME}" +DATAVERSE_ENTITY_QUALIFIED_NAME = ( + f"{DATAVERSE_CONNECTION_QUALIFIED_NAME}/{DATAVERSE_ENTITY_NAME}" +) DATAVERSE_ATTRIBUTE_NAME = "dv-attribute" -DATAVERSE_ATTRIBUTE_QUALIFIED_NAME = f"{DATAVERSE_ENTITY_QUALIFIED_NAME}/{DATAVERSE_ATTRIBUTE_NAME}" +DATAVERSE_ATTRIBUTE_QUALIFIED_NAME = ( + f"{DATAVERSE_ENTITY_QUALIFIED_NAME}/{DATAVERSE_ATTRIBUTE_NAME}" +) TABLE_PARTITION_NAME = "test-table-partition" QUICK_SIGHT_NAME = "test-quick-sight-name" QUICK_SIGHT_CONNECTION_QUALIFIED_NAME = "default/quicksight/123456789" @@ -222,14 +268,12 @@ f"{QUICK_SIGHT_CONNECTION_QUALIFIED_NAME}/1235663folder", ] QUICK_SIGHT_ID_DATASET_FEILD = "23045523" -QUICK_SIGHT_DATASET_FIELD_QUALIFIED_NAME = f"{QUICK_SIGHT_QUALIFIED_NAME}/{QUICK_SIGHT_ID_DATASET_FEILD}" +QUICK_SIGHT_DATASET_FIELD_QUALIFIED_NAME = ( + f"{QUICK_SIGHT_QUALIFIED_NAME}/{QUICK_SIGHT_ID_DATASET_FEILD}" +) QUICK_SIGHT_ID_ANALYSIS_VISUAL = "23045532" QUICK_SIGHT_SHEET_ID = "1234" -QUICK_SIGHT_ANALYSIS_VISUAL_QUALIFIED_NAME = ( - f"{QUICK_SIGHT_QUALIFIED_NAME}/{QUICK_SIGHT_SHEET_ID}/{QUICK_SIGHT_ID_ANALYSIS_VISUAL}" -) +QUICK_SIGHT_ANALYSIS_VISUAL_QUALIFIED_NAME = f"{QUICK_SIGHT_QUALIFIED_NAME}/{QUICK_SIGHT_SHEET_ID}/{QUICK_SIGHT_ID_ANALYSIS_VISUAL}" QUICK_SIGHT_SHEET_NAME = "test-qs-sheet-name" QUICK_SIGHT_ID_DASHBOARD_VISUAL = "230455332" -QUICK_SIGHT_DASHBOARD_VISUAL_QUALIFIED_NAME = ( - f"{QUICK_SIGHT_QUALIFIED_NAME}/{QUICK_SIGHT_SHEET_ID}/{QUICK_SIGHT_ID_DASHBOARD_VISUAL}" -) +QUICK_SIGHT_DASHBOARD_VISUAL_QUALIFIED_NAME = f"{QUICK_SIGHT_QUALIFIED_NAME}/{QUICK_SIGHT_SHEET_ID}/{QUICK_SIGHT_ID_DASHBOARD_VISUAL}" diff --git a/tests/unit/model/custom_entity_test.py b/tests/unit/model/custom_entity_test.py index d97a5a0a0..283e63b10 100644 --- a/tests/unit/model/custom_entity_test.py +++ b/tests/unit/model/custom_entity_test.py @@ -16,9 +16,13 @@ (CUSTOM_ENTITY_NAME, None, "connection_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_creator_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - CustomEntity.creator(name=name, connection_qualified_name=connection_qualified_name) + CustomEntity.creator( + name=name, connection_qualified_name=connection_qualified_name + ) def test_creator(): @@ -40,20 +44,26 @@ def test_creator(): (CUSTOM_ENTITY_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): +def test_updater_with_invalid_parameter_raises_value_error( + qualified_name: str, name: str, message: str +): with pytest.raises(ValueError, match=message): CustomEntity.updater(qualified_name=qualified_name, name=name) def test_updater(): - sut = CustomEntity.updater(qualified_name=CUSTOM_ENTITY_QUALIFIED_NAME, name=CUSTOM_ENTITY_NAME) + sut = CustomEntity.updater( + qualified_name=CUSTOM_ENTITY_QUALIFIED_NAME, name=CUSTOM_ENTITY_NAME + ) assert sut.qualified_name == CUSTOM_ENTITY_QUALIFIED_NAME assert sut.name == CUSTOM_ENTITY_NAME def test_trim_to_required(): - sut = CustomEntity.updater(name=CUSTOM_ENTITY_NAME, qualified_name=CUSTOM_ENTITY_QUALIFIED_NAME).trim_to_required() + sut = CustomEntity.updater( + name=CUSTOM_ENTITY_NAME, qualified_name=CUSTOM_ENTITY_QUALIFIED_NAME + ).trim_to_required() assert sut.name == CUSTOM_ENTITY_NAME assert sut.qualified_name == CUSTOM_ENTITY_QUALIFIED_NAME diff --git a/tests/unit/model/data_contract_test.py b/tests/unit/model/data_contract_test.py index ca2fa4f3d..d9888eba2 100644 --- a/tests/unit/model/data_contract_test.py +++ b/tests/unit/model/data_contract_test.py @@ -62,7 +62,9 @@ def test_creator_with_missing_parameters_raise_value_error( ), ], ) -def test_creator_with_invalid_contract_json_raises_error(asset_qualified_name: str, contract_json: str, error_msg: str): +def test_creator_with_invalid_contract_json_raises_error( + asset_qualified_name: str, contract_json: str, error_msg: str +): with pytest.raises(InvalidRequestError, match=error_msg): DataContract.creator( asset_qualified_name=asset_qualified_name, diff --git a/tests/unit/model/data_domain_test.py b/tests/unit/model/data_domain_test.py index 594b85b86..93ae25618 100644 --- a/tests/unit/model/data_domain_test.py +++ b/tests/unit/model/data_domain_test.py @@ -28,7 +28,9 @@ def test_create_atttributes_with_required_parameters(): name=DATA_DOMAIN_NAME, parent_domain_qualified_name=DATA_DOMAIN_QUALIFIED_NAME, ) - assert test_domain.parent_domain.unique_attributes == {"qualifiedName": DATA_DOMAIN_QUALIFIED_NAME} + assert test_domain.parent_domain.unique_attributes == { + "qualifiedName": DATA_DOMAIN_QUALIFIED_NAME + } def test_create(): @@ -46,7 +48,9 @@ def test_create(): def test_create_for_modification(): - test_domain = DataDomain.create_for_modification(name=DATA_DOMAIN_NAME, qualified_name=DATA_DOMAIN_QUALIFIED_NAME) + test_domain = DataDomain.create_for_modification( + name=DATA_DOMAIN_NAME, qualified_name=DATA_DOMAIN_QUALIFIED_NAME + ) _assert_domain(test_domain) diff --git a/tests/unit/model/data_product_test.py b/tests/unit/model/data_product_test.py index ccafa7547..142b23642 100644 --- a/tests/unit/model/data_product_test.py +++ b/tests/unit/model/data_product_test.py @@ -45,7 +45,9 @@ def data_product_asset_selection(): ).to_request() -def _assert_product(product: DataProduct, qualified_name: str = DATA_PRODUCT_QUALIFIED_NAME) -> None: +def _assert_product( + product: DataProduct, qualified_name: str = DATA_PRODUCT_QUALIFIED_NAME +) -> None: assert product.name == DATA_PRODUCT_NAME assert product.qualified_name == qualified_name @@ -87,36 +89,50 @@ def test_create_with_missing_parameters_raise_value_error( ) -def test_create(data_product_asset_selection: IndexSearchRequest, data_product_assets_dsl_json): +def test_create( + data_product_asset_selection: IndexSearchRequest, data_product_assets_dsl_json +): test_product = DataProduct.create( name=DATA_PRODUCT_NAME, asset_selection=data_product_asset_selection, domain_qualified_name=DATA_DOMAIN_QUALIFIED_NAME, ) - assert test_product.data_domain.unique_attributes == {"qualifiedName": DATA_DOMAIN_QUALIFIED_NAME} + assert test_product.data_domain.unique_attributes == { + "qualifiedName": DATA_DOMAIN_QUALIFIED_NAME + } assert test_product.parent_domain_qualified_name == DATA_DOMAIN_QUALIFIED_NAME assert test_product.super_domain_qualified_name == DATA_DOMAIN_QUALIFIED_NAME - test_asset_dsl = dumps(loads(test_product.data_product_assets_d_s_l), sort_keys=True) + test_asset_dsl = dumps( + loads(test_product.data_product_assets_d_s_l), sort_keys=True + ) expected_asset_dsl = dumps(data_product_assets_dsl_json, sort_keys=True) assert test_asset_dsl == expected_asset_dsl assert test_product.data_product_assets_playbook_filter == ASSETS_PLAYBOOK_FILTER _assert_product(test_product) -def test_create_under_sub_domain(data_product_asset_selection: IndexSearchRequest, data_product_assets_dsl_json): +def test_create_under_sub_domain( + data_product_asset_selection: IndexSearchRequest, data_product_assets_dsl_json +): test_product = DataProduct.create( name=DATA_PRODUCT_NAME, asset_selection=data_product_asset_selection, domain_qualified_name=DATA_SUB_DOMAIN_QUALIFIED_NAME, ) - assert test_product.data_domain.unique_attributes == {"qualifiedName": DATA_SUB_DOMAIN_QUALIFIED_NAME} + assert test_product.data_domain.unique_attributes == { + "qualifiedName": DATA_SUB_DOMAIN_QUALIFIED_NAME + } assert test_product.parent_domain_qualified_name == DATA_SUB_DOMAIN_QUALIFIED_NAME assert test_product.super_domain_qualified_name == DATA_DOMAIN_QUALIFIED_NAME - test_asset_dsl = dumps(loads(test_product.data_product_assets_d_s_l), sort_keys=True) + test_asset_dsl = dumps( + loads(test_product.data_product_assets_d_s_l), sort_keys=True + ) expected_asset_dsl = dumps(data_product_assets_dsl_json, sort_keys=True) assert test_asset_dsl == expected_asset_dsl assert test_product.data_product_assets_playbook_filter == ASSETS_PLAYBOOK_FILTER - _assert_product(test_product, qualified_name=DATA_PRODUCT_UNDER_SUB_DOMAIN_QUALIFIED_NAME) + _assert_product( + test_product, qualified_name=DATA_PRODUCT_UNDER_SUB_DOMAIN_QUALIFIED_NAME + ) assert test_product.daap_status == DataProductStatus.ACTIVE diff --git a/tests/unit/model/data_studio_asset_test.py b/tests/unit/model/data_studio_asset_test.py index 7e815c3c9..de7d488f1 100644 --- a/tests/unit/model/data_studio_asset_test.py +++ b/tests/unit/model/data_studio_asset_test.py @@ -90,18 +90,24 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - DataStudioAsset.create_for_modification(qualified_name=qualified_name, name=name) + DataStudioAsset.create_for_modification( + qualified_name=qualified_name, name=name + ) def test_create_for_modification_report(): - sut = DataStudioAsset.create_for_modification(qualified_name=QUALIFIED_NAME_REPORT, name=REPORT_NAME) + sut = DataStudioAsset.create_for_modification( + qualified_name=QUALIFIED_NAME_REPORT, name=REPORT_NAME + ) assert sut.qualified_name == QUALIFIED_NAME_REPORT assert sut.name == REPORT_NAME def test_create_for_modification_data_source(): - sut = DataStudioAsset.create_for_modification(qualified_name=QUALIFIED_NAME_SOURCE, name=SOURCE_NAME) + sut = DataStudioAsset.create_for_modification( + qualified_name=QUALIFIED_NAME_SOURCE, name=SOURCE_NAME + ) assert sut.qualified_name == QUALIFIED_NAME_SOURCE assert sut.name == SOURCE_NAME diff --git a/tests/unit/model/database_test.py b/tests/unit/model/database_test.py index 38a2cb55a..c8be5108a 100644 --- a/tests/unit/model/database_test.py +++ b/tests/unit/model/database_test.py @@ -27,13 +27,17 @@ ), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): Database.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): - sut = Database.create(name=DATABASE_NAME, connection_qualified_name=CONNECTION_QUALIFIED_NAME) + sut = Database.create( + name=DATABASE_NAME, connection_qualified_name=CONNECTION_QUALIFIED_NAME + ) assert sut.name == DATABASE_NAME assert sut.connection_qualified_name == CONNECTION_QUALIFIED_NAME @@ -56,7 +60,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Database.create_for_modification(qualified_name=DATABASE_QUALIFIED_NAME, name=DATABASE_NAME) + sut = Database.create_for_modification( + qualified_name=DATABASE_QUALIFIED_NAME, name=DATABASE_NAME + ) assert sut.qualified_name == DATABASE_QUALIFIED_NAME assert sut.name == DATABASE_NAME diff --git a/tests/unit/model/dataverse_attribute_test.py b/tests/unit/model/dataverse_attribute_test.py index ff017d514..e50d14a76 100644 --- a/tests/unit/model/dataverse_attribute_test.py +++ b/tests/unit/model/dataverse_attribute_test.py @@ -17,9 +17,13 @@ (DATAVERSE_ATTRIBUTE_NAME, None, "entity_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error(name: str, entity_qualified_name: str, message: str): +def test_creator_with_missing_parameters_raise_value_error( + name: str, entity_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - DataverseAttribute.creator(name=name, dataverse_entity_qualified_name=entity_qualified_name) + DataverseAttribute.creator( + name=name, dataverse_entity_qualified_name=entity_qualified_name + ) def test_creator(): @@ -41,13 +45,17 @@ def test_creator(): (DATAVERSE_ATTRIBUTE_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): +def test_updater_with_invalid_parameter_raises_value_error( + qualified_name: str, name: str, message: str +): with pytest.raises(ValueError, match=message): DataverseAttribute.updater(qualified_name=qualified_name, name=name) def test_updater(): - sut = DataverseAttribute.updater(qualified_name=DATAVERSE_ATTRIBUTE_QUALIFIED_NAME, name=DATAVERSE_ATTRIBUTE_NAME) + sut = DataverseAttribute.updater( + qualified_name=DATAVERSE_ATTRIBUTE_QUALIFIED_NAME, name=DATAVERSE_ATTRIBUTE_NAME + ) assert sut.qualified_name == DATAVERSE_ATTRIBUTE_QUALIFIED_NAME assert sut.name == DATAVERSE_ATTRIBUTE_NAME diff --git a/tests/unit/model/dataverse_entity_test.py b/tests/unit/model/dataverse_entity_test.py index 3816ebb98..665f6c940 100644 --- a/tests/unit/model/dataverse_entity_test.py +++ b/tests/unit/model/dataverse_entity_test.py @@ -16,9 +16,13 @@ (DATAVERSE_ENTITY_NAME, None, "connection_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_creator_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - DataverseEntity.creator(name=name, connection_qualified_name=connection_qualified_name) + DataverseEntity.creator( + name=name, connection_qualified_name=connection_qualified_name + ) def test_creator(): @@ -40,13 +44,17 @@ def test_creator(): (DATAVERSE_ENTITY_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): +def test_updater_with_invalid_parameter_raises_value_error( + qualified_name: str, name: str, message: str +): with pytest.raises(ValueError, match=message): DataverseEntity.updater(qualified_name=qualified_name, name=name) def test_updater(): - sut = DataverseEntity.updater(qualified_name=DATAVERSE_ENTITY_QUALIFIED_NAME, name=DATAVERSE_ENTITY_NAME) + sut = DataverseEntity.updater( + qualified_name=DATAVERSE_ENTITY_QUALIFIED_NAME, name=DATAVERSE_ENTITY_NAME + ) assert sut.qualified_name == DATAVERSE_ENTITY_QUALIFIED_NAME assert sut.name == DATAVERSE_ENTITY_NAME diff --git a/tests/unit/model/fields/atlan_fields_test.py b/tests/unit/model/fields/atlan_fields_test.py index db9a79c17..3bca4dd02 100644 --- a/tests/unit/model/fields/atlan_fields_test.py +++ b/tests/unit/model/fields/atlan_fields_test.py @@ -21,7 +21,9 @@ class TestSearchableField: @pytest.fixture() def sut(self) -> SearchableField: - return SearchableField(atlan_field_name=ATLAN_FIELD_NAME, elastic_field_name=ELASTIC_FIELD_NAME) + return SearchableField( + atlan_field_name=ATLAN_FIELD_NAME, elastic_field_name=ELASTIC_FIELD_NAME + ) def test_internal_field_name(self, sut: SearchableField): assert sut.internal_field_name == ATLAN_FIELD_NAME @@ -50,7 +52,9 @@ def test_order(self, sut: SearchableField): class TestKeywordField: @pytest.fixture() def sut(self) -> KeywordField: - return KeywordField(atlan_field_name=ATLAN_FIELD_NAME, keyword_field_name=KEYWORD_FIELD_NAME) + return KeywordField( + atlan_field_name=ATLAN_FIELD_NAME, keyword_field_name=KEYWORD_FIELD_NAME + ) def test_internal_field_name(self, sut: KeywordField): assert sut.internal_field_name == ATLAN_FIELD_NAME diff --git a/tests/unit/model/file_test.py b/tests/unit/model/file_test.py index 4ffbfedff..967e1279f 100644 --- a/tests/unit/model/file_test.py +++ b/tests/unit/model/file_test.py @@ -22,7 +22,9 @@ (FILE_NAME, FILE_CONNECTION_QUALIFIED_NAME, "", "file_type cannot be blank"), ], ) -def test__create_without_required_parameters_raises_validation_error(name, connection_qualified_name, file_type, msg): +def test__create_without_required_parameters_raises_validation_error( + name, connection_qualified_name, file_type, msg +): with pytest.raises(ValueError, match=msg): File.create( name=name, @@ -40,7 +42,9 @@ def test_create_with_required_parameters(): assert attributes.name == FILE_NAME assert attributes.connection_qualified_name == FILE_CONNECTION_QUALIFIED_NAME assert attributes.qualified_name == FILE_QUALIFIED_NAME - assert attributes.connector_name == AtlanConnectorType.get_connector_name(FILE_CONNECTION_QUALIFIED_NAME) + assert attributes.connector_name == AtlanConnectorType.get_connector_name( + FILE_CONNECTION_QUALIFIED_NAME + ) @pytest.mark.parametrize( @@ -58,14 +62,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = File.create_for_modification(qualified_name=FILE_QUALIFIED_NAME, name=FILE_NAME) + sut = File.create_for_modification( + qualified_name=FILE_QUALIFIED_NAME, name=FILE_NAME + ) assert sut.qualified_name == FILE_QUALIFIED_NAME assert sut.name == FILE_NAME def test_trim_to_required(): - sut = File.create_for_modification(qualified_name=FILE_QUALIFIED_NAME, name=FILE_NAME).trim_to_required() + sut = File.create_for_modification( + qualified_name=FILE_QUALIFIED_NAME, name=FILE_NAME + ).trim_to_required() assert sut.qualified_name == FILE_QUALIFIED_NAME assert sut.name == FILE_NAME diff --git a/tests/unit/model/gcs_bucket_test.py b/tests/unit/model/gcs_bucket_test.py index 5bf14f261..115ddf2b9 100644 --- a/tests/unit/model/gcs_bucket_test.py +++ b/tests/unit/model/gcs_bucket_test.py @@ -16,13 +16,17 @@ (GCS_BUCKET_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): GCSBucket.create(name=name, connection_qualified_name=connection_qualified_name) def test_create(): - sut = GCSBucket.create(name=GCS_BUCKET_NAME, connection_qualified_name=GCS_CONNECTION_QUALIFIED_NAME) + sut = GCSBucket.create( + name=GCS_BUCKET_NAME, connection_qualified_name=GCS_CONNECTION_QUALIFIED_NAME + ) assert sut.name == GCS_BUCKET_NAME assert sut.connection_qualified_name == GCS_CONNECTION_QUALIFIED_NAME @@ -45,7 +49,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = GCSBucket.create_for_modification(qualified_name=GCS_QUALIFIED_NAME, name=GCS_BUCKET_NAME) + sut = GCSBucket.create_for_modification( + qualified_name=GCS_QUALIFIED_NAME, name=GCS_BUCKET_NAME + ) assert sut.qualified_name == GCS_QUALIFIED_NAME assert sut.name == GCS_BUCKET_NAME diff --git a/tests/unit/model/gcs_object_test.py b/tests/unit/model/gcs_object_test.py index 4711de5ba..285476497 100644 --- a/tests/unit/model/gcs_object_test.py +++ b/tests/unit/model/gcs_object_test.py @@ -16,13 +16,17 @@ (GCS_OBJECT_NAME, None, "gcs_bucket_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, gcs_bucket_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, gcs_bucket_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): GCSObject.create(name=name, gcs_bucket_qualified_name=gcs_bucket_qualified_name) def test_create(): - sut = GCSObject.create(name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=GCS_BUCKET_QUALIFIED_NAME) + sut = GCSObject.create( + name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=GCS_BUCKET_QUALIFIED_NAME + ) assert sut.name == GCS_OBJECT_NAME assert sut.gcs_bucket_qualified_name == GCS_BUCKET_QUALIFIED_NAME @@ -58,14 +62,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = GCSObject.create_for_modification(qualified_name=GCS_OBJECT_QUALIFIED_NAME, name=GCS_OBJECT_NAME) + sut = GCSObject.create_for_modification( + qualified_name=GCS_OBJECT_QUALIFIED_NAME, name=GCS_OBJECT_NAME + ) assert sut.qualified_name == GCS_OBJECT_QUALIFIED_NAME assert sut.name == GCS_OBJECT_NAME def test_trim_to_required(): - sut = GCSObject.create(name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=GCS_BUCKET_QUALIFIED_NAME).trim_to_required() + sut = GCSObject.create( + name=GCS_OBJECT_NAME, gcs_bucket_qualified_name=GCS_BUCKET_QUALIFIED_NAME + ).trim_to_required() assert sut.name == GCS_OBJECT_NAME assert sut.qualified_name == GCS_OBJECT_QUALIFIED_NAME diff --git a/tests/unit/model/glossary_category_test.py b/tests/unit/model/glossary_category_test.py index c7916fdfa..c9b78b00a 100644 --- a/tests/unit/model/glossary_category_test.py +++ b/tests/unit/model/glossary_category_test.py @@ -8,7 +8,9 @@ GLOSSARY_QUALIFIED_NAME, ) -ANCHOR = AtlasGlossary.create_for_modification(qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME) +ANCHOR = AtlasGlossary.create_for_modification( + qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME +) GLOSSARY_GUID = "123" PARENT_CATEGORY = AtlasGlossaryCategory.create_for_modification( qualified_name="123", name="Category", glossary_guid=GLOSSARY_GUID diff --git a/tests/unit/model/glossary_term_test.py b/tests/unit/model/glossary_term_test.py index 22e5068a7..3d247c6dd 100644 --- a/tests/unit/model/glossary_term_test.py +++ b/tests/unit/model/glossary_term_test.py @@ -10,7 +10,9 @@ GLOSSARY_TERM_QUALIFIED_NAME, ) -ANCHOR = AtlasGlossary.create_for_modification(qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME) +ANCHOR = AtlasGlossary.create_for_modification( + qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME +) GLOSSARY_GUID = "123" @@ -94,7 +96,11 @@ def test_create_with_missing_parameters_raise_value_error( None, None, GLOSSARY_GUID, - [AtlasGlossaryCategory.updater(qualified_name="123", name="Category", glossary_guid=GLOSSARY_GUID)], + [ + AtlasGlossaryCategory.updater( + qualified_name="123", name="Category", glossary_guid=GLOSSARY_GUID + ) + ], ), ], ) @@ -121,7 +127,8 @@ def test_create( glossary_qualified_name and sut.anchor is not None and sut.anchor.unique_attributes is not None - and sut.anchor.unique_attributes == {"qualifiedName": glossary_qualified_name} + and sut.anchor.unique_attributes + == {"qualifiedName": glossary_qualified_name} ) or (glossary_guid and sut and sut.anchor and sut.anchor.guid == glossary_guid) ) @@ -144,7 +151,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( name: str, qualified_name: str, glossary_guid: str, message: str ): with pytest.raises(ValueError, match=message): - AtlasGlossaryTerm.create_for_modification(qualified_name=qualified_name, name=name, glossary_guid=glossary_guid) + AtlasGlossaryTerm.create_for_modification( + qualified_name=qualified_name, name=name, glossary_guid=glossary_guid + ) def test_create_for_modification(): diff --git a/tests/unit/model/glossary_test.py b/tests/unit/model/glossary_test.py index 9067d5093..3727dc4c8 100644 --- a/tests/unit/model/glossary_test.py +++ b/tests/unit/model/glossary_test.py @@ -31,7 +31,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = AtlasGlossary.create_for_modification(qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME) + sut = AtlasGlossary.create_for_modification( + qualified_name=GLOSSARY_QUALIFIED_NAME, name=GLOSSARY_NAME + ) assert sut.qualified_name == GLOSSARY_QUALIFIED_NAME assert sut.name == GLOSSARY_NAME diff --git a/tests/unit/model/kafka_consumer_group_test.py b/tests/unit/model/kafka_consumer_group_test.py index 488a65ce6..13aeabc04 100644 --- a/tests/unit/model/kafka_consumer_group_test.py +++ b/tests/unit/model/kafka_consumer_group_test.py @@ -17,9 +17,13 @@ (KAFKA_TOPIC_QUALIFIED_NAMES, None, "kafka_topic_qualified_names is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error(name: str, kafka_topic_qualified_names: str, message: str): +def test_creator_with_missing_parameters_raise_value_error( + name: str, kafka_topic_qualified_names: str, message: str +): with pytest.raises(ValueError, match=message): - KafkaConsumerGroup.creator(name=name, kafka_topic_qualified_names=kafka_topic_qualified_names) + KafkaConsumerGroup.creator( + name=name, kafka_topic_qualified_names=kafka_topic_qualified_names + ) def test_creator(): @@ -42,7 +46,9 @@ def test_creator(): (KAFKA_CONSUMER_GROUP_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): +def test_updater_with_invalid_parameter_raises_value_error( + qualified_name: str, name: str, message: str +): with pytest.raises(ValueError, match=message): KafkaConsumerGroup.updater(qualified_name=qualified_name, name=name) diff --git a/tests/unit/model/kafka_topic_test.py b/tests/unit/model/kafka_topic_test.py index 686ffc08e..2a235378b 100644 --- a/tests/unit/model/kafka_topic_test.py +++ b/tests/unit/model/kafka_topic_test.py @@ -16,9 +16,13 @@ (KAFKA_TOPIC_NAME, None, "connection_qualified_name is required"), ], ) -def test_creator_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_creator_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - KafkaTopic.creator(name=name, connection_qualified_name=connection_qualified_name) + KafkaTopic.creator( + name=name, connection_qualified_name=connection_qualified_name + ) def test_creator(): @@ -40,13 +44,17 @@ def test_creator(): (KAFKA_TOPIC_NAME, None, "name is required"), ], ) -def test_updater_with_invalid_parameter_raises_value_error(qualified_name: str, name: str, message: str): +def test_updater_with_invalid_parameter_raises_value_error( + qualified_name: str, name: str, message: str +): with pytest.raises(ValueError, match=message): KafkaTopic.updater(qualified_name=qualified_name, name=name) def test_updater(): - topic = KafkaTopic.updater(name=KAFKA_TOPIC_NAME, qualified_name=KAFKA_TOPIC_QUALIFIED_NAME) + topic = KafkaTopic.updater( + name=KAFKA_TOPIC_NAME, qualified_name=KAFKA_TOPIC_QUALIFIED_NAME + ) assert topic.name == KAFKA_TOPIC_NAME assert topic.qualified_name == KAFKA_TOPIC_QUALIFIED_NAME diff --git a/tests/unit/model/materialised_view_test.py b/tests/unit/model/materialised_view_test.py index 9adfd3395..691a73677 100644 --- a/tests/unit/model/materialised_view_test.py +++ b/tests/unit/model/materialised_view_test.py @@ -26,13 +26,17 @@ (VIEW_NAME, VIEW_COLUMN_QUALIFIED_NAME, "Invalid schema_qualified_name"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, schema_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, schema_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): MaterialisedView.create(name=name, schema_qualified_name=schema_qualified_name) def test_create(): - sut = MaterialisedView.create(name=VIEW_NAME, schema_qualified_name=SCHEMA_QUALIFIED_NAME) + sut = MaterialisedView.create( + name=VIEW_NAME, schema_qualified_name=SCHEMA_QUALIFIED_NAME + ) assert sut.name == VIEW_NAME assert sut.database_name == DATABASE_NAME @@ -76,11 +80,15 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - MaterialisedView.create_for_modification(qualified_name=qualified_name, name=name) + MaterialisedView.create_for_modification( + qualified_name=qualified_name, name=name + ) def test_create_for_modification(): - sut = MaterialisedView.create_for_modification(qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME) + sut = MaterialisedView.create_for_modification( + qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME + ) assert sut.qualified_name == VIEW_QUALIFIED_NAME assert sut.name == VIEW_NAME diff --git a/tests/unit/model/open_lineage/open_lineage_test.py b/tests/unit/model/open_lineage/open_lineage_test.py index a0eba84ec..db77f275b 100644 --- a/tests/unit/model/open_lineage/open_lineage_test.py +++ b/tests/unit/model/open_lineage/open_lineage_test.py @@ -52,7 +52,9 @@ def client(): def mock_event_time(): with patch("pyatlan.model.open_lineage.event.datetime") as mock_datetime: mock_datetime_instance = Mock() - mock_datetime_instance.isoformat.return_value = "2024-10-07T10:23:52.239783+00:00" + mock_datetime_instance.isoformat.return_value = ( + "2024-10-07T10:23:52.239783+00:00" + ) mock_datetime.now.return_value = mock_datetime_instance yield mock_datetime @@ -90,7 +92,9 @@ def mock_session(): [OpenLineageEvent(), None, "none is not an allowed value"], ], ) -def test_ol_client_send_raises_validation_error(test_request, connector_type, error_msg): +def test_ol_client_send_raises_validation_error( + test_request, connector_type, error_msg +): with pytest.raises(ValidationError) as err: OpenLineageClient.send(request=test_request, connector_type=connector_type) assert error_msg in str(err.value) @@ -106,7 +110,9 @@ def test_ol_invalid_client_raises_invalid_request_error( ): client_method = getattr(FluentTasks(), test_method) for invalid_client in test_client: - with pytest.raises(InvalidRequestError, match="No Atlan client has been provided."): + with pytest.raises( + InvalidRequestError, match="No Atlan client has been provided." + ): client_method(client=invalid_client) @@ -116,7 +122,9 @@ def test_ol_client_send( mock_api_caller._call_api.side_effect = ["Event recieved"] test_event = OpenLineageEvent() assert ( - OpenLineageClient(client=mock_api_caller).send(request=test_event, connector_type=AtlanConnectorType.SPARK) + OpenLineageClient(client=mock_api_caller).send( + request=test_event, connector_type=AtlanConnectorType.SPARK + ) is None ) @@ -133,11 +141,15 @@ def test_ol_client_send_when_ol_not_configured(client, mock_session): "this connector before you can send events for it." ) with pytest.raises(AtlanError, match=expected_error): - client.open_lineage.send(request=OpenLineageEvent(), connector_type=AtlanConnectorType.SNOWFLAKE) + client.open_lineage.send( + request=OpenLineageEvent(), connector_type=AtlanConnectorType.SNOWFLAKE + ) def test_ol_models(mock_run_id, mock_event_time): - job = OpenLineageJob.creator(connection_name="ol-spark", job_name="dag_123", producer=PRODUCER) + job = OpenLineageJob.creator( + connection_name="ol-spark", job_name="dag_123", producer=PRODUCER + ) run = OpenLineageRun.creator(job=job) id = job.create_input(namespace=NAMESPACE, asset_name="OPS.DEFAULT.RUN_STATS") @@ -169,5 +181,7 @@ def test_ol_models(mock_run_id, mock_event_time): ] assert to_json(start) == load_json(OL_EVENT_START) - complete = OpenLineageEvent.creator(run=run, event_type=OpenLineageEventType.COMPLETE) + complete = OpenLineageEvent.creator( + run=run, event_type=OpenLineageEventType.COMPLETE + ) assert to_json(complete) == load_json(OL_EVENT_COMPLETE) diff --git a/tests/unit/model/preset_chart_test.py b/tests/unit/model/preset_chart_test.py index e3ed2a0e9..f4a9c5ea0 100644 --- a/tests/unit/model/preset_chart_test.py +++ b/tests/unit/model/preset_chart_test.py @@ -21,7 +21,9 @@ def test_create_with_missing_parameters_raise_value_error( name: str, preset_dashboard_qualified_name: str, message: str ): with pytest.raises(ValueError, match=message): - PresetChart.create(name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name) + PresetChart.create( + name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name + ) def test_create(): @@ -33,7 +35,9 @@ def test_create(): assert sut.name == PRESET_CHART_NAME assert sut.preset_dashboard_qualified_name == PRESET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_CHART_NAME}" + assert ( + sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_CHART_NAME}" + ) assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -47,7 +51,9 @@ def test_overload_creator(): assert sut.name == PRESET_CHART_NAME assert sut.preset_dashboard_qualified_name == PRESET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_CHART_NAME}" + assert ( + sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_CHART_NAME}" + ) assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -66,7 +72,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = PresetChart.create_for_modification(qualified_name=PRESET_CHART_QUALIFIED_NAME, name=PRESET_CHART_NAME) + sut = PresetChart.create_for_modification( + qualified_name=PRESET_CHART_QUALIFIED_NAME, name=PRESET_CHART_NAME + ) assert sut.qualified_name == PRESET_CHART_QUALIFIED_NAME assert sut.name == PRESET_CHART_NAME diff --git a/tests/unit/model/preset_dashboard_test.py b/tests/unit/model/preset_dashboard_test.py index fe3970975..e13769c7e 100644 --- a/tests/unit/model/preset_dashboard_test.py +++ b/tests/unit/model/preset_dashboard_test.py @@ -21,7 +21,9 @@ def test_create_with_missing_parameters_raise_value_error( name: str, preset_workspace_qualified_name: str, message: str ): with pytest.raises(ValueError, match=message): - PresetDashboard.create(name=name, preset_workspace_qualified_name=preset_workspace_qualified_name) + PresetDashboard.create( + name=name, preset_workspace_qualified_name=preset_workspace_qualified_name + ) def test_create(): @@ -33,7 +35,10 @@ def test_create(): assert sut.name == PRESET_DASHBOARD_NAME assert sut.preset_workspace_qualified_name == PRESET_WORKSPACE_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{PRESET_WORKSPACE_QUALIFIED_NAME}/{PRESET_DASHBOARD_NAME}" + assert ( + sut.qualified_name + == f"{PRESET_WORKSPACE_QUALIFIED_NAME}/{PRESET_DASHBOARD_NAME}" + ) assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -47,7 +52,10 @@ def test_overload_creator(): assert sut.name == PRESET_DASHBOARD_NAME assert sut.preset_workspace_qualified_name == PRESET_WORKSPACE_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{PRESET_WORKSPACE_QUALIFIED_NAME}/{PRESET_DASHBOARD_NAME}" + assert ( + sut.qualified_name + == f"{PRESET_WORKSPACE_QUALIFIED_NAME}/{PRESET_DASHBOARD_NAME}" + ) assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -62,7 +70,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - PresetDashboard.create_for_modification(qualified_name=qualified_name, name=name) + PresetDashboard.create_for_modification( + qualified_name=qualified_name, name=name + ) def test_create_for_modification(): diff --git a/tests/unit/model/preset_dataset_test.py b/tests/unit/model/preset_dataset_test.py index 8283b0c90..98301ef12 100644 --- a/tests/unit/model/preset_dataset_test.py +++ b/tests/unit/model/preset_dataset_test.py @@ -21,7 +21,9 @@ def test_create_with_missing_parameters_raise_value_error( name: str, preset_dashboard_qualified_name: str, message: str ): with pytest.raises(ValueError, match=message): - PresetDataset.create(name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name) + PresetDataset.create( + name=name, preset_dashboard_qualified_name=preset_dashboard_qualified_name + ) def test_create(): @@ -33,7 +35,9 @@ def test_create(): assert sut.name == PRESET_DATASET_NAME assert sut.preset_dashboard_qualified_name == PRESET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" + assert ( + sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" + ) assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -47,7 +51,9 @@ def test_creator(): assert sut.name == PRESET_DATASET_NAME assert sut.preset_dashboard_qualified_name == PRESET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == PRESET_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" + assert ( + sut.qualified_name == f"{PRESET_DASHBOARD_QUALIFIED_NAME}/{PRESET_DATASET_NAME}" + ) assert sut.connector_name == PRESET_CONNECTOR_TYPE @@ -66,7 +72,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = PresetDataset.create_for_modification(qualified_name=PRESET_DATASET_QUALIFIED_NAME, name=PRESET_DATASET_NAME) + sut = PresetDataset.create_for_modification( + qualified_name=PRESET_DATASET_QUALIFIED_NAME, name=PRESET_DATASET_NAME + ) assert sut.qualified_name == PRESET_DATASET_QUALIFIED_NAME assert sut.name == PRESET_DATASET_NAME diff --git a/tests/unit/model/preset_workspace_test.py b/tests/unit/model/preset_workspace_test.py index 341ef49e6..09924d28c 100644 --- a/tests/unit/model/preset_workspace_test.py +++ b/tests/unit/model/preset_workspace_test.py @@ -16,9 +16,13 @@ (PRESET_WORKSPACE_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - PresetWorkspace.create(name=name, connection_qualified_name=connection_qualified_name) + PresetWorkspace.create( + name=name, connection_qualified_name=connection_qualified_name + ) def test_create(): @@ -44,7 +48,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - PresetWorkspace.create_for_modification(qualified_name=qualified_name, name=name) + PresetWorkspace.create_for_modification( + qualified_name=qualified_name, name=name + ) def test_create_for_modification(): diff --git a/tests/unit/model/procedure_test.py b/tests/unit/model/procedure_test.py index 8fd5afa3d..088b7da58 100644 --- a/tests/unit/model/procedure_test.py +++ b/tests/unit/model/procedure_test.py @@ -49,7 +49,9 @@ def test_creator(): assert sut.database_name == DATABASE_NAME assert sut.connection_qualified_name == CONNECTION_QUALIFIED_NAME assert sut.database_qualified_name == DATABASE_QUALIFIED_NAME - assert sut.qualified_name == f"{SCHEMA_QUALIFIED_NAME}/_procedures_/{PROCEDURE_NAME}" + assert ( + sut.qualified_name == f"{SCHEMA_QUALIFIED_NAME}/_procedures_/{PROCEDURE_NAME}" + ) assert sut.schema_qualified_name == SCHEMA_QUALIFIED_NAME assert sut.schema_name == SCHEMA_NAME assert sut.connector_name == CONNECTOR_TYPE @@ -71,7 +73,9 @@ def test_overload_creator(): assert sut.database_name == DATABASE_NAME assert sut.connection_qualified_name == CONNECTION_QUALIFIED_NAME assert sut.database_qualified_name == DATABASE_QUALIFIED_NAME - assert sut.qualified_name == f"{SCHEMA_QUALIFIED_NAME}/_procedures_/{PROCEDURE_NAME}" + assert ( + sut.qualified_name == f"{SCHEMA_QUALIFIED_NAME}/_procedures_/{PROCEDURE_NAME}" + ) assert sut.schema_qualified_name == SCHEMA_QUALIFIED_NAME assert sut.schema_name == SCHEMA_NAME assert sut.connector_name == CONNECTOR_TYPE diff --git a/tests/unit/model/process_test.py b/tests/unit/model/process_test.py index fb1e2a5de..c1e3ee94b 100644 --- a/tests/unit/model/process_test.py +++ b/tests/unit/model/process_test.py @@ -90,9 +90,13 @@ def test_create_without_required_parameter_raises_value_error( ), ], ) -def test__create(name, connection_qualified_name, process_id, inputs, outputs, parent, expected_value): +def test__create( + name, connection_qualified_name, process_id, inputs, outputs, parent, expected_value +): expected_value = ( - expected_value if process_id else f"{connection_qualified_name}/{md5(expected_value.encode()).hexdigest()}" + expected_value + if process_id + else f"{connection_qualified_name}/{md5(expected_value.encode()).hexdigest()}" ) process = Process.create( @@ -126,14 +130,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Process.create_for_modification(qualified_name=PROCESS_QUALIFIED_NAME, name=PROCESS_NAME) + sut = Process.create_for_modification( + qualified_name=PROCESS_QUALIFIED_NAME, name=PROCESS_NAME + ) assert sut.qualified_name == PROCESS_QUALIFIED_NAME assert sut.name == PROCESS_NAME def test_trim_to_required(): - sut = Process.create_for_modification(qualified_name=PROCESS_QUALIFIED_NAME, name=PROCESS_NAME).trim_to_required() + sut = Process.create_for_modification( + qualified_name=PROCESS_QUALIFIED_NAME, name=PROCESS_NAME + ).trim_to_required() assert sut.qualified_name == PROCESS_QUALIFIED_NAME assert sut.name == PROCESS_NAME @@ -224,7 +232,9 @@ def test_process_attributes_generate_qualified_name( name, connection_qualified_name, process_id, inputs, outputs, parent, expected_value ): expected_value = ( - expected_value if process_id else f"{connection_qualified_name}/{md5(expected_value.encode()).hexdigest()}" + expected_value + if process_id + else f"{connection_qualified_name}/{md5(expected_value.encode()).hexdigest()}" ) assert ( diff --git a/tests/unit/model/quick_sight_analysis_test.py b/tests/unit/model/quick_sight_analysis_test.py index 894c54dbc..4bdf34961 100644 --- a/tests/unit/model/quick_sight_analysis_test.py +++ b/tests/unit/model/quick_sight_analysis_test.py @@ -75,7 +75,9 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightAnalysis.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) + sut = QuickSightAnalysis.updater( + qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME + ) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_analysis_visual_test.py b/tests/unit/model/quick_sight_analysis_visual_test.py index 9bf4b2d6a..c709bc2e7 100644 --- a/tests/unit/model/quick_sight_analysis_visual_test.py +++ b/tests/unit/model/quick_sight_analysis_visual_test.py @@ -115,7 +115,9 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightAnalysisVisual.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) + sut = QuickSightAnalysisVisual.updater( + qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME + ) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_dashboard_test.py b/tests/unit/model/quick_sight_dashboard_test.py index 48939752e..85948c424 100644 --- a/tests/unit/model/quick_sight_dashboard_test.py +++ b/tests/unit/model/quick_sight_dashboard_test.py @@ -75,7 +75,9 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightDashboard.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) + sut = QuickSightDashboard.updater( + qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME + ) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_dashboard_visual_test.py b/tests/unit/model/quick_sight_dashboard_visual_test.py index 57d3b6789..b54a87719 100644 --- a/tests/unit/model/quick_sight_dashboard_visual_test.py +++ b/tests/unit/model/quick_sight_dashboard_visual_test.py @@ -115,7 +115,9 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightDashboardVisual.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) + sut = QuickSightDashboardVisual.updater( + qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME + ) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_dataset_field_test.py b/tests/unit/model/quick_sight_dataset_field_test.py index da7186eb8..ec2110bec 100644 --- a/tests/unit/model/quick_sight_dataset_field_test.py +++ b/tests/unit/model/quick_sight_dataset_field_test.py @@ -82,7 +82,9 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightDatasetField.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) + sut = QuickSightDatasetField.updater( + qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME + ) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_dataset_test.py b/tests/unit/model/quick_sight_dataset_test.py index 76192a16c..2a3e64ebd 100644 --- a/tests/unit/model/quick_sight_dataset_test.py +++ b/tests/unit/model/quick_sight_dataset_test.py @@ -72,13 +72,17 @@ def test_overload_creator(): assert sut.name == QUICK_SIGHT_NAME assert sut.connection_qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.quick_sight_id == QUICK_SIGHT_ID - assert sut.quick_sight_dataset_import_mode == QuickSightDatasetImportMode.DIRECT_QUERY + assert ( + sut.quick_sight_dataset_import_mode == QuickSightDatasetImportMode.DIRECT_QUERY + ) assert sut.qualified_name == QUICK_SIGHT_QUALIFIED_NAME assert sut.connector_name == QUICK_SIGHT_CONNECTOR_TYPE def test_updater(): - sut = QuickSightDataset.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) + sut = QuickSightDataset.updater( + qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME + ) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/quick_sight_folder_test.py b/tests/unit/model/quick_sight_folder_test.py index d5499524a..b00b69b1f 100644 --- a/tests/unit/model/quick_sight_folder_test.py +++ b/tests/unit/model/quick_sight_folder_test.py @@ -76,7 +76,9 @@ def test_overload_creator(): def test_updater(): - sut = QuickSightFolder.updater(qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME) + sut = QuickSightFolder.updater( + qualified_name=QUICK_SIGHT_CONNECTION_QUALIFIED_NAME, name=QUICK_SIGHT_NAME + ) assert sut.qualified_name == QUICK_SIGHT_CONNECTION_QUALIFIED_NAME assert sut.name == QUICK_SIGHT_NAME diff --git a/tests/unit/model/readme_test.py b/tests/unit/model/readme_test.py index c87ad7819..891b2b859 100644 --- a/tests/unit/model/readme_test.py +++ b/tests/unit/model/readme_test.py @@ -30,7 +30,9 @@ ), ], ) -def test_create_readme_without_required_parameters_raises_exception(asset, content, asset_name, error, message): +def test_create_readme_without_required_parameters_raises_exception( + asset, content, asset_name, error, message +): with pytest.raises(error, match=message): Readme.create(asset=asset, content=content, asset_name=asset_name) @@ -79,14 +81,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Readme.create_for_modification(qualified_name=README_QUALIFIED_NAME, name=README_NAME) + sut = Readme.create_for_modification( + qualified_name=README_QUALIFIED_NAME, name=README_NAME + ) assert sut.qualified_name == README_QUALIFIED_NAME assert sut.name == README_NAME def test_trim_to_required(): - sut = Readme.create_for_modification(qualified_name=README_QUALIFIED_NAME, name=README_NAME).trim_to_required() + sut = Readme.create_for_modification( + qualified_name=README_QUALIFIED_NAME, name=README_NAME + ).trim_to_required() assert sut.qualified_name == README_QUALIFIED_NAME assert sut.name == README_NAME diff --git a/tests/unit/model/s3_bucket_test.py b/tests/unit/model/s3_bucket_test.py index 79adc8d0b..fc6394335 100644 --- a/tests/unit/model/s3_bucket_test.py +++ b/tests/unit/model/s3_bucket_test.py @@ -33,7 +33,9 @@ ), ], ) -def test_create_without_required_parameters_raises_validation_error(name, connection_qualified_name, msg): +def test_create_without_required_parameters_raises_validation_error( + name, connection_qualified_name, msg +): with pytest.raises(ValueError, match=msg): S3Bucket.create( name=name, @@ -81,14 +83,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = S3Bucket.create_for_modification(qualified_name=S3_OBJECT_QUALIFIED_NAME, name=BUCKET_NAME) + sut = S3Bucket.create_for_modification( + qualified_name=S3_OBJECT_QUALIFIED_NAME, name=BUCKET_NAME + ) assert sut.qualified_name == S3_OBJECT_QUALIFIED_NAME assert sut.name == BUCKET_NAME def test_trim_to_required(): - sut = S3Bucket.create_for_modification(qualified_name=S3_OBJECT_QUALIFIED_NAME, name=BUCKET_NAME).trim_to_required() + sut = S3Bucket.create_for_modification( + qualified_name=S3_OBJECT_QUALIFIED_NAME, name=BUCKET_NAME + ).trim_to_required() assert sut.qualified_name == S3_OBJECT_QUALIFIED_NAME assert sut.name == BUCKET_NAME diff --git a/tests/unit/model/s3object_test.py b/tests/unit/model/s3object_test.py index 353ae696e..ab5f75190 100644 --- a/tests/unit/model/s3object_test.py +++ b/tests/unit/model/s3object_test.py @@ -341,7 +341,9 @@ def test_create_with_required_parameters( ), ], ) -def test_create_with_prefix(name, connection_qualified_name, prefix, s3_bucket_name, s3_bucket_qualified_name): +def test_create_with_prefix( + name, connection_qualified_name, prefix, s3_bucket_name, s3_bucket_qualified_name +): attributes = S3Object.create_with_prefix( name=name, connection_qualified_name=connection_qualified_name, @@ -374,7 +376,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = S3Object.create_for_modification(qualified_name=S3_OBJECT_QUALIFIED_NAME, name=S3_OBJECT_NAME) + sut = S3Object.create_for_modification( + qualified_name=S3_OBJECT_QUALIFIED_NAME, name=S3_OBJECT_NAME + ) assert sut.qualified_name == S3_OBJECT_QUALIFIED_NAME assert sut.name == S3_OBJECT_NAME diff --git a/tests/unit/model/schema_test.py b/tests/unit/model/schema_test.py index b29e91b8d..f630f6d00 100644 --- a/tests/unit/model/schema_test.py +++ b/tests/unit/model/schema_test.py @@ -25,13 +25,17 @@ ), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, database_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, database_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): Schema.create(name=name, database_qualified_name=database_qualified_name) def test_create(): - sut = Schema.create(name=SCHEMA_NAME, database_qualified_name=DATABASE_QUALIFIED_NAME) + sut = Schema.create( + name=SCHEMA_NAME, database_qualified_name=DATABASE_QUALIFIED_NAME + ) assert sut.name == SCHEMA_NAME assert sut.database_name == DATABASE_NAME @@ -74,14 +78,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Schema.create_for_modification(qualified_name=SCHEMA_QUALIFIED_NAME, name=SCHEMA_NAME) + sut = Schema.create_for_modification( + qualified_name=SCHEMA_QUALIFIED_NAME, name=SCHEMA_NAME + ) assert sut.qualified_name == SCHEMA_QUALIFIED_NAME assert sut.name == SCHEMA_NAME def test_trim_to_required(): - sut = Schema.create_for_modification(qualified_name=SCHEMA_QUALIFIED_NAME, name=SCHEMA_NAME).trim_to_required() + sut = Schema.create_for_modification( + qualified_name=SCHEMA_QUALIFIED_NAME, name=SCHEMA_NAME + ).trim_to_required() assert sut.qualified_name == SCHEMA_QUALIFIED_NAME assert sut.name == SCHEMA_NAME diff --git a/tests/unit/model/superset_chart_test.py b/tests/unit/model/superset_chart_test.py index 152fdc06e..4b9db96b4 100644 --- a/tests/unit/model/superset_chart_test.py +++ b/tests/unit/model/superset_chart_test.py @@ -36,7 +36,10 @@ def test_create(): assert sut.name == SUPERSET_CHART_NAME assert sut.superset_dashboard_qualified_name == SUPERSET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == SUPERSET_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" + assert ( + sut.qualified_name + == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" + ) assert sut.connector_name == SUPERSET_CONNECTOR_TYPE @@ -50,7 +53,10 @@ def test_overload_creator(): assert sut.name == SUPERSET_CHART_NAME assert sut.superset_dashboard_qualified_name == SUPERSET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == SUPERSET_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" + assert ( + sut.qualified_name + == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_CHART_NAME}" + ) assert sut.connector_name == SUPERSET_CONNECTOR_TYPE @@ -69,7 +75,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = SupersetChart.create_for_modification(qualified_name=SUPERSET_CHART_QUALIFIED_NAME, name=SUPERSET_CHART_NAME) + sut = SupersetChart.create_for_modification( + qualified_name=SUPERSET_CHART_QUALIFIED_NAME, name=SUPERSET_CHART_NAME + ) assert sut.qualified_name == SUPERSET_CHART_QUALIFIED_NAME assert sut.name == SUPERSET_CHART_NAME diff --git a/tests/unit/model/superset_dashboard_test.py b/tests/unit/model/superset_dashboard_test.py index 7d6b967b0..dc9aedd50 100644 --- a/tests/unit/model/superset_dashboard_test.py +++ b/tests/unit/model/superset_dashboard_test.py @@ -16,9 +16,13 @@ (SUPERSET_DASHBOARD_NAME, None, "connection_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, connection_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, connection_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): - SupersetDashboard.create(name=name, connection_qualified_name=connection_qualified_name) + SupersetDashboard.create( + name=name, connection_qualified_name=connection_qualified_name + ) def test_create(): @@ -29,7 +33,10 @@ def test_create(): assert sut.name == SUPERSET_DASHBOARD_NAME assert sut.connection_qualified_name == SUPERSET_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{SUPERSET_CONNECTION_QUALIFIED_NAME}/{SUPERSET_DASHBOARD_NAME}" + assert ( + sut.qualified_name + == f"{SUPERSET_CONNECTION_QUALIFIED_NAME}/{SUPERSET_DASHBOARD_NAME}" + ) assert sut.connector_name == SUPERSET_CONNECTOR_TYPE @@ -44,7 +51,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - SupersetDashboard.create_for_modification(qualified_name=qualified_name, name=name) + SupersetDashboard.create_for_modification( + qualified_name=qualified_name, name=name + ) def test_create_for_modification(): diff --git a/tests/unit/model/superset_dataset_test.py b/tests/unit/model/superset_dataset_test.py index bd0bbd023..3d0983a2b 100644 --- a/tests/unit/model/superset_dataset_test.py +++ b/tests/unit/model/superset_dataset_test.py @@ -36,7 +36,10 @@ def test_create(): assert sut.name == SUPERSET_DATASET_NAME assert sut.superset_dashboard_qualified_name == SUPERSET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == SUPERSET_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" + assert ( + sut.qualified_name + == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" + ) assert sut.connector_name == SUPERSET_CONNECTOR_TYPE @@ -50,7 +53,10 @@ def test_creator(): assert sut.name == SUPERSET_DATASET_NAME assert sut.superset_dashboard_qualified_name == SUPERSET_DASHBOARD_QUALIFIED_NAME assert sut.connection_qualified_name == SUPERSET_CONNECTION_QUALIFIED_NAME - assert sut.qualified_name == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" + assert ( + sut.qualified_name + == f"{SUPERSET_DASHBOARD_QUALIFIED_NAME}/{SUPERSET_DATASET_NAME}" + ) assert sut.connector_name == SUPERSET_CONNECTOR_TYPE @@ -65,7 +71,9 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( qualified_name: str, name: str, message: str ): with pytest.raises(ValueError, match=message): - SupersetDataset.create_for_modification(qualified_name=qualified_name, name=name) + SupersetDataset.create_for_modification( + qualified_name=qualified_name, name=name + ) def test_create_for_modification(): diff --git a/tests/unit/model/table_partition_test.py b/tests/unit/model/table_partition_test.py index a6798cf75..14551b289 100644 --- a/tests/unit/model/table_partition_test.py +++ b/tests/unit/model/table_partition_test.py @@ -21,7 +21,9 @@ (TABLE_PARTITION_NAME, None, "table_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, table_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, table_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): TablePartition.creator( name=name, diff --git a/tests/unit/model/table_test.py b/tests/unit/model/table_test.py index f83ac161f..b017e5aa3 100644 --- a/tests/unit/model/table_test.py +++ b/tests/unit/model/table_test.py @@ -20,7 +20,9 @@ (TABLE_NAME, None, "schema_qualified_name is required"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, schema_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, schema_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): Table.create(name=name, schema_qualified_name=schema_qualified_name) @@ -75,14 +77,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = Table.create_for_modification(qualified_name=TABLE_QUALIFIED_NAME, name=TABLE_NAME) + sut = Table.create_for_modification( + qualified_name=TABLE_QUALIFIED_NAME, name=TABLE_NAME + ) assert sut.qualified_name == TABLE_QUALIFIED_NAME assert sut.name == TABLE_NAME def test_trim_to_required(): - sut = Table.create_for_modification(qualified_name=TABLE_QUALIFIED_NAME, name=TABLE_NAME).trim_to_required() + sut = Table.create_for_modification( + qualified_name=TABLE_QUALIFIED_NAME, name=TABLE_NAME + ).trim_to_required() assert sut.qualified_name == TABLE_QUALIFIED_NAME assert sut.name == TABLE_NAME diff --git a/tests/unit/model/view_test.py b/tests/unit/model/view_test.py index bc02d7815..ec466986f 100644 --- a/tests/unit/model/view_test.py +++ b/tests/unit/model/view_test.py @@ -26,7 +26,9 @@ (VIEW_NAME, VIEW_COLUMN_QUALIFIED_NAME, "Invalid schema_qualified_name"), ], ) -def test_create_with_missing_parameters_raise_value_error(name: str, schema_qualified_name: str, message: str): +def test_create_with_missing_parameters_raise_value_error( + name: str, schema_qualified_name: str, message: str +): with pytest.raises(ValueError, match=message): View.create(name=name, schema_qualified_name=schema_qualified_name) @@ -80,14 +82,18 @@ def test_create_for_modification_with_invalid_parameter_raises_value_error( def test_create_for_modification(): - sut = View.create_for_modification(qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME) + sut = View.create_for_modification( + qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME + ) assert sut.qualified_name == VIEW_QUALIFIED_NAME assert sut.name == VIEW_NAME def test_trim_to_required(): - sut = View.create_for_modification(qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME).trim_to_required() + sut = View.create_for_modification( + qualified_name=VIEW_QUALIFIED_NAME, name=VIEW_NAME + ).trim_to_required() assert sut.qualified_name == VIEW_QUALIFIED_NAME assert sut.name == VIEW_NAME diff --git a/tests/unit/pkg/test_models.py b/tests/unit/pkg/test_models.py index 45b75aeaf..d9c0bec94 100644 --- a/tests/unit/pkg/test_models.py +++ b/tests/unit/pkg/test_models.py @@ -100,7 +100,9 @@ class TestPackageConfig: ) def test_validation(self, good_or_bad_labels, good_or_bad_annotations, msg): with pytest.raises(ValidationError, match=msg): - PackageConfig(labels=good_or_bad_labels, annotations=good_or_bad_annotations) + PackageConfig( + labels=good_or_bad_labels, annotations=good_or_bad_annotations + ) def test_constructor(self, labels, annotations): sut = PackageConfig(labels=labels, annotations=annotations) @@ -153,7 +155,9 @@ def test_create_package(self, custom_package, tmp_path: Path): ], indirect=["good_or_bad_custom_package"], ) -def test_generate_parameter_validation(good_or_bad_custom_package, path, operation, msg): +def test_generate_parameter_validation( + good_or_bad_custom_package, path, operation, msg +): with pytest.raises(ValidationError, match=msg): generate(pkg=good_or_bad_custom_package, path=path, operation=operation) diff --git a/tests/unit/pkg/test_widgets.py b/tests/unit/pkg/test_widgets.py index 3c285736c..3fcbd686e 100644 --- a/tests/unit/pkg/test_widgets.py +++ b/tests/unit/pkg/test_widgets.py @@ -138,7 +138,9 @@ def test_constructor_with_overrides(self): ) def test_validation(self, label, required, hidden, help_, grid, msg): with pytest.raises(ValidationError, match=msg): - APITokenSelector(label=label, required=required, hidden=hidden, help=help_, grid=grid) + APITokenSelector( + label=label, required=required, hidden=hidden, help=help_, grid=grid + ) class TestBooleanInput: @@ -231,7 +233,9 @@ def test_constructor_with_overrides(self): ) def test_validation(self, label, required, hidden, help_, grid, msg): with pytest.raises(ValidationError, match=msg): - BooleanInput(label=label, required=required, hidden=hidden, help=help_, grid=grid) + BooleanInput( + label=label, required=required, hidden=hidden, help=help_, grid=grid + ) class TestConnectionCreator: @@ -459,7 +463,9 @@ def test_constructor_with_overrides(self): ), ], ) - def test_validation(self, label, required, hidden, help_, placeholder, grid, start, msg): + def test_validation( + self, label, required, hidden, help_, placeholder, grid, start, msg + ): with pytest.raises(ValidationError, match=msg): ConnectionSelector( label=label, @@ -750,7 +756,9 @@ def test_constructor_with_overrides(self): ), ], ) - def test_validation(self, label, required, hidden, help_, min, max, default, start, grid, msg): + def test_validation( + self, label, required, hidden, help_, min, max, default, start, grid, msg + ): with pytest.raises(ValidationError, match=msg): DateInput( label=label, @@ -881,7 +889,9 @@ def test_constructor_with_overrides(self): ), ], ) - def test_validation(self, label, possible_values, required, hidden, help_, multi_select, grid, msg): + def test_validation( + self, label, possible_values, required, hidden, help_, multi_select, grid, msg + ): with pytest.raises(ValidationError, match=msg): DropDown( label=label, @@ -991,7 +1001,9 @@ def test_constructor_with_overrides(self): ), ], ) - def test_validation(self, label, file_types, required, hidden, help_, placeholder, msg): + def test_validation( + self, label, file_types, required, hidden, help_, placeholder, msg + ): with pytest.raises(ValidationError, match=msg): FileUploader( label=label, @@ -1488,7 +1500,9 @@ def test_validation(self, label, required, hidden, help_, grid, msg): class TestRadio: def test_constructor_with_defaults(self): - sut = Radio(label=LABEL, posssible_values=POSSIBLE_VALUES, default=(default := "a")) + sut = Radio( + label=LABEL, posssible_values=POSSIBLE_VALUES, default=(default := "a") + ) assert sut.type_ == "string" assert sut.required == IS_NOT_REQUIRED # assert sut.possible_values == POSSIBLE_VALUES @@ -1583,7 +1597,9 @@ def test_constructor_with_overrides(self): ), ], ) - def test_validation(self, label, possible_values, default, required, hidden, help_, msg): + def test_validation( + self, label, possible_values, default, required, hidden, help_, msg + ): with pytest.raises(ValidationError, match=msg): Radio( label=label, diff --git a/tests/unit/test_atlan_tag_name.py b/tests/unit/test_atlan_tag_name.py index d89d836be..88af32cfe 100644 --- a/tests/unit/test_atlan_tag_name.py +++ b/tests/unit/test_atlan_tag_name.py @@ -22,7 +22,9 @@ def get_id_for_name(_): "get_id_for_name", get_id_for_name, ) - with pytest.raises(ValueError, match=f"{GOOD_ATLAN_TAG_NAME} is not a valid Classification"): + with pytest.raises( + ValueError, match=f"{GOOD_ATLAN_TAG_NAME} is not a valid Classification" + ): AtlanTagName(GOOD_ATLAN_TAG_NAME) @@ -57,7 +59,9 @@ def get_id_for_name(value): assert AtlanTagName(GOOD_ATLAN_TAG_NAME) == sut -def test_convert_to_display_text_when_atlan_tag_passed_returns_same_atlan_tag(monkeypatch, good_atlan_tag): +def test_convert_to_display_text_when_atlan_tag_passed_returns_same_atlan_tag( + monkeypatch, good_atlan_tag +): assert good_atlan_tag is AtlanTagName._convert_to_display_text(good_atlan_tag) @@ -71,7 +75,10 @@ def get_name_for_id(_): get_name_for_id, ) - assert AtlanTagName._convert_to_display_text("bad").__repr__() == f"AtlanTagName('{DELETED_}')" + assert ( + AtlanTagName._convert_to_display_text("bad").__repr__() + == f"AtlanTagName('{DELETED_}')" + ) def test_convert_to_display_text_when_id(monkeypatch): diff --git a/tests/unit/test_audit_search.py b/tests/unit/test_audit_search.py index a127ab225..3e1615a1f 100644 --- a/tests/unit/test_audit_search.py +++ b/tests/unit/test_audit_search.py @@ -40,13 +40,18 @@ def load_json(filename): def _assert_audit_search_results(results, response_json, sorts, bulk=False): for audit in results: assert audit.entity_id == response_json["entityAudits"][0]["entity_id"] - assert audit.entity_qualified_name == response_json["entityAudits"][0]["entity_qualified_name"] + assert ( + audit.entity_qualified_name + == response_json["entityAudits"][0]["entity_qualified_name"] + ) assert audit.type_name == response_json["entityAudits"][0]["type_name"] expected_timestamp = datetime.fromtimestamp( response_json["entityAudits"][0]["timestamp"] / 1000, tz=timezone.utc ) assert audit.timestamp == expected_timestamp - expected_created = datetime.fromtimestamp(response_json["entityAudits"][0]["created"] / 1000, tz=timezone.utc) + expected_created = datetime.fromtimestamp( + response_json["entityAudits"][0]["created"] / 1000, tz=timezone.utc + ) assert audit.created == expected_created assert audit.user == response_json["entityAudits"][0]["user"] assert audit.action == response_json["entityAudits"][0]["action"] @@ -57,7 +62,9 @@ def _assert_audit_search_results(results, response_json, sorts, bulk=False): @patch.object(LOGGER, "debug") -def test_audit_search_pagination(mock_logger, mock_api_caller, audit_search_paging_json): +def test_audit_search_pagination( + mock_logger, mock_api_caller, audit_search_paging_json +): client = AuditClient(mock_api_caller) mock_api_caller._call_api.side_effect = [ audit_search_paging_json, @@ -94,7 +101,9 @@ def test_audit_search_pagination(mock_logger, mock_api_caller, audit_search_pagi SortItem(field="entityId", order=SortOrder.ASCENDING), ] - _assert_audit_search_results(response, audit_search_paging_json, expected_sorts, bulk=True) + _assert_audit_search_results( + response, audit_search_paging_json, expected_sorts, bulk=True + ) # The call count will be 2 because # audit search entries are processed in the first API call. # In the second API call, self._entity_audits @@ -120,10 +129,15 @@ def test_audit_search_pagination(mock_logger, mock_api_caller, audit_search_pagi ] audit_search_request = AuditSearchRequest(dsl=dsl) response = client.search(criteria=audit_search_request) - _assert_audit_search_results(response, audit_search_paging_json, expected_sorts, bulk=False) + _assert_audit_search_results( + response, audit_search_paging_json, expected_sorts, bulk=False + ) assert mock_logger.call_count == 1 assert mock_api_caller._call_api.call_count == 3 - assert "Result size (%s) exceeds threshold (%s)" in mock_logger.call_args_list[0][0][0] + assert ( + "Result size (%s) exceeds threshold (%s)" + in mock_logger.call_args_list[0][0][0] + ) # Test exception for bulk=False with user-defined sorting and results exceeds the predefined threshold dsl.sort = dsl.sort + [SortItem(field="some-sort1", order=SortOrder.ASCENDING)] diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index 4badc281c..8ada00ffc 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -82,7 +82,9 @@ ) GLOSSARY = AtlasGlossary.create(name=GLOSSARY_NAME) -GLOSSARY_CATEGORY = AtlasGlossaryCategory.create(name=GLOSSARY_CATEGORY_NAME, anchor=GLOSSARY) +GLOSSARY_CATEGORY = AtlasGlossaryCategory.create( + name=GLOSSARY_CATEGORY_NAME, anchor=GLOSSARY +) GLOSSARY_TERM = AtlasGlossaryTerm.create(name=GLOSSARY_TERM_NAME, anchor=GLOSSARY) UNIQUE_USERS = "uniqueUsers" UNIQUE_ASSETS = "uniqueAssets" @@ -120,9 +122,7 @@ announcement_message="test-msg", announcement_type=AnnouncementType.INFORMATION, ) -TEST_MISSING_GLOSSARY_GUID_ERROR = ( - "ATLAN-PYTHON-400-055 'glossary_guid' keyword argument is missing for asset type: {0}" -) +TEST_MISSING_GLOSSARY_GUID_ERROR = "ATLAN-PYTHON-400-055 'glossary_guid' keyword argument is missing for asset type: {0}" @pytest.fixture(autouse=True) @@ -350,7 +350,9 @@ def test_append_with_valid_guid_and_no_terms_returns_asset(): client = AtlanClient() guid = "123" - asset = client.asset.append_terms(guid=guid, asset_type=asset_type, terms=terms) + asset = client.asset.append_terms( + guid=guid, asset_type=asset_type, terms=terms + ) assert asset == table assert asset.assigned_terms is None @@ -378,7 +380,9 @@ def mock_save_side_effect(entity): client = AtlanClient() guid = "123" - asset = client.asset.append_terms(guid=guid, asset_type=asset_type, terms=terms) + asset = client.asset.append_terms( + guid=guid, asset_type=asset_type, terms=terms + ) assert asset.assigned_terms == terms mock_execute.assert_called_once() @@ -410,7 +414,9 @@ def mock_save_side_effect(entity): client = AtlanClient() guid = "123" - asset = client.asset.append_terms(guid=guid, asset_type=asset_type, terms=terms) + asset = client.asset.append_terms( + guid=guid, asset_type=asset_type, terms=terms + ) updated_terms = asset.assigned_terms assert updated_terms is not None @@ -546,7 +552,9 @@ def mock_save_side_effect(entity): client = AtlanClient() guid = "123" - asset = client.asset.replace_terms(guid=guid, asset_type=asset_type, terms=terms) + asset = client.asset.replace_terms( + guid=guid, asset_type=asset_type, terms=terms + ) assert asset.assigned_terms == terms mock_execute.assert_called_once() @@ -660,8 +668,12 @@ def test_remove_with_valid_guid_when_terms_present_returns_asset_with_terms_remo table.name = "table-test" table.qualified_name = "table_qn" - existing_term = AtlasGlossaryTerm(qualified_name="term_to_remove", guid="b4113341-251b-4adc-81fb-2420501c30e6") - other_term = AtlasGlossaryTerm(qualified_name="other_term", guid="b267858d-8316-4c41-a56a-6e9b840cef4a") + existing_term = AtlasGlossaryTerm( + qualified_name="term_to_remove", guid="b4113341-251b-4adc-81fb-2420501c30e6" + ) + other_term = AtlasGlossaryTerm( + qualified_name="other_term", guid="b267858d-8316-4c41-a56a-6e9b840cef4a" + ) table.attributes.meanings = [existing_term, other_term] with patch("pyatlan.model.fluent_search.FluentSearch.execute") as mock_execute: @@ -669,7 +681,9 @@ def test_remove_with_valid_guid_when_terms_present_returns_asset_with_terms_remo mock_execute.return_value.current_page = lambda: [table] def mock_save_side_effect(entity): - entity.assigned_terms = [t for t in table.attributes.meanings if t != existing_term] + entity.assigned_terms = [ + t for t in table.attributes.meanings if t != existing_term + ] return Mock(assets_updated=lambda asset_type: [entity]) mock_save.side_effect = mock_save_side_effect @@ -677,7 +691,9 @@ def mock_save_side_effect(entity): client = AtlanClient() guid = "123" - asset = client.asset.remove_terms(guid=guid, asset_type=asset_type, terms=[existing_term]) + asset = client.asset.remove_terms( + guid=guid, asset_type=asset_type, terms=[existing_term] + ) updated_terms = asset.assigned_terms assert updated_terms is not None @@ -688,7 +704,9 @@ def mock_save_side_effect(entity): def test_register_client_with_bad_parameter_raises_value_error(client): - with pytest.raises(InvalidRequestError, match="client must be an instance of AtlanClient"): + with pytest.raises( + InvalidRequestError, match="client must be an instance of AtlanClient" + ): AtlanClient.set_default_client("") assert AtlanClient.get_default_client() is client @@ -726,7 +744,9 @@ def test_register_client(client): ), ], ) -def test_find_glossary_by_name_with_bad_values_raises_value_error(name, attributes, message, client: AtlanClient): +def test_find_glossary_by_name_with_bad_values_raises_value_error( + name, attributes, message, client: AtlanClient +): with pytest.raises(ValueError, match=message): client.asset.find_glossary_by_name(name=name, attributes=attributes) @@ -790,7 +810,9 @@ def test_find_connections_by_name_when_none_found_raises_not_found_error(mock_se NotFoundError, match=f"The Connection asset could not be found by name: {CONNECTION_NAME}.", ): - client.asset.find_connections_by_name(name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE) + client.asset.find_connections_by_name( + name=CONNECTION_NAME, connector_type=CONNECTOR_TYPE + ) @patch.object(AssetClient, "search") @@ -810,8 +832,13 @@ def get_request(*args, **kwargs): client = AtlanClient() - assert GLOSSARY == client.asset.find_glossary_by_name(name=GLOSSARY_NAME, attributes=attributes) - assert f"More than 1 AtlasGlossary found with the name '{GLOSSARY_NAME}', returning only the first." in caplog.text + assert GLOSSARY == client.asset.find_glossary_by_name( + name=GLOSSARY_NAME, attributes=attributes + ) + assert ( + f"More than 1 AtlasGlossary found with the name '{GLOSSARY_NAME}', returning only the first." + in caplog.text + ) assert request assert request.attributes assert attributes == request.attributes @@ -1023,12 +1050,16 @@ def test_find_category_by_name_when_bad_parameter_raises_value_error( sut = client with pytest.raises(ValueError, match=message): - sut.asset.find_category_by_name(name=name, glossary_name=glossary_name, attributes=attributes) + sut.asset.find_category_by_name( + name=name, glossary_name=glossary_name, attributes=attributes + ) def test_find_category_by_name(): attributes = ["name"] - with patch.multiple(AssetClient, find_glossary_by_name=DEFAULT, find_category_fast_by_name=DEFAULT) as values: + with patch.multiple( + AssetClient, find_glossary_by_name=DEFAULT, find_category_fast_by_name=DEFAULT + ) as values: mock_find_glossary_by_name = values["find_glossary_by_name"] mock_find_glossary_by_name.return_value.qualified_name = GLOSSARY_QUALIFIED_NAME mock_find_category_fast_by_name = values["find_category_fast_by_name"] @@ -1075,24 +1106,34 @@ def test_find_category_by_name_qn_guid_correctly_populated( # Glossary assert category.anchor.guid == category_json_attributes.get("anchor").get("guid") - assert category.anchor.name == category_json_attributes.get("anchor").get("attributes").get("name") - assert category.anchor.qualified_name == category_json_attributes.get("anchor").get("uniqueAttributes").get( - "qualifiedName" - ) - - # Glossary category - assert category.parent_category.guid == category_json_attributes.get("parentCategory").get("guid") - assert category.parent_category.name == category_json_attributes.get("parentCategory").get("attributes").get("name") - assert category.parent_category.qualified_name == category_json_attributes.get("parentCategory").get( + assert category.anchor.name == category_json_attributes.get("anchor").get( + "attributes" + ).get("name") + assert category.anchor.qualified_name == category_json_attributes.get("anchor").get( "uniqueAttributes" ).get("qualifiedName") + # Glossary category + assert category.parent_category.guid == category_json_attributes.get( + "parentCategory" + ).get("guid") + assert category.parent_category.name == category_json_attributes.get( + "parentCategory" + ).get("attributes").get("name") + assert category.parent_category.qualified_name == category_json_attributes.get( + "parentCategory" + ).get("uniqueAttributes").get("qualifiedName") + # Glossary term - assert category.terms[0].guid == category_json_attributes.get("terms")[0].get("guid") - assert category.terms[0].name == category_json_attributes.get("terms")[0].get("attributes").get("name") - assert category.terms[0].qualified_name == category_json_attributes.get("terms")[0].get("uniqueAttributes").get( - "qualifiedName" + assert category.terms[0].guid == category_json_attributes.get("terms")[0].get( + "guid" ) + assert category.terms[0].name == category_json_attributes.get("terms")[0].get( + "attributes" + ).get("name") + assert category.terms[0].qualified_name == category_json_attributes.get("terms")[ + 0 + ].get("uniqueAttributes").get("qualifiedName") mock_api_caller.reset_mock() @@ -1164,7 +1205,9 @@ def test_find_term_fast_by_name_when_none_found_raises_not_found_error(mock_sear NotFoundError, match=f"The AtlasGlossaryTerm asset could not be found by name: {GLOSSARY_TERM_NAME}.", ): - client.asset.find_term_fast_by_name(name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME) + client.asset.find_term_fast_by_name( + name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME + ) @patch.object(AssetClient, "search") @@ -1179,7 +1222,9 @@ def test_find_term_fast_by_name_when_non_term_found_raises_not_found_error( NotFoundError, match=f"The AtlasGlossaryTerm asset could not be found by name: {GLOSSARY_TERM_NAME}.", ): - client.asset.find_term_fast_by_name(name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME) + client.asset.find_term_fast_by_name( + name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME + ) mock_search.return_value.current_page.assert_called_once() @@ -1284,12 +1329,16 @@ def test_find_term_by_name_when_bad_parameter_raises_value_error( sut = client with pytest.raises(ValueError, match=message): - sut.asset.find_term_by_name(name=name, glossary_name=glossary_name, attributes=attributes) + sut.asset.find_term_by_name( + name=name, glossary_name=glossary_name, attributes=attributes + ) def test_find_term_by_name(): attributes = ["name"] - with patch.multiple(AssetClient, find_glossary_by_name=DEFAULT, find_term_fast_by_name=DEFAULT) as values: + with patch.multiple( + AssetClient, find_glossary_by_name=DEFAULT, find_term_fast_by_name=DEFAULT + ) as values: mock_find_glossary_by_name = values["find_glossary_by_name"] mock_find_glossary_by_name.return_value.qualified_name = GLOSSARY_QUALIFIED_NAME mock_find_term_fast_by_name = values["find_term_fast_by_name"] @@ -1349,7 +1398,9 @@ def test_search_log_most_recent_viewers(mock_sl_api_call, sl_most_recent_viewers mock_sl_api_call.return_value = sl_most_recent_viewers_json recent_viewers_aggs = sl_most_recent_viewers_json["aggregations"] recent_viewers_aggs_buckets = recent_viewers_aggs[UNIQUE_USERS]["buckets"] - request = SearchLogRequest.most_recent_viewers(guid="test-guid-123", exclude_users=["testuser"]) + request = SearchLogRequest.most_recent_viewers( + guid="test-guid-123", exclude_users=["testuser"] + ) request_dsl_json = loads(request.dsl.json(by_alias=True, exclude_none=True)) response = client.search_log.search(request) viewers = response.user_views @@ -1371,7 +1422,9 @@ def test_search_log_most_viewed_assets(mock_sl_api_call, sl_most_viewed_assets_j mock_sl_api_call.return_value = sl_most_viewed_assets_json viewed_assets_aggs = sl_most_viewed_assets_json["aggregations"] viewed_assets_aggs_buckets = viewed_assets_aggs[UNIQUE_ASSETS]["buckets"][0] - request = SearchLogRequest.most_viewed_assets(max_assets=10, exclude_users=["testuser"]) + request = SearchLogRequest.most_viewed_assets( + max_assets=10, exclude_users=["testuser"] + ) request_dsl_json = loads(request.dsl.json(by_alias=True, exclude_none=True)) response = client.search_log.search(request) detail = response.asset_views @@ -1389,7 +1442,9 @@ def test_search_log_views_by_guid(mock_sl_api_call, sl_detailed_log_entries_json client = AtlanClient() mock_sl_api_call.return_value = sl_detailed_log_entries_json sl_detailed_log_entries = sl_detailed_log_entries_json["logs"] - request = SearchLogRequest.views_by_guid(guid="test-guid-123", size=10, exclude_users=["testuser"]) + request = SearchLogRequest.views_by_guid( + guid="test-guid-123", size=10, exclude_users=["testuser"] + ) request_dsl_json = loads(request.dsl.json(by_alias=True, exclude_none=True)) response = client.search_log.search(request) log_entries = response.current_page() @@ -1418,12 +1473,16 @@ def test_search_log_views_by_guid(mock_sl_api_call, sl_detailed_log_entries_json assert log_entries[0].request_relation_attributes -def test_asset_get_lineage_list_response_with_custom_metadata(mock_api_caller, mock_cm_cache, lineage_list_json): +def test_asset_get_lineage_list_response_with_custom_metadata( + mock_api_caller, mock_cm_cache, lineage_list_json +): client = AssetClient(mock_api_caller) mock_cm_cache.get_name_for_id.return_value = CM_NAME mock_api_caller._call_api.side_effect = [lineage_list_json, {}] - lineage_request = LineageListRequest(guid="test-guid", depth=1, direction=LineageDirection.UPSTREAM) + lineage_request = LineageListRequest( + guid="test-guid", depth=1, direction=LineageDirection.UPSTREAM + ) lineage_request.attributes = [CM_NAME] lineage_response = client.get_lineage_list(lineage_request=lineage_request) @@ -1511,13 +1570,15 @@ def test_user_groups_pagination(mock_api_caller, user_groups_json): mock_api_caller.reset_mock() -def test_index_search_with_no_aggregation_results(mock_api_caller, aggregations_null_json): +def test_index_search_with_no_aggregation_results( + mock_api_caller, aggregations_null_json +): client = AssetClient(mock_api_caller) mock_api_caller._call_api.side_effect = [aggregations_null_json] request = ( - FluentSearch(aggregations={"test1": {"test2": {"field": "__test_field"}}}).where( - Column.QUALIFIED_NAME.startswith("test-qn") - ) + FluentSearch( + aggregations={"test1": {"test2": {"field": "__test_field"}}} + ).where(Column.QUALIFIED_NAME.startswith("test-qn")) ).to_request() response = client.search(criteria=request) assert response @@ -1539,7 +1600,9 @@ def _assert_search_results(results, response_json, sorts, bulk=False): @patch.object(LOGGER, "debug") -def test_index_search_pagination(mock_logger, mock_api_caller, index_search_paging_json): +def test_index_search_pagination( + mock_logger, mock_api_caller, index_search_paging_json +): client = AssetClient(mock_api_caller) mock_api_caller._call_api.side_effect = [index_search_paging_json, {}] @@ -1604,7 +1667,10 @@ def test_index_search_pagination(mock_logger, mock_api_caller, index_search_pagi _assert_search_results(results, index_search_paging_json, expected_sorts) assert mock_api_caller._call_api.call_count == 3 assert mock_logger.call_count == 1 - assert "Result size (%s) exceeds threshold (%s)" in mock_logger.call_args_list[0][0][0] + assert ( + "Result size (%s) exceeds threshold (%s)" + in mock_logger.call_args_list[0][0][0] + ) mock_logger.reset_mock() mock_api_caller.reset_mock() @@ -1663,7 +1729,9 @@ def test_asset_get_by_guid_without_asset_type(mock_api_caller, get_by_guid_json) client = AssetClient(mock_api_caller) mock_api_caller._call_api.side_effect = [get_by_guid_json] - response = client.get_by_guid(guid="test-table-guid-123", ignore_relationships=False) + response = client.get_by_guid( + guid="test-table-guid-123", ignore_relationships=False + ) assert response assert isinstance(response, Table) @@ -1673,7 +1741,9 @@ def test_asset_get_by_guid_without_asset_type(mock_api_caller, get_by_guid_json) mock_api_caller.reset_mock() -def test_asset_retrieve_minimal_without_asset_type(mock_api_caller, retrieve_minimal_json): +def test_asset_retrieve_minimal_without_asset_type( + mock_api_caller, retrieve_minimal_json +): client = AssetClient(mock_api_caller) mock_api_caller._call_api.side_effect = [retrieve_minimal_json] @@ -1764,7 +1834,9 @@ def test_typedef_get_by_name_invalid_response(mock_api_caller): mock_api_caller._call_api.side_effect = [{"category": "ENUM", "test": "invalid"}] with pytest.raises(ApiError) as err: client.get_by_name(name="test-enum") - assert "1 validation error for EnumDef\nelementDefs\n field required" in str(err.value) + assert "1 validation error for EnumDef\nelementDefs\n field required" in str( + err.value + ) mock_api_caller.reset_mock() @@ -1959,7 +2031,9 @@ def test_atlan_call_api_server_error_messages_with_causes( client: AtlanClient, test_error_msg, ): - ERROR_CODE_FOR_HTTP_STATUS.update({ErrorCode.ERROR_PASSTHROUGH.http_error_code: ErrorCode.ERROR_PASSTHROUGH}) + ERROR_CODE_FOR_HTTP_STATUS.update( + {ErrorCode.ERROR_PASSTHROUGH.http_error_code: ErrorCode.ERROR_PASSTHROUGH} + ) STATUS_CODES = set(ERROR_CODE_FOR_HTTP_STATUS.keys()) # For "NOT_FOUND (404)" errors, no error cause is returned by the backend, # so we'll exclude that from the test cases: @@ -2015,7 +2089,9 @@ def assert_asset_client_not_called(self, mock_atlan_client, sut): (CustomMetadataHandling.MERGE), ], ) - def test_add_when_capture_failure_true(self, custom_metadata_handling, mock_atlan_client): + def test_add_when_capture_failure_true( + self, custom_metadata_handling, mock_atlan_client + ): table_1 = Mock(Table(guid="t1")) table_2 = Mock(Table(guid="t2")) table_3 = Mock(Table(guid="t3")) @@ -2056,7 +2132,9 @@ def test_add_when_capture_failure_true(self, custom_metadata_handling, mock_atla unsaved.trim_to_required.assert_called_once() assert unsaved.name == saved.name - exception = ErrorCode.INVALID_REQUEST_PASSTHROUGH.exception_with_parameters("bad", "stuff", "") + exception = ErrorCode.INVALID_REQUEST_PASSTHROUGH.exception_with_parameters( + "bad", "stuff", "" + ) if custom_metadata_handling == CustomMetadataHandling.IGNORE: mock_atlan_client.asset.save.side_effect = exception elif custom_metadata_handling == CustomMetadataHandling.OVERWRITE: @@ -2102,8 +2180,12 @@ def test_add_when_capture_failure_true(self, custom_metadata_handling, mock_atla (CustomMetadataHandling.MERGE), ], ) - def test_add_when_capture_failure_false_then_exception_raised(self, custom_metadata_handling, mock_atlan_client): - exception = ErrorCode.INVALID_REQUEST_PASSTHROUGH.exception_with_parameters("bad", "stuff", "") + def test_add_when_capture_failure_false_then_exception_raised( + self, custom_metadata_handling, mock_atlan_client + ): + exception = ErrorCode.INVALID_REQUEST_PASSTHROUGH.exception_with_parameters( + "bad", "stuff", "" + ) if custom_metadata_handling == CustomMetadataHandling.IGNORE: mock_atlan_client.asset.save.side_effect = exception elif custom_metadata_handling == CustomMetadataHandling.OVERWRITE: @@ -2200,7 +2282,9 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): # Test replace and append (list) term1.attributes.see_also = [ AtlasGlossaryTerm.ref_by_guid(guid=term2.guid), - AtlasGlossaryTerm.ref_by_guid(guid=term3.guid, semantic=SaveSemantic.APPEND), + AtlasGlossaryTerm.ref_by_guid( + guid=term3.guid, semantic=SaveSemantic.APPEND + ), ] request = BulkRequest(entities=[term1]) request_json = self.to_json(request) @@ -2219,10 +2303,14 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): # Test replace and append (list) with multiple relationships term1.attributes.see_also = [ AtlasGlossaryTerm.ref_by_guid(guid=term2.guid), - AtlasGlossaryTerm.ref_by_guid(guid=term3.guid, semantic=SaveSemantic.APPEND), + AtlasGlossaryTerm.ref_by_guid( + guid=term3.guid, semantic=SaveSemantic.APPEND + ), ] term1.attributes.preferred_to_terms = [ - AtlasGlossaryTerm.ref_by_guid(guid=term3.guid, semantic=SaveSemantic.APPEND), + AtlasGlossaryTerm.ref_by_guid( + guid=term3.guid, semantic=SaveSemantic.APPEND + ), ] request = BulkRequest(entities=[term1]) request_json = self.to_json(request) @@ -2243,7 +2331,9 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): # Test append and replace (list) term1.attributes.see_also = [ - AtlasGlossaryTerm.ref_by_guid(guid=term2.guid, semantic=SaveSemantic.APPEND), + AtlasGlossaryTerm.ref_by_guid( + guid=term2.guid, semantic=SaveSemantic.APPEND + ), AtlasGlossaryTerm.ref_by_guid(guid=term3.guid), ] request = BulkRequest(entities=[term1]) @@ -2262,8 +2352,12 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): # Test remove and append (list) term1.attributes.see_also = [ - AtlasGlossaryTerm.ref_by_guid(guid=term2.guid, semantic=SaveSemantic.REMOVE), - AtlasGlossaryTerm.ref_by_guid(guid=term3.guid, semantic=SaveSemantic.APPEND), + AtlasGlossaryTerm.ref_by_guid( + guid=term2.guid, semantic=SaveSemantic.REMOVE + ), + AtlasGlossaryTerm.ref_by_guid( + guid=term3.guid, semantic=SaveSemantic.APPEND + ), ] request = BulkRequest(entities=[term1]) request_json = self.to_json(request) @@ -2282,8 +2376,12 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): # Test same semantic (list) term1.attributes.see_also = [ - AtlasGlossaryTerm.ref_by_guid(guid=term2.guid, semantic=SaveSemantic.APPEND), - AtlasGlossaryTerm.ref_by_guid(guid=term3.guid, semantic=SaveSemantic.APPEND), + AtlasGlossaryTerm.ref_by_guid( + guid=term2.guid, semantic=SaveSemantic.APPEND + ), + AtlasGlossaryTerm.ref_by_guid( + guid=term3.guid, semantic=SaveSemantic.APPEND + ), ] request = BulkRequest(entities=[term1]) request_json = self.to_json(request) @@ -2322,7 +2420,9 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): assert self.REMOVE not in request_json # Test append - term1.attributes.anchor = AtlasGlossary.ref_by_guid(guid=glossary.guid, semantic=SaveSemantic.APPEND) + term1.attributes.anchor = AtlasGlossary.ref_by_guid( + guid=glossary.guid, semantic=SaveSemantic.APPEND + ) request = BulkRequest(entities=[term1]) request_json = self.to_json(request) assert request_json @@ -2334,7 +2434,9 @@ def test_process_relationship_attributes(self, glossary, term1, term2, term3): assert "anchor" not in request_json["attributes"] # Test remove - term1.attributes.anchor = AtlasGlossary.ref_by_guid(guid=glossary.guid, semantic=SaveSemantic.REMOVE) + term1.attributes.anchor = AtlasGlossary.ref_by_guid( + guid=glossary.guid, semantic=SaveSemantic.REMOVE + ) request = BulkRequest(entities=[term1]) request_json = self.to_json(request) assert request_json @@ -2448,7 +2550,9 @@ def test_get_by_guid_asset_not_found_fluent_search(): mock_execute.return_value.current_page.return_value = [] client = AssetClient(client=ApiCaller) - with pytest.raises(ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid).__class__): + with pytest.raises( + ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters(guid).__class__ + ): client.get_by_guid( guid=guid, asset_type=asset_type, @@ -2470,7 +2574,9 @@ def test_get_by_guid_type_mismatch_fluent_search(): client = AssetClient(client=ApiCaller) with pytest.raises( - ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters(guid, expected_asset_type.__name__).__class__ + ErrorCode.ASSET_NOT_TYPE_REQUESTED.exception_with_parameters( + guid, expected_asset_type.__name__ + ).__class__ ): client.get_by_guid( guid=guid, @@ -2516,7 +2622,9 @@ def test_get_by_qualified_name_asset_not_found(): client = AssetClient(client=ApiCaller) with pytest.raises( - ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters(qualified_name, asset_type.__name__).__class__ + ErrorCode.ASSET_NOT_FOUND_BY_QN.exception_with_parameters( + qualified_name, asset_type.__name__ + ).__class__ ): client.get_by_qualified_name( qualified_name=qualified_name, diff --git a/tests/unit/test_connection_cache.py b/tests/unit/test_connection_cache.py index a2998b991..8c51f4b9d 100644 --- a/tests/unit/test_connection_cache.py +++ b/tests/unit/test_connection_cache.py @@ -22,7 +22,9 @@ def test_get_by_guid_with_not_found_error(monkeypatch): @patch.object(ConnectionCache, "lookup_by_guid") -@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) +@patch.object( + ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) +) def test_get_by_guid_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_guid): test_guid = "test-guid-123" with pytest.raises( @@ -39,13 +41,19 @@ def test_get_by_qualified_name_with_not_found_error(monkeypatch): @patch.object(ConnectionCache, "lookup_by_qualified_name") -@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) -def test_get_by_qualified_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_qualified_name): +@patch.object( + ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) +) +def test_get_by_qualified_name_with_no_invalid_request_error( + mock_get_cache, mock_lookup_by_qualified_name +): test_qn = "default/snowflake/123456789" test_connector = "snowflake" with pytest.raises( NotFoundError, - match=ErrorCode.ASSET_NOT_FOUND_BY_QN.error_message.format(test_qn, test_connector), + match=ErrorCode.ASSET_NOT_FOUND_BY_QN.error_message.format( + test_qn, test_connector + ), ): ConnectionCache.get_by_qualified_name(test_qn) mock_get_cache.assert_called_once() @@ -57,7 +65,9 @@ def test_get_by_name_with_not_found_error(monkeypatch): @patch.object(ConnectionCache, "lookup_by_name") -@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) +@patch.object( + ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) +) def test_get_by_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_name): test_name = ConnectionName("snowflake/test") with pytest.raises( @@ -72,7 +82,9 @@ def test_get_by_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_b @patch.object(ConnectionCache, "lookup_by_guid") -@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) +@patch.object( + ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) +) def test_get_by_guid(mock_get_cache, mock_lookup_by_guid): test_guid = "test-guid-123" test_qn = "test-qualified-name" @@ -123,7 +135,9 @@ def test_get_by_guid(mock_get_cache, mock_lookup_by_guid): @patch.object(ConnectionCache, "lookup_by_guid") @patch.object(ConnectionCache, "lookup_by_qualified_name") -@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) +@patch.object( + ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) +) def test_get_by_qualified_name(mock_get_cache, mock_lookup_by_qn, mock_lookup_by_guid): test_guid = "test-guid-123" test_qn = "test-qualified-name" @@ -181,7 +195,9 @@ def test_get_by_qualified_name(mock_get_cache, mock_lookup_by_qn, mock_lookup_by @patch.object(ConnectionCache, "lookup_by_guid") @patch.object(ConnectionCache, "lookup_by_name") -@patch.object(ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient())) +@patch.object( + ConnectionCache, "get_cache", return_value=ConnectionCache(client=AtlanClient()) +) def test_get_by_name(mock_get_cache, mock_lookup_by_name, mock_lookup_by_guid): test_name = ConnectionName("snowflake/test") test_guid = "test-guid-123" diff --git a/tests/unit/test_core.py b/tests/unit/test_core.py index 619e16c1c..da216f7ec 100644 --- a/tests/unit/test_core.py +++ b/tests/unit/test_core.py @@ -18,7 +18,9 @@ def test_get_deleted_sentinel(self): assert "(DELETED)" == str(sentinel) assert id(sentinel) == id(AtlanTagName.get_deleted_sentinel()) - def test_atlan_tag_name_when_name_found_returns_atlan_tag_name(self, mock_tag_cache): + def test_atlan_tag_name_when_name_found_returns_atlan_tag_name( + self, mock_tag_cache + ): mock_tag_cache.get_id_for_name.return_value = "123" sut = AtlanTagName(DISPLAY_TEXT) @@ -29,7 +31,9 @@ def test_atlan_tag_name_when_name_found_returns_atlan_tag_name(self, mock_tag_ca def test_atlan_tag_name_when_name_not_found_raise_value_error(self, mock_tag_cache): mock_tag_cache.get_id_for_name.return_value = None - with pytest.raises(ValueError, match=f"{DISPLAY_TEXT} is not a valid Classification"): + with pytest.raises( + ValueError, match=f"{DISPLAY_TEXT} is not a valid Classification" + ): AtlanTagName(DISPLAY_TEXT) def test_json_encode_atlan_tag_returns_internal_code(self, mock_tag_cache): @@ -38,7 +42,9 @@ def test_json_encode_atlan_tag_returns_internal_code(self, mock_tag_cache): sut = AtlanTagName(DISPLAY_TEXT) assert internal_value == AtlanTagName.json_encode_atlan_tag(sut) - mock_tag_cache.get_id_for_name.assert_has_calls([call(DISPLAY_TEXT), call(DISPLAY_TEXT)]) + mock_tag_cache.get_id_for_name.assert_has_calls( + [call(DISPLAY_TEXT), call(DISPLAY_TEXT)] + ) class TestAtlanTag: @@ -49,7 +55,9 @@ def test_atlan_tag_when_tag_name_is_found(self, mock_tag_cache): assert str(sut.type_name) == DISPLAY_TEXT - def test_atlan_tag_when_tag_name_is_not_found_then_sentinel_is_returned(self, mock_tag_cache): + def test_atlan_tag_when_tag_name_is_not_found_then_sentinel_is_returned( + self, mock_tag_cache + ): mock_tag_cache.get_name_for_id.return_value = None sut = AtlanTag(**{"typeName": "123"}) diff --git a/tests/unit/test_credential_client.py b/tests/unit/test_credential_client.py index 00bf3b5c8..b082bdbad 100644 --- a/tests/unit/test_credential_client.py +++ b/tests/unit/test_credential_client.py @@ -15,22 +15,22 @@ CredentialTestResponse, ) -TEST_MISSING_TOKEN_ID = "ATLAN-PYTHON-400-032 No ID was provided when attempting to update the API token." -TEST_INVALID_CREDENTIALS = "ATLAN-PYTHON-400-054 Credentials provided did not work: failed" -TEST_INVALID_GUID_GET_VALIDATION_ERR = "1 validation error for Get\nguid\n str type expected (type=type_error.str)" -TEST_INVALID_GUID_PURGE_BY_GUID_VALIDATION_ERR = ( - "1 validation error for PurgeByGuid\nguid\n str type expected (type=type_error.str)" +TEST_MISSING_TOKEN_ID = ( + "ATLAN-PYTHON-400-032 No ID was provided when attempting to update the API token." ) -TEST_INVALID_CRED_TEST_VALIDATION_ERR = ( - "1 validation error for Test\ncredential\n value is not a valid dict (type=type_error.dict)" +TEST_INVALID_CREDENTIALS = ( + "ATLAN-PYTHON-400-054 Credentials provided did not work: failed" ) -TEST_INVALID_CRED_TEST_UPDATE_VALIDATION_ERR = ( - "1 validation error for TestAndUpdate\ncredential\n value is not a valid dict (type=type_error.dict)" +TEST_INVALID_GUID_GET_VALIDATION_ERR = ( + "1 validation error for Get\nguid\n str type expected (type=type_error.str)" ) -TEST_INVALID_CRED_CREATOR_VALIDATION_ERR = ( - "1 validation error for Creator\ncredential\n value is not a valid dict (type=type_error.dict)" +TEST_INVALID_GUID_PURGE_BY_GUID_VALIDATION_ERR = "1 validation error for PurgeByGuid\nguid\n str type expected (type=type_error.str)" +TEST_INVALID_CRED_TEST_VALIDATION_ERR = "1 validation error for Test\ncredential\n value is not a valid dict (type=type_error.dict)" +TEST_INVALID_CRED_TEST_UPDATE_VALIDATION_ERR = "1 validation error for TestAndUpdate\ncredential\n value is not a valid dict (type=type_error.dict)" +TEST_INVALID_CRED_CREATOR_VALIDATION_ERR = "1 validation error for Creator\ncredential\n value is not a valid dict (type=type_error.dict)" +TEST_INVALID_API_CALLER_PARAMETER_TYPE = ( + "ATLAN-PYTHON-400-048 Invalid parameter type for client should be ApiCaller" ) -TEST_INVALID_API_CALLER_PARAMETER_TYPE = "ATLAN-PYTHON-400-048 Invalid parameter type for client should be ApiCaller" @pytest.fixture() @@ -90,21 +90,27 @@ def test_init_when_wrong_class_raises_exception(test_api_caller): @pytest.mark.parametrize("test_guid", [[123], set(), dict()]) -def test_cred_get_wrong_params_raises_validation_error(test_guid, client: CredentialClient): +def test_cred_get_wrong_params_raises_validation_error( + test_guid, client: CredentialClient +): with pytest.raises(ValidationError) as err: client.get(guid=test_guid) assert TEST_INVALID_GUID_GET_VALIDATION_ERR == str(err.value) @pytest.mark.parametrize("test_credentials", ["invalid_cred", 123]) -def test_cred_test_wrong_params_raises_validation_error(test_credentials, client: CredentialClient): +def test_cred_test_wrong_params_raises_validation_error( + test_credentials, client: CredentialClient +): with pytest.raises(ValidationError) as err: client.test(credential=test_credentials) assert TEST_INVALID_CRED_TEST_VALIDATION_ERR == str(err.value) @pytest.mark.parametrize("test_credentials", ["invalid_cred", 123]) -def test_cred_test_and_update_wrong_params_raises_validation_error(test_credentials, client: CredentialClient): +def test_cred_test_and_update_wrong_params_raises_validation_error( + test_credentials, client: CredentialClient +): with pytest.raises(ValidationError) as err: client.test_and_update(credential=test_credentials) assert TEST_INVALID_CRED_TEST_UPDATE_VALIDATION_ERR == str(err.value) @@ -174,7 +180,9 @@ def test_cred_test_update_when_given_cred( {"message": "successful"}, credential_response.dict(), ] - cred_response = client.test_and_update(credential=Credential(id=credential_response.id)) + cred_response = client.test_and_update( + credential=Credential(id=credential_response.id) + ) assert isinstance(cred_response, CredentialResponse) cred = cred_response.to_credential() _assert_cred_response(cred, credential_response) @@ -188,7 +196,9 @@ def test_cred_test_update_when_given_cred( ({"invalid": "field"}, 10, 0, {"records": []}), ], ) -def test_cred_get_all_success(test_filter, test_limit, test_offset, test_response, mock_api_caller): +def test_cred_get_all_success( + test_filter, test_limit, test_offset, test_response, mock_api_caller +): mock_api_caller._call_api.return_value = test_response client = CredentialClient(mock_api_caller) @@ -283,7 +293,9 @@ def test_cred_get_all_no_results(mock_api_caller): @pytest.mark.parametrize("create_credentials", ["invalid_cred", 123]) -def test_cred_creator_wrong_params_raises_validation_error(create_credentials, client: CredentialClient): +def test_cred_creator_wrong_params_raises_validation_error( + create_credentials, client: CredentialClient +): with pytest.raises(ValidationError) as err: client.creator(credential=create_credentials) assert TEST_INVALID_CRED_CREATOR_VALIDATION_ERR == str(err.value) @@ -351,13 +363,17 @@ def test_creator_success( ), ], ) -def test_cred_creator_with_test_false_with_username_password(credential_data, client: CredentialClient): +def test_cred_creator_with_test_false_with_username_password( + credential_data, client: CredentialClient +): with pytest.raises(Exception, match="ATLAN-PYTHON-400-071"): client.creator(credential=credential_data, test=False) @pytest.mark.parametrize("test_guid", [[123], set(), dict()]) -def test_cred_purge_by_guid_wrong_params_raises_validation_error(test_guid, client: CredentialClient): +def test_cred_purge_by_guid_wrong_params_raises_validation_error( + test_guid, client: CredentialClient +): with pytest.raises(ValidationError) as err: client.purge_by_guid(guid=test_guid) assert TEST_INVALID_GUID_PURGE_BY_GUID_VALIDATION_ERR == str(err.value) diff --git a/tests/unit/test_custom_metadata.py b/tests/unit/test_custom_metadata.py index 14edf5bb8..09ff2b8cf 100644 --- a/tests/unit/test_custom_metadata.py +++ b/tests/unit/test_custom_metadata.py @@ -48,7 +48,9 @@ def sut(self, mock_cache): return CustomMetadataDict(CM_NAME) def test_init_when_invalid_name_throws_not_found_error(self, mock_cache): - mock_cache.get_id_for_name.side_effect = ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters("123") + mock_cache.get_id_for_name.side_effect = ( + ErrorCode.ASSET_NOT_FOUND_BY_GUID.exception_with_parameters("123") + ) with pytest.raises(NotFoundError): CustomMetadataDict(CM_NAME) mock_cache.get_id_for_name.assert_called_with(CM_NAME) @@ -65,11 +67,15 @@ def test_can_get_set_items(self, sut): assert sut.modified is True def test_get_item_with_invalid_name_raises_key_error(self, sut): - with pytest.raises(KeyError, match="'garb' is not a valid property name for Something"): + with pytest.raises( + KeyError, match="'garb' is not a valid property name for Something" + ): sut["garb"] def test_set_item_with_invalid_name_raises_key_error(self, sut): - with pytest.raises(KeyError, match="'garb' is not a valid property name for Something"): + with pytest.raises( + KeyError, match="'garb' is not a valid property name for Something" + ): sut["garb"] = ATTR_FIRST_NAME_ID @pytest.mark.parametrize("name", [ATTR_FIRST_NAME, ATTR_FIRST_NAME]) @@ -117,7 +123,9 @@ def test_get_deleted_sentinel(self): assert 0 == len(sentinel) assert sentinel.modified is False assert sentinel._name == "(DELETED)" - with pytest.raises(KeyError, match=r"'abc' is not a valid property name for \(DELETED\)"): + with pytest.raises( + KeyError, match=r"'abc' is not a valid property name for \(DELETED\)" + ): sentinel["abc"] = 1 @@ -126,11 +134,15 @@ class TestCustomMetadataProxy: def sut(self, mock_cache): yield CustomMetadataProxy(business_attributes=None) - def test_when_intialialized_with_no_business_attributes_then_modified_is_false(self, sut): + def test_when_intialialized_with_no_business_attributes_then_modified_is_false( + self, sut + ): assert sut.modified is False assert sut.business_attributes is None - def test_when_intialialized_with_no_business_attributes_then_business_attributes_returns_none(self, sut): + def test_when_intialialized_with_no_business_attributes_then_business_attributes_returns_none( + self, sut + ): assert sut.business_attributes is None def test_set_custom_metadata(self, sut): @@ -181,7 +193,9 @@ def test_when_modified_returns_updated_business_attributes(self, mock_cache): assert ba == {CM_ID: {ATTR_FIRST_NAME_ID: donna, ATTR_LAST_NAME_ID: joey}} def test_when_invalid_metadata_set_then_delete_sentinel_is_used(self, mock_cache): - mock_cache.get_name_for_id.side_effect = ErrorCode.CM_NOT_FOUND_BY_ID.exception_with_parameters(CM_ID) + mock_cache.get_name_for_id.side_effect = ( + ErrorCode.CM_NOT_FOUND_BY_ID.exception_with_parameters(CM_ID) + ) ba = {CM_ID: {ATTR_FIRST_NAME_ID: "Dave"}} sut = CustomMetadataProxy(business_attributes=ba) diff --git a/tests/unit/test_deprecated.py b/tests/unit/test_deprecated.py index 78f92c952..8f7317e83 100644 --- a/tests/unit/test_deprecated.py +++ b/tests/unit/test_deprecated.py @@ -29,7 +29,9 @@ ) GLOSSARY = AtlasGlossary.create(name=GLOSSARY_NAME) -GLOSSARY_CATEGORY = AtlasGlossaryCategory.create(name=GLOSSARY_CATEGORY_NAME, anchor=GLOSSARY) +GLOSSARY_CATEGORY = AtlasGlossaryCategory.create( + name=GLOSSARY_CATEGORY_NAME, anchor=GLOSSARY +) GLOSSARY_TERM = AtlasGlossaryTerm.create(name=GLOSSARY_TERM_NAME, anchor=GLOSSARY) @@ -51,7 +53,9 @@ def test_get_groups(mock_group_client, client: AtlanClient): sort = "sort" count = False offset = 3 - client.get_groups(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) + client.get_groups( + limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset + ) mock_group_client.assert_called_once_with( limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset @@ -100,7 +104,9 @@ def test_get_roles(mock_role_client, client: AtlanClient): count = False offset = 3 - client.get_roles(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) + client.get_roles( + limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset + ) mock_role_client.assert_called_once_with( limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset @@ -122,7 +128,9 @@ def test_get_api_tokens(mock_token_client, client: AtlanClient): count = False offset = 3 - client.get_api_tokens(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) + client.get_api_tokens( + limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset + ) mock_token_client.assert_called_once_with( limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset @@ -176,7 +184,9 @@ def test_update_api_token(mock_token_client, client: AtlanClient): description = "something" personas = {"something"} - client.update_api_token(guid=guid, display_name=display_name, description=description, personas=personas) + client.update_api_token( + guid=guid, display_name=display_name, description=description, personas=personas + ) mock_token_client.assert_called_once_with( guid=guid, display_name=display_name, description=description, personas=personas @@ -296,7 +306,9 @@ def test_get_users(mock_type_def_client, client: AtlanClient): count = False offset = 6 - client.get_users(limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset) + client.get_users( + limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset + ) mock_type_def_client.assert_called_once_with( limit=limit, post_filter=post_filter, sort=sort, count=count, offset=offset @@ -633,7 +645,9 @@ def test_get_user_by_username(mock_type_def_client, client: AtlanClient): ), ], ) -def test_asset_deprecated_methods(deprecated_name: str, current_name: str, values, client: AtlanClient): +def test_asset_deprecated_methods( + deprecated_name: str, current_name: str, values, client: AtlanClient +): with patch.object(AssetClient, current_name) as mock: func = getattr(client, deprecated_name) func(**values) diff --git a/tests/unit/test_file_client.py b/tests/unit/test_file_client.py index f964b399a..f41cc0ce9 100644 --- a/tests/unit/test_file_client.py +++ b/tests/unit/test_file_client.py @@ -124,7 +124,9 @@ def test_file_client_methods_validation_error(client, method, params): ], ], ) -def test_file_client_upload_file_raises_invalid_request_error(mock_api_caller, file_path, expected_error): +def test_file_client_upload_file_raises_invalid_request_error( + mock_api_caller, file_path, expected_error +): client = FileClient(client=mock_api_caller) with pytest.raises(InvalidRequestError, match=expected_error): @@ -146,7 +148,9 @@ def test_file_client_upload_file_raises_invalid_request_error(mock_api_caller, f ], ], ) -def test_file_client_download_file_raises_invalid_request_error(client, file_path, expected_error): +def test_file_client_download_file_raises_invalid_request_error( + client, file_path, expected_error +): with pytest.raises(InvalidRequestError, match=expected_error): client.files.download_file( presigned_url="test-url", @@ -162,7 +166,9 @@ def test_file_client_download_file_invalid_format_raises_invalid_request_error( f"Error: 'str' object has no attribute 'read', Path: {DOWNLOAD_FILE_PATH}" ) with pytest.raises(InvalidRequestError, match=expected_error): - client.files.download_file(presigned_url=s3_presigned_url, file_path=DOWNLOAD_FILE_PATH) + client.files.download_file( + presigned_url=s3_presigned_url, file_path=DOWNLOAD_FILE_PATH + ) def test_file_client_get_presigned_url(mock_api_caller, s3_presigned_url): @@ -190,7 +196,9 @@ def test_file_client_s3_upload_file(mock_call_api_internal, client, s3_presigned @patch.object(AtlanClient, "_call_api_internal", return_value=None) -def test_file_client_azure_blob_upload_file(mock_call_api_internal, client, blob_presigned_url): +def test_file_client_azure_blob_upload_file( + mock_call_api_internal, client, blob_presigned_url +): client = FileClient(client=client) client.upload_file(presigned_url=blob_presigned_url, file_path=UPLOAD_FILE_PATH) @@ -210,7 +218,9 @@ def test_file_client_gcs_upload_file(mock_call_api_internal, client, gcs_presign def test_file_client_download_file(client, s3_presigned_url, mock_session): # Make sure the download file doesn't exist before downloading assert not os.path.exists(DOWNLOAD_FILE_PATH) - response = client.files.download_file(presigned_url=s3_presigned_url, file_path=DOWNLOAD_FILE_PATH) + response = client.files.download_file( + presigned_url=s3_presigned_url, file_path=DOWNLOAD_FILE_PATH + ) assert response == DOWNLOAD_FILE_PATH assert mock_session.request.call_count == 1 # The file should exist after calling the method diff --git a/tests/unit/test_glossary_term.py b/tests/unit/test_glossary_term.py index 94e14179b..a88bf0bd1 100644 --- a/tests/unit/test_glossary_term.py +++ b/tests/unit/test_glossary_term.py @@ -57,7 +57,9 @@ def test_create_atttributes_without_required_parameters_raises_value_error( ("Glossary", None, None, "123"), ], ) -def test_create_atttributes_with_required_parameters(name, anchor, glossary_qualified_name, glossary_guid): +def test_create_atttributes_with_required_parameters( + name, anchor, glossary_qualified_name, glossary_guid +): sut = AtlasGlossaryTerm.Attributes.create( name=name, anchor=anchor, @@ -68,7 +70,9 @@ def test_create_atttributes_with_required_parameters(name, anchor, glossary_qual if anchor: assert anchor == sut.anchor if glossary_qualified_name: - assert sut.anchor.unique_attributes == {"qualifiedName": glossary_qualified_name} + assert sut.anchor.unique_attributes == { + "qualifiedName": glossary_qualified_name + } if glossary_guid: assert sut.anchor.guid == glossary_guid @@ -127,7 +131,9 @@ def test_create_without_required_parameters_raises_value_error( ("Glossary", None, None, "123"), ], ) -def test_create_with_required_parameters(name, anchor, glossary_qualified_name, glossary_guid): +def test_create_with_required_parameters( + name, anchor, glossary_qualified_name, glossary_guid +): sut = AtlasGlossaryTerm.create( name=name, anchor=anchor, @@ -138,6 +144,8 @@ def test_create_with_required_parameters(name, anchor, glossary_qualified_name, if anchor: assert anchor == sut.attributes.anchor if glossary_qualified_name: - assert sut.attributes.anchor.unique_attributes == {"qualifiedName": glossary_qualified_name} + assert sut.attributes.anchor.unique_attributes == { + "qualifiedName": glossary_qualified_name + } if glossary_guid: assert sut.attributes.anchor.guid == glossary_guid diff --git a/tests/unit/test_lineage.py b/tests/unit/test_lineage.py index d151e7879..c44d1fe42 100644 --- a/tests/unit/test_lineage.py +++ b/tests/unit/test_lineage.py @@ -67,7 +67,13 @@ def test_create_when_relation_is_not_full_link_then_raises_invalid_request_excep InvalidRequestError, match="Lineage was retrieved using hideProces=False. We do not provide a graph view in this case.", ): - LineageGraph.create([LineageRelation(from_entity_id="123", to_entity_id="456", process_id=None)]) + LineageGraph.create( + [ + LineageRelation( + from_entity_id="123", to_entity_id="456", process_id=None + ) + ] + ) def test_get_downstream_asset_guid_with_invalid_guid_returns_empty_set_of_guids( self, @@ -75,7 +81,9 @@ def test_get_downstream_asset_guid_with_invalid_guid_returns_empty_set_of_guids( ): assert len(lineage_graph.get_downstream_asset_guids("123")) == 0 - def test_get_downstream_asset_guid_with_valid_guid_returns_set_of_guids(self, lineage_graph): + def test_get_downstream_asset_guid_with_valid_guid_returns_set_of_guids( + self, lineage_graph + ): assert (guids := lineage_graph.get_downstream_asset_guids(BASE_GUID)) assert len(guids) == 1 assert "e44ed3a2-1de5-4f23-b3f1-6e005156fee9" in guids @@ -92,7 +100,9 @@ def test_get_upstream_asset_guid_with_base_guid_returns_empty_set_of_guids( ): assert len(lineage_graph.get_upstream_asset_guids(BASE_GUID)) == 0 - def test_get_upstream_asset_guid_with_valid_guid_returns_set_of_guids(self, lineage_graph): + def test_get_upstream_asset_guid_with_valid_guid_returns_set_of_guids( + self, lineage_graph + ): assert (guids := lineage_graph.get_upstream_asset_guids(BASE_GUID_TARGET)) assert len(guids) == 1 assert BASE_GUID in guids @@ -106,7 +116,9 @@ def test_get_downstream_process_guid_with_valid_guid_returns_set_of_guids( assert "621d3fa2-54b0-4cc0-a858-5c5ea8c49349" in guids assert "d67d4188-010b-4adf-9886-10162f08c77b" in guids - def test_get_upstream_process_guids_with_valid_guid_returns_set_of_guids(self, lineage_graph): + def test_get_upstream_process_guids_with_valid_guid_returns_set_of_guids( + self, lineage_graph + ): assert (guids := lineage_graph.get_upstream_process_guids(BASE_GUID_TARGET)) assert len(guids) == 2 assert "621d3fa2-54b0-4cc0-a858-5c5ea8c49349" in guids @@ -134,7 +146,9 @@ def test_get_upstream_process_guid_with_invalid_guid_returns_empty_set_of_guids( ("80680c12-f625-4b7f-a5fa-d3fd296e2db1", 18), ], ) - def test_get_all_downstream_asset_guids_dfs(self, guid, expected_count, lineage_graph): + def test_get_all_downstream_asset_guids_dfs( + self, guid, expected_count, lineage_graph + ): assert (guids := lineage_graph.get_all_downstream_asset_guids_dfs(guid)) assert len(guids) == expected_count @@ -148,7 +162,9 @@ def test_get_all_downstream_asset_guids_dfs(self, guid, expected_count, lineage_ ("80680c12-f625-4b7f-a5fa-d3fd296e2db1", 8), ], ) - def test_get_all_upstream_asset_guids_dfs(self, guid, expected_count, lineage_graph): + def test_get_all_upstream_asset_guids_dfs( + self, guid, expected_count, lineage_graph + ): assert (guids := lineage_graph.get_all_upstream_asset_guids_dfs(guid)) assert len(guids) == expected_count @@ -164,7 +180,9 @@ class TestLineageResponse: ("80680c12-f625-4b7f-a5fa-d3fd296e2db1", 18), ], ) - def test_get_all_downstream_asset_guids_dfs(self, guid, expected_count, lineage_response): + def test_get_all_downstream_asset_guids_dfs( + self, guid, expected_count, lineage_response + ): assert (guids := lineage_response.get_all_downstream_asset_guids_dfs(guid)) assert len(guids) == expected_count @@ -178,7 +196,9 @@ def test_get_all_downstream_asset_guids_dfs(self, guid, expected_count, lineage_ ("80680c12-f625-4b7f-a5fa-d3fd296e2db1", 18), ], ) - def test_get_all_downstream_assets_dfs(self, guid, expected_count, lineage_response): + def test_get_all_downstream_assets_dfs( + self, guid, expected_count, lineage_response + ): assert (assets := lineage_response.get_all_downstream_assets_dfs(guid)) assert len(assets) == expected_count @@ -192,7 +212,9 @@ def test_get_all_downstream_assets_dfs(self, guid, expected_count, lineage_respo ("80680c12-f625-4b7f-a5fa-d3fd296e2db1", 8), ], ) - def test_get_all_upstream_asset_guids_dfs(self, guid, expected_count, lineage_response): + def test_get_all_upstream_asset_guids_dfs( + self, guid, expected_count, lineage_response + ): assert (guids := lineage_response.get_all_upstream_asset_guids_dfs(guid)) assert len(guids) == expected_count @@ -216,12 +238,16 @@ def test_get_downstream_asset_guid_with_invalid_guid_returns_empty_set_of_guids( ): assert len(lineage_response.get_downstream_asset_guids("123")) == 0 - def test_get_downstream_asset_guid_with_valid_guid_returns_set_of_guids(self, lineage_response): + def test_get_downstream_asset_guid_with_valid_guid_returns_set_of_guids( + self, lineage_response + ): assert (guids := lineage_response.get_downstream_asset_guids(BASE_GUID)) assert len(guids) == 1 assert "e44ed3a2-1de5-4f23-b3f1-6e005156fee9" in guids - def test_get_downstream_assets_with_valid_guid_returns_set_of_guids(self, lineage_response): + def test_get_downstream_assets_with_valid_guid_returns_set_of_guids( + self, lineage_response + ): assert (assets := lineage_response.get_downstream_assets(BASE_GUID)) assert len(assets) == 1 @@ -237,7 +263,9 @@ def test_get_upstream_asset_guid_with_base_guid_returns_empty_set_of_guids( ): assert len(lineage_response.get_upstream_asset_guids(BASE_GUID)) == 0 - def test_get_upstream_asset_guid_with_valid_guid_returns_set_of_guids(self, lineage_response): + def test_get_upstream_asset_guid_with_valid_guid_returns_set_of_guids( + self, lineage_response + ): assert (guids := lineage_response.get_upstream_asset_guids(BASE_GUID_TARGET)) assert len(guids) == 1 assert BASE_GUID in guids @@ -251,13 +279,17 @@ def test_get_downstream_process_guid_with_valid_guid_returns_set_of_guids( assert "621d3fa2-54b0-4cc0-a858-5c5ea8c49349" in guids assert "d67d4188-010b-4adf-9886-10162f08c77b" in guids - def test_get_upstream_process_guids_with_valid_guid_returns_set_of_guids(self, lineage_response): + def test_get_upstream_process_guids_with_valid_guid_returns_set_of_guids( + self, lineage_response + ): assert (guids := lineage_response.get_upstream_process_guids(BASE_GUID_TARGET)) assert len(guids) == 2 assert "621d3fa2-54b0-4cc0-a858-5c5ea8c49349" in guids assert "d67d4188-010b-4adf-9886-10162f08c77b" in guids - def test_get_upstream_assets_with_valid_guid_returns_set_of_assets(self, lineage_response): + def test_get_upstream_assets_with_valid_guid_returns_set_of_assets( + self, lineage_response + ): assert (assets := lineage_response.get_upstream_process_guids(BASE_GUID_TARGET)) assert len(assets) == 2 @@ -276,7 +308,9 @@ def test_get_upstream_process_guid_with_invalid_guid_returns_empty_set_of_guids( @pytest.fixture def searchable_field() -> SearchableField: - return SearchableField(atlan_field_name="atlan_field", elastic_field_name="elastic_field") + return SearchableField( + atlan_field_name="atlan_field", elastic_field_name="elastic_field" + ) class TestLineageFilterField: @@ -305,17 +339,23 @@ class TestLineageFilterFieldBoolean: def sut(self, searchable_field: SearchableField) -> LineageFilterFieldBoolean: return LineageFilterFieldBoolean(field=searchable_field) - def test_init(self, sut: LineageFilterFieldBoolean, searchable_field: SearchableField): + def test_init( + self, sut: LineageFilterFieldBoolean, searchable_field: SearchableField + ): assert sut.field == searchable_field - @pytest.mark.parametrize("value, expected", [(True, str(True)), (False, str(False))]) + @pytest.mark.parametrize( + "value, expected", [(True, str(True)), (False, str(False))] + ) def test_eq(self, value, expected, sut: LineageFilterFieldBoolean): _filter = sut.eq(value) assert _filter.field == sut.field assert _filter.operator == AtlanComparisonOperator.EQ assert _filter.value == expected - @pytest.mark.parametrize("value, expected", [(True, str(True)), (False, str(False))]) + @pytest.mark.parametrize( + "value, expected", [(True, str(True)), (False, str(False))] + ) def test_neq(self, value, expected, sut: LineageFilterFieldBoolean): _filter = sut.neq(value) assert _filter.field == sut.field @@ -338,20 +378,28 @@ def configure_custom_metadata_field(custom_metadata_field, type_name): attribute_def.configure_mock(**{"type_name": type_name}) custom_metadata_field.attach_mock(attribute_def, "attribute_def") custom_metadata_field.attach_mock(attribute_def, "attribute_def") - custom_metadata_field.configure_mock(**{"set_name": "something", "attribute_name": "an_attribute"}) + custom_metadata_field.configure_mock( + **{"set_name": "something", "attribute_name": "an_attribute"} + ) - def test_init(self, sut: LineageFilterFieldCM, custom_metadata_field: CustomMetadataField): + def test_init( + self, sut: LineageFilterFieldCM, custom_metadata_field: CustomMetadataField + ): assert sut.field == custom_metadata_field assert sut.cm_field == custom_metadata_field - @pytest.mark.parametrize("value, expected", [("value", "value"), (FileType.CSV, FileType.CSV.value)]) + @pytest.mark.parametrize( + "value, expected", [("value", "value"), (FileType.CSV, FileType.CSV.value)] + ) def test_eq(self, value, expected, sut: LineageFilterFieldCM): _filter = sut.eq(value) assert _filter.field == sut.field assert _filter.operator == AtlanComparisonOperator.EQ assert _filter.value == expected - @pytest.mark.parametrize("value, expected", [("value", "value"), (FileType.CSV, FileType.CSV.value)]) + @pytest.mark.parametrize( + "value, expected", [("value", "value"), (FileType.CSV, FileType.CSV.value)] + ) def test_neq(self, value, expected, sut: LineageFilterFieldCM): _filter = sut.neq(value) assert _filter.field == sut.field @@ -438,10 +486,13 @@ def test_non_comparable_type_raises_atlan_error( ("gte", "int, float or date"), ], ) - def test_method_with_wrong_type_raise_atlan_error(self, method, valid_types, sut: LineageFilterFieldCM): + def test_method_with_wrong_type_raise_atlan_error( + self, method, valid_types, sut: LineageFilterFieldCM + ): with pytest.raises( AtlanError, - match="ATLAN-PYTHON-400-048 Invalid parameter type for dict should be " + valid_types, + match="ATLAN-PYTHON-400-048 Invalid parameter type for dict should be " + + valid_types, ): getattr(sut, method)({}) @@ -451,14 +502,18 @@ class TestLineageFilterFieldNumeric: def sut(self, searchable_field: SearchableField) -> LineageFilterFieldNumeric: return LineageFilterFieldNumeric(field=searchable_field) - def test_init(self, sut: LineageFilterFieldNumeric, searchable_field: SearchableField): + def test_init( + self, sut: LineageFilterFieldNumeric, searchable_field: SearchableField + ): assert sut.field == searchable_field @pytest.mark.parametrize( "method", ["eq", "neq", "lt", "lte", "gt", "gte"], ) - def test_method_with_wrong_type_raise_atlan_error(self, method: str, sut: LineageFilterFieldNumeric): + def test_method_with_wrong_type_raise_atlan_error( + self, method: str, sut: LineageFilterFieldNumeric + ): with pytest.raises( AtlanError, match="ATLAN-PYTHON-400-048 Invalid parameter type for dict should be int, float or date", @@ -489,7 +544,9 @@ class TestLineageFilterFieldString: def sut(self, searchable_field: SearchableField) -> LineageFilterFieldString: return LineageFilterFieldString(field=searchable_field) - def test_init(self, sut: LineageFilterFieldString, searchable_field: SearchableField): + def test_init( + self, sut: LineageFilterFieldString, searchable_field: SearchableField + ): assert sut.field == searchable_field @pytest.mark.parametrize( @@ -503,7 +560,9 @@ def test_init(self, sut: LineageFilterFieldString, searchable_field: SearchableF "does_not_contain", ], ) - def test_method_with_wrong_type_raise_atlan_error(self, method: str, sut: LineageFilterFieldNumeric): + def test_method_with_wrong_type_raise_atlan_error( + self, method: str, sut: LineageFilterFieldNumeric + ): with pytest.raises( AtlanError, match="ATLAN-PYTHON-400-048 Invalid parameter type for dict should be int, float or date", @@ -521,8 +580,12 @@ def test_method_with_wrong_type_raise_atlan_error(self, method: str, sut: Lineag ("does_not_contain", AtlanComparisonOperator.NOT_CONTAINS), ], ) - @pytest.mark.parametrize("value, expected", [("abc", "abc"), (FileType.CSV, FileType.CSV.value)]) - def test_eq(self, method, operator, value, expected, sut: LineageFilterFieldBoolean): + @pytest.mark.parametrize( + "value, expected", [("abc", "abc"), (FileType.CSV, FileType.CSV.value)] + ) + def test_eq( + self, method, operator, value, expected, sut: LineageFilterFieldBoolean + ): _filter = getattr(sut, method)(value) assert _filter.field == sut.field assert _filter.operator == operator @@ -794,7 +857,9 @@ def test_request( assert request.direction == direction assert request.exclude_meanings == exclude_meanings assert request.exclude_classifications == exclude_atlan_tags - assert request.attributes == [field.atlan_field_name for field in includes_on_results] + assert request.attributes == [ + field.atlan_field_name for field in includes_on_results + ] self.validate_filter( filter_=request.entity_filters, filter_condition=FilterList.Condition.AND, @@ -832,7 +897,9 @@ def test_request( assert request.direction == direction assert request.exclude_meanings == exclude_meanings assert request.exclude_classifications == exclude_atlan_tags - assert request.attributes == [field.atlan_field_name for field in includes_on_results] + assert request.attributes == [ + field.atlan_field_name for field in includes_on_results + ] self.validate_filter( filter_=request.entity_filters, filter_condition=FilterList.Condition.OR, @@ -954,7 +1021,9 @@ def test_method_with_valid_parameter(self, method, value, sut: FluentLineage): ), ], ) - def test_method_adds_to_list_valid_parameter(self, method, value, internal_name, sut: FluentLineage): + def test_method_adds_to_list_valid_parameter( + self, method, value, internal_name, sut: FluentLineage + ): lineage = getattr(sut, method)(value) assert lineage is not sut diff --git a/tests/unit/test_model.py b/tests/unit/test_model.py index 162cf6b5d..0c1ede9be 100644 --- a/tests/unit/test_model.py +++ b/tests/unit/test_model.py @@ -273,7 +273,9 @@ "Optional[SourceCostUnitType]": SourceCostUnitType.CREDITS, "Optional[List[PopularityInsights]]": [PopularityInsights()], "Optional[QueryUsernameStrategy]": QueryUsernameStrategy.CONNECTION_USERNAME, - "Optional[List[GoogleLabel]]": [GoogleLabel(google_label_key="", google_label_value="")], + "Optional[List[GoogleLabel]]": [ + GoogleLabel(google_label_key="", google_label_value="") + ], "Optional[List[GoogleTag]]": [GoogleTag(google_tag_key="", google_tag_value="")], "Optional[GoogleDatastudioAssetType]": GoogleDatastudioAssetType.REPORT, "Optional[List[AzureTag]]": [AzureTag(azure_tag_key="", azure_tag_value="")], @@ -635,7 +637,9 @@ def type_def_response(): "displayName": "Table URL", "isDefaultValueNull": False, "indexTypeESConfig": {"normalizer": "atlan_normalizer"}, - "indexTypeESFields": {"text": {"analyzer": "atlan_text_analyzer", "type": "text"}}, + "indexTypeESFields": { + "text": {"analyzer": "atlan_text_analyzer", "type": "text"} + }, }, { "name": "VdRC4dyNdTJHfFjCiNaKt9", @@ -666,7 +670,9 @@ def type_def_response(): "displayName": "Freshness", "isDefaultValueNull": False, "indexTypeESConfig": {"normalizer": "atlan_normalizer"}, - "indexTypeESFields": {"text": {"analyzer": "atlan_text_analyzer", "type": "text"}}, + "indexTypeESFields": { + "text": {"analyzer": "atlan_text_analyzer", "type": "text"} + }, }, { "name": "loYJQi6ycokTirQTGVCHpD", @@ -697,7 +703,9 @@ def type_def_response(): }, "displayName": "Freshness Date", "isDefaultValueNull": False, - "indexTypeESFields": {"date": {"format": "epoch_millis", "type": "date"}}, + "indexTypeESFields": { + "date": {"format": "epoch_millis", "type": "date"} + }, }, ], "displayName": "Monte Carlo", @@ -747,7 +755,9 @@ def type_def_response(): "displayName": "Name", "isDefaultValueNull": False, "indexTypeESConfig": {"normalizer": "atlan_normalizer"}, - "indexTypeESFields": {"text": {"analyzer": "atlan_text_analyzer", "type": "text"}}, + "indexTypeESFields": { + "text": {"analyzer": "atlan_text_analyzer", "type": "text"} + }, } ], "displayName": "Moon", @@ -845,7 +855,9 @@ def attribute_value(request): (asset_type, property_name, (asset_type, property_name)) for asset_type in get_all_subclasses(Asset) for property_name in [ - p for p in dir(asset_type) if isinstance(getattr(asset_type, p) and p != "atlan_tag_names", property) + p + for p in dir(asset_type) + if isinstance(getattr(asset_type, p) and p != "atlan_tag_names", property) ] ], indirect=["attribute_value"], @@ -895,7 +907,9 @@ def test_attributes( ), ], ) -def test_validate_single_required_field_with_bad_values_raises_value_error(names, values, message): +def test_validate_single_required_field_with_bad_values_raises_value_error( + names, values, message +): with pytest.raises(ValueError, match=message): validate_single_required_field(names, values) @@ -970,5 +984,7 @@ def test_tableau_upstream_fields_deserialization(test_data): assert td.upstream_tables == test_data["upstreamTables"] assert td.upstream_datasources == test_data["upstreamDatasources"] - tdf = TableauDatasourceField(**{"typeName": "TableauDatasourceField", "attributes": test_data}) + tdf = TableauDatasourceField( + **{"typeName": "TableauDatasourceField", "attributes": test_data} + ) assert tdf.upstream_tables == test_data["upstreamTables"] diff --git a/tests/unit/test_packages.py b/tests/unit/test_packages.py index 0726cd4e8..7b82c280b 100644 --- a/tests/unit/test_packages.py +++ b/tests/unit/test_packages.py @@ -89,7 +89,9 @@ DATABRICKS_MINER_OFFLINE = "databricks_miner_offline.json" DATABRICKS_MINER_SYSTEM_TABLE = "databricks_miner_system_table.json" DATABRICKS_MINER_POPULARITY_REST = "databricks_miner_popularity_rest.json" -DATABRICKS_MINER_POPULARITY_SYSTEM_TABLE = "databricks_miner_popularity_system_table.json" +DATABRICKS_MINER_POPULARITY_SYSTEM_TABLE = ( + "databricks_miner_popularity_system_table.json" +) ORACLE_CRAWLER_BASIC = "oracle_crawler_basic.json" ORACLE_CRAWLER_OFFLINE = "oracle_crawler_offline.json" LINEAGE_BUILDER_S3 = "lineage_builder_s3.json" @@ -158,7 +160,9 @@ def test_snowflake_package(mock_package_env): .tags(True) .to_workflow() ) - request_json = loads(snowflake_with_connection_default.json(by_alias=True, exclude_none=True)) + request_json = loads( + snowflake_with_connection_default.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(SNOWFLAKE_BASIC) snowflake_basic_auth = ( @@ -191,7 +195,9 @@ def test_snowflake_package(mock_package_env): admin_groups=None, admin_users=None, ) - .account_usage(hostname="test-hostname", database_name="test-db", schema_name="test-schema") + .account_usage( + hostname="test-hostname", database_name="test-db", schema_name="test-schema" + ) .keypair_auth( username="test-user", private_key="test-key", @@ -238,7 +244,9 @@ def test_tableau_package(mock_package_env): admin_groups=None, admin_users=None, ) - .direct(hostname="test.tableau.com", port=444, site="test-site", ssl_enabled=True) + .direct( + hostname="test.tableau.com", port=444, site="test-site", ssl_enabled=True + ) .basic_auth( username="test-username", password="test-password", @@ -270,7 +278,9 @@ def test_tableau_package(mock_package_env): .crawl_hidden_fields(False) .to_workflow() ) - request_json = loads(tableau_access_token_auth.json(by_alias=True, exclude_none=True)) + request_json = loads( + tableau_access_token_auth.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(TABLEAU_ACCESS_TOKEN) tableau_offline = ( @@ -331,7 +341,9 @@ def test_powerbi_package(mock_package_env): .exclude(workspaces=None) .to_workflow() ) - request_json = loads(powerbi_service_principal.json(by_alias=True, exclude_none=True)) + request_json = loads( + powerbi_service_principal.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(POWEBI_SERVICE_PRINCIPAL) @@ -482,13 +494,17 @@ def test_snowflake_miner_package(mock_package_env): .custom_config(config={"test": True, "feature": 1234}) .to_workflow() ) - request_json = loads(snowflake_miner_s3_offline.json(by_alias=True, exclude_none=True)) + request_json = loads( + snowflake_miner_s3_offline.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(SNOWFLAKE_MINER_S3_OFFLINE) def test_databricks_miner_package(mock_package_env): databricks_miner_rest = ( - DatabricksMiner(connection_qualified_name="default/databricks/1234567890").rest_api().to_workflow() + DatabricksMiner(connection_qualified_name="default/databricks/1234567890") + .rest_api() + .to_workflow() ) request_json = loads(databricks_miner_rest.json(by_alias=True, exclude_none=True)) assert request_json == load_json(DATABRICKS_MINER_REST) @@ -498,7 +514,9 @@ def test_databricks_miner_package(mock_package_env): .offline(bucket_name="test-bucket", bucket_prefix="test-prefix") .to_workflow() ) - request_json = loads(databricks_miner_offline.json(by_alias=True, exclude_none=True)) + request_json = loads( + databricks_miner_offline.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(DATABRICKS_MINER_OFFLINE) databricks_miner_system_table = ( @@ -506,7 +524,9 @@ def test_databricks_miner_package(mock_package_env): .system_table(warehouse_id="test-warehouse-id") .to_workflow() ) - request_json = loads(databricks_miner_system_table.json(by_alias=True, exclude_none=True)) + request_json = loads( + databricks_miner_system_table.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(DATABRICKS_MINER_SYSTEM_TABLE) databricks_miner_popularity_rest = ( @@ -519,7 +539,9 @@ def test_databricks_miner_package(mock_package_env): ) .to_workflow() ) - request_json = loads(databricks_miner_popularity_rest.json(by_alias=True, exclude_none=True)) + request_json = loads( + databricks_miner_popularity_rest.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(DATABRICKS_MINER_POPULARITY_REST) databricks_miner_popularity_system_table = ( @@ -534,14 +556,18 @@ def test_databricks_miner_package(mock_package_env): ) .to_workflow() ) - request_json = loads(databricks_miner_popularity_system_table.json(by_alias=True, exclude_none=True)) + request_json = loads( + databricks_miner_popularity_system_table.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(DATABRICKS_MINER_POPULARITY_SYSTEM_TABLE) def test_big_query_package(mock_package_env): big_query_direct = ( - BigQueryCrawler(connection_name="test-big-query-conn", admin_roles=["admin-guid-1234"]) + BigQueryCrawler( + connection_name="test-big-query-conn", admin_roles=["admin-guid-1234"] + ) .service_account_auth( project_id="test-project-id", service_account_json="test-account-json", @@ -559,25 +585,35 @@ def test_big_query_package(mock_package_env): def test_dynamo_db_package(mock_package_env): dynamo_db_direct_iam_user = ( - DynamoDBCrawler(connection_name="test-dynamodb-conn", admin_roles=["admin-guid-1234"]) + DynamoDBCrawler( + connection_name="test-dynamodb-conn", admin_roles=["admin-guid-1234"] + ) .direct(region="test-region") .iam_user_auth(access_key="test-access-key", secret_key="test-secret-key") .include_regex(regex=".*_TEST_INCLUDE") .exclude_regex(regex=".*_TEST_EXCLUDE") .to_workflow() ) - request_json = loads(dynamo_db_direct_iam_user.json(by_alias=True, exclude_none=True)) + request_json = loads( + dynamo_db_direct_iam_user.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(DYNAMO_DB_IAM_USER) dynamo_db_direct_iam_user_role = ( - DynamoDBCrawler(connection_name="test-dynamodb-conn", admin_roles=["admin-guid-1234"]) + DynamoDBCrawler( + connection_name="test-dynamodb-conn", admin_roles=["admin-guid-1234"] + ) .direct(region="test-region") - .iam_role_auth(arn="arn:aws:iam::123456789012:user/test", external_id="test-ext-id") + .iam_role_auth( + arn="arn:aws:iam::123456789012:user/test", external_id="test-ext-id" + ) .include_regex(regex=".*_TEST_INCLUDE") .exclude_regex(regex=".*_TEST_EXCLUDE") .to_workflow() ) - request_json = loads(dynamo_db_direct_iam_user_role.json(by_alias=True, exclude_none=True)) + request_json = loads( + dynamo_db_direct_iam_user_role.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(DYNAMO_DB_IAM_USER_ROLE) @@ -622,7 +658,9 @@ def test_postgres_package(mock_package_env): .to_workflow() ) - request_json = loads(postgres_direct_iam_user.json(by_alias=True, exclude_none=True)) + request_json = loads( + postgres_direct_iam_user.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(POSTGRES_DIRECT_IAM_USER) postgres_direct_iam_role = ( @@ -644,7 +682,9 @@ def test_postgres_package(mock_package_env): .to_workflow() ) - request_json = loads(postgres_direct_iam_role.json(by_alias=True, exclude_none=True)) + request_json = loads( + postgres_direct_iam_role.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(POSTGRES_DIRECT_IAM_ROLE) postgres_s3_offline = ( @@ -696,12 +736,16 @@ def test_mongodb_package(mock_package_env): def test_connection_delete_package(mock_package_env): # With PURGE (hard delete) - connection_delete_hard = ConnectionDelete(qualified_name="default/snowflake/1234567890", purge=True).to_workflow() + connection_delete_hard = ConnectionDelete( + qualified_name="default/snowflake/1234567890", purge=True + ).to_workflow() request_json = loads(connection_delete_hard.json(by_alias=True, exclude_none=True)) assert request_json == load_json(CONNECTION_DELETE_HARD) # Without PURGE (soft delete) - connection_delete_soft = ConnectionDelete(qualified_name="default/snowflake/1234567890", purge=False).to_workflow() + connection_delete_soft = ConnectionDelete( + qualified_name="default/snowflake/1234567890", purge=False + ).to_workflow() request_json = loads(connection_delete_soft.json(by_alias=True, exclude_none=True)) assert request_json == load_json(CONNECTION_DELETE_SOFT) @@ -1008,7 +1052,9 @@ def test_asset_import(mock_package_env): ) ).to_workflow() - request_json_default = loads(asset_import_default.json(by_alias=True, exclude_none=True)) + request_json_default = loads( + asset_import_default.json(by_alias=True, exclude_none=True) + ) assert request_json_default == load_json(ASSET_IMPORT_DEFAULT) @@ -1026,7 +1072,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_s3 = loads(asset_export_basic_glossaries_only_s3.json(by_alias=True, exclude_none=True)) + request_json_s3 = loads( + asset_export_basic_glossaries_only_s3.json(by_alias=True, exclude_none=True) + ) assert request_json_s3 == load_json(ASSET_EXPORT_BASIC_GLOSSARIES_ONLY_S3) # Case 2: Export assets with Products only using s3 @@ -1042,7 +1090,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_s3 = loads(asset_export_basic_products_only_s3.json(by_alias=True, exclude_none=True)) + request_json_s3 = loads( + asset_export_basic_products_only_s3.json(by_alias=True, exclude_none=True) + ) assert request_json_s3 == load_json(ASSET_EXPORT_BASIC_PRODUCTS_ONLY_S3) # Case 3: Export assets with Enriched only using s3 @@ -1064,7 +1114,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_s3 = loads(asset_export_basic_enriched_only_s3.json(by_alias=True, exclude_none=True)) + request_json_s3 = loads( + asset_export_basic_enriched_only_s3.json(by_alias=True, exclude_none=True) + ) assert request_json_s3 == load_json(ASSET_EXPORT_BASIC_ENRICHED_ONLY_S3) # Case 4: Export all assets using s3 @@ -1086,7 +1138,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_s3 = loads(asset_export_basic_all_assets_s3.json(by_alias=True, exclude_none=True)) + request_json_s3 = loads( + asset_export_basic_all_assets_s3.json(by_alias=True, exclude_none=True) + ) assert request_json_s3 == load_json(ASSET_EXPORT_BASIC_ALL_ASSETS_S3) # Case 1: Export assets with glossaries only using adls @@ -1103,7 +1157,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_adls = loads(asset_export_basic_glossaries_only_adls.json(by_alias=True, exclude_none=True)) + request_json_adls = loads( + asset_export_basic_glossaries_only_adls.json(by_alias=True, exclude_none=True) + ) assert request_json_adls == load_json(ASSET_EXPORT_BASIC_GLOSSARIES_ONLY_ADLS) # Case 2: Export assets with Products only using adls @@ -1120,7 +1176,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_adls = loads(asset_export_basic_products_only_adls.json(by_alias=True, exclude_none=True)) + request_json_adls = loads( + asset_export_basic_products_only_adls.json(by_alias=True, exclude_none=True) + ) assert request_json_adls == load_json(ASSET_EXPORT_BASIC_PRODUCTS_ONLY_ADLS) # Case 3: Export assets with Enriched only using adls @@ -1143,7 +1201,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_adls = loads(asset_export_basic_enriched_only_adls.json(by_alias=True, exclude_none=True)) + request_json_adls = loads( + asset_export_basic_enriched_only_adls.json(by_alias=True, exclude_none=True) + ) assert request_json_adls == load_json(ASSET_EXPORT_BASIC_ENRICHED_ONLY_ADLS) # Case 4: Export all assets using adls @@ -1166,7 +1226,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_adls = loads(asset_export_basic_all_assets_adls.json(by_alias=True, exclude_none=True)) + request_json_adls = loads( + asset_export_basic_all_assets_adls.json(by_alias=True, exclude_none=True) + ) assert request_json_adls == load_json(ASSET_EXPORT_BASIC_ALL_ASSETS_ADLS) # Case 1: Export assets with glossaries only using gcs @@ -1181,7 +1243,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_gcs = loads(asset_export_basic_glossaries_only_gcs.json(by_alias=True, exclude_none=True)) + request_json_gcs = loads( + asset_export_basic_glossaries_only_gcs.json(by_alias=True, exclude_none=True) + ) assert request_json_gcs == load_json(ASSET_EXPORT_BASIC_GLOSSARIES_ONLY_GCS) # Case 2: Export assets with Products only using gcs @@ -1196,7 +1260,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_gcs = loads(asset_export_basic_products_only_gcs.json(by_alias=True, exclude_none=True)) + request_json_gcs = loads( + asset_export_basic_products_only_gcs.json(by_alias=True, exclude_none=True) + ) assert request_json_gcs == load_json(ASSET_EXPORT_BASIC_PRODUCTS_ONLY_GCS) # Case 3: Export assets with Enriched only using adls @@ -1217,7 +1283,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_gcs = loads(asset_export_basic_enriched_only_gcs.json(by_alias=True, exclude_none=True)) + request_json_gcs = loads( + asset_export_basic_enriched_only_gcs.json(by_alias=True, exclude_none=True) + ) assert request_json_gcs == load_json(ASSET_EXPORT_BASIC_ENRICHED_ONLY_GCS) # Case 4: Export all assets using adls @@ -1238,7 +1306,9 @@ def test_asset_export_basic(mock_package_env): ) ).to_workflow() - request_json_gcs = loads(asset_export_basic_all_assets_gcs.json(by_alias=True, exclude_none=True)) + request_json_gcs = loads( + asset_export_basic_all_assets_gcs.json(by_alias=True, exclude_none=True) + ) assert request_json_gcs == load_json(ASSET_EXPORT_BASIC_ALL_ASSETS_GCS) @@ -1268,7 +1338,9 @@ def test_relational_assets_builder(mock_package_env): ) ).to_workflow() - request_json_s3 = loads(relational_assets_builder_s3.json(by_alias=True, exclude_none=True)) + request_json_s3 = loads( + relational_assets_builder_s3.json(by_alias=True, exclude_none=True) + ) assert request_json_s3 == load_json(RELATIONAL_ASSETS_BUILDER_S3) # Case 2: Build/Update relational assets from adls with advanced configuration @@ -1298,7 +1370,9 @@ def test_relational_assets_builder(mock_package_env): ) ).to_workflow() - request_json_adls = loads(relational_assets_builder_adls.json(by_alias=True, exclude_none=True)) + request_json_adls = loads( + relational_assets_builder_adls.json(by_alias=True, exclude_none=True) + ) assert request_json_adls == load_json(RELATIONAL_ASSETS_BUILDER_ADLS) # Case 3: Build/Update relational assets from gcs with advanced configuration @@ -1326,7 +1400,9 @@ def test_relational_assets_builder(mock_package_env): ) ).to_workflow() - request_json_gcs = loads(relational_assets_builder_gcs.json(by_alias=True, exclude_none=True)) + request_json_gcs = loads( + relational_assets_builder_gcs.json(by_alias=True, exclude_none=True) + ) assert request_json_gcs == load_json(RELATIONAL_ASSETS_BUILDER_GCS) @@ -1444,7 +1520,9 @@ def test_lineage_generator_nt(mock_package_env): ) ).to_workflow() - request_json = loads(lineage_generator_default.json(by_alias=True, exclude_none=True)) + request_json = loads( + lineage_generator_default.json(by_alias=True, exclude_none=True) + ) assert request_json == load_json(LINEAGE_GENERATOR_DEFAULT) lineage_generator_full = ( @@ -1500,7 +1578,9 @@ def test_api_token_connection_admin(mock_package_env): {"abc": NonSerializable()}, ], ) -def test_wrong_hierarchical_filter_raises_invalid_req_err(test_assets, mock_package_env): +def test_wrong_hierarchical_filter_raises_invalid_req_err( + test_assets, mock_package_env +): with pytest.raises( InvalidRequestError, match=INVALID_REQ_ERROR, @@ -1534,7 +1614,9 @@ def test_wrong_flat_filter_raises_invalid_req_err(test_projects, mock_package_en "test_assets", [NonSerializable(), [NonSerializable()]], ) -def test_wrong_glue_package_filter_raises_invalid_req_err(test_assets, mock_package_env): +def test_wrong_glue_package_filter_raises_invalid_req_err( + test_assets, mock_package_env +): with pytest.raises( InvalidRequestError, match=INVALID_REQ_ERROR, diff --git a/tests/unit/test_query_client.py b/tests/unit/test_query_client.py index a4e780ca2..96c442bb5 100644 --- a/tests/unit/test_query_client.py +++ b/tests/unit/test_query_client.py @@ -27,7 +27,9 @@ def client(): @pytest.fixture() def query_request() -> QueryRequest: - return QueryRequest(sql="test-sql", data_source_name="test-ds-name", default_schema="test-schema") + return QueryRequest( + sql="test-sql", data_source_name="test-ds-name", default_schema="test-schema" + ) @pytest.fixture() @@ -62,7 +64,9 @@ def test_init_when_wrong_class_raises_exception(test_api_caller): "test_request, error_msg", [[None, "none is not an allowed value"], ["123", "value is not a valid dict"]], ) -def test_query_stream_wrong_params_raises_validation_error(test_request, error_msg, client: AtlanClient): +def test_query_stream_wrong_params_raises_validation_error( + test_request, error_msg, client: AtlanClient +): with pytest.raises(ValidationError) as err: client.queries.stream(request=test_request) assert error_msg in str(err.value) diff --git a/tests/unit/test_search_log_search.py b/tests/unit/test_search_log_search.py index e03137edb..76a6e92db 100644 --- a/tests/unit/test_search_log_search.py +++ b/tests/unit/test_search_log_search.py @@ -42,7 +42,9 @@ def _assert_search_log_results(results, response_json, sorts, bulk=False): assert log.user_agent == response_json["logs"][0]["userAgent"] assert log.ip_address == response_json["logs"][0]["ipAddress"] assert log.host == response_json["logs"][0]["host"] - expected_timestamp = datetime.fromtimestamp(response_json["logs"][0]["timestamp"] / 1000, tz=timezone.utc) + expected_timestamp = datetime.fromtimestamp( + response_json["logs"][0]["timestamp"] / 1000, tz=timezone.utc + ) assert log.timestamp == expected_timestamp assert log.entity_guids_all == response_json["logs"][0]["entityGuidsAll"] @@ -92,7 +94,10 @@ def test_search_log_pagination(mock_logger, mock_api_caller, search_logs_json): # to verify if the results are empty assert mock_api_caller._call_api.call_count == 2 assert mock_logger.call_count == 1 - assert "Search log bulk search option is enabled." in mock_logger.call_args_list[0][0][0] + assert ( + "Search log bulk search option is enabled." + in mock_logger.call_args_list[0][0][0] + ) mock_logger.reset_mock() mock_api_caller.reset_mock() @@ -112,10 +117,15 @@ def test_search_log_pagination(mock_logger, mock_api_caller, search_logs_json): exclude_users=["atlansupport"], ) response = client.search(criteria=search_log_request) - _assert_search_log_results(response, search_logs_json, expected_sorts, bulk=False) + _assert_search_log_results( + response, search_logs_json, expected_sorts, bulk=False + ) assert mock_logger.call_count == 1 assert mock_api_caller._call_api.call_count == 3 - assert "Result size (%s) exceeds threshold (%s)" in mock_logger.call_args_list[0][0][0] + assert ( + "Result size (%s) exceeds threshold (%s)" + in mock_logger.call_args_list[0][0][0] + ) # Test exception for bulk=False with user-defined sorting and results exceeding the threshold search_log_request = SearchLogRequest.views_by_guid( diff --git a/tests/unit/test_search_model.py b/tests/unit/test_search_model.py index adcf3023b..1c9b9908c 100644 --- a/tests/unit/test_search_model.py +++ b/tests/unit/test_search_model.py @@ -242,7 +242,9 @@ def test_term_to_dict(parameters, expected): ), ], ) -def test_bool_to_dict_without_optional_fields(must, should, must_not, filter, boost, minimum_should_match, expected): +def test_bool_to_dict_without_optional_fields( + must, should, must_not, filter, boost, minimum_should_match, expected +): assert ( Bool( must=must, @@ -282,7 +284,8 @@ def test_index_search_request(): ) request = IndexSearchRequest(dsl=dsl, attributes=["schemaName", "databaseName"]) assert ( - request.json(by_alias=True, exclude_none=True) == '{"attributes": ["schemaName", "databaseName"],' + request.json(by_alias=True, exclude_none=True) + == '{"attributes": ["schemaName", "databaseName"],' ' "dsl": {"from": 0, "size": 300, "aggregations": {}, "track_total_hits": true, ' '"post_filter": {"term": {"databaseName.keyword": ' '{"value": "ATLAN_SAMPLE_DATA"}}}, "query": {"term": {"__typeName.keyword": {"value": "Schema"}}}, ' @@ -298,7 +301,8 @@ def test_audit_search_request(): ) request = AuditSearchRequest(dsl=dsl, attributes=["schemaName", "databaseName"]) assert ( - request.json(by_alias=True, exclude_none=True) == '{"attributes": ["schemaName", "databaseName"],' + request.json(by_alias=True, exclude_none=True) + == '{"attributes": ["schemaName", "databaseName"],' ' "dsl": {"from": 0, "size": 300, "aggregations": {}, "track_total_hits": true, ' '"post_filter": {"term": {"databaseName.keyword": ' '{"value": "ATLAN_SAMPLE_DATA"}}}, "query": {"term": {"__typeName.keyword": {"value": "Schema"}}}, ' @@ -313,7 +317,8 @@ def test_search_log_request(): ) request = SearchLogRequest(dsl=dsl, attributes=["schemaName", "databaseName"]) assert ( - request.json(by_alias=True, exclude_none=True) == '{"attributes": ["schemaName", "databaseName"],' + request.json(by_alias=True, exclude_none=True) + == '{"attributes": ["schemaName", "databaseName"],' ' "dsl": {"from": 0, "size": 300, "aggregations": {}, "track_total_hits": true, ' '"post_filter": {"term": {"databaseName.keyword": ' '{"value": "ATLAN_SAMPLE_DATA"}}}, "query": {"term": {"__typeName.keyword": {"value": "Schema"}}}, ' @@ -411,20 +416,26 @@ def test_match_none_plus_other_is_match_none(): def test_match_one_or_other_is_other(): - assert MatchNone() | Term(field="name", value="bob") == Term(field="name", value="bob") + assert MatchNone() | Term(field="name", value="bob") == Term( + field="name", value="bob" + ) def test_nagate_match_one_is_match_all(): assert ~MatchNone() == MatchAll() -@pytest.mark.parametrize("boost, expected", [(None, {"match_all": {}}), (1.2, {"match_all": {"boost": 1.2}})]) +@pytest.mark.parametrize( + "boost, expected", [(None, {"match_all": {}}), (1.2, {"match_all": {"boost": 1.2}})] +) def test_match_all_to_dict(boost, expected): assert MatchAll(boost=boost).to_dict() == expected def test_match_all_and_other_is_other(): - assert MatchAll() & Term(field="name", value="bob") == Term(field="name", value="bob") + assert MatchAll() & Term(field="name", value="bob") == Term( + field="name", value="bob" + ) def test_match_all_or_other_is_match_all(): @@ -535,7 +546,9 @@ def with_name(request): def test_terms_to_dict(): - assert Terms(field="name", values=["john", "dave"]).to_dict() == {"terms": {"name": ["john", "dave"]}} + assert Terms(field="name", values=["john", "dave"]).to_dict() == { + "terms": {"name": ["john", "dave"]} + } @pytest.mark.parametrize( @@ -553,7 +566,9 @@ def test_terms_to_dict(): ], indirect=["with_name"], ) -def test_by_methods_on_term_prefix_regexp_wildcard(a_class, with_name, value, field, incompatable): +def test_by_methods_on_term_prefix_regexp_wildcard( + a_class, with_name, value, field, incompatable +): if incompatable: assert not hasattr(a_class, with_name) else: @@ -564,7 +579,9 @@ def test_by_methods_on_term_prefix_regexp_wildcard(a_class, with_name, value, fi assert t.value == value -@pytest.mark.parametrize("with_name, field", [(a, a.value) for a in TermAttributes], indirect=["with_name"]) +@pytest.mark.parametrize( + "with_name, field", [(a, a.value) for a in TermAttributes], indirect=["with_name"] +) def test_by_methods_on_exists(with_name, field): assert hasattr(Exists, with_name) t = getattr(Exists, with_name)() @@ -795,7 +812,11 @@ def test_sort_item_to_dict(field, order, expected): None, None, None, - {"fuzzy": {"user": {"value": "ki", "fuzziness": "AUTO", "max_expansions": 3}}}, + { + "fuzzy": { + "user": {"value": "ki", "fuzziness": "AUTO", "max_expansions": 3} + } + }, ), ( "user", @@ -1456,13 +1477,17 @@ def test_with_active_glossary(): ), ], ) -def test_with_active_category_when_invalid_parameter_raises_value_error(name, glossary_qualified_name, message): +def test_with_active_category_when_invalid_parameter_raises_value_error( + name, glossary_qualified_name, message +): with pytest.raises(ValueError, match=message): with_active_category(name=name, glossary_qualified_name=glossary_qualified_name) def test_with_active_category(): - sut = with_active_category(name=GLOSSARY_CATEGORY_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME) + sut = with_active_category( + name=GLOSSARY_CATEGORY_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME + ) assert sut.filter assert 4 == len(sut.filter) @@ -1506,13 +1531,17 @@ def test_with_active_category(): ), ], ) -def test_with_active_term_when_invalid_parameter_raises_value_error(name, glossary_qualified_name, message): +def test_with_active_term_when_invalid_parameter_raises_value_error( + name, glossary_qualified_name, message +): with pytest.raises(ValueError, match=message): with_active_term(name=name, glossary_qualified_name=glossary_qualified_name) def test_with_active_term(): - sut = with_active_term(name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME) + sut = with_active_term( + name=GLOSSARY_TERM_NAME, glossary_qualified_name=GLOSSARY_QUALIFIED_NAME + ) assert sut.filter assert 4 == len(sut.filter) diff --git a/tests/unit/test_source_cache.py b/tests/unit/test_source_cache.py index d61bd905f..c46b89584 100644 --- a/tests/unit/test_source_cache.py +++ b/tests/unit/test_source_cache.py @@ -22,7 +22,9 @@ def test_get_by_guid_with_not_found_error(monkeypatch): @patch.object(SourceTagCache, "lookup_by_guid") -@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) +@patch.object( + SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) +) def test_get_by_guid_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_guid): test_guid = "test-guid-123" with pytest.raises( @@ -39,13 +41,19 @@ def test_get_by_qualified_name_with_not_found_error(monkeypatch): @patch.object(SourceTagCache, "lookup_by_qualified_name") -@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) -def test_get_by_qualified_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_qualified_name): +@patch.object( + SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) +) +def test_get_by_qualified_name_with_no_invalid_request_error( + mock_get_cache, mock_lookup_by_qualified_name +): test_qn = "default/snowflake/123456789" test_connector = "snowflake" with pytest.raises( NotFoundError, - match=ErrorCode.ASSET_NOT_FOUND_BY_QN.error_message.format(test_qn, test_connector), + match=ErrorCode.ASSET_NOT_FOUND_BY_QN.error_message.format( + test_qn, test_connector + ), ): SourceTagCache.get_by_qualified_name(test_qn) mock_get_cache.assert_called_once() @@ -57,7 +65,9 @@ def test_get_by_name_with_not_found_error(monkeypatch): @patch.object(SourceTagCache, "lookup_by_name") -@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) +@patch.object( + SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) +) def test_get_by_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_by_name): test_name = SourceTagName("snowflake/test@@DB/SCHEMA/TEST_TAG") with pytest.raises( @@ -72,7 +82,9 @@ def test_get_by_name_with_no_invalid_request_error(mock_get_cache, mock_lookup_b @patch.object(SourceTagCache, "lookup_by_guid") -@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) +@patch.object( + SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) +) def test_get_by_guid(mock_get_cache, mock_lookup_by_guid): test_guid = "test-guid-123" test_qn = "test-qualified-name" @@ -123,7 +135,9 @@ def test_get_by_guid(mock_get_cache, mock_lookup_by_guid): @patch.object(SourceTagCache, "lookup_by_guid") @patch.object(SourceTagCache, "lookup_by_qualified_name") -@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) +@patch.object( + SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) +) def test_get_by_qualified_name(mock_get_cache, mock_lookup_by_qn, mock_lookup_by_guid): test_guid = "test-guid-123" test_qn = "test-qualified-name" @@ -181,7 +195,9 @@ def test_get_by_qualified_name(mock_get_cache, mock_lookup_by_qn, mock_lookup_by @patch.object(SourceTagCache, "lookup_by_guid") @patch.object(SourceTagCache, "lookup_by_name") -@patch.object(SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient())) +@patch.object( + SourceTagCache, "get_cache", return_value=SourceTagCache(client=AtlanClient()) +) def test_get_by_name(mock_get_cache, mock_lookup_by_name, mock_lookup_by_guid): test_name = SourceTagName("snowflake/test@@DB/SCHEMA/TEST_TAG") test_guid = "test-guid-123" diff --git a/tests/unit/test_sso_client.py b/tests/unit/test_sso_client.py index f08133286..9d6862ca3 100644 --- a/tests/unit/test_sso_client.py +++ b/tests/unit/test_sso_client.py @@ -81,7 +81,9 @@ def test_init_when_wrong_class_raises_exception(test_api_caller): ["azure", [123], "group_map_id\n str type expected"], ], ) -def test_sso_get_group_mapping_wrong_params_raises_validation_error(sso_alias, group_map_id, error_msg): +def test_sso_get_group_mapping_wrong_params_raises_validation_error( + sso_alias, group_map_id, error_msg +): with pytest.raises(ValidationError) as err: SSOClient.get_group_mapping(sso_alias=sso_alias, group_map_id=group_map_id) assert error_msg in str(err.value) @@ -94,7 +96,9 @@ def test_sso_get_group_mapping_wrong_params_raises_validation_error(sso_alias, g [[123], "so_alias\n str type expected"], ], ) -def test_sso_get_all_group_mapping_wrong_params_raises_validation_error(sso_alias, error_msg): +def test_sso_get_all_group_mapping_wrong_params_raises_validation_error( + sso_alias, error_msg +): with pytest.raises(ValidationError, match=error_msg): SSOClient.get_all_group_mappings(sso_alias=sso_alias) @@ -114,7 +118,9 @@ def test_sso_create_group_mapping_wrong_params_raises_validation_error( sso_alias, atlan_group, sso_group_name, error_msg ): with pytest.raises(ValidationError, match=error_msg): - SSOClient.create_group_mapping(sso_alias=sso_alias, atlan_group=atlan_group, sso_group_name=sso_group_name) + SSOClient.create_group_mapping( + sso_alias=sso_alias, atlan_group=atlan_group, sso_group_name=sso_group_name + ) @pytest.mark.parametrize( @@ -170,7 +176,9 @@ def test_sso_update_group_mapping_wrong_params_raises_validation_error( ["azure", [123], "group_map_id\n str type expected"], ], ) -def test_sso_delete_group_mapping_wrong_params_raises_validation_error(sso_alias, group_map_id, error_msg): +def test_sso_delete_group_mapping_wrong_params_raises_validation_error( + sso_alias, group_map_id, error_msg +): with pytest.raises(ValidationError, match=error_msg): SSOClient.delete_group_mapping(sso_alias=sso_alias, group_map_id=group_map_id) @@ -227,7 +235,9 @@ def test_sso_create_group_mapping_invalid_request_error( mock_api_caller.reset_mock() -def test_sso_create_group_mapping(mock_api_caller, get_all_group_mapping_json, create_group_mapping_json): +def test_sso_create_group_mapping( + mock_api_caller, get_all_group_mapping_json, create_group_mapping_json +): mock_api_caller._call_api.side_effect = [ get_all_group_mapping_json, create_group_mapping_json, diff --git a/tests/unit/test_structs.py b/tests/unit/test_structs.py index aafebdc0f..ce9948600 100644 --- a/tests/unit/test_structs.py +++ b/tests/unit/test_structs.py @@ -40,7 +40,9 @@ def mc_monitor_response_json(): return load_json(STRUCT_RESPONSES_DIR, MC_MONITOR_JSON) -def test_structs_flatten_attributes(client, mock_custom_metadata_cache, mc_monitor_response_json): +def test_structs_flatten_attributes( + client, mock_custom_metadata_cache, mc_monitor_response_json +): asset_response = {"referredEntities": {}, "entity": mc_monitor_response_json} mc_monitor_model = MCMonitor(**mc_monitor_response_json) mc_monitor_asset_response = AssetResponse[MCMonitor](**asset_response).entity diff --git a/tests/unit/test_task_client.py b/tests/unit/test_task_client.py index 4e2e725bf..7172513db 100644 --- a/tests/unit/test_task_client.py +++ b/tests/unit/test_task_client.py @@ -43,7 +43,12 @@ def mock_api_caller(): @pytest.fixture() def task_search_request() -> TaskSearchRequest: - return FluentTasks().page_size(1).where(AtlanTask.STATUS.match(AtlanTaskStatus.COMPLETE.value)).to_request() + return ( + FluentTasks() + .page_size(1) + .where(AtlanTask.STATUS.match(AtlanTaskStatus.COMPLETE.value)) + .to_request() + ) @pytest.fixture() @@ -85,7 +90,9 @@ def test_fluent_tasks_invalid_client_raises_invalid_request_error( ): client_method = getattr(FluentTasks(), test_method) for invalid_client in test_client: - with pytest.raises(InvalidRequestError, match="No Atlan client has been provided."): + with pytest.raises( + InvalidRequestError, match="No Atlan client has been provided." + ): client_method(client=invalid_client) diff --git a/tests/unit/test_typedef_model.py b/tests/unit/test_typedef_model.py index 440e45b3d..9423845ae 100644 --- a/tests/unit/test_typedef_model.py +++ b/tests/unit/test_typedef_model.py @@ -139,7 +139,9 @@ def test_enum_defs(self, type_defs): ["my_enum", None, "values is required"], ], ) - def test_enum_create_method_required_parameters(self, test_name, test_values, error_msg): + def test_enum_create_method_required_parameters( + self, test_name, test_values, error_msg + ): with pytest.raises(ValueError) as err: EnumDef.create(name=test_name, values=test_values) assert error_msg in str(err.value) @@ -175,7 +177,9 @@ def test_update_method(self, client, mock_get_enum_cache): } mock_get_by_name = Mock(return_value=EnumDef(**existing_enum)) mock_get_enum_cache.return_value._get_by_name = mock_get_by_name - enum = EnumDef.update(name="test-enum", values=["test-val1", "test-val2"], replace_existing=False) + enum = EnumDef.update( + name="test-enum", values=["test-val1", "test-val2"], replace_existing=False + ) assert enum assert enum.name == "test-enum" assert enum.category == AtlanTypeCategory.ENUM @@ -196,7 +200,9 @@ def test_update_method(self, client, mock_get_enum_cache): } mock_get_by_name = Mock(return_value=EnumDef(**existing_enum)) mock_get_enum_cache.return_value._get_by_name = mock_get_by_name - enum = EnumDef.update(name="test-enum", values=["test-val1", "test-val2"], replace_existing=False) + enum = EnumDef.update( + name="test-enum", values=["test-val1", "test-val2"], replace_existing=False + ) assert enum assert enum.name == "test-enum" assert enum.category == AtlanTypeCategory.ENUM @@ -350,7 +356,9 @@ def sut(self) -> AttributeDef: (APPLICABLE_ENTITY_TYPES, {"Asset"}), ], ) - def test_applicable_types_with_no_options_raises_invalid_request_error(self, attribute, value, sut: AttributeDef): + def test_applicable_types_with_no_options_raises_invalid_request_error( + self, attribute, value, sut: AttributeDef + ): sut = AttributeDef() # Explicitly setting "None" since options # are now initialized with a default factory @@ -385,7 +393,9 @@ def test_applicable_types_with_invalid_type_raises_invalid_request_error( (APPLICABLE_DOMAINS, {"default/domain/uuBI8WSqeom1PXs7oo20L/super"}), ], ) - def test_applicable_types_with_valid_value(self, attribute, value, sut: AttributeDef): + def test_applicable_types_with_valid_value( + self, attribute, value, sut: AttributeDef + ): setattr(sut, attribute, value) assert getattr(sut, attribute) == value options = sut.options @@ -416,5 +426,9 @@ def test_attribute_create_with_limited_applicability(self): assert attribute_def_with_limited.options options = attribute_def_with_limited.options for attribute in applicable_kwargs.keys(): - assert getattr(attribute_def_with_limited, attribute) == applicable_kwargs.get(attribute) - assert getattr(options, attribute) == json.dumps(list(applicable_kwargs.get(attribute))) + assert getattr( + attribute_def_with_limited, attribute + ) == applicable_kwargs.get(attribute) + assert getattr(options, attribute) == json.dumps( + list(applicable_kwargs.get(attribute)) + ) diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 58090d23c..d90b079af 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -33,7 +33,9 @@ def test_list_attributes_to_params_with_query_parms(): (None, None, None), ( None, - {"qualifiedName": "default/glue/1688357913/AwsDataCatalog/development_published_impact/holding_rating"}, + { + "qualifiedName": "default/glue/1688357913/AwsDataCatalog/development_published_impact/holding_rating" + }, None, ), (["ihnLo19fqaT4x9pU8JKWbQ.Cyw6GbqST9M1dhXIBE1yHp"], None, None), @@ -75,7 +77,9 @@ def test_list_attributes_to_params_with_query_parms(): ], ) def test_unflatten_custom_metadata(attributes, flattened_attributes, custom_metadata): - assert custom_metadata == unflatten_custom_metadata(attributes=attributes, asset_attributes=flattened_attributes) + assert custom_metadata == unflatten_custom_metadata( + attributes=attributes, asset_attributes=flattened_attributes + ) @patch("pyatlan.utils.unflatten_custom_metadata") diff --git a/tests/unit/test_workflow_client.py b/tests/unit/test_workflow_client.py index db973d496..54a78eaf0 100644 --- a/tests/unit/test_workflow_client.py +++ b/tests/unit/test_workflow_client.py @@ -267,29 +267,45 @@ def test_find_by_type(client: WorkflowClient, mock_api_caller): assert client.find_by_type(prefix=WorkflowPackage.FIVETRAN) == [] mock_api_caller._call_api.assert_called_once() assert mock_api_caller._call_api.call_args.args[0] == WORKFLOW_INDEX_SEARCH - assert isinstance(mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest) + assert isinstance( + mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest + ) -def test_find_by_id(client: WorkflowClient, search_response: WorkflowSearchResponse, mock_api_caller): +def test_find_by_id( + client: WorkflowClient, search_response: WorkflowSearchResponse, mock_api_caller +): raw_json = search_response.dict() mock_api_caller._call_api.return_value = raw_json assert search_response.hits and search_response.hits.hits - assert client.find_by_id(id="atlan-snowflake-miner-1714638976") == search_response.hits.hits[0] + assert ( + client.find_by_id(id="atlan-snowflake-miner-1714638976") + == search_response.hits.hits[0] + ) mock_api_caller._call_api.assert_called_once() assert mock_api_caller._call_api.call_args.args[0] == WORKFLOW_INDEX_SEARCH - assert isinstance(mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest) + assert isinstance( + mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest + ) -def test_find_run_by_id(client: WorkflowClient, search_response: WorkflowSearchResponse, mock_api_caller): +def test_find_run_by_id( + client: WorkflowClient, search_response: WorkflowSearchResponse, mock_api_caller +): raw_json = search_response.dict() mock_api_caller._call_api.return_value = raw_json assert search_response and search_response.hits and search_response.hits.hits - assert client.find_run_by_id(id="atlan-snowflake-miner-1714638976-mzdza") == search_response.hits.hits[0] + assert ( + client.find_run_by_id(id="atlan-snowflake-miner-1714638976-mzdza") + == search_response.hits.hits[0] + ) mock_api_caller._call_api.assert_called_once() assert mock_api_caller._call_api.call_args.args[0] == WORKFLOW_INDEX_RUN_SEARCH - assert isinstance(mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest) + assert isinstance( + mock_api_caller._call_api.call_args.kwargs["request_obj"], WorkflowSearchRequest + ) def test_re_run_when_given_workflowpackage_with_no_prior_runs_raises_invalid_request_error( @@ -359,7 +375,10 @@ def test_re_run_when_given_workflowpackage_with_idempotent( search_response.dict(), ] - assert client.rerun(WorkflowPackage.FIVETRAN, idempotent=True) == rerun_response_with_idempotent + assert ( + client.rerun(WorkflowPackage.FIVETRAN, idempotent=True) + == rerun_response_with_idempotent + ) assert mock_api_caller._call_api.call_count == 2 mock_api_caller.reset_mock() @@ -374,7 +393,10 @@ def test_re_run_when_given_workflowsearchresultdetail_with_idempotent( ): mock_api_caller._call_api.return_value = search_response.dict() - assert client.rerun(workflow=search_result_detail, idempotent=True) == rerun_response_with_idempotent + assert ( + client.rerun(workflow=search_result_detail, idempotent=True) + == rerun_response_with_idempotent + ) assert mock_api_caller._call_api.call_count == 1 mock_api_caller.reset_mock() @@ -389,7 +411,10 @@ def test_re_run_when_given_workflowsearchresult_with_idempotent( ): mock_api_caller._call_api.return_value = search_response.dict() - assert client.rerun(workflow=search_result, idempotent=True) == rerun_response_with_idempotent + assert ( + client.rerun(workflow=search_result, idempotent=True) + == rerun_response_with_idempotent + ) assert mock_api_caller._call_api.call_count == 1 mock_api_caller.reset_mock() @@ -404,7 +429,9 @@ def test_run_when_given_workflow( Workflow( metadata=WorkflowMetadata(name="name", namespace="namespace"), spec=WorkflowSpec(), - payload=[PackageParameter(parameter="test-param", type="test-type", body={})], + payload=[ + PackageParameter(parameter="test-param", type="test-type", body={}) + ], ) # type: ignore[call-arg] ) assert response == workflow_response @@ -442,7 +469,9 @@ def test_run_when_given_workflow_with_schedule( Workflow( metadata=WorkflowMetadata(name="name", namespace="namespace"), spec=WorkflowSpec(), - payload=[PackageParameter(parameter="test-param", type="test-type", body={})], + payload=[ + PackageParameter(parameter="test-param", type="test-type", body={}) + ], ), # type: ignore[call-arg] workflow_schedule=schedule, ) @@ -545,7 +574,9 @@ def test_workflow_add_schedule( mock_api_caller._call_api.side_effect = [ workflow_response.dict(), ] - response = client.add_schedule(workflow=workflow_response, workflow_schedule=schedule) + response = client.add_schedule( + workflow=workflow_response, workflow_schedule=schedule + ) assert mock_api_caller._call_api.call_count == 1 assert response == WorkflowResponse(**workflow_response.dict()) @@ -556,7 +587,9 @@ def test_workflow_add_schedule( search_response.dict(), workflow_response.dict(), ] - response = client.add_schedule(workflow=WorkflowPackage.FIVETRAN, workflow_schedule=schedule) + response = client.add_schedule( + workflow=WorkflowPackage.FIVETRAN, workflow_schedule=schedule + ) assert mock_api_caller._call_api.call_count == 2 assert response == WorkflowResponse(**workflow_response.dict()) @@ -583,9 +616,16 @@ def test_workflow_find_schedule_query_between( ) assert mock_api_caller._call_api.call_count == 1 - assert response and len(response) == 1 and response[0] == WorkflowRunResponse(**workflow_run_response.dict()) + assert ( + response + and len(response) == 1 + and response[0] == WorkflowRunResponse(**workflow_run_response.dict()) + ) # Ensure it is called by the correct API endpoint - assert mock_api_caller._call_api.call_args[0][0].path == SCHEDULE_QUERY_WORKFLOWS_SEARCH.path + assert ( + mock_api_caller._call_api.call_args[0][0].path + == SCHEDULE_QUERY_WORKFLOWS_SEARCH.path + ) mock_api_caller.reset_mock() # Missed schedule query workflows @@ -600,8 +640,15 @@ def test_workflow_find_schedule_query_between( assert mock_api_caller._call_api.call_count == 1 # Ensure it is called by the correct API endpoint - assert mock_api_caller._call_api.call_args[0][0].path == SCHEDULE_QUERY_WORKFLOWS_MISSED.path - assert response and len(response) == 1 and response[0] == WorkflowRunResponse(**workflow_run_response.dict()) + assert ( + mock_api_caller._call_api.call_args[0][0].path + == SCHEDULE_QUERY_WORKFLOWS_MISSED.path + ) + assert ( + response + and len(response) == 1 + and response[0] == WorkflowRunResponse(**workflow_run_response.dict()) + ) mock_api_caller.reset_mock() # None response @@ -625,7 +672,9 @@ def test_workflow_find_schedule_query( search_result: WorkflowSearchResult, ): mock_api_caller._call_api.return_value = search_response.dict() - response = client.find_schedule_query(saved_query_id="test-query-id", max_results=50) + response = client.find_schedule_query( + saved_query_id="test-query-id", max_results=50 + ) assert len(response) == 1 assert mock_api_caller._call_api.call_count == 1 From 067c1174c077beef0585d0e3f58109eb88e29a9c Mon Sep 17 00:00:00 2001 From: Aryamanz29 Date: Tue, 25 Feb 2025 01:30:14 +0530 Subject: [PATCH 10/10] [ci] Removed coverage jobs --- .github/workflows/pyatlan-pr.yaml | 77 +++++-------------------------- 1 file changed, 11 insertions(+), 66 deletions(-) diff --git a/.github/workflows/pyatlan-pr.yaml b/.github/workflows/pyatlan-pr.yaml index 49dd38a71..c527986eb 100644 --- a/.github/workflows/pyatlan-pr.yaml +++ b/.github/workflows/pyatlan-pr.yaml @@ -60,22 +60,16 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - - name: QA checks (ruff-formatter, ruff-linter, mypy) - run: ./qa-checks + - name: QA checks (ruff-format, ruff-lint, mypy) + run: | + ./qa-checks - name: Run unit tests env: # Test tenant environment variables ATLAN_API_KEY: ${{ secrets.ATLAN_API_KEY }} ATLAN_BASE_URL: ${{ secrets.ATLAN_BASE_URL }} - run: | - pytest tests/unit --cov=atlan --cov-report=xml --cov-report=term --cov-append - - - name: Upload unit test coverage - uses: actions/upload-artifact@v4 - with: - name: coverage-data - path: .coverage - retention-days: 7 + # Run with `pytest-sugar` for enhancing the overall test report output + run: pytest tests/unit --force-sugar - name: Prepare integration tests distribution id: distribute-integration-test-files @@ -112,63 +106,14 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi - - name: Download unit test coverage - uses: actions/download-artifact@v4 - with: - name: coverage-data - path: . - - - name: Run integration test with coverage - env: + - name: Run integration tests + env: # Test tenant environment variables ATLAN_API_KEY: ${{ secrets.ATLAN_API_KEY }} ATLAN_BASE_URL: ${{ secrets.ATLAN_BASE_URL }} uses: nick-fields/retry@v3 with: max_attempts: 3 - timeout_minutes: 10 - command: pytest ${{ matrix.test_file }} --cov=atlan --cov-append --cov-report=xml --cov-report=term || true - - - name: Upload integration test coverage - uses: actions/upload-artifact@v4 - with: - name: coverage-data - path: .coverage - retention-days: 7 - - finalize-coverage: - needs: [integration-tests] - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python 3.9 - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest pytest-cov - - - name: Download all coverage data - uses: actions/download-artifact@v4 - with: - name: coverage-data - path: . - - - name: Combine coverage reports - run: | - coverage combine - coverage report --fail-under=10 - coverage xml - coverage html - - - name: Upload final coverage report - uses: actions/upload-artifact@v4 - with: - name: coverage-report - path: htmlcov - retention-days: 7 + timeout_minutes: 10 # Maximum time per test job; otherwise, the job will fail + # Run the integration test file using `pytest-timer` plugin + # to display only the durations of the 10 slowest tests with `pytest-sugar` + command: pytest ${{ matrix.test_file }} -p name_of_plugin --timer-top-n 10 --force-sugar